Deploying web services applications onto application servers
After assembling the artifacts required to enable the web module for web services into an enterprise archive (EAR) file, you can deploy the EAR file into the application server.
Before you begin
To deploy Java-based web services, you need an enterprise application, also known as an EAR file that is configured and enabled for web services.
A Java™ API for XML-Based Web Services (JAX-WS) application does not require additional bindings and deployment descriptors for deployment whereas a Java API for XML-based RPC (JAX-RPC) web services application requires you to add additional bindings and deployment descriptors for application deployment. JAX-WS is much more dynamic, and does not require any of the static data generated by the deployment step required for deploying JAX-RPC applications.
For JAX-WS web services, the use of the webservices.xml deployment descriptor is optional because you can use annotations to specify all of the information that is contained within the deployment descriptor file. You can use the deployment descriptor file to augment or override existing JAX-WS annotations. Any information that you define in the webservices.xml deployment descriptor overrides any corresponding information that is specified by annotations.
You can use the wsdeploy command with JAX-RPC applications to add WebSphere product-specific deployment classes to a web services-compatible enterprise application enterprise archive (EAR) file or an application client Java archive (JAR) file.
To install or deploy a JAX-WS application, you only need to install the JAX-WS enabled EAR file. If your web services application contains only JAX-WS endpoints, you do not need to run the wsdeploy command, as this command is used to process only JAX-RPC endpoints.
Ensure that you have installed the HTTP or Java Message Service (JMS) router module that was generated with the endptEnabler command onto the same target as your web services enterprise bean JAR files. These HTTP or JMS router modules are included in your web services application and they need to use the runtime libraries of the application server.
About this task
This task is one of the steps in developing and implementing web services.
You can use either the administrative console or the wsadmin scripting tool to deploy an EAR file. If you are installing an application containing web services by using the wsadmin command, specify the -deployws option for JAX-RPC applications. If you are installing an application containing web services by using the administrative console, select Deploy WebServices in the Install New Application wizard. For more information about installing applications using the administrative console, see the installing enterprise application files with the console information.
If your JAX-RPC web services application was previously deployed with the wsdeploy command, it is not necessary to specify web services deployment during installation.
The following actions deploy the EAR file with the wsadmin command:Procedure
Results
You have a web service installed onto your application server.
What to do next
{http://webservice.pli.tc.wssvt.ibm.com}RetireWebServices
Hello! This is an Axis2 web service!
The
first line of this information is variable, depending on your web service. The URI in the brackets
is the namespace and the string that follows, in this example RetireWebServices, is the name of the
port used to access the web service.The next step you might want to consider is to apply security to your web service.