views:

78

answers:

1

I have used few python soap libraries (SOAPpy, soaplib and Twisted wrapper around SOAPpy) to write my soap web service.

When I used python clients (SOAPpy.SOAPProxy and SUDS), I was able to communicate with my web service (returning simple and complex type objects).

But, when I tried with C# ASP.net, I got many issues. I came over returning simple types (int, string, double, boolean) issue with some hack into SOAPpy library. But, I am still struggling with returning ComplexTypes from SOAPpy.

I could not find any complete, compatible alternative python library for writing my web service.

Main Question: Any suggestions/examples for dot net compatible complex type return from python web service would be highly appreciated.

Note: I had to hack SOAPpy quite a bit to make it working in first place. And, I had to handwrite wsdl file in case of SOAPpy.

A: 

In my personal opinion, the compatibility of Python SOAP libraries with other platforms is not good.

I think that there are two issues here:

  • First, the compatibility of web services among web service stacks is an aspiration rather than reality. For example, look at this question to see how to use web services between Java and WCF.
  • That being said, the concept of WSDL which is largely compile time typing is not in line with Python's original philosophy, so less effort was put into it.

I haven't worked with web services for over a year now so may be things have changed. But the advice is the same as in the previous question:

  • Start with the WSDL writing if you are using more than one language/library.
  • As copied from the other question, "start with XSD, but confine yourself to mainstream types. Primitives, complextypes composed of primitives, arrays of same."
  • In the end I settled on using suds for Python web clients, after experimenting with it and soappy and zsi. That was after some time using a C based library (gsoap) and linking to it from Python.
  • I was never satisfied with server implementations in Python, so I used to build Python servers and connect to them from another library which can export SOAP services (in my case Java or C, you will probably use C#). The connection is usually a much simpler protocol.
  • That being said, if you start with WSDL you are likely to get good results using soaplib or may be zsi. But I am afraid there is almost no way around building your types slowly while checking for compatibility.
Muhammad Alkarouri
Surya