wsimport - how to generate service endpoint classes and JAXB classes in separate projects/folders

前端 未结 4 888
清酒与你
清酒与你 2020-12-16 00:49

We are using a top-down approach for a project with multiple web services (multiple WSDL\'s). Each web service needs to be set up as a separate project and deployed as a sep

4条回答
  •  别那么骄傲
    2020-12-16 01:22

    I know that this question is very old, but I wanted to share the answer for those that are looking. I know it took me a while to find the answer.

    As of JAXB 2.1 RI, there's a feature called "episodes" that you can use to facilitate this.

    Let's say you have a schema called myschema.xsd. Then you would want to call the following:

    xjc -episode myschema.episode myschema.xsd
    

    This also works if you are compiling multiple xsd files using a single call. The call will produce the bindings as well as the myschema.episode file.

    The episode file is a special bindings file. You can then use this file with wsimport, like so:

    wsimport mywsdl.wsdl -b myschema.episode
    

    wsimport will now use the previously generated JAXB files, and will generate anything that is missing.

    See this page for more information.

提交回复
热议问题