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

Did you like this post or found it useful? Considering supporting this Blog to keep its web servers running, any amount helps! Thanks!
Have comments or feedback on what I wrote? Please share them below!
comments powered by Disqus
Other posts you may like...