Search code examples
web-serviceswsdlweblogicjax-wswsgen

Generate WSDL file (inline schema) in Weblogic 12


I use Weblogic 12c and I created an EJB web service using annotations: @Stateless and @WebService. The WSDL file of this web service will be generated by Weblogic at run time, by default Weblogic decides not to use inline schemas. What should I do to have a single wsdl file for my web service? I have already seen this post, but I do not know how to use -inlineSchemas parameter in Weblogic.


Solution

  • I searched a lot but there is nothing to solve this problem systematically for example by setting a parameter in Weblogic management panel. I finally decided to solve it manually, I wrote a script to generate WSDL file with -inlineSchemas parameter. Beacause I used @EJB in my class I had to use javaee-api.jar file. I downloaded the jar file and put it near .bat file (I using Windows 10). In the .bat file there should be something like below:

    wsgen -wsdl -inlineSchemas -cp .;javaee-api-6.0.jar qualified.name.of.your.class -r DESTINATION-OF-WSDL-FILE
    

    Then in eclipse, I created a new builder for my project:

    Right click on the project in Project Explorer -> Properties -> Builders -> New... -> Program

    and in the next window I set The Location and Working Directory of my program. Then every time that I build the project (Using Ctrl+B to build all projects) new WSDL file will be generated from qualified.name.of.your.class.