The Jibx2Wsdl tool can be used to easily convert most existing code to an Axis2 (or JiBX/WS) web service. The output of Jibx2Wsdl includes WSDL, schema, and JiBX binding definitions you can use to deploy your service code on Axis2. The documentation page at http://jibx.sourceforge.net/fromcode/jibx2wsdl.html gives an introduction to using it, and the JiBX distribution comes with a set of five examples (http://jibx.sourceforge.net/fromcode/jibx2wsdl-examples.html) showing some usage variations.

Jibx2Wsdl generates clean WSDL and schema definitions for most existing code directly, but is also fully customizable, both at the service definition and schema levels. The article at http://www.ibm.com/developerworks/java/tutorials/j-jibx1/ discusses the schema (and JiBX binding) generation from code part, including customizations.

And yes, it includes handling of user exceptions - see the example code for some details. General information on using JiBX in Axis2, including information about the jibx-axis2 distribution package for updating older versions of Axis2 to work with newer versions of JiBX (and to take advantage of fixes to the Axis2/JiBX linkage code), is at http://jibx.sourceforge.net/axis2/index.html

 - Dennis

Dennis M. Sosnoski
XML and Web Services in Java
Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117



Pär Malmqvist wrote:
Hello!

I have been waiting for code-first approach to handle custom exceptions for about three years now...

So I always have to use contract-first approach to get it to work.
Its really time consuming but not much to do.

Regards
Pär Malmqvist


------------------------------------------------------------------------
Date: Fri, 19 Feb 2010 09:15:03 -0500
Subject: Re: Axis2-1.5.1 and user exceptions
From: [email protected]
To: [email protected]

I have been puzzled by this issue for long time. Seams like at this point, using contract-first approach is the only solution for now.

But it will still be very very helpful if something can be done so code-first approach can work too. Axis1 definitely worked. I can imagine lots of people are using code-first approach because of its simplicity.

Thanks!

Li

On Fri, Feb 19, 2010 at 6:42 AM, Mauro Molinari <[email protected]> wrote:

    Il 17/02/2010 3.53, glopezm ha scritto:

        Any thoughts/experiences with a similar issues with axis2?


    I use contract-first approach. My user exceptions extend Exception
    and have a field called faultMessage with getter getFaultMessage
    and setter setFaultMessage. The constructor prepares the
    faultMessage and sets it via setFaultMessage. The faultMessage is
    an object of a class generated by WSDL2Code from an XMLSchema type
    that describes my fault message, so that it implements ADBBean.

    In this way, when my code raises my user defined exception, Axis2
    recognizes the existence of the fault message and attaches it
    correctly to the fault returned to the client code.

    This is the result of my trial-and-errors researches of some years
    ago with Axis2 1.3 and it is working with Axis2 1.5 too. I think
    that you may find something else in this mailing list archive by
    me on this subject.

-- Mauro Molinari
    Software Designer & Developer
    E-mail: [email protected]




--
Li Ma
[email protected]


------------------------------------------------------------------------
Hotmail: Powerful Free email with security by Microsoft. Get it now. <https://signup.live.com/signup.aspx?id=60969>

Reply via email to