#!/usr/local/bin/python try: from fedd_services import * except ImportError: from fedd_client import * from ZSI.TC import QName, String, URI, AnyElement, UNBOUNDED, Any from ZSI.wstools.Namespaces import SOAP from ZSI.fault import FaultType # This is a bit of minimal trickery to integrate detail parsing of SOAP faults. # ZSI expects detail fields to parse to a class with an "any" attribute. This # little class has such an attribute pointed at itself, so when # ZSI.fault.FaultFromMessage extracts that field, it places this object into # the new Fault object. One can also get around this using an extra XML field # in the message, parsing the wrapper to the any attribute and then actial body # to the class in the any attribute, but this does not perturb the WSDL. class detail_faultType: def __init__(self): self.FeddFaultBody = None self.any = self def get_element_FeddFaultBody(self): return self.FeddFaultBody # Override ZSI.fault.FaultType.typecode - give a parser that speaks our # language. FaultType.typecode = \ Struct(FaultType, [QName(pname='faultcode'), String(pname='faultstring'), URI(pname=(SOAP.ENV,'faultactor'), minOccurs=0), Struct(pname='detail', aname='detail', ofwhat=[ns0.faultType_Def((ns0.faultType_Def.schema, "FeddFaultBody"))], pyclass=detail_faultType, minOccurs=0), ], pname=(SOAP.ENV,'Fault'), inline=True, hasextras=0, )