You are on page 1of 50

®

Informix 4GL y SOE - Rejuveneciendo 4GL con servicios Web

Gagan Maheshwari, Technical Lead, IBM, gagmahes@in.ibm.com


Javier Sagrera, Common Client Technologies, IBM, javier.sagrera@uk.ibm.com

© 2010 IBM Corporation


Disclaimer
© Copyright IBM Corporation [current year]. All rights reserved.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule
Contract with IBM Corp.

THE INFORMATION CONTAINED IN THIS PRESENTATION IS PROVIDED FOR INFORMATIONAL PURPOSES


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

IBM, the IBM logo, ibm.com, Informix and Informix 4GL 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

AXIS2C, Apache and Tomcat products or service names may be trademarks or service marks of others.

The information on the new product is intended to outline our general product direction and it should not be relied on in
making a purchasing decision. The information on the new product is not a commitment, promise, or legal obligation to
deliver any material, code or functionality. The development, release, and timing of any features or functionality described
for our products remains at our sole discretion
1
Contenido
Informix 4GL
Arquitectura Orientada a Servicios (SOA)
Requerimientos y plataformas soportadas
Servicios Web
– Publish
– Subscribe
Problemas típicos
Futuro de Informix 4GL
Referencias

2
Informix 4GL
Lenguaje de 4ª Generación
Fácil desarrollo y mantenimiento de aplicaciones
Incluye todo lo necesario para crear aplicaciones complejas
– Administrador de proyectos
– Generador de formularios
– Debugger
Interfaz basado en modo texto (CUI)
Usado por miles de clientes en todo el mundo

3
Contenido
Informix 4GL
Arquitectura Orientada a Servicios (SOA)
Requerimientos y plataformas soportadas
Servicios Web
– Publish
– Subscribe
Problemas tipicos
Futuro de Informix 4GL
Referencias

4
Arquitectura Orientada a Servicios (SOA)
Que es SOA
Ventajas de SOA en I4GL
Beneficios para los clientes

5
¿Que es SOA ?
Separación de las funciones básicas

Mayor aprovechamiento de recursos

Integración entre recursos humanos,


procesos e información

Mejor control de la información

Reutilización

6
Ventajas de SOA en I4GL
Publicar funciones en Informix 4GL como Servicios Web
Integración con aplicaciones Web
Reutilizar código existente desde aplicaciones Web
Descubrir y consumir servicios Web usando I4GL
Mayor oportunidades de negocio para sus aplicaciones I4GL

7
Beneficios para los clientes
Reuso del código y la lógica existente
- desde Internet
- desde otras compañías o partners
Nueva mentalidad al programar: “Que” en lugar de “Como”
No hay dependencia de hardware o lenguajes de programación
Mejor colaboración entre diferentes departamentos dentro de una
misma organización
Biblioteca de funciones y Servicios
Ahorro de dinero y tiempo.

8
Contenido
Informix 4GL
Arquitectura Orientada a Servicios (SOA)
Requerimientos y plataformas soportadas
Servicios Web
– Publish
– Subscribe
Problemas típicos
Futuro de Informix 4GL
Referencias

9
Requerimientos y plataformas soportadas
Requerimientos
– Apache Axis2/C Version 1.5.1 (incluido en I4GL)
– Apache Axis2/Java Version 1.3.1 (incluido en I4GL)
– IBM Informix Dynamic Server Version 10 o posterior
– IBM Informix 4GL 7.50.xC3
– Java™ Runtime Environment (JRE) 1.5 o posterior
– Perl 5.8.8

Plataformas soportadas (32 y 64-bit)


– 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

10
Contenido
Informix 4GL
Arquitectura Orientada a Servicios (SOA)
Requerimientos y plataformas soportadas
Servicios Web
– Publish
– Subscribe
Problemas típicos
Futuro de Informix 4GL
Referencias

11
Publicar un Servicio Web
I4GL-SOA Arquitectura
Publish /Subscribe (Publicar/Suscribir)
W4GL y W4GLC : Publish
Publicar I4GL funciones como servicios Web
– desde la línea de comando (W4GLC)
– desde el interfaz grafico (W4GL)

12
I4GL-SOA Arquitectura

Servicio Web

Pubish Subscribe

Publisher Subscriber

Apache AXIS2C Web Server

IBM Informix 4GL

IDS

13
Publish / Subscribe
•Servicio Web
Publisher

•Función I4GL Servidor de Librerías


IDS
•Argumentos Aplicaciones I4GL
•Ficheros I4GL

Otros servicios
IDS Web
Consumidor
(Web, Java, .NET)

•Servicio Web
•Función Web Fichero Consumidor
Subscriber

•Función I4GL objeto (I4GL)


•Argumentos
•Fichero WSDL

I4GL

14
W4GL y W4GLC: Publish
FUNCTION cc_details(card_number, expiry_date, cvv_number)
DEFINE credit_card_rec RECORD LIKE credit_customer.*
...
LET query_stmt = "SELECT * FROM credit_customer WHERE card_number = ? AND expiry_date = ? AND
cvv_number = ?"
...
IF SQLCA.SQLCODE != 100 THEN
LET query_stmt = "SELECT * FROM card_transaction WHERE customerId = ?"
...
FETCH cur_card_transaction INTO transaction_rec.*

IF SQLCA.SQLCODE = 100 THEN


DISPLAY "No transaction record found."
END IF
...
4GL
ELSE
Codigo DISPLAY "No customer record found."
fuente END IF
...
RETURN credit_card_rec.name, credit_card_rec.address, credit_card_rec.city, credit_card_rec.state ...
END FUNCTION

15
W4GL y W4GLC: Publish
w4gl fichero de configuración w4glc
(Interfaz grafico) 4cf (Perl script)

Web service definition


(WSDL)

4GL
Codigo
fuente
Publish
IDS

16
Linea de comando: W4GLC
Script basado en Perl
No hace uso de la base de datos, solo trabaja con ficheros de texto
W4GLC {-OPTION} <configuration-file>

OPTION DESCRIPTION

silent No muestra ninguna salida en la pantalla

keep No borra los ficheros temporales

force Si ya existe un servicio con el mismo nombre lo sobrescribe

generate Genera el código auxiliar para publicar o suscribir

compile Compila el código auxiliar.

deploy Deploy el servicio web in el servidor AXIS

package Crea el paquete con el servicio web para poder ser usado en
producción

17
Interfaz Grafico: W4GL
Definir un servicio Web
Generar el fichero de configuración (4cf)
Deploy un servicio Web
Package un servicio Web

18
Definir un servicio Web

19
Definir un servicio Web

20
Definir un servicio Web

21
Generar el fichero de configuración (4cf)

22
Ejemplo de un fichero 4cf usado al Publicar

23
Deploy un servicio Web

Usa la información definida en el fichero .4cf


Genera y compila el código auxiliar
Crea el fichero WSDL (Web Services Definition Language)
Crea la librería I4GL
Copia los ficheros al directorio services en el servidor de aplicaciones (AXIS)

24
Deploy un servicio Web

25
Package un servicio Web
Facilita el proceso de deployment en diferentes servidores
Reduce trabajo a la hora de recrear el servicio Web
Crea un fichero comprimido (.tar) con todo lo necesario para el
funcionamiento de el servicio Web

26
Package un servicio Web

27
Contenido
Informix 4GL
Arquitectura Orientada a Servicios (SOA)
Requerimientos y plataformas soportadas
Servicios Web
– Publish
– Subscribe
Problemas típicos
Futuro de Informix 4GL
Referencias

28
Consumir un servicio Web
Proceso
W4GL y W4GLC: Subscribe
Añadir una defección de un servicio Web
Fichero de configuración 4cf (Subscriber)
Generar y compilar el código auxiliar

29
Proceso
Definir la información sobre el servicio que se quiere
suscribir usando la herramienta W4GL
Compilar usando “Compile” para obtener:
– fichero de configuración (.4cf)
– código .c de el wrapper o función proxy para poder usar
el servicio Web
– fichero objeto con el código
Linkar el objeto con la aplicación I4GL

30
W4GL y W4GLC: Subscribe
w4gl Fichero de configuration w4glc
(Interfaz grafico) (4cf) (Script perl )

Genera y Compila
el codigo auxiliar
Fichero WSDL
servicio Web
(WSDL) Codigo fuente en
Informix 4GL

Subscribe

IDS

31
W4GL y W4GLC: Subscribe
MAIN
CALL call_web_service_client()
END MAIN w4gl Fichero de configuration w4glc
(Interfaz grafico) (4cf) (Script perl )
FUNCTION call_web_service_client()
DEFINE name VARCHAR(40),
address VARCHAR(200),
...
transaction_date DATE,
description VARCHAR(250), Genera y Compila
value INTEGER
el codigo auxiliar
...

Fichero WSDL
OPEN FORM f_credit FROM "svc_client"
DISPLAY FORM f_credit
servicio Web
INPUT card_number, cvv_number, expiry_date FROM s_card.card_number, s_card.cvv_number, s_card.expiry_date
(WSDL) Codigo fuente en
CALL i4gl_cc_details(card_number, expiry_date, cvv_number)
Informix 4GL
RETURNING name, address, city, state, zipcode, phone, email, card_number, creditLimit, cardType, transaction_date,
description, value

Subscribe
DISPLAY name TO s_card.name
DISPLAY address TO s_card.address
...
IDS
DISPLAY description TO s_card.description
DISPLAY value TO s_card.value
END FUNCTION

32
W4GL y W4GLC: Subscribe
w4gl Fichero de configuration w4glc
(Interfaz grafico) (4cf) (Script perl )

Genera y Compila
el codigo auxiliar
Fichero WSDL
servicio Web
(WSDL) Codigo fuente en
Informix 4GL

Subscribe

Aplicación en 4GL utilizando


IDS
un servicio web

33
Añadir una definición de un servicio Web

34
Añadir una definición de un servicio Web

35
Compilar el código auxiliar

36
Ejemplo de un fichero 4cf para suscribir

37
Usar el servicio Web sin I4GL
El servicio Web puede ser usado desde cualquier otro lenguaje que
soporte Web Services.

38
Usar el servicio Web sin I4GL
El servicio Web puede ser usado desde cualquier otro lenguaje que
soporte Web Services.

39
Usar el servicio Web sin I4GL
El servicio Web puede ser usado desde cualquier otro lenguaje que
soporte Web Services.

40
Contenido
Informix 4GL
Arquitectura Orientada a Servicios (SOA)
Requerimientos y plataformas soportadas
Servicios Web
– Publish
– Subscribe
Problemas tipicos
Futuro de Informix 4GL
Referencias

41
Problemas Típicos
Ficheros logs de el servidor de aplicaciones AXIS2C
– Problemas de conexión
– Problemas con el servidor Web
– Errores durante el proceso de deployment

Fichero de log de W4GL y W4GLC (/tmp/w4glerr.log)


– Errores relacionados con configuración
– Errores de compilación

42
Problemas Típicos
Ficheros logs de el servidor de aplicaciones AXIS2C
– Problemas de conexión
– Problemas con el servidor Web
– Errores durante el proceso de deployment

Fichero de log de W4GL y W4GLC (/tmp/w4glerr.log)


– Errores relacionados con configuración
– Errores de compilación

43
Contenido
Informix 4GL
Arquitectura Orientada a Servicios (SOA)
Requerimientos y plataformas soportadas
Servicios Web
– Publish
– Subscribe
Problemas típicos
Futuro de Informix 4GL
Referencias

44
Futuro de Informix 4GL I4GL Interim
Releases
4GL 7.x 2012 and beyond
4GL 7.x (I4GL Form enhancements

(I4GL Modernization) System curses


Improved color
4GL 7.x Embeddability) Form enhancements Box
(SOA enablement) Library support Horizontal Scrolling Multi-line fields in
screen arrays
I4GL non-interactive Form and field status
SOA enablement part as library Variable size forms
List support
Enhanced Sub-table
Reports via web services Dynamic load of shared
Report enhancements handling
Function signature library by p-code runner
detection (I4GL parser) XML output Mac OS
Certification of non-
Enhanced Error handling interactive I4GL-LIB for web Enhanced Language Native Library
languages/tools. support
RECORD type Enhance Language
WSDL parser Mac OS basic port New I4GL syntax support
Evaluation copy Client Required Priority New SQL syntax
Enhance Language support
Defect Fixes from IDS
File I/O support P-code, C-code, ISQL
& ID SOA Enablement
Client Required Priority
WAS support
Defect Fixes Client Required Priority
Defect Fixes Report enhancements
PDF support
Q2 2010 Q4 2010 Q2 2011
I4gl in IDS

Disclaimer: The information on the new product is intended to outline our general product direction and it should not be relied on in making a
purchasing decision. The information on the new product is for informational purposes only and may not be incorporated into any contract. The information
on the new product is not a commitment, promise, or legal obligation to deliver any material, code or functionality. The development, release, and timing of
any features or functionality described for our products remains at our sole discretion.

45
Contenido
Informix 4GL
Arquitectura Orientada a Servicios (SOA)
Requerimientos y plataformas soportadas
Servicios Web
– Publish
– Subscribe
Problemas típicos
Futuro de Informix 4GL
Referencias

46
Referencias

La documentación de IBM Informix 4GL v 7.50.xC3 esta disponible en:


http://www-01.ibm.com/support/docview.wss?uid=swg27015416

IBM Informix 4GL v 7.50.xC3, xC2 : Release notes, documentación notes y machine
notes:
http://www-01.ibm.com/support/docview.wss?uid=pub1gi11910302
http://www-01.ibm.com/support/docview.wss?uid=swg27013651

Artículos sobre SOA en DeveloperWorks:


http://www.ibm.com/developerworks/data/library/techarticle/dm-
0910i4glwebservices/index.html

http://www.ibm.com/developerworks/data/library/techarticle/dm-0902mottupalli/

47
Forums y Comunidades online para Informix

IIUG – the worldwide community of Informix users


Membership is FREE – join today!
http://www.iiug.org

Data Management Community – share and interact with peers


around the world
http://www.ibm.com/software/data/management/community.html

Information Champions – recognizes individuals who have made


the most outstanding contributions to the Information Management
community
http://www.ibm.com/software/data/champion

48
49

You might also like