Académique Documents
Professionnel Documents
Culture Documents
Informix Conference
4GL functions usage in the GUI
environment via web services
IBM, the IBM logo, ibm.com, FileNet, OmniFind and all IBM FileNet products are trademarks or registered
trademarks of International Business Machines Corporation in the United States, other countries, or both. If these
and other IBM trademarked terms are marked on their first occurrence in this information with a trademark symbol (®
or ™), these symbols indicate U.S. registered or common law trademarks owned by IBM at the time this information
was published. Such trademarks may also be registered or common law trademarks in other countries. A current list
of IBM trademarks is available on the Web at “Copyright and trademark information” at
www.ibm.com/legal/copytrade.shtml
Other company, product, or service names may be trademarks or service marks of others.
2
2010 IIUG Informix Conference
Contents
Informix 4GL
Problem statement
Service Oriented Architecture (SOA)
Prerequisites and Supported Platforms
Publish Web services
Consume Web services
Troubleshooting
Informix 4GL: Road Ahead
Demos
References
3
2010 IIUG Informix Conference
Informix 4GL
4
2010 IIUG Informix Conference
Problem Statement
• Solution: I4GL-SOA
5
2010 IIUG Informix Conference
Service Oriented Architecture (SOA)
6
2010 IIUG Informix Conference
Before I4GL-SOA
• Interoperability between distributed system was very complex
• Tight coupling among interactive systems
• Migrating existing system to newer technology
7
2010 IIUG Informix Conference
After I4GL-SOA
• Efficient, flexible and agile systems in place
• Interoperability between distributed system made easy
• Loose coupling among interactive systems
• Needless to migrate existing system to newer technology
8
2010 IIUG Informix Conference
I4GL-SOA – Rationale
• Ease of deployment of I4GL functions as web services
• Easy integration of I4GL with web based applications
• Reuse the existing I4GL functions in web based solutions
• Consuming I4GL services from within I4GL
• Consuming third party services from within I4GL
• Ease of maintenance
• More business opportunity for your existing I4GL code
9
2010 IIUG Informix Conference
Benefit to Customers
10
2010 IIUG Informix Conference
I4GL-SOA Architecture
Web Service
Publish Consume
Publisher Subscriber
IDS
11
2010 IIUG Informix Conference
Prerequisites and Supported Platforms
Prerequisites
– Apache Axis2/C Version 1.5.1 (bundled with I4GL)
– Apache Axis2/Java Version 1.3.1 (bundled with I4GL)
– IBM Informix Dynamic Server Version 10 or later
– IBM Informix 4GL 7.50.xC4
– Java™ Runtime Environment (JRE) 1.5 or later
– Perl 5.8.8
Supported Platforms
– HP-IA 11.23 or 11.31
– AIX 5.3 and 6.1
– Red Hat Enterprise Linux 4 or 5
– Solaris 5.9 or 5.10
– SUSE® Linux Enterprise Server 10
12
2010 IIUG Informix Conference
Role of w4gl and w4glc
END FUNCTION
Publish Subscribe
2010 IIUG Informix Conference
W4GL
14
2010 IIUG Informix Conference
W4GL facilitates
Create a web service entry
Manage a web service entry
Generates configuration for publisher and subscriber
Deploys/Publish a web service
Package a deployed web service
Parse WSDL – Source can be URL and file
Generates code for consumer/subscriber
Trouble shooting
Persistent web service entries for regeneration
15
2010 IIUG Informix Conference
Schema Design
16
2010 IIUG Informix Conference
Publish / Subscribe – Work flow
•I4GL function
Publisher
Other web
IDS Non-I4GL services
consumer
•WSDL
Subscriber
I4GL
•Operation name
•I4GL function
Object file + I4GL
consumer
•Target Directory
17
2010 IIUG Informix Conference
MACH 11 topology
Client Apps
Connection Manager
(workload balancing and failover arbitration)
Client Apps
HDRTraffic
IDSAdmin
HDRSecondary
Primary
SDS
Shared
Blade Server A Disk Shared Blade Server B
City-A RSSTraffic Disk
City-B
DBA
IDSAdmin
SDS Shared
Disk RSS
Mirror
SDS
Blade Server D
City-A
Shared Blade Server C
Disk City-D
18
2010 IIUG Informix Conference
I4GL-SOA and MACH11
Connection
Manager
•I4GL function
Publisher
•WSDL
Subscriber
I4GL
•Operation name
•I4GL function
Object file + I4GL
consumer
•Target Directory
19
2010 IIUG Informix Conference
Publishing / Deploying Process overview
END FUNCTION
App Server
20
2010 IIUG Informix Conference
Defining a Web Service for Publishing
• Basic environment description
– Hostname
– Application server
– Database
• Web Service
– Service name, function name
– Input and Output parameters
– Existing I4GL source code
– Generate and build
21
2010 IIUG Informix Conference
Define: Publishing
I4GL function
that provides a
service
22
2010 IIUG Informix Conference
Define: Publishing
• Input and output arguments
Input / Output
arguments to /
from the function
23
2010 IIUG Informix Conference
Define: Publishing
• Entering 4GL file details
24
2010 IIUG Informix Conference
Generate configuration for Publishing
• Generating configuration file
25
2010 IIUG Informix Conference
Generated configuration file
….
TYPE = publisher
….
26
2010 IIUG Informix Conference
Deploying a web service
• Needs a configuration file
27
2010 IIUG Informix Conference
Deploying a web service
28
2010 IIUG Informix Conference
Subscribing / Consuming Process overview
MAIN
CALL call_web_service_client()
w4gl MAIN
END
Configuration File (.4cf)
w4glc
(User Interface)
FUNCTION call_web_service_client() (Backend script)
DEFINE name VARCHAR(40),
address VARCHAR(200),
...
transaction_date DATE,
description VARCHAR(250),
value INTEGER
...
OPEN FORM f_credit FROM "svc_client"
Generate and Compile
DISPLAY FORM f_credit Intermediate code
INPUT card_number, cvv_number, expiry_date
Web service FROM s_card.card_number, s_card.cvv_number, s_card.expiry_date
29
2010 IIUG Informix Conference
Consuming a web service
• Generates consumption code
30
2010 IIUG Informix Conference
Consuming a web service
• Generates consumption code
31
2010 IIUG Informix Conference
Consuming a web service
32
2010 IIUG Informix Conference
Consuming a web service
33
2010 IIUG Informix Conference
Generated Configuration File
….
Data extracted from
TYPE = subscriber
WSDL
….
34
2010 IIUG Informix Conference
Steps to consume
• Compile option generates
– Configuration file
– Object file
35
2010 IIUG Informix Conference
Reports
• Reports can also be generated from web-service
• Reports function can be deployed similar to other functions
• New type for file WS_FILENAME introduced in w4gl UI and config
file
• Generated report
– Received at the client side
– Stored at the client side in the target directory
– Known file extensions are honored
36
2010 IIUG Informix Conference
[SERVICE]
Report function
TYPE =as web-service
subscriber
I4GLVERSION = 7.50.xC4
WSHOME = /home/informix/4GL/AXIS2C
• Similar to deploying other services
TARGET_DIR = /home/informix/IIUG_demo/i4gl-report/
I4GL_FUNCTION = client_report
• TARGET_FILE = client_report.c
Similar to consuming other services
[WSDL_INFO]
New Type
WSDL_PATH = /home/informix/IIUG_demo/i4gl-report//local.wsdl WS_FILENAME
WSDL_NAME_SPACE = http://www.ibm.com/genreport_cc_details
[FUNCTION]
SERVICENAME = ws_gen_report
NAME = genreport_cc_details
[INPUT]
[VARIABLE] NAME = card_number TYPE = varchar(19) [END-VARIABLE]
[VARIABLE] NAME = expiry_date TYPE = varchar(5) [END-VARIABLE]
[VARIABLE] NAME = cvv_number TYPE = varchar(3) [END-VARIABLE]
[END-INPUT]
[OUTPUT]
[VARIABLE] NAME = stmt_report TYPE = ws_filename [END-VARIABLE]
[END-OUTPUT]
[END-FUNCTION]
[END-WSDL_INFO]
[END-SERVICE]
37
2010 IIUG Informix Conference
REPORT cust_list (r_customer, r_trans)FUNCTION genreport_cc_details(lcard_number, lexpiry_date, lcvv_number)
Report function as web-service
DEFINE r_customer RECORD LIKE credit_customer.*
DEFINE lcard_number VARCHAR(19),
DEFINE r_trans RECORD LIKE card_transaction.*
lexpiry_date VARCHAR(5),
FUNCTION call_web_service_client()
lcvv_number VARCHAR(3),
• Similar to consuming other services
OUTPUT
p_qrystmt VARCHAR(255),
TOP MARGIN 0 DEFINE file VARCHAR(255),
BOTTOM MARGIN 0 file VARCHAR(255)
cc_num VARCHAR(19),
PAGE LENGTH 25 DEFINE p_customer RECORD LIKE credit_customer.*,
exp_date VARCHAR(5),
p_trans RECORD LIKE card_transaction.*
cvv_num VARCHAR(3)
FORMAT
DEFINE l_ans CHAR(1),
ON EVERY ROW LET p_qrystmt = "SELECT * FROM card_transaction \
p_msg CHAR(50)
PRINT "STATEMENT FOR CREDIT CARD " || r_customer.card_number WHERE customerid = ?";
PRINT "---------------------------------------------" LET file = "cust_listing.html"
PRINT "To" OPEN FORM f_input FROM "client"
START REPORT cust_list TO OUTPUT "FILE" DESTINATION file
PRINT " " DISPLAY FORM f_input
DECLARE q_curs CURSOR FOR
PRINT " " || r_customer.name INPUT cc_num, cvv_num, exp_date FROM
SELECT * FROM credit_customer
PRINT " " || r_customer.address s_card.card_number, s_card.cvv_number,
WHERE card_number = lcard_number
PRINT " " || r_customer.city || ", " || r_customer.state || ", " || s_card.expiry_date
r_customer.zipcode AND expiry_date = lexpiry_date
PRINT " " AND cvv_number = lcvv_number
CALL client_report(cc_num, exp_date, cvv_num)
PRINT "Ph: " || r_customer.phone PREPARE stmt_1 FROM p_qrystmt
RETURNING file
PRINT "Email: " || r_customer.email DECLARE q_trans CURSOR FOR stmt_1
PRINT " "
DISPLAY cc_num TO s_card.card_number
PRINT " " FOREACH q_curs INTO p_customer.*
DISPLAY cvv_num TO s_card.cvv_number
PRINT "Credit Limit : " || r_customer.creditLimit OPEN q_trans USING p_customer.customerid
PRINT " " DISPLAY exp_date TO s_card.expiry_date
FETCH q_trans INTO p_trans.*
PRINT "Transaction Details" DISPLAY file TO s_card.rep_file
OUTPUT TO REPORT cust_list(p_customer.*, p_trans.*)
PRINT "-------------------" CLOSE q_trans
PRINT r_trans.transaction_Date || " " || END FUNCTION
END FOREACH
r_trans.description || " " ||
r_trans.value
FINISH REPORT cust_list
PRINT " "
PRINT " " RETURN file
END REPORT END FUNCTION
38
2010 IIUG Informix Conference
Trouble Shooting
39
2010 IIUG Informix Conference
Command Line Utility (W4GLC)
• For Advanced users
• Manually create a configuration file
• Data in configuration file not stored in database
40
2010 IIUG Informix Conference
W4GL – A glance
• Management of web-service details
• Persistent data for easy regeneration of configurations
• Flexible design to deploy a service remotely
• Easy administration
• Written in I4GL
• Ease of use for I4GL users
• Automation using WSDL parser
• Validation using data type parser
• Remote error propagation
41
2010 IIUG Informix Conference
Demos
42
2010 IIUG Informix Conference
Informix 4GL: Road Ahead
I4GL Interim
Releases
4GL 7.x 2012 and beyond
(I4GL Form enhancements
Modernization) System curses
Improved color
Form enhancements
4GL 7.x Box
Horizontal Scrolling
(I4GL Multi-line fields in screen arrays
Form and field status
4GL 7.x Embeddability) Variable size forms
List support Enhanced Sub-table handling
(SOA enablement) Library support
Report enhancements Mac OS
SOA enablement I4GL non-interactive part as
library XML output Native Library
9Reports via web services
Function signature Dynamic load of shared Enhanced Language Enhance Language support
detection (I4GL parser) library by p-code runner support New SQL syntax from IDS
9 Enhanced Error handling Certification of non-interactive New I4GL syntax SOA Enablement
I4GL-LIB for web
9 RECORD type Client Required Priority WAS support
languages/tools.
9 AIX port of SOA Defect Fixes
Report enhancements
Mac OS basic port
9 WSDL parser PDF support
Evaluation copy
9 Enhance Language support I4gl in IDS
9File I/O support P-code, C-code, ISQL & ID
43
2010 IIUG Informix Conference
Summary
• Tools w4gl and w4glc
• I4GL-SOA can
– publish functions to web services
– subscribe functions from other web services
• Reuse of existing code and skill set
• I4GL code can be used in GUI
• Opens new business opportunities
• Aggressive enhancements to I4GL
• New investments to I4GL
44
2010 IIUG Informix Conference
References
• IBM Informix 4GL v 7.50.xC4, xC3: Release notes, documentation notes and
machine notes is available at
TBD
http://www-01.ibm.com/support/docview.wss?uid=pub1gi11910302
45
2010 IIUG Informix Conference
Questions
!!!
46
2010 IIUG Informix Conference
Signup to participate in user feedback sessions for IDS
Session opportunities include:
mrsrinivas@in.ibm.com
Session: C07
48