XML differences between WCF and Python SUDS for inheritance?
Asked Answered
F

2

15

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?

Falsify answered 25/2, 2010 at 14:54 Comment(2)
Can you post more of a code sample?Bligh
+1 this topic. We've been having problems integrating with SOAP servers developed in .net as well.Rectal
F
1

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.

Fioritura answered 28/7, 2011 at 19:13 Comment(0)
E
0

You could use the data contract serializer to control how the xml is created and read. See: http://msdn.microsoft.com/en-us/library/ms731073.aspx

Explorer answered 14/5, 2011 at 17:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.