Print
Category: IT
Hits: 639

JAX-WS

API for XML Web Services

 

HTTP

 

 

SOAP

To provide a basic, common XML messaging protocol for the Web

 

WSDL

Establishes a common format for describing and publishing Web service

Information.

 

 

JSP

A JSP actually gets translated into a servlet by the container.

 

Three ways to pass information around:

 

Attached to:

Context

HttpSession

Request

 

Purpose of Web (servlet & JSP) Container

 

 

Purpose of EJB Container

 

 

 

JSP Problems

JSP request parameter to bean properties mapping problem

J2EE Application Servers

 

 

EJB

 

Remote access

Local access

J2EE clients

Distributed component

 

Interfaces

EJBObject- remote interface

EJBHome- home interface

Container-managed relationship

Tightly coupled as a logical unit

 

Interfaces

EJBLocalObject- local interface

EJBLocalHome- local home interface

   

 

 

Choosing between Servlets and Stateless Session Beans

 

Servlets

Stateless Session Beans

Need to execute business logic in the same web tier

Need to handle concurrency and synchronization

Need to execute business logic within an EJB tier

Need transaction and component-level security

Need container support concurrency and synchronization

 

 

 

Remote Protocols

 

RMI

 

Oldest protocol. However, it does not provide support for authorization, encryption, compression, or HTTP tunneling.

 

Not as up-to-date as recent dynamic proxies, code-generation libraries like CGLIB, and programming techniques like AOP.

 

Session EJB

 

J2EE default protocol. Using Spring reduces the complexity. Using Spring SimpleRemoteStatelessSessionProxyFactoryBean creates a RMI proxy over the EJB object.

 

WSDL and SOAP

 

Creating WSDL

 

WSDL can be created by using package such as axis2 running on a Web Container. The client stubs can be created by using axis2 wsdl2java. axis2 admin password is stored in axis2\WEB-INF\conf

 

It can also be created by using NetBeans. Create a web service project, add to “Web Services”, and code the services using the generated code in “Source Packages”

 

 

Transactions

 

Declarative transaction demarcation

 

Specifying within the deployment descriptor the transaction attributes for the various methods of the container-managed EJB component. This is a flexible and preferable approach that facilitates changes in the application's transactional characteristics without modifying any code. Entity EJB components must use this container-managed transaction demarcation.

 

REST

 

Representational State Transfer

 

Use of HTTP to manipulate objects on server