This discussion is archived
2 Replies Latest reply: Apr 8, 2013 6:52 AM by gimbal2 RSS

Wsgen utility usage with javaSE

Nico Newbie
Currently Being Moderated
Hi all, I'm studying how to build and publish Jax-WS web services using only javaSE 6 or later. The book I'm reading says that, for document-style ws, you need to call wsgen utility before publishing the ws in order to create the java classes that act as wrapper for request and response messages. However, I tried to publish the ws without calling wsgen and everything seems to work fine: Endpoint.publish publishes the ws instance and the request and response messages are wrapped as expected (I'm using SoapUI to test the WS).

The version of my jdk is 1.7 and the jax-ws version is 2.2.4. The book speaks about jax-ws 2.1. Is it possible that wsgen is optional in jax-ws 2.2?

Thanks a lot for your help.

Nico
  • 1. Re: Wsgen utility usage with javaSE
    Nico Newbie
    Currently Being Moderated
    Hi, I found this note on the book when speaking about how to generate the wsdl with wsgen:

    "In the current Metro release, the Endpoint publisher automatically generates the wsgen artifacts if the programmer does not..... In time this convenient feature of the Metro release will make its way into core Java so that the wsgen step in document-style services can be avoided."

    I think this is what happens with current versions of Jax-WS.
  • 2. Re: Wsgen utility usage with javaSE
    gimbal2 Guru
    Currently Being Moderated
    Your findings certainly seem to back it up.

    I have used Metro based on the JAX-WS 2.1 API on JBoss servers without ever having to manually invoke wsgen myself to be honest, you'd only run into this when you use the bog-standard default JAX-WS implementation (which is derived from Metro but not exactly Metro) in Java 6 itself I guess. I wouldn't use that to actually host a service, only to compile and perhaps use to create simple clients.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points