Monday 23 February 2009

How to deploy webservice on WAS V6.0?

This article details the steps required to deploy webservice on Websphere Application Server(WAS) V6.0 on a developemnt environment and test it.

WAS V6.x implements the JAX-RPC 1.1 specification. WAS has multiple implementaitons of webservices stack. WAS websphere implentation supports JAX-RPC, JAX-WS.

Since V5, a derivative of Apache Axis 1.0 has been used in WAS. There is buil-in webservices engine that supports Axis.


I am goign to talk about deplying webservice developed using Axis, though it will be same for any webservice developed on technology that supports JAX-RPC.

Deploy webservice as EAR:

To deploy Web services that are based on the Web Services for Java 2 Platform, Enterprise Edition (J2EE) specification, you need an enterprise application, also known as an enterprise archive (EAR) file that is configured and enabled for Web services. Deploying webservice as a EAR files is the easiest way.

Steps


  1. Login Admin Console




  2. Click Applications.


  3. Click Install New Application.






  4. Click on the Browse button to locate the UserAdmin.war file.


  5. Then type in the context name you want to access the servicenam



  6. Click Next and keep the default values in the Generate Default Bindings page.


  7. Ignore the security warning in the Application Security Warning page and click Continue.


  8. In the first step keep all default values and just check the Deploy Web Services option.
    Keep default values in step 2, 3 and 4. If you wish to change the host



  9. Click Finish.


  10. Click Save to Master Configuration.


  11. Click Save.


  12. Browse through the list of applications in Applications - > Enterprise Applications.


  13. Find the Webservice name and Start the application.


Testing

To test the webservice that we just deployed, we should have a client application. There are numerous tools out there which make our task easier. One of such popular tools is 'SOAPUI'.Learn more about it http://www.soapui.org/. Install a free version.And follow the instructions to access the EndPoint.


Virtual Hosts & PORTS

A virtual host is a configuration enabling a single host machine to resemble multiple host machine. Virtual hosts enable you to isolate, and independently manage, multiple sets of resources on the same physical machine.

Each virtual host has a logical name and a list of one or more DNS aliases by which it is known. A DNS alias is the TCP/IP host name and port number used to request the servlet, for example yourHostName:80. When no port number is specified, 80 is assumed.


By defaut WAS comes with 2 virtual hosts, admin_host and default_host. Each virtual host will have a set of ports as aliases. These can be viewed on Environment -> Virtual Hosts > admin_host > Host Aliases. You should know the port on which the webservices engine is running to access the webservice.

For example on WAS V6.0, webservices engine is on 10000. So a service named 'TestService' can be accessed as below end point:

http://localhost:10000/WebServices/services/TestService and add '?wsdl' to the link for viewing the WSDL definition of the WebService.
























3 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. I want to know the details related to 404 error while hosting appications..... Will you help me???? I have given the syntax is as follows : http://localhost:80/WebSphereBankWeb/

    Unable to host application. plzzz help me out....

    ReplyDelete
  3. Please send the details to pathanjali.v@gmail.com

    ReplyDelete