I am having an issue when trying to access my own PHP Soap Service with PHP. I am using Zend_Soap for both the client and server.
Basically, the result I get from the client is null. However if I look at the last response, it contains the expected, correct XML. So the client is failing to convert the xml to a php object (in my test case, a simple int) for use.
my wsdl looks like this
<definitions name="SOAP_Model_soaphandler" targetNamespace="http://website.com/appldev/applications/public/SOAP/index/soap">
<types>
<xsd:schema targetNamespace="http://website.com/appldev/applications/public/SOAP/index/soap"/>
</types>
<portType name="SOAP_Model_soaphandlerPort">
<operation name="test">
<documentation>Returns list of all products in database</documentation>
<input message="tns:testIn"/>
<output message="tns:testOut"/>
</operation>
<operation name="test2">
<documentation>Adds new product to database</documentation>
<input message="tns:test2In"/>
<output message="tns:test2Out"/>
</operation>
</portType>
<binding name="SOAP_Model_soaphandlerBinding" type="tns:SOAP_Model_soaphandlerPort">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="test">
<soap:operation soapAction="http://website.com/appldev/applications/public/SOAP/index/soap#test"/>
<input>
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://website.com/appldev/applications/public/SOAP/index/soap"/>
</input>
<output>
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://website.com/appldev/applications/public/SOAP/index/soap"/>
</output>
</operation>
<operation name="test2">
<soap:operation soapAction="http://website.com/appldev/applications/public/SOAP/index/soap#test2"/>
<input>
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://website.com/appldev/applications/public/SOAP/index/soap"/>
</input>
<output>
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://website.com/appldev/applications/public/SOAP/index/soap"/>
</output>
</operation>
</binding>
<service name="SOAP_Model_soaphandlerService">
<port name="SOAP_Model_soaphandlerPort" binding="tns:SOAP_Model_soaphandlerBinding">
<soap:address location="http://website.com/appldev/applications/public/SOAP/index/soap"/>
</port>
</service>
<message name="testIn"/>
<message name="testOut">
<part name="return" type="xsd:int"/>
</message>
<message name="test2In">
<part name="id" type="xsd:int"/>
</message>
<message name="test2Out">
<part name="return" type="soap-enc:Array"/>
</message>
</definitions>
and my response looks like this
<env:envelope xmlns:enc="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://website.com/appldev/applications/public/SOAP/index/soap" xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc">
<ns1:testresponse env:encodingstyle="http://www.w3.org/2003/05/soap-encoding">
<rpc:result>return</rpc:result>
<return xsi:type="xsd:int">7</return>
</ns1:testresponse>
</env:body>
</env:envelope>
but
$result=$client->test();
var_dump($result);
outputs NULL.
Any ideas? It looks like it should be working to me, but I am not an expert in how the soap client works. Perhaps there is an issue with the namespace or something? I really dont know. It seems like it should be working fine. For reference, I followed this guide to get things up and running:
http://www.ibm.com/developerworks/webservices/library/x-zsoap/index.html
I suppose I could always just manually get the response from the xml, but I am hoping to figure out why the client is not doing so for me.