tags:

views:

339

answers:

1

I want to query a SOAP service that requires the use of keys.

I could write a SOAP client myself making use of httplib's HTTPSConnection, I'm pretty sure that would work, but it means I have to write a load of XML. Is there a nicer way to do this? Perhaps getting an existing SOAP library to use a HTTPSConnection object.

I found an example from 2001 based on an old version of SOAPpy (not SOAPy) but I think the SOAPpy library has changed since then.

+1  A: 

See twisted.web.xmlrpc.Proxy. The url argument knows about HTTPS:

url - The URL to which to post method calls. Calls will be made over SSL if the scheme is HTTPS.

This twisted doc page claims

From the point of view of a Twisted developer, there is little difference between XML-RPC support and SOAP support.

Following the example there, it should not be difficult to make SOAP HTTPS calls. Note that twisted tends to be different from other Python networking frameworks, and has a significant learning curve.

For PKI HTTPS support, see validate-ssl-certificates-with-python. It looks like there are some limitations, hopefully the Twisted API will cater to your needs.

gimel
I can't see a way to specify keys unfortunately.
StephenPaulger
Added ref to http://stackoverflow.com/questions/1087227/validate-ssl-certificates-with-python
gimel