[Fedora-suds-list] Handling faults from Axis web service

Martin Aspeli optilude at gmail.com
Tue Mar 30 16:10:25 UTC 2010


Hi Joshua,

Thanks for the quick reply!

On 31 March 2010 00:07, Joshua J. Kugler <joshua at eeinternet.com> wrote:
> On Tuesday 30 March 2010, Martin Aspeli elucidated thus:
>> AxisFault
>>  faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server
>>  faultSubcode:
>>  faultString: 213
>>  faultActor:
>>  faultNode:
>>  faultDetail:
>>       {http://acme.com/}SOAPException:<message>213</message>
>>
>> The bit we're interested in is the 213. So, we have code like this:
>>
>> try:
>>     response = client.service.someMethod()
>> except WebFault, e:
>>     # ?
>>
>> The question is how we get at that 213 in the 'e' that's returned. My
>> guess was e.fault.message, but that's mostly conjecture.
>
> If the above is truly the data structure of the fault, then you should
> be able to get it via e.faultString.

I think the above is what the developer sees in his debugger when an
exception representing the fault is not raised. Then again, I can't be
100% sure.

I don't see e.faultString in WebException. Did you mean e.fault.faultString?

Martin


More information about the suds mailing list