Here are the key points about servlet endpoint packaging as a WAR file and packaging an EJB endpoint using an EJB-JAR:
Servlet Endpoint Packaging as a WAR File:
- The service implementation bean is contained in WEB-INF/classes and packaged in the WAR file.
- The service endpoint interface is also contained in WEB-INF/classes.
- Optional files like WSDL, deployment descriptors, and dependent classes are also packaged inside the WAR file.
Packaging an EJB Endpoint Using an EJB-JAR:
- The service implementation bean is contained in the package path directory inside the EJB-JAR.
- The service endpoint interface is also contained in the package path
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
Soa 32 packaging and deployment of soa components
1. Service Oriented Architecture: 32
Packaging and Deployment of SOA Components
Prof Neeraj Bhargava
Vaibhav Khanna
Department of Computer Science
School of Engineering and Systems Sciences
Maharshi Dayanand Saraswati University Ajmer
2. Packaging and Deployment of SOA
Components
• The two specifications that provide most of the detail regarding
packaging and deployment are
– Web Services Metadata for the Java Platform (WS-Metadata) [JSR 181]
and
– Implementing Enterprise Web Services (WSEE) [JSR 109].
• WS-Metadata defines a set of standard annotations programmers
use to configure how the container will deploy a Java class as a Web
service.
• During deployment, the JWS container interprets those annotations
to generate artifacts and configure itself to deploy the specified
Web service.
• For example, the container may construct a WSDL representation of
a Web service based on the WS-Metadata annotations.
3. WSEE and WS Metadata
• WSEE defines a service architecture to ensure portability of Web Services
applications across Java EE application server implementations.
• It defines requirements for each major integration point for Web services
in Java EE, including client, server, and deployment models.
• WSDL bindings and security are also addressed.
• Whereas WS-Metadata specifies how to describe the Web service to be
deployed from a Java class
• For this reason, WSEE is often referred to as the “portability
specification”— Its compliance ensures that Web services are portable.
• It defines the types of objects that can be deployed as Web services, how
to package those objects, and what annotations and/or deployment
descriptors are required for deployment.
• For example, WSEE tells us that a Web service can be deployed either as a
servlet endpoint or as an EJB endpoint
4. WSEE Port Component
• WSEE defines the concept of a port component to refer
to the component that gets packaged and deployed to
the container to implement a Web service.
• A port component is an addition to the Java EE
platform defined by WSEE and should be thought of in
the same manner as other deployable components
such as servlets and JSPs (Web container) or EJBs (EJB
container).
• Like those other components, a port component
depends on the functionality provided by the Web and
EJB containers.
5. Service Packaging in WAR file or EJB
JAR file
• Per WSEE, port components may be packaged in
a WAR file or EJB JAR file.
• Port components packaged in a WAR file are
referred to in WSEE as JAX-WS Service Endpoints.
• These are simply service implementation beans
that do not have the @Stateless annotation.
• In fact, a SEI can be implemented by either a JAX-
WS Service Endpoint or a Stateless Session EJB in
an EJB container.
7. Service Implementation Bean
• 1.Service Implementation Bean [required] is
contained in the WEBINF/ classes/<package-
path>/, where <package-path> is determined by
the class’s package name.
• This location is not mandatory, but customary.
Alternatively, the SIB could be contained in a JAR
under the WEB-INF/lib or even in an extension
JAR installed in the Web container and referenced
by the WAR’s MANIFEST Class-Path
8. Service endpoint interface SEI
• 2. Service endpoint interface [optional] is
contained in the WEBINF/ classes/<package-
path>/ where <package-path> is determined
by the class’s package name.
• This location is customary, but not mandatory.
• The SEI class file may be located anywhere on
the application classpath
9. WSDL
• 3 WSDL [optional] is contained in the WEB-
INF/wsdl directory.
• This is not a mandatory location, but is
customary. When used, the SIB’s
@WebService.wsdlLocation attribute’s value
must equal the relative location of this file.
• Any files (e.g., XML Schema definitions)
referenced by the WSDL must be referenced
relative to the WSDL’s location.
10. Other Elements
• 4. web.xml [optional] is contained in the WEB-INF/ directory.
• 5. webservices.xml [optional] is contained in the WEB-INF/ directory.
• 6. jax-ws-catalog.xml [optional] is contained in the WEB-INF/ directory.
This descriptor is used in connection with OASIS XML Catalog
• 7. sun-web.xml [optional] is contained in the WEB-INF/ directory. This is
the GlassFish-specific Web application descriptor.
• 8. Handler Chain File [optional] is contained under the WEB-INF/ classes
directory where it will be available as a resource on the application
classpath. There is no standard name for this file.
• 9 Dependent Classes [optional] are bundled in a JAR and contained under
the WEB-INF/lib directory where they are available on the application
classpath. These are any classes the SIB or SEI depend on.
12. . Service implementation bean
• 1. Service implementation bean [required] is contained in
the <package-path>/ directory where <package-path> is
determined by the class’s package name.
• This location is not mandatory, but customary.
• Alternatively, the SIB could be contained in another JAR
(e.g., bundled within an EAR with this same EJB-JAR) and
referenced by the EJB-JAR’s manifest file Class-Path
attribute.
• You could even have the SIB located in an installed library
and referenced by the EJB-JAR’s manifest file Extension-List
attribute.
• As long as the SIB is on the application classpath, the
packaging will work.
13. Service endpoint interface
• 2. Service endpoint interface [optional] is
contained in the <package- path>/ where
<package-path> is determined by the class’s
package name.
• This location is customary, but not mandatory.
• The SEI class file may be located anywhere on the
application classpath (see classpath description in
item 1).
• When used, the SIB’s @WebService. Endpoint
Interface attribute’s value must equal the
complete name of this SEI.
14. Other Elements in EJB-JAR
• 3. WSDL [optional] is contained in the META-INF/wsdl
directory. WAR and EJB-JAR usage is the same.
• 4. ejb-jar.xml [optional] is contained in the META-
INF/directory.
• 5. webservices.xml [optional] is contained in the
META-INF/directory.
• 6. jax-ws-catalog.xml [optional] is contained in the
META-INF/ directory.
• 7. sun-ejb-jar.xml [optional] is contained in the META-
INF/directory. This is the GlassFish-specific EJB
deployment descriptor.
15. Other Elements in EJB-JAR
• 8. Handler Chain File [optional] is contained under the
<packagepath>/ directory (<package-path> is determined
by the SIB class’s package name) where it is available as a
resource on the application classpath. WAR and EJB-JAR
usage is the same.
• 9. Dependent Classes [optional] are contained in a
separate JAR file at the root of the enclosing EAR where
they will be available on the application classpath. These
are any classes the SIB or SEI depends on.
• This is not a mandatory location.
• The dependent classes may be located anywhere on the
application classpath
16. Assignment
• Explain Servlet endpoint packaging as a WAR
File
• Explain the Packaging an EJB Endpoint Using
an EJB-JAR