+ All Categories
Home > Documents > © Logicalis Group Web self-service: integration of applications and databases Mandy Shaw.

© Logicalis Group Web self-service: integration of applications and databases Mandy Shaw.

Date post: 21-Dec-2015
Category:
View: 219 times
Download: 0 times
Share this document with a friend
Popular Tags:
30
© Logicalis Group Web self-service: integration of applications and databases Mandy Shaw
Transcript

© Logicalis Group

Web self-service: integration of applications and databases

Mandy Shaw

Web self-service

Web enablement

Web integration

Web development

Agenda

Choosing your mechanisms

Availability, performance (both ends), resilience, security

Culture and skills issues

Development lifecycle issues

Reusability issues

Synchronous or asynchronous?

Existing middleware, infrastructure and/or interfaces

Problem determination techniques

Open standards

JDBC, XML, Web services (SOAP), JMS

Non-open standards

ODBC

Examples

iSeries specifics

Web self-service: infrastructure,logic elements and data flows

INTERNET

DMZ

MZ

Firewall

Extranet and external Web server

Firewall

Internal databases and applications

Web browser – potential Extranet or external user

(Other potential external data or transaction sources and targets)

Internal application user

Web application server

Intranet Web server

Web browser – Intranet user

Connectors

Web enablement

CHALLENGE

Motor insurers Admiral Group required a highly secure, highly scalable e-commerce Web site that could be fully integrated with its iSeries-based back end systems

insurance policy management, postcode lookups, credit card processing, …

SOLUTION

A WebSphere-based Web site with real-time integration to Admiral’s back end systems

Live since July 2000

BENEFITS

Improved customer service

Both online and on the ‘phone

Reduced administration costs and workload

DMZ MZ

IBM HTTP server with

SSL

WebSphere Application Server 5.1

Servlets, JavaBeans and JSPs

New RPG programs

using existing

logic

Stored procedure definitions

Rating engine runs here for performance

I90 LOB application:

postcode lookups, credit checking, policy

creation, etc.

JDBC using DB2 (DRDA) driver

HTTP / HTTPS protocols

Web enablement

Web enablement

CHALLENGE

Shop fittings suppliers Morplan were selling to retailers via ‘phone/fax from a printed catalogue

Needed a Web channel to grow revenue

SOLUTION

A WebSphere Commerce solution integrated with Morplan’s existing SAP implementation

BENEFITS

Improved customer service and longer ‘opening hours’

Reduced administration costs and workload

Very considerable revenue growth

Web enablement

DMZ MZ

WebSphere Application Server 3.5

WebSphere Commerce Suite 4.1

SAP

NT

IBM HTTP server with

SSL

Customised BAPI

WCS/SAP standard interface (using RFC), customisedHTTP /

HTTPS protocols

Web integration

CHALLENGE

Optical products suppliers Bausch and Lomb wanted to provide retail opticians with improved order placement and order enquiry facilities

Technology pilot for both Web self-service and application integration

SOLUTION

A customised WebSphere Commerce application

integrated with BPCS via B&L’s strategic middleware

deploying reusable application integration techniques and components

BENEFITS

Improved customer service

Reduced administration costs and workload

Tried-and-tested integration techniques and components

INTERNET

DMZ MZ

Firewall etc.

Firewall etc.

NT NT

EAI hub (e*Gate)

Web integration

DMZMZ

WebSphere Application Server 3.5

WebSphere Commerce Suite 4.1

NT

IBM HTTP server with SSL

HTTP / HTTPS protocols

New RPG programs using existing logic

Stored procedure definitions

BPCS

ECM

IBM HTTP server

WebSphere Application Server 3.02

Generalised XML

handler servlet

XML messages, handled by bespoke OFs and commands

Routing of requests, retry handling, XML transformation, etc.

HTTP e*Way

C API e*Way

JDBC using DB2 driver

Other XML-based transactions from various sources

Web integration

Web integration: XML example

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE Message SYSTEM "wcsorder.dtd"><Message> <MessageHeader> <MessageType MessageMode="Request" MessageTypeDetail="Order"/> <TargetSystem> <CountryCode Country="UK"/> <TargetEnvironment>ELCBP604FL</TargetEnvironment> </TargetSystem> <TimeStamp>20001124155400</TimeStamp> </MessageHeader> <MessageDetail> <OrderRequest> <SourceOrderHeader> <SourceOrderReference>WCS1234567</SourceOrderReference> <CustomerReference>PO54321</CustomerReference> <NumberLines>123</NumberLines> </SourceOrderHeader> <SourceOrderDetail> <SourceOrderReference>WCS1234567</SourceOrderReference> <NumberLines>123</NumberLines> <SKU>1234ABCDEF</SKU> <Quantity>35</Quantity> <LineNo>1</LineNo> </SourceOrderDetail> <SourceOrderDetail> . . . </SourceOrderDetail> </OrderRequest> </MessageDetail></Message>

Web integration using WebSphere MQ

CHALLENGE

High speed, high volume, Internet-based order entry for customers

SOLUTION

A customised WebSphere application

integrated with BAAN via WebSphere MQ

BENEFITS

24x7 order placing

Reduced administration costs and workload

Tried-and-tested integration techniques and components

DMZ: Web server

MZ: BAAN server

IBM HTTP server with

SSL

WebSphere App Server

5.0

Servlets, JavaBeans and JSPs

JNI wrappersMQ

HTTP / HTTPS protocols

BAAN APIs

BAAN

User store

Web integration using WebSphere MQ

Web development: meet your ancestors

www.1837online.com

Clustered WebSphere and DB2 on Linux RedHat Advanced Server on xSeries

LizardTech DjVu for high performance over dial-up lines

2.4 million images (converted and cleaned up by us)

52 day ROI

INTERNET

DMZ MZ

FailoverFirewall

Web server

Firewall

VPN connection

Internal desktop/server with VPN client

Customer Web browser

Database serverLoad

Balancer

Occasional admin

Image updates

Failover database server

Web server

Web server

DMZ: Web servers

MZ: database server

IBM HTTP server with

SSL

WAS 5.1 Network

Deployment

Servlets, JavaBeans and JSPs

DB2 UDB relational database

DB2 JDBC driver

HTTP / HTTPS protocols

DB2 UDB relational database -

failover

Steeleye high availability

Web development: meet your ancestors

Web self-service: Some product choices

INTERNET

DMZ

MZ

Firewall

Apache on iSeries, or Apache on xSeries (Windows or Linux)

Firewall

Internal databases and applications

Web browser – potential Extranet or external user

(Other potential external data or transaction sources and targets)

Internal application user

Tomcat or WebSphere Application Server

Apache on iSeries

Web browser – Intranet user

JDBC, stored procedures, JMS, WebSphere MQ, Web services, …

Summary

Availability, performance (both ends), resilience, security

Culture and skills issues

Development lifecycle issues

Reusability issues

Synchronous or asynchronous?

Existing middleware, infrastructure and/or interfaces

iSeries specifics follow …

iSeries application and database integration mechanisms

WebFacing

JDBC

iSeries Toolbox for Java

Direct program calls

Web services

/* JDBC import */import java.sql.*;

/* Variables for DB2/400 connection */Connection conn = null;PreparedStatement out = null;

/* Connect to DB2/400 (DRDA JDBC driver for performance) */Class.forName("com.ibm.db2.jdbc.app.DB2Driver");conn = DriverManager.getConnection("jdbc:db2:cat32", “<user>“,“<password>");

/* Prepare INSERT statement (executed once only) */out = conn.prepareStatement("INSERT INTO MAXDW.ONECALLADJ (LEIUNID, NARRATIVEDATE, NARRATIVETIME, NARRATIVE) VALUES(?, ?, ?, ?)");

/* Use INSERT statement (executed once per record) */out.setString(1,leiUnid);out.setString(2,narrativeDate);out.setString(3,narrativeTime);out.setString(4,narrative);out.execute();

/* Disconnect from DB2/400 */conn.close();

DB2/400 JDBC drivers

Native DRDA

iSeries Toolbox for Java JDBC driver

Native DRDA JDBC driver

Runs over SNA or TCP/IP

Very fast, resilient and secure

Does have some JDBC support limitations

No need to add to classpath

Can only test on iSeries server

iSeries Toolbox for Java JDBC driver

100% pure Java, allowing it to run on any platform

Fewer design limitations than the DRDA driver

Not so fast or resilient as the DRDA driver

Limitation that it will only run over TCP/IP

Needs adding to classpath

Use /QIBM/ProdData/java400/jt400ntv.jar version, or optimise jt400.jar to level 40 with CRTJVAPGM

Development client based testing feasible

iSeries Toolbox also provides classes for direct access to iSeries functionality, e.g. Remote Command. Here is an example:

/* Java import for Toolbox */import com.ibm.as400.access.*;

/* AS400 connection and command invoker */ private AS400 myServer = null; myServer = new AS400(“<system>", “<user>", “<password>"); CommandCall cc = new CommandCall(myServer);

/* Set up command */cmd = "RMVLNK OBJLNK('/QFileSvr.400/MYAS400/QDLS/MYFOLDER/" + this.folderName + File.separator + files[i] + "')"; /* Run command - this will generate a Java exception if OS/400 returns an exception */cc.run(cmd);

/* Get messages returned and put in Notes log */AS400Message[] msgList = cc.getMessageList(); for (int i=0; i < msgList.length; i++){ System.out.println(msgList[i].getText());}

Options for calling iSeries native code from Java

Mechanism Description Pros Cons Comments

WebSphere MQ

Assured delivery queuing mechanism

Supported across vast number of platforms

Complex to establish for synchronous integration

Recommended for asynchronous integration

Stored procedures via J DBC (native or Toolbox driver)

Invoke RPG program via stored procedure call using SQL syntax

Effective and tunable connection pooling provided out of the box, supports return of result sets

Not IBM recommended route, IBM not investing development dollars, program call performance not as good as Toolbox program call. Requires some SQL knowledge

Program call via Toolbox (PCML, program call bean)

Invokes RPG program (or service program entry point) via socket call to relevant OS/400 host server. Also supports remote command, data queues, data areas

IBM recommended route. Can encapsulate as web service (e.g. using WDSC wizard)

No connection pooling out of the box, no result sets

Can always encode result set as XML string

J NI Invokes RPG code as ‘native method’ from J ava

High performance Requires RPG code placed within service program. Can run on local machine only (i.e. can’t test in WDSC). Input/output parameters, but no result sets

JNI: Calling RPG code from Java

More at http://publib.boulder.ibm.com/infocenter/iadthelp/v6r0/index.jsp?topic=/com.ibm.etools.iseries.pgmgd.doc/c0925076175.htm

P checkCust B EXPORTD checkCust PI ND custName 100A VARYING CONST /free chain custName rec; return %found; /end-freeP checkCust E

class MyClass { static { System.loadLibrary ("MYSRVPGM"); }

native boolean checkCust (byte custName[]);

void anotherMethod () { boolean found; // call the native method found = checkCust (str.getBytes()); } }

Toolbox and JNI: Message Broker to JDE World program call to Java

Message Broker

iSeries

Existing target RPG program, amended to bind to

DDSXMLUtil Java class

iSeries Adapter (via Adapter Framework)

New Java class DDSXMLUtil to parse request (not yet

implemented) and generate XML reply

iSeries job

JNI

JVM within iSeries job

New Java class DDSXMLUtil

Existing target RPG program

Bound in CL initialisation code to

set CLASSPATH environment variable and current directory

Direct bind using RPG prototype

Physical files for external descriptions

Generated classes to handle externally

described data structures

Open source XML Java classes

JNI: Web service call via Java from RPG

Mapsolute server (via Internet)

iSeries

Main RPG proof of concept application program module

ADDRESSDSP

New RPG module ADDRSUBMIT (bound in to

ADDRESSDSP) passing array back to main program module

Web services interface

New Java class AddressValidation

Open source (SAAJ) Web services Java classes

iSeries job

JNI

JVM within iSeries job

New Java class AddressValidation constructs SOAP message, calls web service,

parses response

New STRADDVAL initialisation code to set current directory and create JVM with

correct settings (classpath, endorsed directories). Called

once per iSeries job, before any JVM has

been created

New RPG module ADDRSUBMIT

JVM manipulation instructions

Direct bind using RPG prototype

iSeries database table ADDRESS (used for

external description only)

Automatically generated class

ADDRESSRFormat (used to build array entry)

Stored procedure call example

// Register correct JDBC driverClass.forName("com.ibm.db2.jdbc.app.DB2Driver");

// Connect to destination machineconn = DriverManager.getConnection("jdbc:db2:cat34","vtuser","vtpwd");

// Prepare call to stored procedurecs = conn.prepareCall("CALL QGPL.TNAPICMD (?,?)");

// Set input parameterscs.setString (1, functionKey);cs.setString (2, reqBuffer);

// Run the SQL statementcs.execute ();

// Handle the result set, if anyrs = cs.getResultSet();

if (rs != null) {

// Loop through rows of result set processing each appropriately i = 0; while (rs.next()) { ++i; fieldType = rs.getDouble(2); . [do stuff] . } }


Recommended