Jump to content

Complex SoapClient with multiple namespaces


Levian

Recommended Posts

Hi,

 

Well, I'm having this

 

The formatter threw an exception while trying to deserialize the message: Error in deserializing body of request message for operation 'GetSomething'. End element 'Body' from namespace 'http://schemas.xmlsoap.org/soap/envelope/' expected. Found element 'param1' from namespace ''.

 

 

The soapclient request itself is something with multiple namespaces, like :

     <aaa xmlns="namespace1">
         <bbb xmlns="namespace2" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">

            <requestparams>xxxxx</requestparams>
         </bbb>

      </aaa>

 

So far I think this may got to do with multiple namespaces, so I've been trying to figure out how to deal with this for hours to no avail.

 

Anyone can shed a light into this problem ?

 

 

Thanks in advance,

 

 

Thanks for the response requinix,

 

It seems somehow that's how it is from what I just saw in __getLastRequest()

somehow it turns into <ns1:aaa />

So it may have to do with how to put xml into php kind of stuff.

 

$client = new SoapClient('web service wsdl', array('trace' => 1));
$client->__setSoapHeaders($header);
$result = $client->getSomething($params);

 

This was how I did it n the $params is a nested array (from the xml nodes...in which some of the nodes have xml namespaces)

 

During my time figuring out on how to solve this...I stumbled upon soapVar and something like extending soapclient...still figuring out how to use it in my case n whether or not it solves my problem.

Again thanks requinix,

 

Well, I used SoapVar with XSD_ANYXML n response is well received...it's not really how I want it (as it's in StdClass object instead of array/xml), but it's a good first step.

 

Well, thanks a lot...I'll keep in mind to check my request next time.

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.