php写的soap客户端访问用gsoap(C++)建立的webservice服务端的有关问题【50分】
php写的soap客户端访问用gsoap(C++)建立的webservice服务端的问题【50分】
我用gsoap写的服务端和客户端。想见http://happyyourlife.spaces.live.com/blog/cns!C6D18F3A3C949232!431.entry
http://www.cppblog.com/qiujian5628/archive/2008/06/19/54019.html
C++开发的服务端和客户端,客户端访问服务端执行正常结果。我想用php做客户端访问gsoap的webservice。出现问题。
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't find <definitions> in 'http://localhost:8888/?wsdl' in F:\phpinstall\webroot\web\one.php:5 Stack trace: #0 F:\phpinstall\webroot\web\one.php(5): SoapClient->SoapClient('http://localhos...') #1 {main}
服务端情况:
Socket connection successful: master socket = 3
SOAP 1.1 fault: SOAP-ENV:Client [no subcode]
"Method 'ns1:httpserver' not implemented: method name or namespace not recognized"
Detail: [no detail]
我的WSDL文件:
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="httpserver"
targetNamespace="http://127.0.0.1/httpserver.wsdl"
xmlns:tns="http://127.0.0.1/httpserver.wsdl"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ns="urn:httpserver"
xmlns:SOAP="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:MIME="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:DIME="http://schemas.xmlsoap.org/ws/2002/04/dime/wsdl/"
xmlns:WSDL="http://schemas.xmlsoap.org/wsdl/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<types>
<schema targetNamespace="urn:httpserver"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ns="urn:httpserver"
xmlns="http://www.w3.org/2001/XMLSchema"
elementFormDefault="unqualified"
attributeFormDefault="unqualified">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
</schema>
</types>
<message name="addRequest">
<part name="num1" type="xsd:double"/>
<part name="num2" type="xsd:double"/>
</message>
<message name="addResponse">
<part name="sum" type="xsd:double"/>
</message>
<portType name="httpserverPortType">
<operation name="add">
<documentation>Service definition of function ns__add</documentation>
<input message="tns:addRequest"/>
<output message="tns:addResponse"/>
</operation>
</portType>
<binding name="httpserver" type="tns:httpserverPortType">
<SOAP:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="add">
<SOAP:operation style="rpc" soapAction=""/>
<input>
<SOAP:body use="encoded" namespace="urn:httpserver" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<SOAP:body use="encoded" namespace="urn:httpserver" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
我用gsoap写的服务端和客户端。想见http://happyyourlife.spaces.live.com/blog/cns!C6D18F3A3C949232!431.entry
http://www.cppblog.com/qiujian5628/archive/2008/06/19/54019.html
C++开发的服务端和客户端,客户端访问服务端执行正常结果。我想用php做客户端访问gsoap的webservice。出现问题。
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't find <definitions> in 'http://localhost:8888/?wsdl' in F:\phpinstall\webroot\web\one.php:5 Stack trace: #0 F:\phpinstall\webroot\web\one.php(5): SoapClient->SoapClient('http://localhos...') #1 {main}
服务端情况:
Socket connection successful: master socket = 3
SOAP 1.1 fault: SOAP-ENV:Client [no subcode]
"Method 'ns1:httpserver' not implemented: method name or namespace not recognized"
Detail: [no detail]
我的WSDL文件:
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="httpserver"
targetNamespace="http://127.0.0.1/httpserver.wsdl"
xmlns:tns="http://127.0.0.1/httpserver.wsdl"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ns="urn:httpserver"
xmlns:SOAP="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:MIME="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:DIME="http://schemas.xmlsoap.org/ws/2002/04/dime/wsdl/"
xmlns:WSDL="http://schemas.xmlsoap.org/wsdl/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<types>
<schema targetNamespace="urn:httpserver"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ns="urn:httpserver"
xmlns="http://www.w3.org/2001/XMLSchema"
elementFormDefault="unqualified"
attributeFormDefault="unqualified">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
</schema>
</types>
<message name="addRequest">
<part name="num1" type="xsd:double"/>
<part name="num2" type="xsd:double"/>
</message>
<message name="addResponse">
<part name="sum" type="xsd:double"/>
</message>
<portType name="httpserverPortType">
<operation name="add">
<documentation>Service definition of function ns__add</documentation>
<input message="tns:addRequest"/>
<output message="tns:addResponse"/>
</operation>
</portType>
<binding name="httpserver" type="tns:httpserverPortType">
<SOAP:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="add">
<SOAP:operation style="rpc" soapAction=""/>
<input>
<SOAP:body use="encoded" namespace="urn:httpserver" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<SOAP:body use="encoded" namespace="urn:httpserver" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>