views:

372

answers:

2

I am looking at the soaplib python module (it comes with standard ubuntu 9.04). I have used xmlrpclib extensively in the last years but now I am curious about soap. writing servers with soaplib is acceptably easy, I assume writing clients should be even easier.

in my impatience I can't find a way to make use of introspection. do I really need to describe each and every method in the server in order to define the client ( http://trac.optio.webfactional.com/wiki/Client )?

I find this difficult to believe, but I can't find any significant web page holding my three search terms: python soap introspect...

so the question sounds: can I use Python soaplib to access just any remote web service of which I only know the URL? and how do I do that?

am I or is the library missing something?

+1  A: 

If I understand your question correctly, you would like to generate client code for a given webservice without defining what methods etc are availible on that service in your own code directly? IE: you would like to introspect the service and generate client automatically.

If this is the case then the answer is that you need to use the soaplib trunk. Specifically you will be interested in a recently contributed script that allows the generation of Python classes to act as a client to a given service as described in a WSDL file. There are scripts in soaplib to allow the generation of classes both in a static manner (where a .py module is generated and written to disk) and in a dynamic manner where the classes exist only at runtime in your program.

Hope that helps.

jkp
yes, that is the situation. it's not an urgent thing and it is temporarily parked. the scripts you point to, do they only work with the soaplib bleeding edge?
mariotomo
Yeah, thats correct: watch this space because there is some work going on with those scripts right now to make them interoperate better with more complex services.
jkp
A: 

I just did some introspection using SOAPpy, and I'm on Ubuntu as well. I used these examples: http://diveintopython.org/soap_web_services/

Hope that helps

Also, I'm using SOAP UI to explore the SOAP service. There's an open-source version that you can install on ubuntu by just running the .sh file on their sourceforge page. Takes 30 seconds, it pre-populates the list of methods, and creates the XML shells for you so that all you fill in are the values you're searching for (can also be used for writing a test suite of your SOAP service).

hendrixski