[Gug-cvs] gug/gug/client soap.py,1.11,1.12
Status: Planning
Brought to you by:
szferi
From: Nagy Z. <zs...@us...> - 2007-05-07 13:27:52
|
Update of /cvsroot/gug/gug/gug/client In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv2617/gug/client Modified Files: soap.py Log Message: HTTP BaseAUTH Index: soap.py =================================================================== RCS file: /cvsroot/gug/gug/gug/client/soap.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** soap.py 22 Feb 2007 15:22:13 -0000 1.11 --- soap.py 7 May 2007 13:27:52 -0000 1.12 *************** *** 8,14 **** --- 8,16 ---- import time import base64, pickle + from gug.common import log from gug.common.share import import_class_from_string from gug.common.exception import NoServiceKnown, CannotAssignPort, HTTPError, UnknownServiceError from ZSI import TC, FaultException + from ZSI.auth import AUTH from ZSI.client import Binding #TC.Any.parsemap[(None,'string')] = TC.String(strip = False) *************** *** 40,43 **** --- 42,46 ---- """ self._unwrap = unwrap + self._auth = (AUTH.none,) if wsdl: raise Exception, 'not implemented' *************** *** 63,66 **** --- 66,72 ---- return self._methods.keys() + def _set_auth(self, user, pwd): + self._auth = (AUTH.httpbasic, user, pwd) + def __getattr__(self, name): if name[0] == '_': *************** *** 68,79 **** if name == 'trait_names': return self._trait_names ! return self.__Method(self._url, self._transdict, name, self._unwrap, self._methods) class __Method: ! def __init__(self, url, transd, method, unwrap, methods): self.url, self.transd, self.method, self.unwrap = \ url, transd, method, unwrap self.__name__ = self.method ! self.proxy = Binding(url = url, transdict = transd, readerclass = ExpatReaderClass) if methods: try: --- 74,87 ---- if name == 'trait_names': return self._trait_names ! return self.__Method(self._url, self._transdict, name, \ ! self._unwrap, self._auth, self._methods) class __Method: ! def __init__(self, url, transd, method, unwrap, auth, methods): self.url, self.transd, self.method, self.unwrap = \ url, transd, method, unwrap self.__name__ = self.method ! self.proxy = Binding(url = url, transdict = transd, \ ! readerclass = ExpatReaderClass, auth = auth) if methods: try: *************** *** 101,104 **** --- 109,113 ---- raise except TypeError: + log.error() # if SOAP message can be parsed, then the error messages are inside the message # else: |