axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ajith Ranabahu <ajith.ranab...@gmail.com>
Subject Re: [Axis2] Throwing faults
Date Wed, 04 Jan 2006 04:51:00 GMT
Hi Ruben,
The Axis2 code generator does not generate exceptions for faults yet!
However as soon as the Axis engine sees the fault, it throws an AxisFault
loaded with the fault information (The stub actually turns that switch on)
So for the time being you'll have to work with AxisFaults.

On 1/4/06, Anne Thomas Manes <atmanes@gmail.com> wrote:
>
> Note that faults should always be defined as document/literal.
> From the WS-I Basic Profile:
>
>  4.4.2 Bindings and Faults
>
> There are several interpretations for how wsdl:part elements that describe
> soapbind:fault, soapbind:header, and soapbind:headerfault may be defined.
>
>  R2205 A wsdl:binding in a DESCRIPTION MUST refer, in each of its
> soapbind:header, soapbind:headerfault and soapbind:fault elements, only to
> wsdl:part element(s) that have been defined using the element attribute.
>
> Because faults and headers do not contain parameters, soapbind:fault,
> soapbind:header and soapbind:headerfault assume, per WSDL 1.1, that the
> value of the style attribute is "document". R2204 requires that all
> wsdl:part elements with a style attribute whose value is "document" that
> are bound to soapbind:body be defined using the element attribute. This
> requirement does the same for soapbind:fault, soapbind:header and
> soapbind:headerfault elements.
>
> Anne
>
>
> On 1/3/06, Rubén Naranjo Izquierdo <rnaranjo@alumnos.upm.es> wrote:
> >
> >   Hi,
> >
> >   I'm migrating from Axis 1.3 and I want to know how can I throw faults
> > from
> > my service to a client in Axis 2.
> >
> >   In Axis 1.3 I had some wsdl code like this:
> >
> > --------------------
> >         <wsdl:message name="GeneralFaultMessage">
> >             <wsdl:part name="fault" type="xs:string"/>
> >         </wsdl:message>
> > (....)
> >         <wsdl:portType name="MyServicePortType">
> >                 <wsdl:operation name="begin">
> >                         <wsdl:input message="tns:BeginMessage"/>
> >                         <wsdl:output message="tns:BegunMessage"/>
> >                                                 <wsdl:fault
> > name="GeneralFault" message="tns:GeneralFaultMessage"/>
> >                 </wsdl:operation>
> >         </wsdl:portType>
> > (....)
> >     <wsdl:binding name="MyServicePortTypeSOAPBinding"
> > type="tns:MyServicePortType">
> >                 <soap:binding style="rpc" transport="
> > http://schemas.xmlsoap.org/soap/http"/<http://schemas.xmlsoap.org/soap/http%22/>
> > >
> >
> >         <wsdl:operation name="begin">
> >                 <soap:operation
> > soapAction="
> > http://www.webservicestransactions.org/wsdl/myservice/2003/03/begin"
> > style="rpc"/>
> >                 <wsdl:input>
> >                                                 <soap:body
> > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> > namespace="http://www.webservicestransactions.org/schemas/myservice/2003/03
> > "
> > use="encoded"/>
> >                 </wsdl:input>
> >                 <wsdl:output>
> >                                                 <soap:body
> > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> > namespace="http://www.webservicestransactions.org/schemas/myservice/2003/03
> > "
> > use="encoded"/>
> >                 </wsdl:output>
> >                 <wsdl:fault name="GeneralFault">
> >                                                 <soap:fault
> > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> > namespace="http://www.webservicestransactions.org/schemas/wsctx/2003/03
> > "
> > use="encoded"/>
> >                 </wsdl:fault>
> >         </wsdl:operation>
> > --------------------
> >
> >   And using that wsdl code, wsdl2java generates an interface like this:
> >
> > --------------------
> > public interface MyServicePortType extends java.rmi.Remote {
> >     public AssertionType begin(_begin content) throws RemoteException,
> > GeneralFaultMessage;
> > --------------------
> >
> >   But that doesn't work any more on Axis2. Even using "literal" instead
> > of
> > "encoding" in the bindings of the wsdl. The resulting code generated by
> > Axis2's wsdl2java doesn't throw any kind of exception. The question is,
> > should it be thrown or Axis2 handles faults in a different way? If
> > exceptions
> > must be thrown in the same way Axis1.3 did, what am I doing wrong?
> >
> >   Thank you so much in advance,
> >
> >
> >   Rubén Naranjo Izquierdo
> >
>
>


--
Ajith Ranabahu

Mime
View raw message