We connect with suds 0.4 to Sharepoint.
In case of a 403/Unauthorized response (because of improper credentials),
Sharepoint responds with
an *HTML* error message as body causing the following (unrelated) traceback:
File "example.py", line 16, in ?
service = connector.Connector(url, username, password, list_id)
File
"/local/HRS2/Devel/junga/haufe.sharepoint/haufe/sharepoint/connector.py",
line 36, in Connector
return ListEndpoint(client, list_id)
File
"/local/HRS2/Devel/junga/haufe.sharepoint/haufe/sharepoint/connector.py",
line 82, in __init__
self.model = self._getFields()
File
"/local/HRS2/Devel/junga/haufe.sharepoint/haufe/sharepoint/connector.py",
line 89, in _getFields
list_ = self.service.GetList(self.list_id)
File
"/local/HRS2/Devel/junga/haufe.sharepoint/lib/python2.4/site-packages/suds-0.4.1-py2.4.egg/suds/client.py",
line 542, in __call__
return client.invoke(args, kwargs)
File
"/local/HRS2/Devel/junga/haufe.sharepoint/lib/python2.4/site-packages/suds-0.4.1-py2.4.egg/suds/client.py",
line 602, in invoke
result = self.send(soapenv)
File
"/local/HRS2/Devel/junga/haufe.sharepoint/haufe/sharepoint/patches.py", line
61, in send
result = self.succeeded(binding, reply.message)
File
"/local/HRS2/Devel/junga/haufe.sharepoint/lib/python2.4/site-packages/suds-0.4.1-py2.4.egg/suds/client.py",
line 688, in succeeded
reply, result = binding.get_reply(self.method, reply)
File
"/local/HRS2/Devel/junga/haufe.sharepoint/lib/python2.4/site-packages/suds-0.4.1-py2.4.egg/suds/bindings/binding.py",
line 145, in get_reply
replyroot = sax.parse(string=reply)
File
"/local/HRS2/Devel/junga/haufe.sharepoint/lib/python2.4/site-packages/suds-0.4.1-py2.4.egg/suds/sax/parser.py",
line 136, in parse
sax.parse(source)
File
"/HRS2/local/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py", line
109, in parse
xmlreader.IncrementalParser.parse(self, source)
File "/HRS2/local/lib/python2.4/site-packages/_xmlplus/sax/xmlreader.py",
line 123, in parse
self.feed(buffer)
File
"/HRS2/local/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py", line
220, in feed
self._err_handler.fatalError(exc)
File "/HRS2/local/lib/python2.4/site-packages/_xmlplus/sax/handler.py",
line 38, in fatalError
raise exception
xml.sax._exceptions.SAXParseException: <unknown>:11:2: mismatched tag
Is there a better way to propagate the 403 response back to the application?
-aj