i-series New Workloads

Download Report

Transcript i-series New Workloads

Web self-service: integration of
applications and databases
Mandy Shaw
© Logicalis Group
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
MZ
Web
browser –
Intranet
user
Web
browser –
potential
Extranet
or external
user
Intranet
Web
server
DMZ
Firewall
INTERNET
Extranet
and
external
Web
server
Firewall
Web
application
server
Connectors
Internal
databases
and
applications
(Other potential
external data or
transaction
sources and
targets)
Internal
application
user
Web enablement
CHALLENGE
Motor insurers Admiral Group required a highly secure, highly scalable ecommerce 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
Web enablement
DMZ
Servlets,
JavaBeans
and JSPs
HTTP /
HTTPS
protocols
WebSphere
Application
Server 5.1
IBM HTTP
server with SSL
Rating engine
runs here for
performance
MZ
JDBC
using
DB2
(DRDA)
driver
Stored
procedure
definitions
New RPG
programs
using
existing
logic
I90 LOB
application:
postcode lookups,
credit checking,
policy creation,
etc.
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
Commerce
Suite 4.1
HTTP /
HTTPS
protocols
WebSphere
Application
Server 3.5
IBM HTTP
server with SSL
NT
WCS/SAP
standard
interface
(using
RFC),
customised
Customised
BAPI
SAP
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
Web integration
DMZ
MZ
EAI hub
(e*Gate)
NT
INTERNET
Firewall
etc.
Firewall
etc.
NT
Web integration
Other XML-based
transactions from
various sources
WebSphere
Commerce
Suite 4.1
HTTP /
HTTPS
protocols
WebSphere
Application
Server 3.5
IBM HTTP server
with SSL
NT
DMZ
XML
messages,
handled by
bespoke
OFs and
commands
Routing of
requests, retry
handling, XML
transformation,
etc.
C API
e*Way
HTTP
e*Way
BPCS
IBM HTTP
server
ECM
New RPG
programs using
existing logic
Stored
procedure
definitions
MZ
JDBC
using
DB2
driver
WebSphere
Application
Server 3.02
Generalised
XML handler
servlet
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
Web integration using WebSphere MQ
MZ: BAAN server
User store
DMZ: Web server
Servlets,
JavaBeans
and JSPs
HTTP /
HTTPS
protocols
WebSphere
App Server 5.0
IBM HTTP
server with SSL
MQ
JNI
wrappers
BAAN APIs
BAAN
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
Web
server
DMZ
Customer
Web browser
Failover
Firewall
MZ
Database
server
Load
Balancer
Firewall
Image updates
INTERNET
Occasional
admin
Web
server
VPN connection
Internal
desktop/server
with VPN client
Web
server
Failover
database
server
Web development: meet your ancestors
DMZ: Web
servers
Servlets,
JavaBeans
and JSPs
HTTP /
HTTPS
protocols
WAS 5.1
Network
Deployment
IBM HTTP
server with SSL
MZ: database
server
DB2
JDBC
driver
DB2 UDB
relational
database
Steeleye high
availability
DB2 UDB
relational
database failover
Web self-service: Some product choices
MZ
Web
browser –
potential
Extranet
or external
user
Firewall
Apache on
iSeries, or
Apache on
xSeries
(Windows
or Linux)
Firewall
(Other potential
external data or
transaction
sources and
targets)
Apache on iSeries
DMZ
INTERNET
Web
browser –
Intranet
user
Tomcat or
WebSphere
Application
Server
JDBC, stored procedures,
JMS, WebSphere MQ,
Web services, …
Internal
databases
and
applications
Internal
application
user
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
WebSphere
MQ
Assured delivery
queuing mechanism
Stored
procedures
via JDBC
(native or
Toolbox
driver)
Not IBM recommended
route, IBM not investing
development dollars,
program call performance
not as good as Toolbox
program call. Requires
some SQL knowledge
Invokes RPG program IBM recommended No connection pooling out ofCan always encode
(or service program route. Can
the box, no result sets
result set as XML
entry point) via
encapsulate as
string
socket call to relevant web service (e.g.
OS/400 host server. using WDSC
Also supports remote wizard)
command, data
queues, data areas
Invokes RPG code as High performance Requires RPG code placed
‘native method’ from
within service program.
Java
Can run on local machine
only (i.e. can’t test in
WDSC).
Input/output parameters,
but no result sets
Program call
via Toolbox
(PCML,
program call
bean)
JNI
Pros
Supported across
vast number of
platforms
Invoke RPG program Effective and
via stored procedure tunable connection
call using SQL syntax pooling provided
out of the box,
supports return of
result sets
Cons
Comments
Complex to establish for
synchronous integration
Recommended for
asynchronous
integration
JNI: Calling RPG code from Java
More at
http://publib.boulder.ibm.com/infocenter/iadthelp/v6r0/index.jsp?topic=/com.i
bm.etools.iseries.pgmgd.doc/c0925076175.htm
class MyClass
{
static
{
System.loadLibrary ("MYSRVPGM");
}
native boolean checkCust (byte custName[]);
void anotherMethod ()
{
boolean found;
// call the native method
found = checkCust (str.getBytes());
}
}
P checkCust
B
D checkCust
PI
D
custName
/free
chain custName
return %found;
/end-free
P checkCust
E
EXPORT
N
100A
rec;
VARYING CONST
Toolbox and JNI: Message Broker to JDE World program
call to Java
Message Broker
iSeries Adapter (via
Adapter Framework)
JVM within
iSeries job
Existing target RPG program,
amended to bind to
DDSXMLUtil Java class
New Java class DDSXMLUtil
to parse request (not yet
implemented) and generate
XML reply
Open source XML Java
classes
iSeries
JNI
Bound in CL
initialisation code to
set CLASSPATH
environment variable
and current directory
Existing target RPG
program
Direct bind
using RPG
prototype
New Java class
DDSXMLUtil
Generated classes
to handle
externally
described data
structures
Physical files for external
descriptions
iSeries job
JNI: Web service call via Java from RPG
Mapsolute server (via
Internet)
Web services
interface
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
JNI
JVM
manipulation
instructions
Open source (SAAJ) Web
services Java classes
New Java class
AddressValidation
New RPG module
ADDRSUBMIT
Direct bind
using RPG
prototype
JVM within
iSeries job
New Java class
AddressValidation
constructs SOAP
message, calls
web service,
parses response
New RPG module
ADDRSUBMIT (bound in to
ADDRESSDSP) passing array
back to main program module
Automatically
generated class
ADDRESSRFormat
(used to build
array entry)
Main RPG proof of concept
application program module
ADDRESSDSP
iSeries database table
ADDRESS (used for
external description only)
iSeries
iSeries job
Stored procedure call example
// Register correct JDBC driver
Class.forName("com.ibm.db2.jdbc.app.DB2Driver");
// Connect to destination machine
conn = DriverManager.getConnection("jdbc:db2:cat34","vtuser","vtpwd");
// Prepare call to stored procedure
cs = conn.prepareCall("CALL QGPL.TNAPICMD (?,?)");
// Set input parameters
cs.setString (1, functionKey);
cs.setString (2, reqBuffer);
// Run the SQL statement
cs.execute ();
// Handle the result set, if any
rs = 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] . } }