SOAP differences between PHP and Perl
| From: | Jon Drukman | Date: | Wed, 15 Oct 2003 20:21:40 +0000 |
| Subject: | SOAP differences between PHP and Perl | ||
| Groups: | php.soap | ||
| Request: | Send a blank email to php-soap+get-1113@lists.php.net to get a copy of this message | ||
Hi all. I'm trying to use an Apache Axis webservice from PEAR::SOAP. The guys who set it up gave me a bunch of sample code in perl that accesses it. I'm having problems dealing with the service because the messages that PEAR::SOAP transmits look different from what perl's SOAP::Lite module generates.
so for example if i take their perl code:
$soap->updateSubscription(SOAP::Data->type(WsSubscription => $sub));
i converted that to this PHP code:
$new = $soapclient->call('updateSubscription',
$params = Array('WsSubscription' => $ret));
perl generates a SoapAction header:
SOAPAction: "http://soap.rps.com.com#updateSubscription"
but PEAR::SOAP does not:
SOAPAction: ""
don't know if that means anything or not.
the perl body looks like:
<SOAP-ENV:Body>
<namesp2:updateSubscription
xmlns:namesp2="http://soap.rps.com.com"> <WsSubscription xsi:type="namesp3:WsSubscription"> <offerId xsi:type="xsd:int">80</offerId> <country xsi:type="xsd:string">US</country> </WsSubscription></namesp2:updateSubscription> </SOAP-ENV:Body> the php body looks like: <SOAP-ENV:Body> <updateSubscription>
<WsSubscription>
<country xsi:type="xsd:string">US</country>
<offerId xsi:type="xsd:int">80</offerId>
</WsSubscription>
</updateSubscription>
</SOAP-ENV:Body>
seems like the php version is missing the xmlns on the updateSubscription element and it's missing the xsi:type on the WsSubscription. this generates a fault:
org.xml.sax.SAXException: Deserializing parameter 'WsSubscription': could not find deserializer for type {http://www.w3.org/2001/XMLSchema}WsSubscription
i'm pretty ignorant about SOAP although i have used it a lot from perl, but mostly just adapting other people's code, so i don't really know what pieces of the puzzle here are important.
-jsd-