Jump to content

Soap Client returning Null


ajlisowski

Recommended Posts

I am having an issue when trying to access my own PHP Soap Service with PHP. Technically I am using Zend_Soap for both, but I do not think this is a zend specific problem, but perhaps it is.

 

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 string) 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>[/code

my response looks like this

[code]
<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?

Link to comment
https://forums.phpfreaks.com/topic/266283-soap-client-returning-null/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.