Hi Ramesh , According to the Axis2 JAX-WS user guide it should be possible to deploy JAX-WS as a AAR archives , but as you mentioned here there is no JAX-WS sample available that demonstrate AAR approach , please refer following thread [1], it seems like you cant use AAR for JAX-WS .
Let's see some one else will share his insights about this fact. [1]- http://www.nabble.com/Including-JAXWS-annotated-POJOs-within-AAR-files-td19457772.html Thanks , On Mon, Apr 20, 2009 at 11:35 PM, Ramesh Vishwanatham <[email protected]> wrote: > > Alian/Philip > > I was meant "aar" and not "war" deployment inside axis2 war with Tomcat. > > I wanted to specify my own wsdl file (with wsdlLocation attribute) and it > works fine for both cases aar and jar deployment. With out this axis2 does > create a wsdl with both SOAP 11 and SOAP12 bindings and I do not want this > behaviour. > > Thanks > Ramesh > > > > "Philip Wilder" <[email protected]> > > 04/20/2009 01:07 PM > > Please respond to > [email protected] > To > <[email protected]> > cc > Subject > RE: Message Receiver not found for AxisOperation error with Axis2 1.4.1 and > service built using JAX-WS > > > > > Hi Alain/Ramesh, > > The wsdlLocation points to the location of our wsdl within our deployment > jar file. Without it I think Axis2 will either try to generate its own wsdl > or possibly just fail. > > Philip > > ________________________________ > From: Drolet, Alain (CAR:QT12) > Sent: Monday, April 20, 2009 1:01 PM > To: [email protected] > Subject: Re: Message Receiver not found for AxisOperation error with Axis2 > 1.4.1 and service built using JAX-WS > > Hi Ramesh > > You cannot deploy a war file in axis2. > > war are for web container like Tomcat, or JBossAS... > If you like war files you can deploy them in Tomcat, but then use > the Glassfish Metro SOAP stack (instead of the axis2 one). > > Tomcat by itself (alone) cannot do SOAP. > > If you deploy as a jar file in axis2 servicesjar, then the attribute of the > @WebService > are very important. > > I make my service work by specifying the following attribute. > endpointInterface > targetNamespace > wsdlLocation // not sure if it is useful > serviceName > portName > > Make sure they match what you specified in your wsdl file. > Search the web to find the documentation on the @WebService attributes. > > To invoke the client, you use the class generated by wsimport. > This should be the class with the same name as your serviceName attribute. > > You need to specify a QName. Its built from the attributes above, > and a URL. If you get it wrong the axis2 web page, or the error text you > receive should help you. > > As for examples get the bin distribution of axis2. > It has a nice set of jaxws examples in its samples directory. > > Good luck > Alain > > > > Ramesh Vishwanatham wrote: > > Hi Alain > Thanks for clarifying the axis2 depliyment. I will take a look JAXWSDeployer > class. The axis2 behaviour is different with war and aar. Below > Implementation class deployed as war (services.xml is included) is > successful with tomcat: > > @WebService(endpointInterface = "service.Prj71", > serviceName = "Prj71Service", > wsdlLocation="META-INF/Prj71Service.wsdl") > public class Prj71Impl implements Prj71 { > ... > } > > Same failed to deploy with jar with stand alone. When I added portName > attribute, then it deployed fine. Still I am having problems with client > invocation. > > I will try to figure it out. > > Regards, > Ramesh > > > > "Alain Drolet" <[email protected]> > > 04/17/2009 05:17 PM > > Please respond to > [email protected] > > To > [email protected] > cc > Subject > Re: Message Receiver not found for AxisOperation error with Axis2 1.4.1 and > service built using JAX-WS > > > > > > Hi Ramesh > > The two options I mentioned have nothing to do with the way you run axis2. > It can run it stand alone, or deployed as a war in tomcat. > > Once you have a running axis2 you can then deploy your jar or aar file in > the appropriate directory under axis2. > If you downloaded the axis2 source, you can pick at the > org.apache.axis2.jaxws.framework.JAXWSDeployer class. > Its quite instructive. This is where I realized that services.xml and > jar/servicejars do not mix. > > Deploying as a aar file might work, if you figure out all the details of the > services.xml file. Good luck! > An example would be nice. > Reading various sites I'm picking that the axis2 developers implemented the > jaxws support in a silo aside > the other models they were already supporting. > This is why I think it is an either-or thing. > > If you are happy with simple pojo, then aar might be just fine. > If you go all the way with the wsdl to java approach using wsimport, then my > feeling is that > the aar approach is no longer for you. You need to go the jar way, which I > suspect was designed explicitly for jaxws. > > If any one can share input on the history and purpose of aar vs jar it would > be nice. > For now its looking like two ship cruising in the dark! > > Regards Alain > > Ramesh Vishwanatham wrote: > Hi Alain > > Thanks for quick response. > > My understanding is, you deploy "jar" file (without services.xml) in > servicejars directory under axis2 distribution and run axis2server.bat and > not under tomcat. > > Use "aar" deployment (along with services.xml) with tomcat or other > application server. > > Please correct if I am wrong. > > You are 100% correct about "The guide however provides zero info on how to > do this" deploying aar along with services.xml. I was playing different > combinations and norrow it down to following: > > a) service implementation is wrong, some thing is missing > or > b) services.xml is missing some thing > or > c) axis2 1.4.1 version has bugs reagrding deploying aar for JAX-WS > > I will try deploying jar with servicejars and see what happens. > > But in real world, you write a wsdl (with policy and security info) and > deploy services under app server. I am trying to understand axis2 with > JAX-WS by wrting a simple service. > > Regards, > Ramesh > > > > "Alain Drolet" <[email protected]> > > 04/17/2009 03:38 PM > Please respond to > [email protected] > > To > [email protected] > cc > Subject > Re: Message Receiver not found for AxisOperation error with Axis2 1.4.1 and > service built using JAX-WS > > > > > > > > Hi Rameh > > I have very limited time to answer to you. > Also I am not an axis2 guru, but I typically make it do what I need if I > fight for long enough. > > Having said that here are a few quick pointers I can provide. > These are based on experience and what I think I know about axis2 ways to do > things. > Axis2 real gurus, feel free to correct me. > > There is 2 general ways to deploy a web service in axis2: > > - deploy as a jar file > That seems to be the natural approach provided by axis2 if you build your > project using the JAXWS programming model. > With this approach you generate code from the wsdl using wsimport (not > wsdl2java). > You package as a jar files (see the jaxws-guide). > You do not use a services.xml file. That makes you life easier. > You deploy in the servicejars directory. > This directory uses a different deployer class. > Look in the axis2 configuration file to learn more. > > That's the approach I use. > > - deploy as a aar file > That's for all the other programming models supported by axis2. > Here you build your archive the axis2 way. That's why its not a war file. > You generate code using wsdl2java. That also produce a services.xml file. > You deploy in the services directory. > > In theory aar files can be used as well for JAXWS project. > The guide however provides zero info on how to do this. > For instance you need to specify the message receivers. > I just gave up and deploy as aar in servicejars - easy! > > Hoping this helps > Alain > > Ramesh Vishwanatham wrote: > > Hi Axis2 Developers and Gurus > > Recently I have sent below request to "axis2-user" group and did not get > any responses at all. I am evalutaing axis2 and JAX-WS programming model > and struck with simple sample application. I found there is not much > material out there like "how-to" step by step guild to build web > applications using axis2 and JAX-WS. I have read following link > "http://ws.apache.org/axis2/1_4_1/jaxws-guide.html" and gives an overall > high level view but lacks details. > > May be some thing is wrong with my implementation class and/or services.xml > file. Also there is a possibility there is bug in Axis2 1.4.1 for JAX-WS. > > I am hoping some one will clarify this issue. > > Thanks in Advance > Ramesh > ------------------------------------------------------------------------------------------------------------------------------------------------------------ > Hi All > > I am getting below error when a client calls a web service operation built > using Axis2 1.4.1, Java 1.6, JAX-WS > and Tomcat 6.0.18: > > [ERROR] Message Receiver not found for AxisOperation: > {http://service/}getQuote > org.apache.axis2.AxisFault: Message Receiver not found for AxisOperation: > {http: > //service/}getQuote > > Here are the steps followed: > > 1) Axis2 war file is deployed in Tomcat 6.0.18. > > 2) Using top-down model with existing wsdl. Generated server and client side > code using wsimport tool part of > Java 1.6. Added Java implementation class for interface and deployed the > service under services folder in axis2 > WEB-INF.The service is deployed and it is active. > > 3) When I run the client I get an exception with above exception message > > 4) I also built service using axis2 WSDL2Java tool (adb as data binding) and > deployed it. When I ran the > client (which is built using JAX-WS api) it works fine. > > So the error is in service side with JAX-WS. Is it a bug in axis2 1.4.1 > implememtation or some thing I am missing? > > Please help me resolve this issue. > > Below are the service implementation class, services.xml and wsdl files: > > Prj71Impl.java > --------------- > package service; > import javax.jws.WebService; > import javax.xml.ws.BindingType; > import javax.xml.ws.soap.SOAPBinding; > > > @WebService(endpointInterface = "service.Prj71", > serviceName = "Prj71Service", > wsdlLocation="META-INF/Prj71Service.wsdl", portName= "Prj71Port") > public class Prj71Impl implements Prj71 { > > public GetQuoteResponse > getQuote(GetQuoteRequest req) { > GetQuoteResponse res = new GetQuoteResponse(); > res.setReturn(100); > return res; > } > > } > > services.xml > ------------ > <?xml version="1.0" encoding="UTF-8"?> > <serviceGroup> > <service name="Prj71Service" scope="application"> > <messageReceiver> > <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out" > class="org.apache.axis2.jaxws.server.JAXWSMessageReceiver"/> > </messageReceiver> > <parameter name="ServiceClass">service.Prj71Impl</parameter> > <parameter name="useOriginalwsdl">true</parameter> > <!-- Below entries are added but no difference in resolving the problem > --> > <parameter name="modifyUserWSDLPortAddress">true</parameter> > <operation name="getQuote" mep="http://www.w3.org/2004/08/wsdl/in-out" > namespace="http://service/"> > <actionMapping>tns:getQuote</actionMapping> > > <outputActionMapping>http://service/Prj71/getQuoteResponse</outputActionMapping> > </operation> > </service> > </serviceGroup> > > > Prj7Service.wsdl > ----------------- > > <?xml version="1.0" encoding="UTF-8" standalone="yes"?> > > <wsdl:definitions name="Prj71Service" targetNamespace="http://service/" > xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" > xmlns:tns="http://service/" > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"> > <wsdl:types> > <xsd:schema> > <xsd:import namespace="http://service/" > schemaLocation="Prj71Service_schema1.xsd"/> > </xsd:schema> > </wsdl:types> > <wsdl:message name="getQuoteRequest"> > <wsdl:part name="parameters" element="tns:GetQuoteRequest"/> > </wsdl:message> > <wsdl:message name="getQuoteResponse"> > <wsdl:part name="parameters" element="tns:GetQuoteResponse"/> > </wsdl:message> > <wsdl:portType name="Prj71"> > <wsdl:operation name="getQuote"> > <wsdl:input message="tns:getQuoteRequest"/> > <wsdl:output message="tns:getQuoteResponse"/> > </wsdl:operation> > </wsdl:portType> > <wsdl:binding name="Prj71PortBinding" type="tns:Prj71"> > <soap:binding transport="http://schemas.xmlsoap.org/soap/http" > style="document"/> > <wsdl:operation name="getQuote"> > <soap:operation soapAction="tns:getQuote"/> > <wsdl:input> > <soap:body use="literal"/> > </wsdl:input> > <wsdl:output> > <soap:body use="literal"/> > </wsdl:output> > </wsdl:operation> > </wsdl:binding> > <wsdl:service name="Prj71Service"> > <wsdl:port name="Prj71Port" binding="tns:Prj71PortBinding"> > <soap:address > location="http://localhost:8080/axis2/services/Prj71Service"/> > </wsdl:port> > </wsdl:service> > </wsdl:definitions> > > Thanks > Ramesh > ________________________________________________________ > DTCC DISCLAIMER: This email and any files transmitted with it are > confidential and intended solely for the use of the individual or entity to > whom they are addressed. If you have received this email in error, please > notify us immediately and delete the email and any attachments from your > system. The recipient should check this email and any attachments for the > presence of viruses. The company accepts no liability for any damage caused > by any virus transmitted by this email. > > -- Sagara Gunathunga Blog - http://ssagara.blogspot.com Web - http://sagaras.awardspace.com/
