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

Skip down to comments...
Hope you found this post useful...

...so please read on! I love writing articles that provide beneficial information, tips and examples to my readers. All information on my blog is provided free of charge and I encourage you to share it as you wish. There is a small favour I ask in return however - engage in comments below, provide feedback, and if you see mistakes let me know.

If you want to show additional support and help me pay for web hosting and domain name registration, donations, no matter how small, are always welcome!

Use of any information contained in this blog post/article is subject to this disclaimer.
 
comments powered by Disqus
Other posts you may like...