You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Scott Selvia <ss...@datamentors.com> on 2011/10/03 16:27:49 UTC

JSR-181 Annotated POJO Webservice "useOriginalwsdl" should default to false

I have reviewed the JSR-181 specs and I don't see away to set the
useOriginalwsdl to false in the annotation parameters.  I was under the
impression that the services.xml would be generated from the annotations
to make life easier along with what Axis2 already does by generating the
WSDL from the service.

 

So if the wsdlLocation parameter on the WebService annotation is not
specified then the services.xml that is generated from the annotations
should set the useOriginalwsdl to false instead of true.

 

From: Scott Selvia [mailto:sselvia@datamentors.com] 
Sent: Friday, September 30, 2011 12:18 PM
To: java-user@axis.apache.org
Subject: Annotated POJO Webservice Errors

 

I have the following annotated pojo webservice class, I compile the
class and build the jar file.  However, when it is deployed on Axis2
1.6.0 running in Tomcat 7.0.21 I see the following displayed in the
Tomcat console:

 

Could not identify the Annotation....

Could not identify the Annotation....

 

When I access the web service to see the WSDL I get the following
response.  What JAR's or what else is needed to deploy a POJO webservice
with annotations?

 

- <http://localhost:8080/axis2/services/MyPOJOWebServiceService?wsdl>
<error>

  <description>Unable to generate WSDL 1.1 for this
service</description> 

  <reason>If you wish Axis2 to automatically generate the WSDL 1.1, then
please set useOriginalwsdl as false in your services.xml</reason> 

  javax.xml.ws.WebServiceException: Error occurred generating WSDL file
for Web service implementation class
{com.datamentors.web.service.MyPOJOWebService} at
org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.generate
Wsdl(JAXWSRIWSDLGenerator.java:198) at
org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.initiali
ze(JAXWSRIWSDLGenerator.java:390) at
org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.getWSDL(
JAXWSRIWSDLGenerator.java:383) at
org.apache.axis2.description.AxisService.printWSDL(AxisService.java:1394
) at
org.apache.axis2.transport.http.ListingAgent.handleWSDLRequest(ListingAg
ent.java:327) at
org.apache.axis2.transport.http.ListingAgent.processListService(ListingA
gent.java:183) at
org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:260)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:304) at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:210) at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
e.java:224) at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
e.java:185) at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticator
Base.java:472) at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:151) at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:100) at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929
) at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
java:118) at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:4
05) at
org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.j
ava:269) at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(Abs
tractProtocol.java:515) at
org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.j
ava:1773) at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecuto
r.java:886) at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.ja
va:908) at java.lang.Thread.run(Thread.java:662) Caused by:
java.lang.NoClassDefFoundError: com/sun/xml/ws/api/server/Container at
java.lang.Class.getDeclaredMethods0(Native Method) at
java.lang.Class.privateGetDeclaredMethods(Class.java:2427) at
java.lang.Class.getMethod0(Class.java:2670) at
java.lang.Class.getMethod(Class.java:1603) at
org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.generate
Wsdl(JAXWSRIWSDLGenerator.java:179) ... 24 more Caused by:
java.lang.ClassNotFoundException: com.sun.xml.ws.api.server.Container at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader
.java:1678) at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader
.java:1523) ... 29 more 

  </error>

 

 

package com.datamentors.web.service;

 

import javax.jws.WebMethod;

import javax.jws.WebParam;

import javax.jws.WebService;

import javax.jws.soap.SOAPBinding;

 

@WebService(name="MyPOJOWebService",
targetNamespace="http://service.web.datamentors.com")

@SOAPBinding(style=SOAPBinding.Style.RPC)

public class MyPOJOWebService

{

  @WebMethod(operationName="echoMethod")

  public String echoMethod(@WebParam(name="aFromClient") String
aFromClient)

  {

    return "The WS got the Message: ".concat(aFromClient);

  }

}

 

Scott Selvia
Manager of Product Development
(O) 813.960.7800 x102
(F) 813.960.7811
http://www.datamentors.com <http://www.datamentors.com/>