Using soaplib to connect to remote SOAP server without definition

I am looking at the papon soaplib module (it comes with standard ubuntu 9.04). I have used xmlrpclib extensively in recent years, but now I am curious about soap. writing servers with soaplib is reasonably easy, I think it should be even easier to write clients.

in my impatience, I cannot find a way to use introspection. do I really need to describe each method on the server to define a client ( http://trac.optio.webfactional.com/wiki/Client )?

I find it hard to believe, but I cannot find any significant web page containing my three search terms: python introspect mouse ...

so the question is: can I use Python soaplib to access any remote web service that I only know about the URL? and how to do it?

am Am I or is there something missing from the library?

+2


source to share


1 answer


If I understand your question correctly, you would like to generate client code for a given web service without defining which methods, etc. available on this service directly in your own code? IE: You would like to introspectively explore the service and generate the client automatically.

If so, then the answer is that you need to use soaplib trunk . In particular, you will be interested in a recently provided script that allows you to generate Python classes as a client for a given service, as described in the WSDL file . Soaplib has scripts that allow you to generate classes both statically (where the .py module is generated and written to disk) and dynamically, when the classes only exist at runtime in your program.



Hope it helps.

+1


source







All Articles