Levian Posted January 21, 2015 Share Posted January 21, 2015 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, Quote Link to comment https://forums.phpfreaks.com/topic/294100-complex-soapclient-with-multiple-namespaces/ Share on other sites More sharing options...
requinix Posted January 21, 2015 Share Posted January 21, 2015 Typo in the XML? Maybe a opening tag that was supposed to be a closing tag? The full XML, including SOAP markup, would help. Quote Link to comment https://forums.phpfreaks.com/topic/294100-complex-soapclient-with-multiple-namespaces/#findComment-1503665 Share on other sites More sharing options...
Levian Posted January 22, 2015 Author Share Posted January 22, 2015 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. Quote Link to comment https://forums.phpfreaks.com/topic/294100-complex-soapclient-with-multiple-namespaces/#findComment-1503698 Share on other sites More sharing options...
requinix Posted January 22, 2015 Share Posted January 22, 2015 The ns1 is probably harmless. Can you get the full XML? That would be really helpful because posting little bits of code here and there doesn't always do the job. Quote Link to comment https://forums.phpfreaks.com/topic/294100-complex-soapclient-with-multiple-namespaces/#findComment-1503709 Share on other sites More sharing options...
Levian Posted January 23, 2015 Author Share Posted January 23, 2015 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. Quote Link to comment https://forums.phpfreaks.com/topic/294100-complex-soapclient-with-multiple-namespaces/#findComment-1503850 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.