I am posting to a SOAP-based Web Service via PHP SOAP Client and I'm expecting a return via XML, however I'm not getting one. The information is being handled by the Web Service as expected (writing to a database in this instance) but then I just see a blank page in my web browser.
Other methods in this API where I am just posting information to the Web Service in order to get a return value back does give me the XML, but it seems when I am posting information to be written to a database is not able to return a value.
$url='wsdl.xml';
$client = new SoapClient($url,array('trace' => 1,
'exceptions' => 1));
$client = new SoapClient($url,arra开发者_如何转开发y('soap_version' => SOAP_1_1));
$params = array('IntValue'=>$int,
'StringValue'=>$string);
try {
$client->Test_Parameters_Add($params);
} catch (SoapFault $exception) {
echo 'soap fault occured: '.$exception->getMessage().'<br/>';
}
The WSDL file:
<s:element name="Test_Parameters_Add">
−
<s:complexType>
−
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="IntValue" type="s:int"/>
<s:element minOccurs="0" maxOccurs="1" name="StringValue" type="s:string"/>
</s:sequence>
</s:complexType>
</s:element>
−
<s:element name="Test_Parameters_AddResponse">
−
<s:complexType>
−
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="Test_Parameters_AddResult" type="s:int"/>
</s:sequence>
</s:complexType>
</s:element>
I managed to narrow down the problem to the Web Service not handling the passing through of an Object from my PHP code. Whether that's because my code is incorrect, I'm not sure but noone has pointed that out so far. I have resorted to getting the Web Service provider to develop a new API method which allows me to use REST which has been much easier and is now working.
精彩评论