Igor Kromin |   Consultant. Coder. Blogger. Tinkerer. Gamer.

In the past I've shown how to use Ant and the JWSC task to build a JAX-WS web service, well I've moved onto Maven now and started to use the Oracle WebLogic Maven plugin to build services. This is an example on how to build a JAX-WS web service using that plugin, specifically the wsgen goal.

It should be noted that even though the plugin still provides the ws-jwsc goal, it has been deprecated and should not be used. I found that ws-jwsc was full of bugs when I used it in the past, wsgen is much more reliable.

Since I am using Maven, I have a standard folder structure for my service, which looks like this...
wsgen_jaxws.png


All of the above files are available from GitHub here: ikromin/misc/j2ee/wsgen_jaxws_example.

Below is the configuration for the plugin. The most significant part is on line 15 where I specify the service endpoint interface (SEI), which is my web service implementation class.
 Maven Plugin
<plugin>
<groupId>com.oracle.weblogic</groupId>
<artifactId>weblogic-maven-plugin</artifactId>
<version>12.2.1-0-0</version>
<executions>
<execution>
<id>wsgen</id>
<phase>process-classes</phase>
<goals>
<goal>wsgen</goal>
</goals>
<configuration>
<keep>false</keep>
<protocol>Xsoap1.2</protocol>
<sei>net.igorkromin.WsExampleImpl</sei>
<genWsdl>false</genWsdl>
</configuration>
</execution>
</executions>
</plugin>




That's pretty much all there is to it. As long as you package your project as a WAR file, Maven takes care of the rest.

Once you run 'mvn clean package', you will get a target/WsExample-1.0.war file which can be deployed to WebLogic. Once deployed the WSDL should be accessible at a URL similar to: http://localhost:7001/WsExample-1.0/WsExample?wsdl

-i

A quick disclaimer...

Although I put in a great effort into researching all the topics I cover, mistakes can happen. Use of any information from my blog posts should be at own risk and I do not hold any liability towards any information misuse or damages caused by following any of my posts.

All content and opinions expressed on this Blog are my own and do not represent the opinions of my employer (Oracle). Use of any information contained in this blog post/article is subject to this disclaimer.
Hi! You can search my blog here ⤵
NOTE: (2022) This Blog is no longer maintained and I will not be answering any emails or comments.

I am now focusing on Atari Gamer.