WSDL: Only one fault per operation?

Ask a Question related to Ruby, Design and Development.

  1. #1

    Default WSDL: Only one fault per operation?

    Hi!

    I'm currently building a simple request-response style webservice using
    SOAP4R and describing it in WSDL, so that it can easily be used from multiple
    langages.

    I was wondering how best I should describe the exceptions my methods will be
    raising. First, I defined two compexType's that look like what SOAP4R actually
    throws.

    <wsdl:types>
    <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://fakeroot.net/webservice/rbg/ver1/">
    <complexType name="AuthenticationError">
    <all>
    <element name="message" type="xsd:string" />
    <element name="backtrace" type="xoapenc:Array" />
    </all>
    </complexType>
    <complexType name="AuthorizationError">
    <all>
    <element name="message" type="xsd:string" />
    <element name="backtrace" type="xoapenc:Array" />
    </all>
    </complexType>
    </xsd:schema>
    </wsdl:types>

    and then, defined each of them as a message.

    <wsdl:message name="authentication_ERROR" >
    <wsdl:part name="exception" type="tns:AuthenticationError" />
    </wsdl:message>
    <wsdl:message name="authorization_ERROR" >
    <wsdl:part name="exception" type="tns:AuthorizationError" />
    </wsdl:message>

    Finally I bound the two messages to my operation with the <fault/> element
    <wsdl:portType name="FooService">
    <wsdl:operation name="dosomething">
    <wsdl:input message="tns:dosomething_IN" />
    <wsdl:output message="tns:dosomething_OUT" />
    <wsdl:fault message="tns:authentication_ERROR" />
    <wsdl:fault message="tns:authorization_ERROR" />
    </wsdl:operation>
    </wsdl:portType>


    The AuthenticationError and AuthorizationError classdefs are generated according
    to the type-definition (naturally, similart to Ruby's Exception class) but
    using the XML-code above, only AuthorizationError inherits from StandardError,
    AuthenticationError doesn't. If I swap the two <fault> tags above, only
    AuthorizationError inherits but AuthenticationError doesn't.

    Looking at SOAP4R 1.5.0's wsdl/operation.rb, it seems that it only supports
    one fault per operation, overriding earlier <fault>s with later occuring ones
    in WSDL::Operation#parse_element().
    But the WSDL 1.1 schema states that an <operation> can have multiple <faults>.

    ...
    <element name="operation" type="wsdl:operationType"/>
    <complexType name="operationType">
    ....
    <element ref="wsdl:fault" minOccurs="0" maxOccurs="unbounded"/>
    ....
    </complexType>


    A bug in SOAP4R 1.5.0 ? Or I might be misunderstanding something.
    Or is there any recommended/proper way to declare the exceptions that
    my SOAP4R-service will raise in WSDL, in a langage-independent way ?

    --
    Oliver M. Bolzer
    [email]oliver@gol.com[/email]

    GPG (PGP) Fingerprint = 621B 52F6 2AC1 36DB 8761 018F 8786 87AD EF50 D1FF

    Oliver M. Bolzer Guest

  2. Similar Questions and Discussions

    1. Unable to load WSDL. If currently online, please verifythe URI and/or format of the WSDL
      Hello, I'm using Flex 2.0 Beta 3 with Flash Player 9. http://mywsdlurl)"] at">http://mywsdlurl)"</a> mx.rpc.soap::WSDLParser/::dispatchFault()...
    2. get custom fault detail type in to wsdl?
      Hi, I understand that I can add custom fault information to the Detail element of a SOAP fault. For example, I can serialize my own custom type...
    3. How to have a "fault" element in generated WSDL?
      I have a standard web method in a standard asmx web service. Say: public string mySimpleMethod(string data){ try { . . . . . . } catch...
    4. WSDL file produces useless class when imported with WSDL.exe
      I am having a problem with a WSDL file supplied by a client. When WSDL.exe is used, the WSDL file (shown later) produces the following output class....
    5. soap:fault in WSDL
      Hi all, I'm trying to modify the wsdl automatically genereated by ASP.NET, to include fault tag under operation and binding tags. All worked...
  3. #2

    Default Re: Only one fault per operation?

    Hi, Oliver,

    Thank you for the report. Summary: It's a bug of SOAP4R. I'll fix it
    soon.
    > From: "Oliver M. Bolzer" <oliver@gol.com>
    > Sent: Tuesday, November 11, 2003 11:14 PM
    > Looking at SOAP4R 1.5.0's wsdl/operation.rb, it seems that it only supports
    > one fault per operation, overriding earlier <fault>s with later occuring ones
    > in WSDL::Operation#parse_element().
    > But the WSDL 1.1 schema states that an <operation> can have multiple <faults>.
    Yes. You are completely right. SOAP4R must accept multiple fault
    definitions in WSDL operation element. I misunderstood the spec.

    Regards,
    // NaHi

    NAKAMURA, Hiroshi Guest

  4. #3

    Default Re: Only one fault per operation?

    Hi, again,
    > From: "NAKAMURA, Hiroshi" <nakahiro@sarion.co.jp>
    > Sent: Wednesday, November 12, 2003 10:33 AM
    > Thank you for the report. Summary: It's a bug of SOAP4R. I'll fix it
    > soon.
    Fixed in the CVS of soap4r. Can you try the latest version
    (SOAP4R/1.5.1.2 + the fix) ?
    [url]http://www.ruby-lang.org/cgi-bin/cvsweb.cgi/lib/soap4r/[/url]

    Regards,
    // NaHi

    NAKAMURA, Hiroshi Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139