Skip to main content

JAX-WS 2.0EA2: no wsdl generation for "annotations" sample

6 replies [Last post]
juergen_zimmermann
Offline
Joined: 2005-06-24

The task of the "annotations" sample doesn't generate a WSDL file.

When deploying the produced WAR file to Tomcat 5.5.9 I get this error message:

25.06.2005 14:01:43 com.sun.xml.ws.transport.http.servlet.JAXRPCServletDelegate init
INFO: JAXRPCSERVLET14: JAX-RPC servlet initializing
25.06.2005 14:01:43 com.sun.xml.ws.transport.http.servlet.JAXRPCServletDelegate warnMissingContextInformation
WARNING: JAXRPCSERVLET16: missing context information

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jitu
Offline
Joined: 2003-06-14

You should see something like this in the tomcat log file.
----------------
Jun 25, 2005 2:09:24 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive jaxws-annotations.war
Jun 25, 2005 2:09:24 PM com.sun.xml.ws.transport.http.servlet.JAXRPCContextListener contextInitialized
INFO: JAXRPCSERVLET12: JAX-RPC context listener initializing
Jun 25, 2005 2:09:25 PM com.sun.xml.ws.transport.http.servlet.JAXRPCServletDelegate init
INFO: JAXRPCSERVLET14: JAX-RPC servlet initializing
Jun 25, 2005 2:11:13 PM com.sun.xml.ws.server.WSDLPatcher patchImport
INFO: Fixing the relative location:schema1.xsd with absolute location:http://localhost:8080/jaxws-annotations/addnumbers?xsd=schema1.xsd

juergen_zimmermann
Offline
Joined: 2005-06-24

The warning can be eliminated by *NOT* loading the JAXRPCServlet when Tomcat is started.

However, the wsdl file is still missing. So that
http://localhost:8080//?wsdl does not work.

jitu
Offline
Joined: 2003-06-14

* wsdl is created in memory for this sample during deployment by our JAXRPCContextListener. Check if there are any exceptions during that time.(copying the war file to webapps dir)

* http://localhost:8080/jaxws-annotations/addnumbers?wsdl should work

My tomcat setup
----------------
* My tomcat version is 5.5.9. Java version is 1.5.0_03

* The way I configure tomcat is by copying all the jars to tomcat's shared/lib directory

* deploy target in samples/etc/common-targets.xml is changed as follows

todir="/Users/jitu/jakarta-tomcat-5.5.9/webapps"/>

* Then everything should work. If you have any problems, post them here.

a_o_k
Offline
Joined: 2004-10-10

When "starting from Java sources" and using JAX-WS EA2, neither the .wsdl nor the schema still need to be packaged in the .war. Correct?

Some of the documentation still seems to indicate that it is needed and\or that these files are still generated by the annotation processor(s).

Under "How Do I Pick a Tool" at https://jax-rpc.dev.java.net/jaxws20-ea2/docs/jaxws-tools.html#mozTocId5..., it states that apt should be used to "generate the artifacts: a WSDL file, schema documents, and other Java artifacts", bu the .wsdl and the schema are no longer generated in the course of apt processing.

In the EA2 User's Guide (https://jax-rpc.dev.java.net/jaxws20-ea2/docs/UsersGuide.html#mozTocId23...), under 3.1.1.1 there's a list of the generated artifacts which does not include a .wsdl or an .xsd, and yet the text reads "The AddNumbersImplService.wsdl file describes the web service. The schema1.xsd file is imported by the AddNumbersImplService.wsdl and contains the datatypes used by the web service. "

Thanks,

AOK

juergen_zimmermann
Offline
Joined: 2005-06-24

> When "starting from Java sources" and using JAX-WS
> EA2, neither the .wsdl nor the schema still need to
> be packaged in the .war. Correct?

I was also confused by the documentation. In fact the WSDL file is not physically required. Calling http://localhost:8080/jaxws-annotations/addnumbers?wsdl works with Tomcat.

jitu
Offline
Joined: 2003-06-14

Starting from java, you don't have to package wsdl, and schema files in the war. The runtime generates wsdl and necessary files for the endpoint. But it's also possible to package wsdl file in the war, and specify it in sun-jaxws.xml. In that case, runtime uses the wsdl file specified in the war.

By default, wsgen doesn't generate wsdl. But you can specify -wsdl option to generate wsdl and schema files. I need to check whether apt also supports -wsdl option.

We will update the documentation to clarify things more. Thanks for pointing it out.