That's half right :) You then need to throw a fault of that type. If I 
were to create the CalculatorFault in a way that is similar to other base 
faults in Muse, I woul do it like this:


public class CalculatorFault extends BaseFault
{
        private static final QName FAULT_NAME = new QName(...);

        public CalculatorFault(String message)
        {
                super(FAULT_NAME, message);
        }

        // there are other optional constructors
}


and then:


        void doSomething() throws CalculatorFault;


The Muse WS-BF implementation will handle the serialization - you just 
have to provide the fault name and message.

Dan



Pablo Javier Roca Mendez <[EMAIL PROTECTED]> wrote 
on 09/25/2006 04:59:54 AM:

> 
> Hi Asaf!
> 
> > How can I define a custom fault for this operation?
> 
> I guess something like:
> 
>     <xsd:element name="CalculatorFault">
>    <xsd:complexType>
>        <xsd:complexContent>
>       <xsd:extension base="wsbf:BaseFaultType"/>
>        </xsd:complexContent>
>    </xsd:complexType>
>     </xsd:element>
> 
> 
(xmlns:wsbf="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-BaseFaults-1.2-draft-01.xsd
> ")
> 
> Regards,
> Pablo
> 
> On Mon, Sep 25, 2006 at 11:35:42AM +0200, Asaf Lahav wrote:
> > I am creating a test service using MUSE-2.0 m2.
> > 
> > A custom operation I defined is called "calculate".
> > 
> > The definition of the operation messages schema elements is as 
follows:
> > 
> > <xsd:element name="CalculateRequest">
> > 
> > <xsd:complexType>
> > 
> >                         <xsd:sequence>
> > 
> >                                     <xsd:element name="a" 
type="xsd:int"/>
> > 
> >                                     <xsd:element name="b" 
type="xsd:int"/>
> > 
> >                         </xsd:sequence>
> > 
> >             </xsd:complexType>
> > 
> > </xsd:element>
> > 
> > <xsd:element name="CalculatorResponse">
> > 
> >             <xsd:complexType>
> > 
> >                         <xsd:sequence>
> > 
> >                                     <xsd:element name="result"
> > type="xsd:int"/>
> > 
> >                         </xsd:sequence>
> > 
> >             </xsd:complexType>
> > 
> > </xsd:element>
> > 
> > 
> > 
> > How can I define a custom fault for this operation?
> > 
> > 
> > 
> > Thanks in advance,
> > 
> > Asaf
> > 
> 
> -- 
> Pablo Javier Roca Mendez
> Intel GmbH/Bruehl, Hermuelheimer Str. 8a, 50321 Bruehl, Germany
> Tel.: +49-2232-209024
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to