On Thu, Feb 28, 2008 at 5:19 AM, Inman, Peter <[EMAIL PROTECTED]> wrote:

>  I'm new to AXIS2, and I have to develop a web service which someone else
> has supplied the WSDL, We also have to host a couple of operations as well
> as make calls to them.
>
>
>
> I have used WSDL2Java to generate the client code and service skeleton and
> I have also deployed a service and put some debugging code in the skeleton
> to verify that the methods can be called. SO far, all seems to work ok.
>
>
>
> With one particular operation, I have to validate the incoming SOAP
> message against the schema using XMLBeand and either return a
> "CERSErrorDocument" or a SOAPFaultException with details of the exception in
> it. This is where my confusion starts.
>
>
>
> I thought I would build a module (handler) and validate the SOAP message
> here. This works fine and seems quite a tidy way of doing things.
>
>
>
> The problem I'm having is – how do exceptions get out of the handler and
> back to the client? Do I just throw them out of the handler?
>
you can throw AxisFaults from handlers. set the AxisFault details element
correctly. this will added to the soap fault details element.

>
>
> Also – if the SOAP message is valid, I return an acknowledge document, if
> it's invalid I return a SOAPFaultException – do I return those out of the
> handler too?
>

No you can do this at the Skelton and send the throw an Exception. Here set
the exception message element correctly.

>
>
> Where is the best place to handle this kind of thing? The module(handler)
> seems quite tidy, but I'm obviously missing the bit of information which
> tells me how exceptions are handled from modules.
>
>
>
> Or – should I modify the "MyServiceSkeleton.java" class and put the
> validation and logic in that.
>
>
>
> Any advice would be appreciated.
>
>
>
> Thanks,
>
> Pete
>
>
>
>
>



-- 
Amila Suriarachchi,
WSO2 Inc.

Reply via email to