Monday, 29 September 2014

How to deserialize a soap request with a namespace prefix?



The first request works. The second returns a null in the arg0. The only difference is the namespace prefix "ns2". The request with the prefix comes from an external source and can't be changed.



<?xml version="1.0" ?>
<S:Envelope xmlns:S="http://ift.tt/sVJIaE">
<S:Body><putEvent xmlns="http://xxx.xxx.x.xx/">
<arg0>test</arg0>
</putEvent></S:Body>
</S:Envelope>


<?xml version="1.0" ?>
<S:Envelope xmlns:S="http://ift.tt/sVJIaE">
<S:Body><ns2:putEvent xmlns:ns2="http://xxx.xxx.x.xx/">
<arg0>test</arg0>
</ns2:putEvent></S:Body>
</S:Envelope>


How to handle such a request properly? For now the code handling it is generated from the wsdl.


No comments:

Post a Comment