Re: SOAP differences between PHP and Perl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If you're not using a wsdl file, you'll have to manually set the soapaction if it is required by the service. You can see my talk slides on talks.php.net which has several examples of that usage.
Regads,
Shane


Jon Drukman wrote:

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-


-- PHP Soap Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Kernel Newbies]     [PHP Database]     [Yosemite]

  Powered by Linux