Transaction Implementation Using WSIT - Slides

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 20

IMPLEMENT A TRANSACTION

USING A WEB SERVICE


COMP6017 – CourseWork
MSc. Web Technology 2009-2010

Chen, Cheng-Che : 23361301


GK, Eakan : 23813172
Sun, Wei : 23656018
Agenda
 Transaction – A brief Introduction
 Transactions in Web Services
 WS Co-ordination and WS Transaction
 Web Services Interoperability Toolkit
 NetBeans IDE Integrated with WSIT
 Implementation
 Questions (if any)
Transaction
 What is a Transaction?

 ACID Properties
Atomic, Consistent, isolated, and durable (ACID)
Transactions in Web Services
 In Web Service transactions we do not need to
abide to the ACID properties. But for long
transactions consistency has to be maintained.

 Need some forms of correlation, but not necessarily


require transaction behavior.
WS-Coordination
 The primary goal of WS-Coordination
 Components of WS-Coordination:
WS-Coordination
 WS-Coordination addresses fundamental issues in
coordination among Web services:
1. SOAP extensions
2. Meta-protocols
3. Middleware components
WS-Transaction
 Atomic Transactions:
Completion, 2PC, Completion WithAck, PhaseZero,
OutcomeNotification.
 Business Activities:

BusinessAgreement ,
BusinessAgreementWithComplete
Web Services Interoperability Technologies

 What is WSIT?
-- A product of Sun Microsystems web services
interoperability to develop Java clients and service
providers.
-- An implementation of a number of open web
services specifications to support enterprise features.
Web Services Interoperability Technologies
 Goal
> Interoperability with Microsoft Windows
Communication Foundation (WCF, a.k.a. “Indigo”)
> Implementation of WS-* specifications
> Foundation for building SOA
WSIT Features
 Bootstrapping and Configuration
 Message Optimization Technology
 Reliable Messaging Technology
 WS-Security
Implementation
 NetBeans IDE
 GlassFish v2.1
 Java EE
 Java Metro Stack(Project Tango)
 Web Services Interoperability Toolkit
 Java WS
 Enterprise Java Beans
 Java Transaction API
EJB : BankWebServiceBean

 public void init()

 public int debitAccount(String accnum, String amount)

 public int creditAccount(String accnum, String amount)


Web Service Attributes
Screen-shots of Client – Main Page
Screen-shots of Client – AccountDetails
TransferServlet
public class TransferServlet extends HttpServlet {
...
..
@Resource
UserTransaction ut;
..
..
@WebServiceRef(wsdlLocation = "WEB-
INF/wsdl/localhost_8080/BankWebServiceBeanService/BankWe
bServiceBean.wsdl")
private BankWebServiceBeanService service;
TransferServlet : processRequest
protected void processRequest(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException,
Exception {
...
bwsb.BankWebServiceBean port =
service.getBankWebServiceBeanPort();
..
port.init();
try {
ut.begin(); //demarcate beginning of transaction
result = port.debitAccount(dest_account, amount);
result = port.creditAccount(dest_account, amount);
ut.commit();
}catch(Exception e) {ut.rollback();}
References:
 Java EE 5 Tutorial, Sun Microsystems
 Java Web Services Tutorial, Sun Microsystems
 Teach Yourself Web Services in 24 Hours, Sams
Publishing
 NetBeans : The Definitive Guide, O’Reilly
 Project Tango: Overview, Sun Microsystems
 WSIT Tutorial, Sun Microsystems
 WS Atomic Transaciton, WS Coordination
Questions
Trugarez Merci
French Gracias
Breton Spanish

Korean
Arabic
Hebrew

Hindi
Traditional
Tack så mycket Swedish
Chinese

Obrigado
Brazilian
Portuguese go raibh maith agat Gaelic
Tak
Grazie Dankon
Danish

Italian Esperanto
Simplified
Chinese
Danke German

Japanese

Dank u
Thank You Dutch Thai

English
DekujemeVam Czech
Tamil

You might also like