Jay SenSharma

Jay SenSharma

In continuation to the Bottom Approach to Build JAXRPC Style JMS based WebService….Here is a Simple Demonstration to Develop the Same service using “Top to Bottom” approach…Means we will convert a JMS Service based WSDL into a JAXRPC WebService.

To get the WSDL for our current Demo please Use the link :jaxrpc-service-with-wljmstransport/

Once you get the WSDL (or you can use your own WSDL as well)

Step1). Placde the WSDL in some Location inside your filesystem: Example: F:DELETEWlJmsTransportDemoWSDL_to_Service

Step2). Now write the following ANT to Generate the Service from the WSDL: “build.xml”

<project name="GenerateWS" default="all">
<property name="build" value="output" />
<property name="adminurl" value="t3://localhost:7001" />
<property name="serverName" value="AdminServer" />
<property name="ear.dir" value="EJB_JAXWS_Ear" />
<taskdef name="jwsc" classname="weblogic.wsee.tools.anttasks.JwscTask" />
<taskdef name="wsdlc" classname="weblogic.wsee.tools.anttasks.WsdlcTask"/>
<target name="all" depends="generate-from-wsdl,wait"/>

<target name="generate-from-wsdl">
<wsdlc srcWsdl="JMSService_saved_wsdl.wsdl"

<target name="wait">
<echo message=" Now you need to provide your own Implementation for sayHello() of ws/JMSServicePortTypeImpl.java" />
<echo message=" then you need to run 'ant deploy' to rebuild your edited Service and to Deploy it on the Server..." />

<target name="build-service">
<jwsc srcdir="." destdir="output/EJB_WS_Ear">
<jws file="ws/SimpleService_SimplePortImpl.java"
compiledWsdl="jarJws/SimpleService_wsdl.jar" />

<target name="deploy" depends="build-service">
<wldeploy action="deploy"
source="output/EJB_WS_Ear" user="weblogic"
password="weblogic" verbose="true"
targets="${serverName}" />

<target name="redeploy">
<wldeploy action="redeploy" source="output/EJB_WS_Ear"
user="weblogic" password="weblogic" verbose="true"
targets="${serverName}" />

Step3). Run the Ant script …. sothat it can generate the WebService..
Step4). Now inside “F:DELETEWlJmsTransportDemoWSDL_to_Servicews” directory you will find the following WebService class is generated…“JMSServicePortTypeImpl.java” …Please edit this class and Just provide the WebMethod implementation according to your requirement…
Step5). Just run the ANT again with Build and Deploy your Service…
ant deploy
Jay SenSharma
If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.