[Soap-Python] Implement a server from an existing WSDL specification

Burak Arslan burak.arslan at arskom.com.tr
Sat Mar 17 03:03:48 CET 2012


Hey there,

So I guess you're the first person I've come to meet online or offline 
who actually enjoys working with soap :)

Your message is huge, yet entertaining, so I've actually read it all. 
Top posting answers to prevent this thread from explosing in length:

1) You do it manually, from scratch. This comes up a lot, and I believe 
someone just will do it sometime.

2) Rpclib supports all this, and it also supports other protocols. It 
doesn't support NCName, but to get that you just need to:

from rpclib.model.primitive import Unicode

class NCName(Unicode):
     __type_name__='NCName'

and you're set. send me a pull request if that works for you.

3) Nope. Java ecosystem has plenty of those though.

Avoid ZSI, SOAPPy, SOAPpy, they're not maintained anymore. Use 
maintained packages like Rpclib, Ladon or PySimpleSoap for server and 
SUDS for client.

Best Regards,
Burak

PS: I'm totally going to steal ladon's documentation generator :)


On 03/16/12 20:20, Alex Railean wrote:
> Hi everyone,
>
>
> I am glad I discovered this list, I've read most of the conversations
> from the "beginning of time" up to this day and I am looking forward
> to interacting with you.
>
> SOAP is a new concept for me, there are questions I hope you can help
> with. I am not intimately familiar with the terminology, so I suspect
> some of the questions may be dumb.
>
>
> The service I am working on must comply with an existing WSDL
> specification: http://pastebin.com/vqVpGix1 (standardized in ETSI
> 102.204)
>
>
> My questions are:
> 1. what is the recommended approach for writing a SOAP server that
>     implements an existing WSDL?
>
> 2. which of the existing frameworks
>     a. supports basic types such as xsd:anyURI, xsd:dateTime or
>        xsd:base64Binary?
>     b. allows the declaration of enumerations and their possible
>        values?
>     c. allows the declaration of custom types for which some
>        information is passed not as an XML element, but as an
>        attribute?
>     d. allows the use of custom complex types that are defined in an
>        existing namespace?  (I think this is the same as [a], but am
>        not entirely sure about it)
>
> 3. are there any books on SOAP/XML and Python you can recommend? If
>     there is no Python-specific literature, perhaps there are good
>     books about SOAP/XML in general?
>
>
>
>
>
>
>
>
> The part below is optional :-), it describes my experiences with
> SOAP/XML in Python.
>
>
>
> Having studied the available tools, I chose to go with Ladon, because:
> - the description makes it look very simple
> - the syntax is straightforward and concise
> - it has very clear examples
> - documentation is generated automatically
>
> I was able to create a simple SOAP/XML server and call its functions
> within an hour, it worked just as advertised.
>
>
> Surprisingly, I only found 2 references to Ladon on this mailing list,
> it seems that the rest of the world is doing something completely
> different.
>
>
> Although my first experience was very positive, later I realized
> things may be more complicated than I anticipated.
>
> Ladon makes it easy to write services from scratch, I focus on the
> logic, and the WSDL is automagically generated.
>
>
>
> However, my actual objective is to take an existing WSDL and implement
> its rules in my own code. Since my WSDL is relatively simple, it has 7
> functions (not sure if this is the proper SOAP terminology) - I
> figured I'd just define my classes and functions accordingly, such
> that the generated WSDL is identical to the reference WSDL.
>
> This is where things got tricky. While everything is easy with
> primitive types such as strings or numbers, the XML schema of the spec
> has a lot of other types in it, simple ones such as anyURI or NCName,
> and complex ones.
>
> These two examples I gave are still strings, but they have some
> constraints applied to them. If I declare them as strings, I can
> perform all the necessary checks myself, but the generated WSDL file
> doesn't look right (because "xs:string" and "xs:anyURI" are
> different). This is probably going to cause compatibility issues with
> systems that are supposed to use my service when it is released.
>
>
> My conclusion was that I would have to define them as custom types
> derived from primitive types, but.... this simply doesn't feel right,
> because it involves reinventing a lot of things.
>
>
>
>
> Then I turned to ZSI, as people say it generates code from the given
> WSDL - it sounded that this was the thing I needed. I was also hoping
> it would take care of defining all the types for me.
>
> ZSI seems pretty arcane and not very alive (even though the mailing
> list seems to be somewhat active) - I am not sure if it is a good
> choice.
>
>
> I hope you weren't bored to death by the account of my SOAP
> adventures.
>
>
> Alex
>
>
>
>
>
> p.s. if anyone ever visits Moldova, I'd be happy to show you around
> :-)
>
> _______________________________________________
> Soap mailing list
> Soap at python.org
> http://mail.python.org/mailman/listinfo/soap



More information about the Soap mailing list