b15 leffler 4gl as soa

Post on 27-Nov-2014

46 Views

Category:

Documents

5 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Enabling 4GL function as web service

Srinivasan R MottupalliIBM India Pvt Ltd

Wednesday, April 29, 2009 • 01:00 – 02:00

Session: B15

- 2 -

2009 IIUG Informix Conference

International Informix Users Group 2

© Copyright IBM Corporation 2009. All rights reserved.U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP ScheduleContract with IBM Corp.

THE INFORMATION CONTAINED IN THIS PRESENTATION IS PROVIDED FOR INFORMATIONAL PURPOSESONLY. WHILE EFFORTS WERE MADE TO VERIFY THE COMPLETENESS AND ACCURACY OF THEINFORMATION CONTAINED IN THIS PRESENTATION, IT IS PROVIDED “AS IS” WITHOUT WARRANTY OFANY KIND, EXPRESS OR IMPLIED. IN ADDITION, THIS INFORMATION IS BASED ON IBM’S CURRENTPRODUCT PLANS AND STRATEGY, WHICH ARE SUBJECT TO CHANGE BY IBM WITHOUT NOTICE. IBMSHALL NOT BE RESPONSIBLE FOR ANY DAMAGES ARISING OUT OF THE USE OF, OR OTHERWISERELATED TO, THIS PRESENTATION OR ANY OTHER DOCUMENTATION. NOTHING CONTAINED IN THISPRESENTATION IS INTENDED TO, NOR SHALL HAVE THE EFFECT OF, CREATING ANY WARRANTIES ORREPRESENTATIONS FROM IBM (OR ITS SUPPLIERS OR LICENSORS), OR ALTERING THE TERMS ANDCONDITIONS OF ANY AGREEMENT OR LICENSE GOVERNING THE USE OF IBM PRODUCTS AND/ORSOFTWARE.

IBM, the IBM logo, ibm.com, FileNet, OmniFind and all IBM FileNet products are trademarks or registeredtrademarks of International Business Machines Corporation in the United States, other countries, or both. If theseand 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 informationwas published. Such trademarks may also be registered or common law trademarks in other countries. A current listof IBM trademarks is available on the Web at “Copyright and trademark information” atwww.ibm.com/legal/copytrade.shtml

Other company, product, or service names may be trademarks or service marks of others.

Disclaimer

- 3 -

2009 IIUG Informix Conference

International Informix Users Group 3

• Informix 4GL (I4GL)• SOA Concepts• Rationale behind SOA for I4GL• What can we achieve with I4GL v7.50 xC2• 4GL-SOA Architecture• Using I4GL SOA• References

Contents

- 4 -

2009 IIUG Informix Conference

International Informix Users Group 4

• Front-end for Informix Database Servers

• Caters to development of database applications

• Character-based user interface

• Easy To Maintain

• Cost and performance advantage over new generation languages

• Extensively used by many Informix customers

I4GL

- 5 -

2009 IIUG Informix Conference

International Informix Users Group 5

• Interoperability between system very complex

• Tight coupling among interactive systems

• Migrating existing system to newer technology

Before SOA

- 6 -

2009 IIUG Informix Conference

International Informix Users Group 6

• 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

“A collection of loosely-coupled, distributed services which communicate and interoperate via agreed standards.”

After SOA

- 7 -

2009 IIUG Informix Conference

International Informix Users Group 7

SOA for I4GL - Rationale • Ease of deployment of 4GL functions as web services

• Easy integration of 4GL with web based applications

• Reuse the existing 4GL functions in web based solutions

• Consuming other services from with in 4GL

• Ease of maintenance

• More business opportunity for your existing 4GL code

- 8 -

2009 IIUG Informix Conference

International Informix Users Group 8

I4GL SOA Architecture

- 9 -

2009 IIUG Informix Conference

International Informix Users Group 9

W4GL enables to …• Create a web service entry

• Manage a web service entries

• Deploy a web service – interface code generation

• Package a web service

• Consume web service – interface code generation

• Trouble shooting

- 10 -

2009 IIUG Informix Conference

International Informix Users Group 10

Pre-requisites

• Apache Axis2/C Version 1.5 (bundled with 4GL)

• Apache Axis2/Java Version 1.3.1 (bundled with 4GL)

• IBM Informix Dynamic Server Version 7.31 or later

• IBM Informix 4GL 7.50.xC2 or later

• Java™ Runtime Environment (JRE) 1.4 or later

• Perl 5.8.5 or later

- 11 -

2009 IIUG Informix Conference

International Informix Users Group 11

Supported Platforms

• Linux

• * Will also be available on• Sun Solaris• HP-UX• AIX

* Subject to change

- 12 -

2009 IIUG Informix Conference

International Informix Users Group 12

Role of w4gl and w4glc

4GL source code

w4gl(User Interface)

Web-service definitions

IDS

Configuration File (.4cf) w4glc(Perl script)

Publisher / Subscriber

Publish Subscribe

FUNCTION visa_valid(cc_number, cc_exp, cc_cvp)

DEFINE vis_rec RECORD LIKE visa_validation.* ,cc_number CHAR(16),

cc_exp CHAR(5),cc_cvp CHAR(3),

sel_stmt CHAR(512);

LET sel_stmt = "SELECT * FROM visa_validation WHERE cc_number = ?

AND cc_exp = ? AND cc_cvp = ?";

PREPARE st_id FROM sel_stmt;DECLARE cur_id CURSOR FOR st_id;

OPEN cur_id USING cc_number, cc_exp, cc_cvp;FETCH cur_id INTO vis_rec.*;

CLOSE cur_id;FREE cur_id;FREE st_id;

RETURN vis_rec.cc_name, vis_rec.cc_balance, vis_rec.cc_limit

END FUNCTION

- 13 -

2009 IIUG Informix Conference

International Informix Users Group 13

A Sample Configuration Files

- 14 -

2009 IIUG Informix Conference

International Informix Users Group 14

W4GL

A different database can be chosen using an environment variable PROGRAM_DESIGN_DBS

- 15 -

2009 IIUG Informix Conference

International Informix Users Group 15

Syspgm4gl - Database Design

- 16 -

2009 IIUG Informix Conference

International Informix Users Group 16

Create a web serviceAdding a Host Name

- 17 -

2009 IIUG Informix Conference

International Informix Users Group 17

Create a web serviceAdding an Application Server

- 18 -

2009 IIUG Informix Conference

International Informix Users Group 18

Create a web service• Adding database information

Specify database used by I4GL function

- 19 -

2009 IIUG Informix Conference

International Informix Users Group 19

Adding a Web Service

Create a web serviceName of the web-service

that is exposed

I4GL function that provides a

service

Input / Output arguments to /

from the function

- 20 -

2009 IIUG Informix Conference

International Informix Users Group 20

Create a web serviceInput and Output argument entry

- 21 -

2009 IIUG Informix Conference

International Informix Users Group 21

Create a web serviceEntering 4GL file details

- 22 -

2009 IIUG Informix Conference

International Informix Users Group 22

Create a web serviceGenerating configuration file

- 23 -

2009 IIUG Informix Conference

International Informix Users Group 23

Generated Configuration File

- 24 -

2009 IIUG Informix Conference

International Informix Users Group 24

Deploying a web service

• Input to deployment process is the configuration file

• Compiles supplied files

• Generates a Web Services Definition Language (WSDL) file

• Generates Axis2/C interface files

• Copies the files to the location from which application server refers for services

- 25 -

2009 IIUG Informix Conference

International Informix Users Group 25

Deploying a web service• Needs a configuration file

- 26 -

2009 IIUG Informix Conference

International Informix Users Group 26

Trouble Shooting

- 27 -

2009 IIUG Informix Conference

International Informix Users Group 27

Consuming a web service• Generates consumption code

- 28 -

2009 IIUG Informix Conference

International Informix Users Group 28

Consuming a web service

- 29 -

2009 IIUG Informix Conference

International Informix Users Group 29

Consuming a web service

- 30 -

2009 IIUG Informix Conference

International Informix Users Group 30

Consuming a web service

- 31 -

2009 IIUG Informix Conference

International Informix Users Group 31

Consuming a web service

- 32 -

2009 IIUG Informix Conference

International Informix Users Group 32

Generated Configuration File

- 33 -

2009 IIUG Informix Conference

International Informix Users Group 33

Steps to consume• Compile option generates

Configuration file Object file

• User application links this object file

- 34 -

2009 IIUG Informix Conference

International Informix Users Group 34

Managing Web-services• W4GL allows you to manage

Host Name

App Server

Database

Web service

- 35 -

2009 IIUG Informix Conference

International Informix Users Group 35

w4glc tool• Independent tool• Requires configuration file• Requires specific command line options

Usage: perl /vobs/tools_4xpm/sqldist/bin/w4glc { [-help] [-version] | [-silent] [-force] [-generate] [-compile] [-deploy] [-package]} <config-file>

-silent - Do not display the progress-force - Avoid user prompts-generate - Generate the code-compile - Compile the generated code-deploy - Deploy the web service-package - Create a package (tar-format) file for web-service

- 36 -

2009 IIUG Informix Conference

International Informix Users Group 36

• IBM Informix 4GL v 7.50.xC2 documents available at : http://www-01.ibm.com/support/docview.wss?uid=swg27013652

• IBM Informix 4GL v 7.50.xC2 : Release notes, documentation notes and machine notes is available at http://www-01.ibm.com/support/docview.wss?uid=swg27013651

• Developer works Article on deploying 4GL functions as web-services at http://www.ibm.com/developerworks/data/library/techarticle/dm-0902mottupalli/

References

- 37 -

2009 IIUG Informix Conference

International Informix Users Group 37

Srinivasan R MottupalliIBM India Private Limitedmrsrinivas@in.ibm.com

Session: B15Enabling 4GL Function as Web Service

- 38 -

2009 IIUG Informix Conference

International Informix Users Group 38

Backup slides

- 39 -

2009 IIUG Informix Conference

International Informix Users Group 39

Role of w4gl and w4glcUser Interface

(w4gl)Configuration File

(.4cf)

Input definitions

-Hostname-Appserver-Database-WebService-Subscriber

IDSProgramDesign

DB

PERL script(w4glc)

Generate Code

Deploy Consume

- 40 -

2009 IIUG Informix Conference

International Informix Users Group 40

[SERVICE]TYPE = publisherINFORMIXDIR = /vobs/tools_4xpm/sqldistDATABASE = i4glsoaCLIENT_LOCALE = en_US.8859-1DB_LOCALE = en_US.8859-1INFORMIXSERVER = loc_ids11_mrsHOSTNAME = idcxs2.in.ibm.comPORTNO = 9876I4GLVERSION = 7.50.xC2WSHOME = /vobs/tools_4xpm/sqldist/AXIS2CWSVERSION = AXIS1.5TMPDIR = /tmp/w4glSERVICENAME = ws_demo[FUNCTION]

NAME = test_demoINPUT = CHAR(10),OUTPUT = CHAR(100), CHAR(100),

[END-FUNCTION][DIRECTORY]

NAME = /tmp/soademoFILE = soademo.4gl,

[END-DIRECTORY][END-SERVICE]

Configuration File - Deployment

top related