Vedha
Hi!
When you run Java2WSDL it only creates the WSDL, not the actual code.
So although you have a WSDL, you don't actually have a service.
You can follow your route in which case you should do the following:
1) J2W
2) WSDL2Java -ss -sd -uri your.wsdl
This creates the server-side skeleton file. You know edit this to add
your business logic (i.e. call your existing code)
3) ant - will build the AAR file for you
4) deploy your AAR service
5) Now you will have an updated WSDL pointing to your deployed service
6) Run WSDL2Java to create the client (as you did).
However, there is a much simpler way of doing this!!! Just deploy your
existing code/bean as a POJO service. Then the WSDL is automatically
generated for you.
To do this you need to:
1) Create a services.xml file like this:
<service name="UserBean" >
<description>my POJO service </description>
<messageReceivers>
<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/>
<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
</messageReceivers>
<parameter name="ServiceClass"
locked="false">simple.bean.UserBean</parameter>
</service>
Now create an AAR file (just a JAR file) with the following:
META-INF/services.xml
simple/bean/UserBean.class
Then deploy it (copy the AAR file into the repository/services
directory). Now you can browse
http://localhost:8080/axis2/services/UserBean?wsdl and you can
generate the client from there.
Look at samples/pojo for an example.
Paul
On 1/2/07, Vedha Vijayan <[EMAIL PROTECTED]> wrote:
Hi,
I'm new to Axis2 and I'm trying to piece together a web service using
axis2. Here is the scenario and the queries i have:
I'm trying to publish an existing service as a web service. I use
Java2Wsdl to come up with a wsdl from the existing code base. The
existing bean has the package "simple.bean.UserBean" and the generated
wsdl has the schema under "simple.bean.xsd.UserBean" namespace. The
client uses Wsdl2Java to generate client code and invokes the service
using the same. I use XMLBeans for databinding. What I need is to find a
means for Axis2 (on the server side) to generate an instance of my class
("simple.bean.UserBean") from the incoming SOAP message.
1. Is using AXIOM API my only choice to accomplish this? Or are there
other alternatives?
Thanks in advance for your help!
vedha
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Paul Fremantle
VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
http://bloglines.com/blog/paulfremantle
[EMAIL PROTECTED]
"Oxygenating the Web Service Platform", www.wso2.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]