Thanks Paul for your prompt reply. The primary reason why I want to go the WSDL route and not the POJO service route, is because I want to decouple any resource dependencies between the client and the server. To elaborate, if i were to deploy my service as a POJO service, I would have to include the "simple.bean.UserBean" in the service archive (AAR) file. I do not wish to do so. So, WSDL route is my option.
My question is how do people handle creating instances of custom beans, as in this scenario where I have an existing bean that I want to be populated/created for an incoming request. 1. Is writing Axiom code the only option? 2. Is there any means to use an existing class for marshalling incoming request? Thanks in advance. vedha On Tue, 2007-01-02 at 19:31 +0000, Paul Fremantle wrote: > 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] > > > > > > -- Vedha Vijayan Senior Software Engineer Comergent Technologies Inc. Ph: 650 232 5833 Fax: 650 232 6010 Email: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
