kartagis / pysimplesoap

Automatically exported from code.google.com/p/pysimplesoap
0 stars 0 forks source link

Client doesn't work properly when SOAP server uses sessions #25

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I need to connect to a SOAP server which uses cookies to maintain session 
information - but pysimplesoap doesn't support it.

To get round it, I wrote a replacement Http object which is based on the Http 
object defined in the client library, that uses urllib2 for connections:

----
from cookielib import CookieJar
from urllib2 import build_opener, HTTPCookieProcessor, Request

class Http(object):
    def __init__(self):
        from cookielib import CookieJar
        self.opener = build_opener(HTTPCookieProcessor(CookieJar()))

    def request(self, url, method, body, headers):
        f = self.opener.open(Request(url, body, headers))
        return f.info(), f.read()

client.http = Http()
----

I think the client should support this directly by taking a constructor 
argument of "sessions" - which if set to True will enable cookie support.

Original issue reported on code.google.com by allan.cr...@yougov.com on 6 May 2011 at 3:20

GoogleCodeExporter commented 8 years ago
Great, can you post a patch against the latest version in the repository?

Original comment by reingart@gmail.com on 10 May 2011 at 9:31

GoogleCodeExporter commented 8 years ago
Do you want to be listed as a Contributor?
Also, if you agree, I could give you commit permissions

Original comment by reingart@gmail.com on 10 May 2011 at 9:50

GoogleCodeExporter commented 8 years ago
Yes, I'd like to be added as a contributor (with commit permissions). Thanks.

Original comment by allan.cr...@yougov.com on 17 May 2011 at 11:14

GoogleCodeExporter commented 8 years ago
Done, you can now commit. Thanks for your collaboration. 

Original comment by reingart@gmail.com on 17 May 2011 at 9:06

GoogleCodeExporter commented 8 years ago
Fixed in revision 548e2c3141e0.

Original comment by allan.cr...@yougov.com on 18 May 2011 at 1:17