WSDL: Only one fault per operation?

Discussion in 'Ruby' started by Oliver M. Bolzer, Nov 11, 2003.

  1. 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:eek:peration name="dosomething">
    <wsdl:input message="tns:dosomething_IN" />
    <wsdl:eek:utput message="tns:dosomething_OUT" />
    <wsdl:fault message="tns:authentication_ERROR" />
    <wsdl:fault message="tns:authorization_ERROR" />
    </wsdl:eek:peration>
    </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:eek:perationType"/>
    <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


    GPG (PGP) Fingerprint = 621B 52F6 2AC1 36DB 8761 018F 8786 87AD EF50 D1FF
     
    Oliver M. Bolzer, Nov 11, 2003
    #1
    1. Advertising

  2. 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" <>
    > 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, Nov 12, 2003
    #2
    1. Advertising

  3. Re: Only one fault per operation?

    Hi, again,

    > From: "NAKAMURA, Hiroshi" <>
    > 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) ?
    http://www.ruby-lang.org/cgi-bin/cvsweb.cgi/lib/soap4r/

    Regards,
    // NaHi
     
    NAKAMURA, Hiroshi, Nov 12, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?S01aX3N0YXRl?=

    Quick one - Is SESSION per browser instance or per IP Address?

    =?Utf-8?B?S01aX3N0YXRl?=, Apr 4, 2006, in forum: ASP .Net
    Replies:
    7
    Views:
    5,910
    gerry
    Apr 10, 2006
  2. Razvan
    Replies:
    1
    Views:
    423
    tony vee
    Sep 10, 2004
  3. Replies:
    5
    Views:
    2,587
  4. Replies:
    0
    Views:
    355
  5. Replies:
    0
    Views:
    196
Loading...

Share This Page