I'm sorry you haven't gotten any help on this so far, Johann. I am not
sure if anybody out there still supports SOAPpy. There is another
soap-related mailing list where you might find others using SOAPpy:

    https://lists.sourceforge.net/lists/listinfo/pywebsvcs-talk

These days for Python SOAP clients most are using suds which has
pretty good community support.

For server side soaplib is a pretty good choice; a lot of good work
has been going into the upcoming 2.0 release and at this point the
master branch is very usable.

On Tue, Nov 9, 2010 at 6:35 AM, Johann Spies <[email protected]> wrote:
>
> I am new to Soap and will appreciate help on the following please.
>
> Using the following code (up to the ====) I could successfully get a
> session_id which should be included in further queries in the http
> headers.
>
> >From the documentation:
>
>        Header name:  Cookie
>        Header value:  [SID="the session identifier"]
>
>
> What would be the most simple way to include the session_id (SID) as
> header in further queries?
>
> -----------------------------------------------------------------
> import warning
> warnings.simplefilter('ignore',DeprecationWarning)
> from SOAPpy import HeaderHandler
> from SOAPpy import WSDL
> from SOAPpy import URLopener
> url= 'http://search.isiknowledge.com/esti/wokmws/ws/WOKMWSAuthenticate?wsdl'
> url1 = URLopener.URLopener(username='xy',passwd='xy')
> server=WSDL.Proxy(url1.open(url))
> import os
> if os.environ.has_key('http_proxy'):
>    http_proxy_conf = os.environ['http_proxy'].replace('http://', '')
> elif os.environ.has_key('HTTP_PROXY'):
>    http_proxy_conf = os.environ['HTTP_PROXY'].replace('http://', '')
> else:
>    http_proxy_conf = 'proxy.sun.ac.za:3128'
>
> server.soapproxy.http_proxy = http_proxy_conf
>
> session_id = server.authenticate('http://auth.cxf.wokmws.thomsonreuters.com', 
> 'authenticateResponse')
> print "Session id: %s" % session_id
>
> ==============================
>
> I have tried the following code (did not find much documentation that I
> could understand) but I have to add another argument to HeaderHandler()
> and I don't know what:
>
> kopstukke = {'Name': 'Cookie', 'Value': 'SID = %s' % session_id}
> hd = HeaderHandler(kopstukke)
> hd.InteropTestHeader = session_id
> hd._setMustUnderstand ('InteropTestHeader', 0)
> hd._setActor 
> ('InteropTestHeader','http://schemas.xmlsoap.org/soap/actor/next')
> server = server._hd (hd)
> respons = server.authenticate('http://auth.cxf.wokmws.thomsonreuters.com', 
> 'closeSession')
>
> print server.authenticate('http://auth.cxf.wokmws.thomsonreuters.com', 
> 'closeSesisonResponse')
>
>     41 kopstukke = {'Name': 'Cookie', 'Value': 'SID = %s' % session_id}
> ---> 42 hd = HeaderHandler(kopstukke)
>     43 hd.InteropTestHeader = session_id
>     44 hd._setMustUnderstand ('InteropTestHeader', 0)
>
> TypeError: __init__() takes exactly 3 arguments (2 given)
>
>
> Regards
> Johann
>
> --
> Johann Spies                            Telefoon: 021-808 4699
> Databestuurder /  Data manager
>
> Sentrum vir Navorsing oor Evaluasie, Wetenskap en Tegnologie
> Centre for Research on Evaluation, Science and Technology
> Universiteit Stellenbosch.
>
>     "O death, where is thy sting? O grave, where is
>      thy victory?"             1 Corinthians 15:55
> _______________________________________________
> Soap mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/soap
>
_______________________________________________
Soap mailing list
[email protected]
http://mail.python.org/mailman/listinfo/soap

Reply via email to