Adding xsi:type and envelope namespace when using SUDS

vemeth

New Member
I need to interact with a SOAP service and am having a lot of trouble doing so; would really appreciate any pointers on this. The original error message was:\[code\]org.apache.axis2.databinding.ADBException: Any type element type has not been given\[/code\]After some research, it turns out that this is a disagreement between SUDS and the server has to how deal with\[code\]type="xsd:anyType"\[/code\]on the element in question.I've confirmed using SOAPUI and after advice that the problem can be fixed by taking these steps:[*]Adding xsi:type="xsd:string" to each element which causes problems[*]Adding xmlns:xsd="http://www.w3.org/2001/XMLSchema" to the SOAP EnvelopeSo, where SUDS currently does this:\[code\]<SOAP-ENV:Envelope ... xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><ns3:Body> <ns0:method> <parameter> <values> <table> <key>EMAIL_ADDRESS</key> <value>[email protected]</value> </table> </values> </parameter> </ns0:method>\[/code\] it should instead produce this:\[code\]<SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" ... xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <ns3:Body> <ns0:method> ... <parameter> <values> <table> <key xsi:type="xsd:string">EMAIL_ADDRESS</key> <value xsi:type="xsd:string">[email protected]</value> </table> </values> </parameter> </ns0:method>\[/code\]Is there a correct way to do this? I've seen suggestions of using ImportDoctor or MessagePlugins, but haven't really grokked how to achieve the desired effect.
 
Back
Top