Title: Web%20Services%20and%20SOA%20for%20the%20RPG%20Developer%20on%20IBM%20i%20%20IBM%20Integrated%20Web%20services%20for%20i
1Web Services and SOA for the RPG Developer on IBM
i IBM Integrated Web services for i
Dan Hiebert IBM dhiebert_at_us.ibm.com
2Agenda
- Introduction to SOA Web Services
- Creating RPG Web Service Business Logic.
- Deploying/Testing RPG Web Services.
- Consumption of Web Services.
- Presentation Layer of Web Services.
3Introduction SOA Web Serviceson IBM i
- Introduction to SOA Web Services
- IBM i Project for Web services
- Introduction Web Services and SOA technology's
4Web Services Made Easy An IBM i Project
5Web Services Made Easy An IBM i Project
- IBM Integrated Web Services for i
- An Easy Step to starting with SOA on System i
- Simplify the process of externalizing RPG/COBOL
business logic as a service. - Externalize various RPG/COBOL business tasks as
services. - Abstracts the hidden complexities of Web services
for IBM i. - Provide RPG/COBOL Developer easy to use Web
interface, not requiring additional tools or
skills - http//www.ibm.com/systems/i/software/iws/
6IBM Integrated Web services server for i
- Merged the Development Process and Deployment
Server - 2 Steps to Create a Web services server on IBM i
- 7 Steps to Deploy an RPG/COBOL Service
- Built on IBM Integrated Web Application Server
for I - Note 2 Methods returned for every procedure or
program - XML - Automated Data (Including Data Structures)
- Standard Serialized objects.
- Embedded Axis 2 Engine into IBM i (5722SS1)
7Introduction to Web services and SOA
8What is ..?
a service? A repeatable business task e.g.,
check customer credit open new account
service oriented architecture (SOA)? An IT
architectural style that supports integrating
your business as linked services
"SOA impacts every aspect of IT and business.
9Web Service Definition
(from the Wikipedia.com) A 'Web service' (also
Web Service) is defined by the W3C as "a software
system designed to support interoperable
machine-to-machine interaction over a
network"1. Web services are frequently just Web
APIs that can be accessed over a network, such as
the Internet, and executed on a remote system
hosting the requested services.
10What Are They?
- Web services
- Applications that are invoked over the Web
- An implementation of Service Oriented
Architecture (SOA) - Contain only business logic, do not have a user
interface - Self-contained
- Self-describing
11Requirements Addressed By Web Services
- Interoperability need a common communication
protocol - Between systems
- Between languages
- Interface Description Language
- Describe the services interface
- Clear and unambiguous
- Platform independent
- Retrieval of Service
- Search and retrieve available services
- Conventient integration at design time and
runtime - Security
- Protection of services
- Protection of data sent to/from services
12Types of Web Services
- Business Information access to a database or
rapidly changing contents - Stock quotes
- Currency conversion rates
- Address book
- Geographical data
- Business Integration implementing a function or
outsourcing a business process - Reservations system
- Credit check
- Payment system
- Loan service
- Product catalog
13Web Services Overview
Definition Self-Contained with well-defined
interfaces that provide functionality that is
accessible over the Internet/Intranet
Key Technologies XML, WSDL, SOAP, UDDI
14Web Service Participants
- Provider implements a Web service
- Requestor has a business need
- Broker lists all available services
Broker
2
1
publish
find
3
bind/invoke
Provider
Requestor
15Web Services Technology Stack
Discovery
UDDI, WSIL
Description
WSDL
XML Messaging
SOAP
Transport HTTP, JMS, FTP,
SMTP
16What is ..?
a service? A repeatable business task e.g.,
check customer credit open new account
service oriented architecture (SOA)? An IT
architectural style that supports integrating
your business as linked services
"SOA impacts every aspect of IT and business.
17SOA Is Like Musical Notes
Each musical notes represents a business service
Checking Inventory
Tracking Shipment
Checking Credit
Placing an Order
Opening Account
SOA allows for flexible composition of music
18Web services are a good start
Turn this
into this (web services).
Service
Service
Service
Service
Service
Service
Service
- Decouples the interfaces from the business
applications
- Rich business abstractions describe the
application interface
- Business applications and their interfaces become
reusable
- The number and complexity of the interfaces is
reduced
19Resources
- Integrated Web Services for IBM i
- http//www.ibm.com/systems/i/software/iws/
- IBM Technical Information and Example
- http//www.ibm.com/developerworks/
- WebSphere Enterprise Service Bus
- http//www-306.ibm.com/software/integration/wsesb/
- WebSphere Process Server
- http//www-306.ibm.com/software/integration/wps/
20Creating RPG Web Service Business Logic
Web Services and SOA for the RPG Developer on IBM
i
Dan Hiebert IBM dhiebert_at_us.ibm.com
21Agenda
- Introduction to SOA Web Services
- Creating RPG Web Service Business Logic.
- Lab Time
- Consumption of Web Services.
- Lab Time
- Deploying/Testing RPG Web Services.
- Lab Time
- Presentation Layer of Web Services.
- Lab Time
22Creating RPG Web Service Business Logic
- ILE RPG Best Programming Practices
- RPG Style Web Service
- Encapsulated
- Reusable
- Stateless
- Event driven
- Loosely coupled
- RPG Traditional vs Modular - Example
23RPG Developer Misconceptions
- The RPG language is outdated and does not work
with the Web Services paradigm. - I need to modernize my Monolithic application.
- I have to re-write my entire application to code
for RPG Web Services.
24RPG Best Practices Quick Reference
- Use Free Form
- Utilize ILE Techniques
- Procedures
- Binding Directories
- Service Programs
- Exports Hints Tips
- Centralize Declarations
- Expand Naming Conventions
- Write Indicatorless Code
- Use Structured Programming Techniques
- Use Comments
- Avoid Obsolescence
25What is a Service?
- Function
- Get information
- Perform action
- Properties
- Encapsulated
- Reusable
- Stateless
- Event driven
- Loosely coupled
- Modular
26Implementing Encapsulation
- Procedure
- Typed parameters
- Input only
- Value
- Const
- Both input and output
- Return value
- Local variables
- Only accessible in procedure
- No side effects
- Subroutine
- Global variables
- All can be modified
- Global variables
- Accessible outside procedure
- Side effects
27Reusability
- Design from business perspective
- What is the business function provided
- Not based on implementation
- Design for future enhancements
- Based on what business function should do
- Not based on current limits
- Input checking
- Do not trust interface user
- Provide meaningful error messages
28Stateless
- State is kept by service user
- Data necessary for request is provided
- Response must contain appropriate data for
follow-on requests - Service may be called by many different users
- Ensure no data carryover
- Pragmatism
- If service will be heavily used with persistent
connection - Caching of state my improve performance
- Request data overrules use of cached data
- Caution On RPG Record access to DB Do not
necessarily expect maintained, especially with
1 to M users.
29Event Driven
- Service does not assume any particular order
- Requests drive service
- Allows new uses for service
- Problems if data is locked between requests
- Service processes request
- Validity checks
- Perform operations
- Sends response
- Frees resources
30Loosely Coupled
- Positive
- Increased flexibility
- More responsive to business changes
- More responsive to technology changes
- Code maintenance
- Negative
- More computationally expensive
- Higher latency
- More parts
31Properties Comparison Review Service
- Service
- Encapsulated
- Access through interface
- Reusable
- Write once use everywhere
- Stateless
- Information not retained
- Event driven
- No required order
- Loosely coupled
- Callable from anywhere
- Traditional
- Global data
- Access directly
- Reuse by copy
- Maintain everywhere
- Stateful
- Information retained in job
- Application driven
- Fixed order
- Tightly coupled
- Tied to application
32RPG Traditional vs. Modular Example
A Simple Rewrite example for RPG Procedures
33Traditional RPG Program.
34RPG Modular
Business Logic
35(No Transcript)
36Web Services and SOA for the RPG Developer on IBM
i
Deploy RPG Web Service Business Logic
Dan Hiebert IBM dhiebert_at_us.ibm.com
37Agenda
- Introduction to SOA Web Services
- Creating RPG Web Service Business Logic.
- Lab Time
- Deploying/Testing RPG Web Services.
- Lab Time
- Consumption of Web Services.
- Lab Time
- Presentation Layer of Web Services.
- Lab Time
38Deploy RPG Web ServiceBusiness Logic
- Introducing IBM Web Services Server on i
- Recent Enhancements
- Embedding WS information in Program/Service
Program - Demo WS-Server (that easy)
- Deep Dive Scripts
39Introducing - IBM Integrated Web Services Server
on i
- Key Features of IBM I Web Services server
- Integrated into IBM i
- WS-Basic Profile Compliant
- Developed for RPG/COBOL
- Open Source Technology
- Removes Complexities of Web Services for IBM i
Developer - Easy to Use - Web Admin Interface
- IBM i Web Services Test Client
- Externalizes IBM i Program Objects
- Tracing WS-Message Program Objects
- Scripting Support
40 NEW Improvements for YOU! October/08
41Embedding Web services information with RPG on
IBM i
42Example RPG Find Customer
RPG Find Customer
43V5R4 - Enablement
44Binding RPG Business Logic to Program/Service
Program
- Service Info embedded with RPG or COBOL program
objects (PCML) - For V6R1 need to recompile specifyingCRTRPGMOD
PGMINFO(PCML MODULE) CRTCBLMOD PGMINFO(PCML
MODULE) - For V5R4 recompile specifying following option
in the source - For RPG H PGMINFO(PCMLMODULE)
- For COBOLPROCESS OPTIONS PGMINFO(PCML MODULE)
- Service Information can alternatively be
generated in IFS - Restrictions
- Program objects must be Stateless
- Further Information - http//www.ibm.com/systems/i
/software/iws/
45Externalizing Web services with RPG on IBM i
(Demo) - Simplification and Ease of Use
46Web Admin Install Web Service
Access Web Admin http//hostname2001/HTTPAdmin
Click on the Create New Web Services Server link
47Web Admin Install Web Service
- Step 1 Create the server to run Web services.
48Web Admin Install Web Service
- Step 2 Select to Install a new Web service
49Web Admin Install Web Service
- Step 3 What program contains the services ?
50Web Admin Install Web Service
- Step 4 What should we call this new Web service?
51Web Admin Install Web Service
- Step 5 What in the ILE program should be
externalized as a Web service?
52Web Admin Install Web Service
- Step 6 Specify User for the Web service
53Web Admin Install Web Service
- Step 7 Configure IBM i resources for the Web
service
54Web Admin Install Web Service
- Step 8 Ready to deploy the new Web service
Server tab
55Web Admin Install Web Service
- Step 8 Ready to deploy the new Web service
Server tab
56Web Admin Install Web Service
- Step 8 Ready to deploy the new Web service
Service tab
57Web Admin Install Web Service
- Create server - after short period of time
(seconds) server created and service deployed
58Web Admin Install Web Service
- Once created, the server is started and deployed
service started
59Web Admin Install Web Service
- Manage installed Services view and install new
services to this server
60Web Admin Install Web Service
61Web Admin Install Web Service
- Manage installed Services view and install new
services to this server
62IBM i Web Services Test Client
63IWS Deep Dive
64Deep Dive - IBM i integrated Web services server
- IBM i integrated Web services server
- Based on Apache AXIS2 version 1.3 - runtime
- A set of native service programs and java tools
that enable you to build Web service applications
from existing ILE RPG/COOBL Programs dynamically
generating WSDL and Java Artifacts. - Supported on V5R4, V6R1
- IBM i integrated Web services server has the
following capabilities - Support for Web Services Description Language
(WSDL 1.1, supports WSDL 1.2 but right now we are
not advertising the fact ) - document literal
only - SOAP 1.1 (Enabled) SOAP 1.2 (Disabled) REST
(Disabled) - - Supports Web Services Invocation (WSI) 1.0 basic
profile compliance - Support for Secure Sockets Layer (SSL)
- Java API for XML-based remote procedure call
(JAX-RPC) style implementation - Support IBM i non-Java languages RPG, COBOL,
C,C
65IBM i Web Services Script Support
- IBM Integrated Web Services Server Scripts
- GUI avoidance
- QSHELL environment
- Automate create/deploy
- Deployable applications (ISVs)
- Example
- Create 20 servers use scripts
- Automate RPG/COBOL deployments
- Create/Delete Servers
66Server Packaging
- IBM i integrated Web services server - Server
Image - /QIBM/ProdData/OS/WebServices/V1/server
- Scripts reside in the ../bin directory
- installWebService.sh
- listWebServices.sh
- startWebServices.sh
- stopWebServices.sh
- uninstallWebServices.sh
- createWebServicesServer.sh
- deleteWebServicesServer.sh
- startWebServicesServer.sh
- stopWebServicesServer.sh
- Axis2 1.3 Engine Runtime
- /QIBM/ProdData/OS/OSGi/LWI71/runtime/webservicesma
x/eclipse/plugins/org.apache.axis2 - User Web services server
- /www/wservice unless user used script
- 4 Jobs Run in QHTTPSVR subsystem
- 1 HTTP and 3 Web Service jobs
WS Server
67Web Services Instance Packaging
- /www/WSERVICE/lwi/runtime/webservicesmax/eclipse/p
lugins/WebServicesEngine/WEB-INF/conf/axis2.xml - ltparameter name"disableREST" locked"true"gttruelt/
parametergt - ltparameter name"disableSOAP12"
locked"true"gttruelt/parametergt - Examples Above ws.apache.org for more values.
- Directory - /www/WSERVICE
- /conf httpd.conf, i5OSStartup.properties
- /htdocs
- /logs - Important Error information
- /lwi/logs -
- /webservices
- Directory - /www/WSERVICE/webservices
- /temp
- /services Important all customer service
artifacts here - /archive
68Web Service Deployment Location
- Sample - /www/WSERVICE/webservices/services/Conver
tTemp - Tracing ConvertTemp.config info parms
for services - ./META-INF/services.xml - customize
- Generated Java
- ../iseries/wsbeans/converttemp
- ../iseries/programcall/base
69IWS Server Restrictions
- SOAP 1.1
- WSDL 1.1
- PCML (deployment of ILE-based Web services)
- The deploying of ILE programs as Web services is
dependent on a Program Call Markup Language
(PCML) - The following data types are not supported by
PCML - Date
- Time
- Timestamp
- Pointer
- Procedure Pointer
- 1-Byte Integer
- 8-byte Unsigned Integer
- Return values and parameters passed by value can
only be 4 byte integers. - Varying-length arrays, and data structures
containing varying-length subfields are not
supported. - More details regarding RPG and PCML can be found
in the ILE RPG Reference. More details regarding
COBOL and PCML can be found in the ILE COBOL
reference. - Parameters
- A procedure in an ILE service program (SRVPGM)
that is to be externalized as a Web service
operation can have a maximum of 7 parameters. An
ILE program (PGM) can have a maximum of 32
parameters. - Note The work around is to create a Data
Structure as a parameter which is a single
parameter.
70Security Discussion
- Security Concerns
- Messages are being sent over the
intranet/internet Are they Secure? - Web Services Security
- HTTP
- WS-Security
- Three Available Security Mechanisms
- HTTP - SSL encryption and authorization
(Certificates) (Basic authorization) - WS-Security (No support on IBM Integrated Web
services server for i) - IBM Datapower Appliances (Pretty cool utility)
71What is Coming Next Future Directions?
- Client Improvements
- WSDL2RPG
- Presentation Layer? (WS-Explorer Client only
Customizable) - JSF or PHP or AJAX?
- Enhance RESTful SOA on the Web services server?
- Enable REST style services for Web Services
server - Performance Improvements?
- Impressive improvements
- Serviceability
- Utility to capture SOAP/XML communication for
support? - Migration tool IBM i WS server to WAS Web
Service? - Or to IBM i )
- WS-Security specification?
72Web Services and SOA for the RPG Developer on IBM
i
Consuming RPG Web Service Business Logic
Dan Hiebert IBM dhiebert_at_us.ibm.com
73Agenda
- Introduction to SOA Web Services
- Creating RPG Web Service Business Logic.
- Lab Time
- Deploying/Testing RPG Web Services.
- Lab Time
- Consumption of Web Services.
- Lab Time
- Presentation Layer of Web Services.
- Lab Time
74RPG Consuming Web ServiceBusiness Logic
- IBM Integrated Web Services client
- IWS Client / Process
- WSDL
- Stub Generation and Header Files
- Building / Compiling RPG and C code
- Review Process
- Deep Dive
75Consuming Web services with RPG on IBM i The
Unlimited Potential
76Web Services a client view
Definition Self-Contained with well-defined
interfaces that provide functionality that is
accessible over the Internet/Intranet
RPG FindCustomers
RPG web service client
Key Technologies XML, WSDL, SOAP, UDDI
77Integrated Web services client for IBM i
- Natural for ILE RPG/COBOL Developer
- 4 Step Static Development Process
- Use WSDL to generate Web service proxy code in C
- Build RPG stub code from C proxy code
- Compile/Bind RPG Web service stub code
- Invoke RPG/COBOL Web service client
- http//www.ibm.com/systems/i/software/iw
s/
78Web Services Client for ILE
- Overview
- Based on Apache AXIS C Version 1.5
- Consists
- Tools
- Convert services WSDL to C/C APIs
- SOAP client
- ILE Service Program
- Supported today
- Packaged with 5733-XT1
- V5R1, V5R2, V5R3, V5R4
- Availability
- 4Q/07 IBM i SS1 Option 3
- V5R4 and later
- Supports
- C, C, RPG, COBOL
- Web Services Description Language (WSDL) -
document literal only - Web Services Invocation (WSI) 1.1 basic profile
compliance - Secure Sockets Layer (SSL)
79Web Service Deployment Review
80Where to find my WSDL
81FindCustomers.WSDL
82(No Transcript)
83FindCustomers.WSDL
FindCustomers.wsdl
84Web Services Client for ILEStep 1 Stub
Generation Creating a Web Services Proxy
- Developer generates stubs using
- Java tools (wsdl2ws.jar)
- Qshell script - wsdl2ws.sh -lc STOCKQ.wsdl
WSDL passed into tool that generates C/C stubs
C/C stubs
85FindCustomersPortType.h
86FINDCUSTOMERSInput.h
871
2
3
884
5
896
7
8
9
10
90http//www.ibm.com/systems/i/software/iws
91RPG Call Find Customers Program
92Quick Review of Steps
- Process to Run RPG Web Service
- Stub Generation Creating a Web Services Proxy
(intermediary for ILE RPG, COBOL ) - Use Stubs to build RPG prototypes
- Compile/Bind and Invocation
- Run Program
- Prerequisites
- C Compiler (Compiler - ILE C, licensed
program product ID 5722WDS, option 52) - Java (IBM Developer Kit for Java, JDK 1.4,
licensed program product ID 5722JV1, option 6) - C Compiler (Compiler - ILE C, licensed program
product ID 5722WDS, option 51) - Only needed if generating C stubs
93Web Services Client for ILEStep 2 Compile/Bind
and Invocation
- Create the application that uses the stubs to
invoke the Web service
Client Application
Call/Return
C/C stubs (service, method)
Call/Return
SOAP Request
Axis Client
SOAP Response
Server
94IBM Web Services Client Deep Dive -
Configuration
95IBM i integrated Web services client
- IBM i integrated Web services client
- Based on Apache AXIS C Version 1.5
- A set of native service programs and java tools
that enable you to build Web service client
applications from existing Web Service
Description Language (WSDL) files by generating
C/C stubs - Supported on V5R4, V6R1
- IBM i integrated Web services client has the
following capabilities - Support for Web Services Description Language
(WSDL) - document literal only - Supports Web Services Invocation (WSI) 1.0 basic
profile compliance - Support for Secure Sockets Layer (SSL)
- Java API for XML-based remote procedure call
(JAX-RPC) style implementation - Support IBM i non-Java languages C, C, RPG,
COBOL
96IWS client - packaging
- Product install directory is /QIBM/ProdData/OS/Web
Services/V1/client - bin/ contains wsdl2ws.sh tool to generate stubs
(calls wsdl2ws.jar) - docs/ contain PDF document and API docs
- etc/ contains empty configuration file
axiscpp.conf - include/ contains header files
- lib/ contains service program symbolic links
- prereqs/ contains jar files needed by wsdl2ws
tool - samples/ contains sample code
- WSDL2Ws/ contains wsdl2ws.jar that generates
stubs - Product install library is QSYSDIR
- QAXIS10C.SRVPGM gt SOAP Engine
- QAXIS10HC.SRVPGM gt HTTP Channel
- QAXIS10HCS.SRVPGM gt HTTP Channel SSL
- QAXIS10HT.SRVPGM gt HTTP Transport
- QAXIS10X.SRVPGM gt XML Parser
97Questions?
98Trademarks and Disclaimers
8 IBM Corporation 1994-2007. All rights
reserved. References in this document to IBM
products or services do not imply that IBM
intends to make them available in every
country. Trademarks of International Business
Machines Corporation in the United States, other
countries, or both can be found on the World Wide
Web at http//www.ibm.com/legal/copytrade.shtml.
- Intel, Intel logo, Intel Inside, Intel Inside
logo, Intel Centrino, Intel Centrino logo,
Celeron, Intel Xeon, Intel SpeedStep, Itanium,
and Pentium are trademarks or registered - trademarks of Intel Corporation or its
subsidiaries in the United States and other
countries. - Linux is a registered trademark of Linus Torvalds
in the United States, other countries, or both. - Microsoft, Windows, Windows NT, and the Windows
logo are trademarks of Microsoft Corporation in
the United States, other countries, or both. - IT Infrastructure Library is a registered
trademark of the Central Computer and
Telecommunications Agency which is now part of
the Office of Government Commerce. - ITIL is a registered trademark, and a registered
community trademark of the Office of Government
Commerce, and is registered in the U.S. Patent
and Trademark Office. - UNIX is a registered trademark of The Open Group
in the United States and other countries. - Java and all Java-based trademarks are trademarks
of Sun Microsystems, Inc. in the United States,
other countries, or both. - Other company, product, or service names may be
trademarks or service marks of others. - Information is provided "AS IS" without warranty
of any kind. - The customer examples described are presented as
illustrations of how those customers have used
IBM products and the results they may have
achieved. Actual environmental costs and
performance characteristics may vary by customer. - Information concerning non-IBM products was
obtained from a supplier of these products,
published announcement material, or other
publicly available sources and does not
constitute an endorsement of such products by
IBM. Sources for non-IBM list prices and
performance numbers are taken from publicly
available information, including vendor
announcements and vendor worldwide homepages.
IBM has not tested these products and cannot
confirm the accuracy of performance, capability,
or any other claims related to non-IBM products.
Questions on the capability of non-IBM products
should be addressed to the supplier of those
products. - All statements regarding IBM future direction and
intent are subject to change or withdrawal
without notice, and represent goals and
objectives only. - Some information addresses anticipated future
capabilities. Such information is not intended
as a definitive statement of a commitment to
specific levels of performance, function or
delivery schedules with respect to any future
products. Such commitments are only made in IBM
product announcements. The information is
presented here to communicate IBM's current
investment and development activities as a good
faith effort to help with our customers' future
planning.