I have being playing around with suds for a bit and I have not figured out how to get the exceptions that are returned from the web service.
from suds.client import Client
from suds import WebFault
from suds.transport.https import HttpAuthenticated, WindowsHttpAuthenticated
print "Qualcomm stuff";
url = "http://kwweb01:8080/SAWebService.asmx?wsdl"
t = WindowsHttpAuthenticated(username=sys.argv[1], password=sys.argv[2])
client = Client(url, transport=t, faults=True, cache=None)
print client;
result = client.service.GetBuildLocation('Q6695ASCTUUS1170');
if (str(result) == "soap:Server"): # Not very good, I should be able to get the exception that is thrown?????????
print "Did not get results"
else:
print "Q6695ASCTUUS1170 - %s" %(str(result));
I found that if the service returns a string value and the service throws an exception i can look at the result and it will contain 'soap:Server', but if the service returns void then you can not tell if you have an error or not.
But what I am really trying to figure out, is how do you see what exception the service has thrown.
You may noticed that I am using the WindowsHttpAuthenticated, this is required for access to the server that is running the web services.