Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XML differences between WCF and Python SUDS for inheritance?

I have a question regarding the different ways inheritance are represented between WCF and SUDS (Python). I have a C++/CLI WCF server (.NET 3.5 SP1) and I'm trying to communicate with it. I've used a C# (WCF also) client and it work fine, but there are problems when using a SUDS client (Python 2.6.4, SUDS 0.3.8). It's mostly fine, but for inherited types, and the difference seems to be in the way the two represent inheritance in the SOAP XML. When I look at the messages that the server logs, I get results similar to the following:

C# Client:

<ns:DerivedType>
...
</ns:DerivedType>

Python Client:

<ns:BaseType xsi:type="ns:DerivedType">
...
</ns:BaseType>

Is it possible to change the WCF server to accept the Python style? Or to change the Python SUDS client to send the WCF style? Which one is correct?

like image 761
Paul Navin Avatar asked Feb 25 '10 14:02

Paul Navin


1 Answers

Don't know about the python side but there are couple of options on the WCF side. The more straight foward option is to create a message inspector to detect and convert the python generated soap to something more palatable to the WCF service.

The more difficult but "purer" option is to determine how to shape the WSDL generated by the WCF service so it allows the python client to produce the aforementioned palatable soap. Once you find the required tweaks, you would use the MessageContract classes in place of the DataContract to make the service produce the tweaked WSDL. The .NET clients should handle this tweaked WSDL without complaint.

like image 193
Sixto Saez Avatar answered Oct 31 '22 19:10

Sixto Saez