We can make this Web Service client application as a stand alone application as well then we do not need to deploy the same on WAS server.
I have created a BankClient in RAD to demonstrate the same. I created a WSDL in message broker and developed a flow with SOAPInput and SOAPReply node. This flow acts like a server flow running on Message Broker.
WSDL has four operations like- CreateAccount, CreditRequest, DebitRequest and CheckBalance.
Here are the required steps to make a standalone client application:
- Create a Web Service client application from WSDL as you generally do in RAD.
- Create a new main class under Java Resources as shown in following screen shot:
- It is required to create an object of *Proxy class in the main and
then call all the operation using that object as shown in following
- Remember to create required variables to call operations.
- Save the changes and if any error then resolve that.
- Now the next step is to change the *Service.java file for WSDL location.
- Right click on your WSDL file under ->Web Content->WEB-INF->wsdl and select properties.
- From the Resources window , copy the location of WSDL as shown below:
- Open *Service.java.
- Search for wsdlLocation variable and change the value of that variable to this copied location of wsdl. Do not forget to add 'file:' before 'C:\' and change the slash from '\' to '/' e.g. wsdlLocation = "file:C:/Documents and Settings/shelly/IBM/rationalsdp/ShellyDW1/BankClient/WebContent/WEB-INF/wsdl/BankMessageSetService.wsdl".
- Now add these 2 lines and update them as per your file structure.
Also update the wsdl path 'MalformedURLException' and
'logger.warning' as shown below:
- Save *Service.java.
- Now it is required to add thinclient jar for webservices in Build path.
- Right click on your Client application and select Build Path -> Configure Build Path.
- Select 'Libraries' tab and click on 'Add External JARs....'. Select 'com.ibm.ws.webservices.thinclient_7.0.0.jar' from WAS installed location. Select 'Order and Export' tab and click on 'Select All' button. Then click on OK.
- Now Client is ready to run as standalone application. Right click on your Client application and select Run As->Java Application.