我正在尝试将PHP程序连接到托管其他地方的Web服务,我已经尝试过以下内容
$client = new SoapClient('http://website.co.nz:port/services/services.svc?singleWsdl');
并返回此错误。
SOAP-ERROR:解析WSDL:找不到任何可用的绑定服务 在WSDL中。
我还尝试了另一个PHP库wsdl2phpgenerator,但它返回相同的(因为它似乎无论如何都在调用SoapClient)
并将代码更改为
$client = new SoapClient(null,array('location' => 'http://website.co.nz:port/services/services.svc?singleWsdl', 'uri' => ''));
返回
SOAP
不支持DTD
这是
中返回的缩短版本<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://placeholder/v1" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" name="MembershipService" targetNamespace="http://placeholder/v1">
<wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://placeholder/v1">
<xs:import namespace="http://schemas.datacontract.org/Web.API.Models"/>
<xs:element name="Ping">
<xs:complexType>
<xs:sequence/>
</xs:complexType>
</xs:element>
<xs:element name="PingResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="PingResult" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="GetPageData">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="regionCode" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="GetPageDataResponse">
<xs:complexType>
<xs:sequence>
<xs:element xmlns:q1="http://schemas.datacontract.org/Web.API.Models" minOccurs="0" name="GetPageDataResult" nillable="true" type="q1:PageData"/>
</xs:sequence>
</xs:complexType>
</xs:element>
非常感谢任何帮助