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.
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
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
- Login Admin Console
- Click Applications.
- Click Install New Application.
- Click on the Browse button to locate the UserAdmin.war file.
- Then type in the context name you want to access the servicenam
- Click Next and keep the default values in the Generate Default Bindings page.
- Ignore the security warning in the Application Security Warning page and click Continue.
- 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 - Click Finish.
- Click Save to Master Configuration.
- Click Save.
- Browse through the list of applications in Applications - > Enterprise Applications.
- 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.