I am using the folllwing code to run a SOAP service and getting this error: Any help is greatly appreciated. Thanks
from pysimplesoap.client import SoapClient import socket import os client = SoapClient(wsdl="http://me-uat-txapp1/MEUAT/TxWS.asmx?WSDL") host = socket.gethostname() pid = os.getpid() client[context] = {'ClientHost': 'host', 'ClientProcessId': 'pid', 'ApiVersion':'706', 'UserName': 'user', 'ConfigName':'MEUAT', 'TimeoutMilliseconds':'10000', 'ApplicationName':'pythonsoap', 'PublicKeyToken': 'neck.rarely'} moniker='live/qa.pp.objectfacepp/spread/live/41334283' client['packing'] = {'packing': 'None'} client['objectName'] = moniker response = client.Load() result = response.LoadResult 1 with httplib2 & another without. Traceback (most recent call last): File "./ME_Webservice.py", line 29, in <module> client = SoapClient(wsdl="http://me-uat-txapp1/MEUAT/TxWS.asmx?WSDL") File "/home/sysnyqcestg/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/PySimpleSOAP-1.10-py2.7.egg/pysimplesoap/client.py", line 136, in __init__ self.services = wsdl and self.wsdl_parse(wsdl, cache=cache) File "/home/sysnyqcestg/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/PySimpleSOAP-1.10-py2.7.egg/pysimplesoap/client.py", line 472, in wsdl_parse xml = fetch(url, self.http, cache, force_download, self.wsdl_basedir) File "/home/sysnyqcestg/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/PySimpleSOAP-1.10-py2.7.egg/pysimplesoap/helpers.py", line 71, in fetch response, xml = http.request(url, 'GET', None, {}) File "/home/sysnyqcestg/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/httplib2-0.8-py2.7.egg/httplib2/__init__.py", line 1570, in request (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey) File "/home/sysnyqcestg/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/httplib2-0.8-py2.7.egg/httplib2/__init__.py", line 1326, in _request for authorization in self._auth_from_challenge(host, request_uri, headers, response, content): File "/home/sysnyqcestg/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/httplib2-0.8-py2.7.egg/httplib2/__init__.py", line 1226, in _auth_from_challenge challenges = _parse_www_authenticate(response, 'www-authenticate') File "/home/sysnyqcestg/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/httplib2-0.8-py2.7.egg/httplib2/__init__.py", line 317, in _parse_www_authenticate raise MalformedHeader("WWW-Authenticate") httplib2.MalformedHeader: WWW-Authenticate sysnyqcestg@nykpsr9951 PROD $ vi /home/sysnyqcestg/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/httplib2-0.8-py2.7.egg/httplib2/__init__.py sysnyqcestg@nykpsr9951 PROD $ ./ME_Webservice.py Traceback (most recent call last): File "./ME_Webservice.py", line 29, in <module> client = SoapClient(wsdl="http://me-uat-txapp1/MEUAT/TxWS.asmx?WSDL") File "/home/sysnyqcestg/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/PySimpleSOAP-1.10-py2.7.egg/pysimplesoap/client.py", line 136, in __init__ self.services = wsdl and self.wsdl_parse(wsdl, cache=cache) File "/home/sysnyqcestg/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/PySimpleSOAP-1.10-py2.7.egg/pysimplesoap/client.py", line 472, in wsdl_parse xml = fetch(url, self.http, cache, force_download, self.wsdl_basedir) File "/home/sysnyqcestg/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/PySimpleSOAP-1.10-py2.7.egg/pysimplesoap/helpers.py", line 71, in fetch response, xml = http.request(url, 'GET', None, {}) File "/home/sysnyqcestg/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/PySimpleSOAP-1.10-py2.7.egg/pysimplesoap/transport.py", line 121, in request f = self.request_opener(req, timeout=self._timeout) File "/home/sysnyqcestg/Canopy/appdata/canopy-1.5.1.2730.rh5-x86_64/lib/python2.7/urllib2.py", line 127, in urlopen return _opener.open(url, data, timeout) File "/home/sysnyqcestg/Canopy/appdata/canopy-1.5.1.2730.rh5-x86_64/lib/python2.7/urllib2.py", line 410, in open response = meth(req, response) File "/home/sysnyqcestg/Canopy/appdata/canopy-1.5.1.2730.rh5-x86_64/lib/python2.7/urllib2.py", line 523, in http_response 'http', request, response, code, msg, hdrs) File "/home/sysnyqcestg/Canopy/appdata/canopy-1.5.1.2730.rh5-x86_64/lib/python2.7/urllib2.py", line 448, in error return self._call_chain(*args) File "/home/sysnyqcestg/Canopy/appdata/canopy-1.5.1.2730.rh5-x86_64/lib/python2.7/urllib2.py", line 382, in _call_chain result = func(*args) File "/home/sysnyqcestg/Canopy/appdata/canopy-1.5.1.2730.rh5-x86_64/lib/python2.7/urllib2.py", line 531, in http_error_default raise HTTPError(req.get_full_url(), code, msg, hdrs, fp) urllib2.HTTPError: HTTP Error 401: Unauthorized WSDL looks like this: <?xml version="1.0" encoding="utf-8" ?> - <http://me-uat-txapp1/meuat/txwsfacade.asmx?WSDL#> <wsdl:definitions xmlns:soap="*http://schemas.xmlsoap.org/wsdl/soap/*" xmlns:tm=" *http://microsoft.com/wsdl/mime/textMatching/*" xmlns:soapenc=" *http://schemas.xmlsoap.org/soap/encoding/*" xmlns:mime=" *http://schemas.xmlsoap.org/wsdl/mime/*" xmlns:tns=" *http://www.cacap.com/TxWSFacade/1*" xmlns:s=" *http://www.w3.org/2001/XMLSchema*" xmlns:soap12=" *http://schemas.xmlsoap.org/wsdl/soap12/*" xmlns:http=" *http://schemas.xmlsoap.org/wsdl/http/*" targetNamespace=" *http://www.barcap.com/TxWSFacade/1*" xmlns:wsdl=" *http://schemas.xmlsoap.org/wsdl/*"> - <http://me-uat-txapp1/meuat/txwsfacade.asmx?WSDL#> <wsdl:types> - <http://me-uat-txapp1/meuat/txwsfacade.asmx?WSDL#> <s:schema elementFormDefault="*qualified*" targetNamespace=" *http://www.cacap.com/TxWSFacade/1*"> - <http://me-uat-txapp1/meuat/txwsfacade.asmx?WSDL#> <s:element name=" *Load*"> - <http://me-uat-txapp1/meuat/txwsfacade.asmx?WSDL#> <s:complexType> - <http://me-uat-txapp1/meuat/txwsfacade.asmx?WSDL#> <s:sequence> <s:element minOccurs="*1*" maxOccurs="*1*" name="*context*" nillable=" *true*" type="*tns:CallContext*" /> <s:element minOccurs="*0*" maxOccurs="*1*" name="*objectName*" type=" *s:string*" /> <s:element minOccurs="*1*" maxOccurs="*1*" name="*packing*" type=" *tns:Packing*" /> </s:sequence> </s:complexType> </s:element> - <http://me-uat-txapp1/meuat/txwsfacade.asmx?WSDL#> <s:complexType name=" *CallContext*"> - <http://me-uat-txapp1/meuat/txwsfacade.asmx?WSDL#> <s:sequence> <s:element minOccurs="*0*" maxOccurs="*1*" name="*ClientHost*" type=" *s:string*" /> <s:element minOccurs="*1*" maxOccurs="*1*" name="*ClientProcessId*" type ="*s:int*" /> <s:element minOccurs="*1*" maxOccurs="*1*" name="*ApiVersion*" type=" *s:int*" /> <s:element minOccurs="*0*" maxOccurs="*1*" name="*UserName*" type=" *s:string*" /> <s:element minOccurs="*0*" maxOccurs="*1*" name="*ConfigName*" type=" *s:string*" /> <s:element minOccurs="*1*" maxOccurs="*1*" name="*TimeoutMilliseconds*" type="*s:int*" /> <s:element minOccurs="*0*" maxOccurs="*1*" name="*ApplicationName*" type ="*s:string*" /> <s:element minOccurs="*0*" maxOccurs="*1*" name="*PublicKeyToken*" type=" *s:string*" /> <s:element minOccurs="*0*" maxOccurs="*1*" name="*RetryCode*" type=" *s:string*" /> </s:sequence> </s:complexType> - <http://me-uat-txapp1/meuat/txwsfacade.asmx?WSDL#> <s:simpleType name=" *Packing*"> - <http://me-uat-txapp1/meuat/txwsfacade.asmx?WSDL#> <s:restriction base=" *s:string*"> <s:enumeration value="*Dummy*" /> <s:enumeration value="*None*" /> <s:enumeration value="*LZOX*" /> <s:enumeration value="*LZOXWordPadded*" /> <s:enumeration value="*FastInfoset*" /> </s:restriction> </s:simpleType> - <http://me-uat-txapp1/meuat/txwsfacade.asmx?WSDL#> <s:element name=" *LoadResponse*"> - <http://me-uat-txapp1/meuat/txwsfacade.asmx?WSDL#> <s:complexType> - <http://me-uat-txapp1/meuat/txwsfacade.asmx?WSDL#> <s:sequence> <s:element minOccurs="*0*" maxOccurs="*1*" name="*LoadResult*" type=" *s:base64Binary*" /> <s:element minOccurs="*0*" maxOccurs="*1*" name="*objectHeader*" type=" *s:string*" /> </s:sequence> </s:complexType> </s:element> -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.