[bb3769a] | 1 | #!/usr/local/bin/python |
---|
| 2 | |
---|
[8445caf] | 3 | try: |
---|
| 4 | from fedd_services import * |
---|
| 5 | except ImportError: |
---|
| 6 | from fedd_client import * |
---|
[bb3769a] | 7 | |
---|
| 8 | from ZSI.TC import QName, String, URI, AnyElement, UNBOUNDED, Any |
---|
| 9 | from ZSI.wstools.Namespaces import SOAP |
---|
| 10 | from ZSI.fault import FaultType |
---|
| 11 | |
---|
| 12 | |
---|
| 13 | # This is a bit of minimal trickery to integrate detail parsing of SOAP faults. |
---|
| 14 | # ZSI expects detail fields to parse to a class with an "any" attribute. This |
---|
| 15 | # little class has such an attribute pointed at itself, so when |
---|
| 16 | # ZSI.fault.FaultFromMessage extracts that field, it places this object into |
---|
| 17 | # the new Fault object. One can also get around this using an extra XML field |
---|
| 18 | # in the message, parsing the wrapper to the any attribute and then actial body |
---|
| 19 | # to the class in the any attribute, but this does not perturb the WSDL. |
---|
| 20 | class detail_faultType: |
---|
| 21 | def __init__(self): |
---|
[2d5c8b6] | 22 | self.FeddFaultBody = None |
---|
[bb3769a] | 23 | self.any = self |
---|
[2d5c8b6] | 24 | def get_element_FeddFaultBody(self): |
---|
| 25 | return self.FeddFaultBody |
---|
[bb3769a] | 26 | |
---|
| 27 | # Override ZSI.fault.FaultType.typecode - give a parser that speaks our |
---|
| 28 | # language. |
---|
| 29 | FaultType.typecode = \ |
---|
| 30 | Struct(FaultType, |
---|
| 31 | [QName(pname='faultcode'), |
---|
| 32 | String(pname='faultstring'), |
---|
| 33 | URI(pname=(SOAP.ENV,'faultactor'), minOccurs=0), |
---|
| 34 | Struct(pname='detail', aname='detail', |
---|
[2d5c8b6] | 35 | ofwhat=[ns0.faultType_Def((ns0.faultType_Def.schema, "FeddFaultBody"))], |
---|
[bb3769a] | 36 | pyclass=detail_faultType, minOccurs=0), |
---|
| 37 | ], |
---|
| 38 | pname=(SOAP.ENV,'Fault'), |
---|
| 39 | inline=True, |
---|
| 40 | hasextras=0, |
---|
| 41 | ) |
---|
| 42 | |
---|