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

Transaction Implementation Using WSIT - Slides

Embed Size (px)

DESCRIPTION

Web Services and Transactions using Web services interoperability toolkit. Slides on the implementation. I would appreciate sincere comments if any.

Citation preview

Page 1: Transaction Implementation Using WSIT - Slides

IMPLEMENT A TRANSACTION

USING A WEB SERVICE

COMP6017 – CourseWorkCOMP6017 – CourseWork

MSc. Web Technology 2009-2010

Chen, Cheng-Che : 23361301

GK, Eakan : 23813172

Sun, Wei : 23656018

Page 2: Transaction Implementation Using WSIT - Slides

Agenda

� Transaction – A brief Introduction

� Transactions in Web Services

� WS Co-ordination and WS Transaction

� Web Services Interoperability Toolkit� Web Services Interoperability Toolkit

� NetBeans IDE Integrated with WSIT

� Implementation

� Questions (if any)

Page 3: Transaction Implementation Using WSIT - Slides

Transaction� What is a Transaction?

� ACID Properties

Atomic, Consistent, isolated, and durable (ACID)

Page 4: Transaction Implementation Using WSIT - Slides

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.

Page 5: Transaction Implementation Using WSIT - Slides

WS-Coordination

� The primary goal of WS-Coordination

� Components of WS-Coordination:

Page 6: Transaction Implementation Using WSIT - Slides

WS-Coordination

� WS-Coordination addresses fundamental issues in

coordination among Web services:

1. SOAP extensions

2. Meta-protocols2. Meta-protocols

3. Middleware components

Page 7: Transaction Implementation Using WSIT - Slides

WS-Transaction

� Atomic Transactions:

Completion, 2PC, Completion WithAck, PhaseZero,

OutcomeNotification.

� Business Activities:� Business Activities:

BusinessAgreement ,

BusinessAgreementWithComplete

Page 8: Transaction Implementation Using WSIT - Slides

Web Services Interoperability Technologies

� What is WSIT?

-- A product of Sun Microsystems web services

interoperability to develop Java clients and service

providers.providers.

-- An implementation of a number of open web

services specifications to support enterprise features.

Page 9: Transaction Implementation Using WSIT - Slides

Web Services Interoperability Technologies

� Goal

> Interoperability with Microsoft Windows

Communication Foundation (WCF, a.k.a. “Indigo”)

> Implementation of WS-* specifications> Implementation of WS-* specifications

> Foundation for building SOA

Page 10: Transaction Implementation Using WSIT - Slides

WSIT Features� Bootstrapping and Configuration

� Message Optimization Technology

� Reliable Messaging Technology

� WS-Security

Page 11: Transaction Implementation Using WSIT - Slides

Implementation

� NetBeans IDE

� GlassFish v2.1

� Java EE

� Java Metro Stack(Project Tango)� Java Metro Stack(Project Tango)

� Web Services Interoperability Toolkit

� Java WS

� Enterprise Java Beans

� Java Transaction API

Page 12: Transaction Implementation Using WSIT - Slides

EJB : BankWebServiceBean

� public void init()

� public int debitAccount(String accnum, String amount)

� public int creditAccount(String accnum, String amount)

Page 13: Transaction Implementation Using WSIT - Slides

Web Service Attributes

Page 14: Transaction Implementation Using WSIT - Slides

Screen-shots of Client – Main Page

Page 15: Transaction Implementation Using WSIT - Slides

Screen-shots of Client – AccountDetails

Page 16: Transaction Implementation Using WSIT - Slides

TransferServlet

public class TransferServlet extends HttpServlet {

...

..

@Resource

UserTransaction ut;

..

..

@WebServiceRef(wsdlLocation = "WEB-

INF/wsdl/localhost_8080/BankWebServiceBeanService/BankWe

bServiceBean.wsdl")

private BankWebServiceBeanService service;

Page 17: Transaction Implementation Using WSIT - Slides

TransferServlet : processRequestprotected void processRequest(HttpServletRequest request,

HttpServletResponse response)

throws ServletException, IOException,

Exception {

...

bwsb.BankWebServiceBean port =

service.getBankWebServiceBeanPort();

..

port.init();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();}

Page 18: Transaction Implementation Using WSIT - Slides

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’ReillyNetBeans : The Definitive Guide, O’Reilly

� Project Tango: Overview, Sun Microsystems

� WSIT Tutorial, Sun Microsystems

� WS Atomic Transaciton, WS Coordination

Page 19: Transaction Implementation Using WSIT - Slides

Questions

Page 20: Transaction Implementation Using WSIT - Slides

Hebrew

MerciFrench

Grazie

GraciasSpanish

ObrigadoBrazilian

Portuguese

Arabic

Traditional Chinese

Korean

Hindi

go raibh maith agatGaelic

Tak

TrugarezBreton

Tack så mycketSwedish

Japanese

Thank YouEnglish

DankeGerman

GrazieItalian

Simplified Chinese

Thai

Tamil

TakDanish

Dutch

Dank u

Czech

Dekujeme Vam

DankonEsperanto