Deploying Web Services
As with the other J2EE components (EJB, web) and resources (JMS
Destination
s, JavaMail Session
s, JDBC DataSource
s, and so on) discussed in this
book, web service implementations need to be deployed to an
application server. And, as with these other things, deploying a web
service isn’t simply putting your code up on the server. You need to
tell the web service engine how to manage your web services at
runtime.
The web service engine is responsible for accepting SOAP requests from clients, converting them into appropriate method calls on your Java implementation code , and taking the results of those method calls and converting them into the appropriate SOAP responses to the clients. In order to do this, the web service engine needs to know the following information for each web service that you want to deploy:
- Java implementation code
What Java code implements the web service, and what aspects of the Java code should be part of the web service?
- Java-to-XML mapping
How should the Java entities in your service implementation (interfaces, data objects, exceptions, etc.) be converted into SOAP/XML entities and vice versa? This covers both the description of your web service in the form of a WSDL document and conversions between SOAP entities and Java entities at runtime when operations are invoked.
This information is provided in the form of deployment descriptors and/or configuration files. These typically include:
- Web service deployment file
This file defines the web ...
Get Java Enterprise in a Nutshell, Third Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.