source: fedd/federation/parse_detail.py @ 37f6592

axis_examplecompt_changesinfo-opsversion-3.01version-3.02
Last change on this file since 37f6592 was 5d3f239, checked in by Ted Faber <faber@…>, 16 years ago

change package name to avoid conflicts with fedd on install

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