![Red Hat Application Server Скачать руководство пользователя страница 227](http://html.mh-extra.com/html/red-hat/application-server/application-server_manual_1427406227.webp)
Chapter 29. Web Services with JOnAS
219
The servlet is used to respond to a client request and dispatch the call to the designated instance
of servant (the SSB or JAX-RPC class exposed as Web Service). It handles the deserialization of
incoming SOAP message to transform SOAP XML into a Java Object, perform the call, and serialize
the call result (or the thrown exception) into SOAP XML before send the response message to the
client.
29.2. Exposing a J2EE Component as a Web Service
There are two types of J2EE components that can be exposed as Web Services endpoints: Stateless
Session Beans and JAX-RPC classes. Web Services’ endpoints must not contain state information.
A new standard Deployment Descriptor has been created to describe Web Services endpoints. This
Descriptor is named
webservices.xml
and can be used in a Web Application (in WEB-INF/) or
in an EJB-JAR (in META-INF/). This Descriptor has its JOnAS-specific Deployment Descriptor
(
jonas-webservices.xml
is optional).
29.2.1. A JAX-RPC Endpoint
A JAX-RPC endpoint is a simple class running in the Tomcat servlet container. SOAP requests are
dispatched to an instance of this class and the response is serialized and sent back to the client.
A JAX-RPC endpoint must be in a Web Application (the WAR file must contain a
WEB-INF/webservices.xml
).
29.2.2. Stateless Session Bean Endpoint
An Stateless Session Bean (SSB) is an EJB that will be exposed (all or some of its methods) as a Web
Service endpoint.
In the
ejb-jar.xml
standard descriptor, a Session Bean, exposed as a Web Service, must now use
the new service-endpoint tag. Here the developer defines the fully qualified interface name of the Web
Service. Notice that no other interfaces (home, remote, localhome, local) are needed with a Session
Bean exposed as Web Service.
Typically, an SSB must be in an EJB-JAR, and a
META-INF/webservices.xml
is located in the
EJB-JAR file.
29.2.3. Usage
In this Descriptor, the developer describes the components that will be exposed as Web Services’
endpoints; these are called the port-components. A set of port-components defines a webservice-
description, and a webservice-description uses a WSDL Definition file for a complete description of
the Web Services’ endpoints.
Each port-component is linked to the J2EE component that will respond to the request (service-impl-
bean with a servlet-link or ejb-link child element) and to a WSDL port (wsdl-port defining the port’s
QName). A list of JAX-RPC Handlers is provided for each port-component. The optional service-
endpoint-interface defines the methods of the J2EE components that will be exposed (no inheritance
needed).
A JAX-RPC Handler is a class used to read or modify the SOAP Message before transmission or
after reception (refer to the
JAX-RPC v1.1 spec. chap#12 "SOAP Message Handlers"
). The Session
Handler is a simple example that will read/write SOAP session information in the SOAP Headers.
Handlers are identified with a unique name (within the application unit), are initialized with the init-
Содержание Application Server
Страница 1: ...Red Hat Application Server JOnAS User Guide ...
Страница 8: ......
Страница 22: ...14 Chapter 1 Java Open Application Server JOnAS a J2EE Platform ...
Страница 58: ...50 Chapter 3 JOnAS Configuration ...
Страница 66: ...58 Chapter 5 JOnAS Class Loader Hierarchy ...
Страница 78: ...70 Chapter 6 JOnAS Command Reference ...
Страница 80: ......
Страница 86: ...78 Chapter 7 Developing Session Beans ...
Страница 136: ...128 Chapter 9 Developing Message Driven Beans ...
Страница 142: ...134 Chapter 10 Defining the Deployment Descriptor ...
Страница 148: ...140 Chapter 11 Transactional Behavior of EJB Applications ...
Страница 158: ...150 Chapter 14 EJB Packaging ...
Страница 162: ...154 Chapter 15 Application Deployment and Installation Guide ...
Страница 164: ......
Страница 176: ...168 Chapter 18 WAR Packaging ...
Страница 178: ......
Страница 184: ...176 Chapter 20 Defining the Client Deployment Descriptor ...
Страница 186: ...178 Chapter 21 Client Packaging ...
Страница 188: ......
Страница 192: ...184 Chapter 23 EAR Packaging ...
Страница 194: ......
Страница 200: ...192 Chapter 24 JOnAS Services ...
Страница 204: ...196 Chapter 25 JOnAS and the Connector Architecture ...
Страница 222: ...214 Chapter 27 Ant EJB Tasks Using EJB JAR ...
Страница 234: ...226 Chapter 29 Web Services with JOnAS ...
Страница 236: ......
Страница 260: ...252 Chapter 34 How to use Axis in JOnAS ...
Страница 270: ...262 Chapter 36 Web Service Interoperability between JOnAS and BEA WebLogic ...
Страница 296: ......