GO BEYOND CONVENTION WORF Developing DB 2 UDB
GO BEYOND CONVENTION WORF: Developing DB 2 UDB based Web Services on a Websphere Application Server Kris Van Thillo, ABIS Training & Consulting
Agenda J 2 EE and Web Services • Introduction › About Web Services › About Stored Procedures • Architecting Web Services › Understand application requirements › The server component model - the client invocation model › WSDL, SOAP and UDDI constructs • DB 2 Stored Procedures and Web Services › WORF › DB 2 XML Extender › Web Services 2 9/15/2021 © 2003 BMC Software
GO BEYOND CONVENTION Introduction Web Services and Stored Procedures
Web Services - Definition Web Services are “Software applications identified by a URI, whose interfaces and bindings are capable of being defined, described and discovered by XML artifacts, supporting direct interactions with other software applications using XML based messages via internet-based protocols. ”. . . 4 9/15/2021 © 2003 BMC Software
Web Services - Standards and based on open standards • • XML - e. Xtensible Markup Language SOAP - Simple Object Access Protocol WSDL - Web Services Description Language UDDI - Universal Description, Discovery and Integration 5 9/15/2021 © 2003 BMC Software
Webservices - Execution 6 9/15/2021 © 2003 BMC Software
Web Services - Execution Step 1: Define and build Web Service (method signature) • function/operation(s), parameters • return value, errors/exceptions Step 2: Deploy Web Service • to SOAP router • deployment descriptor Step 3: Create client application • Java calls SOAP API Step 4: Execute the client application 7 9/15/2021 © 2003 BMC Software
Web Services - Why? Advantages: • loosely coupled and coarse-grained service granularity • programming language independent, interoperable • transport independent • mutiple invocation styles: static or dynamic • multiple communication styles: synchronous or asynchronous • open, extensible, standards based: based on XML • composable 8 9/15/2021 © 2003 BMC Software
About Stored Procedures. . . Stored Procedures 9 9/15/2021 © 2003 BMC Software
Advantages of Stored Procedures • Faster execution • Reduced network traffic • Modular programming • Increased security 10 9/15/2021 © 2003 BMC Software
Writing Stored Procedures • Languages: Java, C, … • Generation with GUI: › Stored Procedure Builder (v 7) › Development Center (v 8) • SQL/PL DB 2 UDB v 8 supports the dynamic CALL statement 11 9/15/2021 © 2003 BMC Software
GO BEYOND CONVENTION Architecting Web Services
Common Web Service Architectures 13 9/15/2021 © 2003 BMC Software
Server component model Client invocation model • Server component model › Request-Response and RPC paradigms: use solutions with basic synchronous blocking behaviour e. g. Java classes, EJBs, stored procedures › Fire and Forget: JMS architecture and MDBeans for asynchronous behaviour • Client invocation model › Static Proxy, static proxy generated, based on WSDL › Dynamic Proxy › Dynamic Invocation Interface 14 9/15/2021 © 2003 BMC Software
WSDL, SOAP, UDDI Constructs SOAP provides a myriad of constructs! Consider: • usage styles › SOAP ‘RPC’ style › SOAP Document style • encoding styles › encoded › literal 15 9/15/2021 © 2003 BMC Software
GO BEYOND CONVENTION Stored Procedures and Web Services
WORF - Basic Architecture WORF: a piece of software plugged in the Websphere application server used by all DB 2 Web Service enterprise applications. 17 9/15/2021 © 2003 BMC Software
The DB 2 XML Extender Offers … › › › Stored Procedures › User Defined Datatypes (UDT) › Supporting tables Triggers User Defined Functions (UDF) … to extend DB 2 functionality! 18 9/15/2021 © 2003 BMC Software
Two methods (i) XColumn data = XML documents DB 2 used as XML document repository Validation of XML docs Storing XML docs Search through XML docs 19 9/15/2021 © 2003 BMC Software
Two methods (ii) XCollection DB 2 used as database (no XML in DB 2) XML is transport language Validation of XML docs Decompose XML docs into data Compose XML docs from data 20 9/15/2021 © 2003 BMC Software
DADs XML document › › 21 Validate DTD-id Method Detailed description of data mapping: DB 2 vs. XML 9/15/2021 © 2003 BMC Software
DB 2 Web Services WORF: software plugged in the Web. Sphere application server used by all DB 2 Web Service enterprise applications. 22 9/15/2021 © 2003 BMC Software
Web Service Object Runtime Framework (WORF) Provides for: › Resource-based deployment and invocation, i. e. § DADX based § optionally other resources that help define the web service › Automatic service redeployment › Automatic WSDL and XSD generation › Automatic documentation › Automatic test page generation 23 9/15/2021 © 2003 BMC Software
WORF configuration files description of deployed service servlet mapping service specific config database specs engine 24 9/15/2021 © 2003 BMC Software
DADX Document Access Definition e. Xtension › XML document › a DADX <DADX xmlns="http: //schemas…"> <operation name="list. Persons"> <query> for each Web Service › Web Service meths: DADX operations <SQL_query>SELECT pfname, plname FROM db 2. persons</SQL_query> </operation> <operation name="Insert. Person"> <call> › Web Service <SQL_call>call db 2. In. Pers(: lname, : com) </SQL_call> <parameter name="lname" type="xsd: string"/> <parameter name="com" type="xsd: string” kind="out"/> documentation › Query Description 25 </call> </operation> </DADX> 9/15/2021 © 2003 BMC Software
Possible DADX operations / DB 2 manipulations SQL based queries › › › 26 select XML based queries › › insert update retrieve. XML store. XML delete call 9/15/2021 © 2003 BMC Software
SOAP request processing by WORF Processing sequence: › › › › 27 loads the DADX optionally loads a DAD file replaces query parameters connects to DB 2 runs the SQL statement commits the database transaction formats the result into XML returns the response in a SOAP envelope 9/15/2021 © 2003 BMC Software
DB 2 Web Services WORF: software plugged in the Web. Sphere application server used by all DB 2 Web Service enterprise applications. 28 9/15/2021 © 2003 BMC Software
Why will Web Services Succeed? Because: › Implementation de-coupled from interface § any language § open standard transport ‘distributed’ technology › Optimized for Internet § standard based › › 29 ‘No’ assumptions about technology at either side of the chain Backed by key software vendors: IBM, Oracle, MS, etc. 9/15/2021 © 2003 BMC Software
- Slides: 29