Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.