Need: Tomcat + Axis2 + JAX-WS for mannequins

We work with Tomcat + Axis2 + POJO to implement web services, and we are faced with some problems with POJO and Axis2, which showstopper is for us. It seems that the Axis2 and POJO SOA analysis implementation ignores the XML element names and simply assigns values โ€‹โ€‹to the arguments according to the order of the XML elements in the SOAP message. This problem causes many problems in complex APIs.

After some swimming in the Axis2 documentary swamp, I was more confused, then I walked in, so I really need help.

I understand that JAX-WS and Axis2 do not have these problems (correct me if I am wrong), but I cannot figure out how to develop and deploy such a solution.

I wrote POJO and annotated it with JAX-WS annotations, I executed wsgen in the class and packed everything into aar file along with this services.xml file:

<service name="TESTService" > <description> TEST web service </description> <messageReceivers> <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only" class="org.apache.axis2.jaxws.server.JAXWSMessageReceiver" /> <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out" class="org.apache.axis2.jaxws.server.JAXWSMessageReceiver"/> </messageReceivers> <parameter name="ServiceClass">com.test.WsdlImpl</parameter> </service> 

When I try to make a web service call, I get an exception in Tomcat:

  [ERROR] The service class cannot be found for this AxisService.
 java.lang.RuntimeException: The service class cannot be found for this AxisService.
     at org.apache.axis2.jaxws.server.JAXWSMessageReceiver.receive (JAXWSMessageReceiver.java:95)
     at org.apache.axis2.engine.AxisEngine.receive (AxisEngine.java:176)
     at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest (HTTPTransportUtils.java:275)
     at org.apache.axis2.transport.http.AxisServlet.doPost (AxisServlet.java:133)
     at javax.servlet.http.HttpServlet.service (HttpServlet.java:710)
     at javax.servlet.http.HttpServlet.service (HttpServlet.java:803)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:290)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:206)
     at org.apache.catalina.core.StandardWrapperValve.invoke (StandardWrapperValve.java:233)
     at org.apache.catalina.core.StandardContextValve.invoke (StandardContextValve.java:175)
     at org.apache.catalina.core.StandardHostValve.invoke (StandardHostValve.java:128)
     at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)
     at org.apache.catalina.core.StandardEngineValve.invoke (StandardEngineValve.java:109)
     at org.apache.catalina.connector.CoyoteAdapter.service (CoyoteAdapter.java:286)
     at org.apache.coyote.http11.Http11Processor.process (Http11Processor.java:844)
     at org.apache.coyote.http11.Http11Protocol $ Http11ConnectionHandler.process (Http11Protocol.java data)
     at org.apache.tomcat.util.net.JIoEndpoint $ Worker.run (JIoEndpoint.java:447)
     at java.lang.Thread.run (Unknown Source)

Please help me explain how to deploy JAX-WS with Tomcat + Axis2 (if CXF works with Tomcat, I can also use it) or refer me to the GOOD tutorial that covers Tomcat + Axis2.

Thanks!!

+3
source share
3 answers

Directly from the Axis2 website, this is a tutorial covering Axis2 and Jax-Ws. You get the above error, probably because axis2-jaxws-1.3.jar is missing. Check your class path.

Of course, you can use CXF with Tomcat, and my personal opinion is that you will be better off with it.

+3
source

Like CXF, another good option would be Apache Tuscany - making it easy to turn POJOs into services.

+1
source

I was recommended to use the official JAX-WS level Sun implementation (Metro 1.4), and so far it has worked very well. The main thing is that he knows how to create artifacts as needed at runtime inside the web server.

When I got to the production on our material here, I will probably write the necessary steps.

+1
source

All Articles