Upload
eakan-gopalkrish
View
140
Download
5
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
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
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)
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-protocols2. Meta-protocols
3. Middleware components
WS-Transaction
� Atomic Transactions:
Completion, 2PC, Completion WithAck, PhaseZero,
OutcomeNotification.
� Business Activities:� 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.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> 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)� 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 : 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();}
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
Questions
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