Frank Adämmer - 2008-10-25

Hi,

I'm  coding a pywebsvcs based web service server. I have already generate the sources with wsdl2py and wsdl2dispatch. All is working pretty fine (nice stuff thx), but my problem is that I want to add in the WSDL defined fault messages. I have for example:

########################################
    <wsdl:operation name="getStatus">
        <wsdl:input message="tns:getStatusRequest"></wsdl:input>
        <wsdl:output message="tns:getStatusResponse"></wsdl:output>
            <wsdl:fault name="fault" message="tns:getStatus_faultMsg"></wsdl:fault>
        </wsdl:operation>
########################################

and wsdl2py generates the type

########################################
class getStatus_fault_Dec(ZSI.TCcompound.ComplexType, ElementDeclaration):
        literal = "getStatus_fault"
        schema = "http://www.mydomain.com/for/my/webservice/"
        def __init__(self, **kw):
            ns = ns0.getStatus_fault_Dec.schema
            TClist = [ZSI.TCnumbers.Iint(pname="getStatus_fault", aname="_getStatus_fault", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded"))]
            kw["pname"] = ("http://www.mydomain.com/for/my/webservice/","getStatus_fault")
            kw["aname"] = "_getStatus_fault"
            self.attribute_typecode_dict = {}
            ZSI.TCcompound.ComplexType.__init__(self,None,TClist,inorder=0,**kw)
            class Holder:
                __metaclass__ = pyclass_type
                typecode = self
                def __init__(self):
                    # pyclass
                    self._getStatus_fault = None
                    return
            Holder.__name__ = "getStatus_fault_Holder"
            self.pyclass = Holder
########################################

and now I would like to know how to call this fault message in my web service server.

Thanks in advance .

greetz

copyrights