1 Reply Latest reply on Dec 29, 2005 3:12 PM by Jason Greene

    wsdl2java vs wscompile ala JBoss

    Brenda Bell Newbie

      I need to develop a web service top-down -- e.g., using the WSDL to define my implementation.

      I originally used JBoss's wsdl2java to generate my Java code, but kept running across forum posts that said I should be using wscompile instead.

      I've used wscompile as follows to generate at least part of the code I need:

      wscompile -keep -import -f:wsi -model ControlService.xml.gz -mapping mapping.xml config.xml

      I thought I would have to run wscompile a second time in order to generate serializers from the model, but the thread at http://www.jboss.com/index.html?module=bb&op=viewtopic&t=60857 indicates that I should not do this.

      I've searched the forums and googled for guidance on top-down development that's compatible with JBoss, but I can't seem to find anything that provides any details regarding the complete process, from WSDL to deployment -- all of the getting started documentation seems to be geared towards bottom-up.

      I'd be most grateful if someone can point me in the right direction.

        • 1. Re: wsdl2java vs wscompile ala JBoss
          Jason Greene Master

          A J2EE Webservice client needs 4 components
          1) WSDL
          2) jaxrpc-mapping.xml - to preserve the java & wsdl mapping
          3) Java types (SEI + JavaBeans)
          4) service-ref tag in whatever your deployment descriptor is

          If you are starting development from a wsdl file then you will only have 1, and will need to generate 2 and 3, and hand code 4.

          The following wscompile command will do this for you:
          wscompile -keep -import -f:wsi -mapping jaxrpc-mapping.xml config.xml

          If your webservice is a document/literal webservice, you can control whether wscompile generates a wrapped, or bare service endpoint interface by using -f:unwrap, and -f:dontunwrap respectively

          Since wscompile expects a plain JAX-RPC client (and not a J2EE client), it generates a bunch of sun implementaiton classes (like serializers). The only types you need are the plain JavaBeans that represent complex types in your wsdl file.