1 / 82

Web Services and SOA for the RPG Developer on IBM i IBM Integrated Web services for i

Web Services and SOA for the RPG Developer on IBM i IBM Integrated Web services for i. Dan Hiebert IBM dhiebert@us.ibm.com. Agenda. Introduction to SOA & Web Services Creating RPG Web Service Business Logic. Deploying/Testing RPG Web Services. Consumption of Web Services.

duy
Download Presentation

Web Services and SOA for the RPG Developer on IBM i IBM Integrated Web services for i

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Web Services and SOA for the RPG Developer on IBM iIBM Integrated Web services for i Dan Hiebert IBM dhiebert@us.ibm.com

  2. Agenda • 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.

  3. Introduction SOA & Web Serviceson IBM i Introduction to SOA & Web Services • IBM i Project for Web services • Introduction Web Services and SOA technology's

  4. Web Services Made Easy An IBM i Project

  5. Web 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/

  6. IBM 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)

  7. Introduction to Web services and SOA

  8. What 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.”

  9. Web Service Definition (from the Wikipedia.com) “A 'Web service' (also Web Service) is defined by the W3C as "a software system designed to support interoperablemachine-to-machine interaction over a network"[1]. Web services are frequently just WebAPIs that can be accessed over a network, such as the Internet, and executed on a remote system hosting the requested services.”

  10. What 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

  11. Requirements Addressed By Web Services • Interoperability – need a common communication protocol • Between systems • Between languages • Interface Description Language • Describe the service’s 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

  12. Types 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

  13. Web 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

  14. Web 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 Requestor Provider

  15. Web Services Technology Stack Discovery UDDI, WSIL Description WSDL XML Messaging SOAP Transport HTTP, JMS, FTP, SMTP

  16. What 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.”

  17. SOA 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

  18. Interface Interface Service Application = = = = Web services are a good start… Turn this … …into this (web services). Service Service Service Service Service Service Service • Rich business abstractions describe the application interface • Decouples the interfaces from the business applications • The number and complexity of the interfaces is reduced • Business applications and their interfaces become reusable

  19. Resources • 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/

  20. Creating RPG Web Service Business Logic Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.com

  21. Agenda • 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

  22. Creating 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

  23. RPG 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.

  24. RPG 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

  25. What is a Service? • Function • Get information • Perform action • Properties • Encapsulated • Reusable • Stateless • Event driven • Loosely coupled • Modular

  26. 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 Implementing Encapsulation

  27. Reusability • 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

  28. Stateless • 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.

  29. Event 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

  30. Loosely Coupled • Positive • Increased flexibility • More responsive to business changes • More responsive to technology changes • Code maintenance • Negative • More computationally expensive • Higher latency • More parts

  31. 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 Properties Comparison Review – Service

  32. RPG – Traditional vs. Modular Example A Simple Rewrite example for RPG Procedures

  33. Traditional RPG Program.

  34. RPG Modular Business Logic

  35. Deploy RPG Web Service Business Logic Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.com

  36. Agenda • 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

  37. Deploy 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

  38. Introducing - 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

  39. NEW Improvements for YOU! – October/08

  40. Embedding Web services information with RPG on IBM i

  41. Example: RPG Find Customer RPG Find Customer

  42. V5R4 - Enablement

  43. Binding RPG Business Logic to Program/Service Program • Service Info embedded with RPG or COBOL program objects (PCML) • For V6R1 need to recompile specifying:CRTRPGMOD PGMINFO(*PCML *MODULE) CRTCBLMOD PGMINFO(*PCML *MODULE) • For V5R4 – recompile specifying following option in the source: • For RPG H PGMINFO(*PCML:*MODULE) • 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/

  44. Externalizing Web services with RPG on IBM i(Demo) - Simplification and Ease of Use

  45. Web Admin: Install Web Service Access Web Admin http://hostname:2001/HTTPAdmin Click on the Create New Web Services Server link

  46. IWS – Deep Dive

  47. Deep 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++]

  48. IBM i Web Services Script Support IBM Integrated Web Services Server – Scripts • GUI avoidance – • QSHELL environment • Automate create/deploy • Deployable applications (ISV’s) • Example: • Create 20 servers – use scripts • Automate RPG/COBOL deployments • Create/Delete Servers

  49. Server 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/webservicesmax/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

More Related