kartagis / pysimplesoap

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

Client should authenticate #11

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
client cannot use Soap services with (basic) authentication - although httplib2 
is present.

What version of the product are you using? On what operating system?

diff -r 9dc392f4a0ec client.py
--- a/client.py Wed Oct 20 03:59:29 2010 -0300
+++ b/client.py Tue Oct 26 18:39:00 2010 +0200
@@ -75,6 +75,11 @@
             ##httplib2.debuglevel=4
             self.http = httplib2.Http(proxy_info = httplib2.ProxyInfo(
                 proxy_type=socks.PROXY_TYPE_HTTP, **proxy))
+        if '@' in location and hasattr(self.http, 'add_credentials'):
+            p = location.index('://')
+            auth = location[p+3 : location.index('@', p)].split(':', 1)
+            self.http.add_credentials(*auth)
+            del p
         #if self.certssl: # esto funciona para validar al server?
         #    self.http.add_certificate(self.keyssl, self.keyssl, self.certssl)
         self.__ns = ns # namespace prefix or False to not use it

Original issue reported on code.google.com by tgulacs...@gmail.com on 26 Oct 2010 at 4:39

GoogleCodeExporter commented 8 years ago
Good, can you provide a test case?

urllib2 dows work?

Original comment by reingart@gmail.com on 23 Nov 2010 at 11:47