82
8 CopyrightIBM Corporation, 2008. A llRightsReserved. Thispublication m ay referto productsthatare notcurrently available in yourcountry. IBM m akesno com m itm entto m ake available any productsreferred to herein. IBM Power Systems Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM [email protected] Presenting RPG Web Service Business Logic

IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM [email protected]@us.ibm.com

  • View
    214

  • Download
    0

Embed Size (px)

Citation preview

Page 1: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

8 Copyright IBM Corporation, 2008. All Rights Reserved.

This publication may refer to products that are not currently available in your country. IBM makes no commitment to make available any products referred to herein.

IBM Power Systems™

Agenda Key:Session Number:

Web Services and SOA for the RPG Developer on IBM i

Dan Hiebert IBM [email protected]

Presenting RPG Web Service Business Logic

Page 2: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

• 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

Agenda

Page 3: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Presentation RPG Web ServiceBusiness Logic

• IBM i Web - Presentation Technologies’

• Basics of Web Technologies– HTTP / Servlets– JSP

• Demo - JSF

Page 4: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

How Did We Get Here over 20 years?

• Evolution of the Web– Document-centric =>

• Application-centric => – Service-centric

Static Web ApplicationsStatic Web Applications

Dynamic Web ApplicationsDynamic Web Applications

Web ServicesWeb Services Portlet ApplicationsPortlet Applications

Page 5: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Web Service – Web Presentation Technologies

Web Development Tools• WDSc V7• RDI • RDI – SOA

Web Server Runtime• Apache HTTP• IBM Integrated Web Application Server for i

• WebSphere Application Server– Java Server Pages (JSP)– Java Server Faces (JSF)

• WebSphere Portal• PHP

– Scripting Language – Web service Support

Other Platforms• .NET/C#• Lotus Expeditor • Mashup Servers• Portal

IBM i – Web Service - Key Technologies

Page 6: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Web applications Technologies

• JavaServer Faces (JSF) is a framework for building Web applications

• JSF is an evolutional step in Web application frameworks development, it builds on Servlet API and JSPs technologies

Fun

ctio

nalit

y

Better architecture, RAD, easier maintenance

Servlets

JSP(Java Server

Pages)

JSF (Java Server

Faces)HTML(Hyper Text

Markup Language

PHP

Page 7: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

What is Hypertext Markup Language (HTML)?

• An open standard– Developed by the World Wide Web Consortium (W3C)

• A language used to format text and objects (such as images) to be displayed in a Web browser– The display language of a browser

• Static—it is only display.– Use other technologies to add dynamic function:

• Client-side (browser) scripting languages (JavaScript)• Server-side programs (CGI, Java servlets, PHP)

• The user interface language of the Web.

Page 8: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Two parts to HTML

Text/HTML editor

Browser

HTML files are flat-text files that have a .html (or .htm) extension.

When you open an HTML file with a browser, the code is run.

Source code Display

Page 9: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Basic HTML syntax

Page 10: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

HTML syntax

• Tags– Instructions for the browser

<tag>Some text</tag>

• Nesting– Close tags in the opposite order in which you opened them.

<tag1><tag2>Some text</tag2></tag1>

• Attributes– Specify attributes to use non-default behavior

<tag attribute=“value”>Text</tag>

Page 11: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

HTML document structure

<html>

<head>(Header: information about the page)

</head>

<body>(Body: Web page content)

</body>

</html>

Page 12: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Header (<head>)

• Content within the <head> tags is not displayed in the browser.

• Optionally, contains information about your Web page.– <meta name=“author” content=“Tim Rowe”>

• Optionally, contains non-HTML code for your Web page– JavaScript, Cascading Style Sheets, etc.

• Contains the title of the Web page– Optional, but recommended

Page 13: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Header (<head>)

• Use the <title> tag for the title of the page

<html>

<head>

<title>Ima Geeke’s Resume</title>

</head>

. . .

</html>

Page 14: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Body <body>

• The contents of the Web page (mainly text)– Headings

– Paragraphs and line breaks

– Text formatting

– Lists

– Links and images

– Tables

– Fonts and colors

– Comments

• The tags described in the rest of the session occur in the <body> section

Page 15: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Headings

• <hx> - x is a number from 1 to 6• <h1> is the biggest• <h6> is the smallest

<body><h1>Ima Geeke</h1><h2>Ima Geeke</h2><h3>Ima Geeke</h3><h4>Ima Geeke</h4><h5>Ima Geeke</h5><h6>Ima Geeke</h6></body>

Page 16: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Paragraphs (<p>)

• Adds a line feed after a line.<body> <h1>Ima Geeke</h1> <p>123 State Street</p> <p>Rochester, MN 55901</p> <p>(507)555-1212</p> <p>[email protected]</p> <p>Objective: To get a really sweet job.</p>

</body>

Page 17: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Line breaks (<br>)

• Add a line break.

<h1>Ima Geeke</h1>

<p>123 State Street

<br>Rochester, MN 55901

<br>(507)555-1212

<br>[email protected]</p>

<p>Objective: To get a really sweet job.</p>

Page 18: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Bold, Italics, and Underline (<b>, <i>, <u>)

<p>123 State Street

<br>Rochester, MN 55901

<br>(507)555-1212

<br><u>[email protected]</u></p>

<p><b>Objective:</b> To get a really <i>sweet</i> job.</p>

Page 19: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Lists

• Unordered list (UL) with list items (LI)

<ul>

<li>Item</li>

<li>Item</li>

</ul>

• Ordered list (OL)

<ol>

<li>Item 1</li>

<li>Item 2</li>

</ol>

Page 20: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Lists

<p>Languages:</p>

<ul>

<li>RPG</li>

<li>COBOL</li>

<li>Java</li>

</ul>

Page 21: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Links (<a href>)

• Use the anchor tag (<a>) with required hyperlink reference (HREF) attribute– Local file:

<a href=“rpg.html”>RPG</a>

– Full URL:

<a href=“http://java.sun.com”>Java</a>

– E-mail address

<a href=“mailto:[email protected]”>….</a>

Page 22: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Links (<a href>)

<br><a href="mailto:[email protected]">[email protected]</a>

</p>

. . .

<p>Languages:</p>

<ul>

<li><a href="rpg.html">RPG</a></li>

<li><a href="cobol.html">COBOL</a></li>

<li>

<a href="http://java.sun.com">Java</a>

</li>

</ul>

Page 23: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Images (<img src>)

• Use the image (IMG) tag with required source (SRC) attribute:– Local file

<img src=“mypic.gif”>

– Full URL:<img src=“http://www.ibm.com/c.gif”>

• No closing tag (</img>)

<h1>Ima Geeke</h1>

<img src=“mypic.gif”>

Page 24: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Tables

• Use the <table> tag as a container for the table contents.<table></table>

• By default, there is no border, so use the border (BORDER) attribute:<table border=“1”></table>

• HTML tables are row-major ordered. Define the rows with the table row (TR) tag:<table border=“1”>

<tr></tr><tr></tr>

</table>

Page 25: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Tables

• Use the table heading (TH) and table data (TD) tags to define the cells in a row:– <th>: Content is bold and centered– <td>: Content is not bold and left-justified

• You can have both <td> tags and <th> tags in the same row.

• The browser will resize the table to fit the contents.– Manually size the table, rows, and cells with the WIDTH and HEIGHT

attributes. – Values are pixel widths or percentages.

• <td width=“10”>…</td>• <tr height=“50%”>…</tr>

Page 26: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Tables

<p>Education:</p>

<table border=“1”>

<tr>

<th>School</th>

<th>Degree</th>

</tr>

<tr>

<td>PC University</td>

<td>B.A. 1985</td>

</tr>

</table>

Page 27: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Positioning text

• Use the ALIGN attribute to position text. Values are RIGHT, CENTER, and LEFT.<p align=“right”>

<td align=“center”>

<th align=“left”> (default is center)

<h1 align=“right”>

<img src=“mypic.gif” align=“right”>

• Most tags take the ALIGN attribute.

Page 28: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Positioning text

<h1>Ima Geeke</h1>

<img src="mypic.gif" align="right">

. . .

<p align="center">

<b>Objective:</b> To get a really <i>sweet</i> job.</p>

Page 29: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Positioning text

• Use an “invisible table” to position text into columns.

<table border=“0” width=“100%”>

<tr>

<td>(Left column)</td>

<td>(Right column)</td>

</tr>

</table>

• The number of <td> tags is the number of columns.

Page 30: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Fonts

• Use the FONT tag– FACE attribute: Change the font

type.• Common types:

– Times New Roman (default), Arial, Courier, Verdana, Sans Serif, Script

• Choices are based on what is installed on the user’s system

– SIZE attribute: Change the size of the text.• size=“x”

– x is a number between 1 and 7 (default is 3)

<h1><font face=“script” size=“7”>Ima Geeke</font></h1>

Page 31: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Colors

• Color values:– Simple names: black, blue, white,

red, yellow, etc.

– Hexadecimal values: #RRGGBB (amount of red, green, and blue)

– See http://www.w3schools.com/tags/ref_colornames.asp for a list of named and hex values.

• Use the BGCOLOR and COLOR attributes to change the default colors.

<body bgcolor="#FFFFAA">

<h1><font face="script" size="7" color="green">Ima Geeke</font></h1>

Page 32: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

HTML in a Web server environment

`

HTML

HTML

HTML

Response

Request

http://<server_name>/file.html

Client

Server

Page 33: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

HTML forms

• HTML forms support Web programs:– By gathering input data from the

user

– By sending the request that causes the Web server to invoke the program

• Data is sent to the server in name/value pairs.

Page 34: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Forms (<form>)

• Container for form elements

• Tells the Web server what to do with the request– ACTION attribute

• The location of the Web program (full or partial URL or an alias)

– METHOD attribute• GET

– Web server stores data in an environment variable

• POST– Web server stores data in a buffer

<form action=“/request.jsp” method=“post”></form>

Page 35: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Form elements

• Used to gather specific pieces of data from the user.

• Attributes we need to use on the form elements tags:– NAME attribute

• Specifies a name for a piece of data

– VALUE attribute• Available on selection elements• Allows the return value to be different than the display text

• Most form elements are defined with the INPUT tag.– TYPE attribute

• Specifies the type of form element

Page 36: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

A brief Servlet Intro

Page 37: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

What is Servlet?

• Request/response model

1. Collect information on an HTML page

2. Invoke business logic from a servlet

3. Display results on an HTML page

HTMLServlet

BusinessLogic

Page 38: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Servlet Drawback

• Drawbacks– Maintenance problems: HTML is embedded in servlet code

Page 39: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

JSP (Java Server Pages)

Page 40: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Java Web applications• Java Web applications consist of

– Presentation layer: combination of HTML and other technologies– Server component: servlets– Business logic: written in Java or other programming languages

• Most business logic (request processing) is executed on the server

• Client-side processing is accomplished with JavaScript

• Java Web applications run in an Application Server (WebSphere Application Server, Tomcat, etc.)

HTML JavaServer

Pages

Presentation Business Logic

JavaBean Servlet RPG/COBOL DB2

Runs on Server Runs in an Application Server

Runs on i5/OS

Page 41: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

JSP (Java Server Pages)• Better architecture than Servlet API

– Model-View-Controller (MVC) pattern: separation of presentation and business logic (HTML code is not in a servlet)

– Code reuse

– Easier to maintain

JSP

JSP

JSP

Servlet

JavaBean

JavaBean

View Controller Model

RPG/COBOL

DB2

Page 42: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

JSP Background

•Combines HTML, XML and Java Servlets

•Presentation Layer Separate from Business Logic

•Dynamic Content on Server

Page 43: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

What is a JSP

• HTML Programmer View– JSP is extension of HTML

– Dynamic HTTP Content

– JavaBean embedded technology

• Java Programmer View– High Level Way to write Servlets

– Easier HTML scripting than embedding HTML in Servlets

– Dynamic Compile for JSP’s

• JSP Misconception– Not Javascript like – (Run on Browser)

– Translated into Servlet and run on Server side

Page 44: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

HelloWorld1.jsp - Simple JSP

<HTML><HEAD><TITLE>Hello World JSP Example</TITLE></HEAD><BODY>Hello World.</BODY></HTML>

Page 45: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

HelloWorld2.jsp Dynamic JSP

<HTML>

<HEAD><TITLE>Hello World JSP Example w/Current Time</TITLE></HEAD>

<BODY>

Hello World. The local server time is

<%= new java.util.Date() %>.

<jsp:expression> new java.util.Date() </jsp:expression>.

</BODY>

</HTML>

Page 46: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

HelloWorld3.jsp - Directives

<jsp:directive.page import="java.util.Date"/>

<HTML>

<HEAD><TITLE>Hello World JSP Example w/Current Time</TITLE></HEAD>

<BODY>

Hello World. The local server time is <%= new Date() %>.

</BODY>

</HTML>

Page 47: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

HelloWorld4.jsp - 3 Code Comments

<jsp:directive.page import="java.util.*"/><jsp:declaration>/* date is a new member variable, initialized when we are instantiated.It can be used however we want, such as:out.println("Instantiated at " + date); // display our "birth" date*/ Date date = new Date();</jsp:declaration><!-- The time is <%= new java.util.Date() %> --><%-- This is our oft-repeated Hello World example: --%><HTML><HEAD><TITLE>Hello World JSP Example</TITLE></HEAD><BODY>Hello World.</BODY></HTML>

Page 48: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

JSP Based Application

HTTPHTTP

url request

HTTP HTTP ServServerer

JSPJSPWeb-Web-

ServerServer*SRVP*SRVP

GMGM

*PGM*PGMDB2DB2JavaJava

11

22 33

44

1 User makes a Web application request & HTML form is displayed on the browser

2 User enters data and clicks ‘Submit’, which invokes the JSP

3 JSP performs processing, invokes any enterprise applications or data

4 JSP accesses the results, formats response, returns ouput to the Web Server

5. Web server returns results to the browser

55

Page 49: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Introduction to JSP Reference Material – IBM DeveloperWorks

http://www.ibm.com/developerworks/edu/j-dw-jsp-i.html

Page 50: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

JSF (Java Server Faces)

Page 51: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

JavaServer Faces: Overview• JSF enhancements to JSP/Servlet API

– More built-in Java classes– More tag libraries– Better tooling in IBM tools (WebSphere Studio and Rational)– AJAX integration

Servlet API

JSP/Servlet API

Struts

Mor

e bu

ilt-in

func

tiona

lity

JSF

Page 52: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Developing JSF applications

• Designing JSF applications

– Follow Model-View-Controller (MVC) design pattern• Model (business logic): JavaBeans, EJBs or Web Services

• View (user interface): JSPs with JSF components

• Controller: no programming required, JSF framework implements the controller

– Access i5/Os programs, functions and data in the “Model” part of the application

Database

RPGCOBOLJavaBean

FacesServlet

JavaBean

ModelView Controller

JSPs

Page 53: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Any questions?

Page 54: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Demo JSF Technologies

Page 55: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Web Service - Data components

• How it works:1. Drag and drop components from the Palette

Web Service

2. Select fields to display

3. Add Selective Information

JSF Web service client demo

1. Create JSF pages

2. Add Web service JSF component

Page 56: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

14.

Page 57: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

8 Copyright IBM Corporation, 2008. All Rights Reserved.

This publication may refer to products that are not currently available in your country. IBM makes no commitment to make available any products referred to herein.

IBM Power Systems™

Agenda Key:Session Number:

Extended Web Services Technologies

Dan Hiebert IBM [email protected]

Web Services and SOA for the RPG Developer on IBM i

Page 58: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Web Services Technologies and Development ToolsIBM i Web Services Runtimes / Technologies• IBM Integrated Web services for i• WebSphere Application Server

– Java Server Pages (JSP)– Java Server Faces (JSF)– Host Access Transformation Services (HATS)

• PHP

IBM i Web Service Development Tools• WDSc V7• Rational Developer for i (RDi) – Web Services Wizard• Rational Developer for I – SOA (RDi –SOA)• HATS Tools

IBM i Advanced SOA Technolgies• WebSphere Enterprise Service Bus (WESB)• WebSpehre Process Server (WPS)• WebSphere Integration Developer (WID)

Other Platform Web service Technology’s• .NET/C#• Lotus Expeditor • Mashup Servers• Portal

Page 59: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Rational Developer for I (RDI) &WebSphere Application Server

Page 60: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Web Service Wizard in RDi SOA• Web Services wizard in RDi SOA generates a Web Services wrapper for a

program or service program procedure– Program or procedure must be able to run as batch– Generated Web Service wrapper is deployed onto WebSphere Application Server or

the Integrated Web Application Server for IBM i Operating System• Does not have to be deployed onto the same server as the program or service program

Example program to be called

Start the wizard by right-clicking on

member in the RSE and selecting Web Services > Create

Web Service

Page 61: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Web Service Wizard

Select the blue hyperlinks to change the Web Application Server, Web service runtime, J2EE version, or Web project

The Service project and Service EAR projects are the location where wizard generates files related to the Web Service

If a Service project or EAR project does not exist, it will be created for you!

Page 62: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Host Access Transformation Services (HATS)

Page 63: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Host Access Transformation Services(HATS) Web Service creation overview

Create a HATS project

Setup Development environment

Define host connections

Create a HATS project

Setup Development environment

Define host connections

Create Macros

Navigate host screens

Define input parameters & output data

Connect, data, disconnect macros

Create Macros

Navigate host screens

Define input parameters & output data

Connect, data, disconnect macros

Optionally Set up session poolingOptionally Set up session pooling

Page 64: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

HATS Web Service Creation Overview - Continued

Create Web Service client for test

From WSDL file

Create Web Service client for test

From WSDL file

Create an Integration Object

Defines the programming interface to the

macro

Create an Integration Object

Defines the programming interface to the

macro

Create Web Service

Web Service files

Web Service Definition Language (WSDL)

file

Create Web Service

Web Service files

Web Service Definition Language (WSDL)

file

Page 65: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

IBM SOA Foundation (Advanced)

Page 66: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Business Process Management Enabled with SOA

IBM SOA Foundation: http://www.ibm.com/soa

WebSphere Integration Developer

Easy-to-use integration to simplify and speed the assembly of composite

applications

http://www.ibm.com/software/integration/wid/

WebSphere Process Server

Flexible deployment of business processes, making

plug-and-play of components a reality

http://www.ibm.com/software/integration/wps/

WebSphere Business Modeler

Simple to use process modeling for the business analyst to help maximize process and business resource re-use

http://www.ibm.com/software/integration/wbimodeler/

WebSphere ESBConnectivity infrastructure for integrating applications and services to power your SOA

http://www.ibm.com/software/integration/wsesb/

WebSphere Business Monitor

Real-time visibility into process performance enabling process intervention and continuous

improvement

http://www.ibm.com/software/integration/wbimonitor/

Page 67: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

WebSphere Enterprise Service Bus (WESB)(Advanced)

Page 68: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

The Enterprise Service Bus shrinks those interfaces further

RESULT Greater Business Responsiveness

Allows for dynamic selection, substitution, and matching

Enables you to find both the applications and the interfaces for re-use

Decouples the point-to-point connections from the interfaces

Enables more flexible coupling and decoupling of the applications

Turn this (web services)… …into this (SOA)

Enterprise Service Bus

Service Service Service Service

Service Service Service

= Interface = Service

Service Service Service Service

Service Service Service

= Service= Interface

Page 69: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

What are the IBM ESB offerings

1A Basic ESB: WebSphere ESB V6, a new product delivering an Enterprise Service Bus, built on top of and leveraging WebSphere Application Server. Facilitates SOA for Web services. Uniquely able to connect to WebSphere MQ networks.

Now Available on i5/OS

Now Available on i5/OS

2A Network Appliance ESB: The Datapower XA35 is a hardware implementation of an Enterprise Service Bus. It accelerates infrastructure implementation, offloading XML traffic to speed up processing with minimum network disruption.

DatapowerXA35

DatapowerXA35

An Advanced ESB:WebSphere Message Broker V6, a new version of our proven product, built on top of and leveraging WebSphere MQ. Delivers an advanced Enterprise Service Bus facilitating SOA for existing (non-Web Services) applications.

3Runs in aSystem i

LPAR

Runs in aSystem i

LPAR

Page 70: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Color = Data type

Shape = Protocol

Enterprise Service Bus capabilities

Flexible connectivity infrastructure for integrating applications, data, and services to power your SOA

Page 71: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

ESB Capabilities: Transformation

Customer Master

Shipping System

Customer Master

Lastname( Char 20)

Firstname (Char 20)

Address1 (Char 25)

City (Char 20)

State (Char 20)

Zipcode (char 5)

etc

Shipping Master

Lname (Char 15)

Fname (Char 15)

Zipcde (Char 5)

Addr1 (Char 30)

City (Char 20)

State (Char 2)

etc

TRANSFORMS message formats between requestor and service

Page 72: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

ESB Capabilities: Conversion

Customer Master

Customer AddressChange

XML<name>John Smith</name>

<address>100 Main St.</address>

Etc…

JDBCUPDATE CUSTMAST RECORD=1 Name=“John Smith”, Address = “100 Main St.”, etc…

CONVERTS transport protocols between requestor and service

Page 73: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

WebSphere Process Server (WPS) (Advanced)

Page 74: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

WebSphere Process Server

• Robust execution of business processes– Reliable, scalable, secure, open standards– Single integrated runtime for all SOA based process automation

• Supports all aspects of process integration– Process flows– Business rules– Human steps– Services– State machines

• Rapid process change ensuring business agility– Reuse existing services that you already have and create new services for future use.– Build process flows without knowing where the information is coming from (late binding of

services)– Business rules control the execution sequence of the process and can change

dynamically

The Engine Room of Business Process Management

Page 75: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

WebSphere Integration Developer (WID) (Advanced)

Page 76: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

WebSphere Integration Developer

• The complete toolbox for building composite applications

– An Assembly Editor for wiring solutions together

– All the tools you need for building solution components (Editors for BPEL, Business Rules….)

– One, easy to learn user interface based on Eclipse

• Architected for reuse and flexibility

– Simplified component interfaces– Plug-and-play solution components

One Tool, One set of skills, Many usesIntegrating services across the enterprise: Processes, Mediations,

Adapters, Components

Accelerated Solution Assembly

Page 77: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

WebSphere Business Monitor & WebSphere Business Modeler

(Advanced)

Page 78: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Business Alerts Notification of situations that require response

External InformationInformation affecting performance

ScorecardsKey Performance Indicators for business units

Reports & AnalysesUnderstanding trends by combining real-time performance and historical information

Collaboration Work with teams to resolve situations

Achieve Real-time Visibility into ProcessesWebSphere Business Monitor

Page 79: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

• Designed for business users • Import models directly from Visio• Hundreds of process templates

available• Optimize all aspects of your business

– set KPI’s and metrics• Collaborate with subject matter

experts through the Publishing Server

Model, simulate, and analyze• Enhanced analysis and simulation

capabilities. Fully understand impacts before deploying.

Clean hand-off to I/T• Rapid and accurate deployment of

your solutions• Business modeling is the starting

point for IT deployment (WID)

Business Level Modeling And SimulationWebSphere Business Modeler

Page 80: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Summary!!

• Introduction to SOA & Web Services• Creating RPG Web Service Business Logic.

– Lab Time

• Deploying/Testing RPG Web Services.– Lab Time

• Presentation Layer of Web Services.– Lab Time

• Consumption of Web Services.– Lab Time

Page 81: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

Questions?

Page 82: IBM Power Systems ™ Agenda Key: Session Number: Web Services and SOA for the RPG Developer on IBM i Dan Hiebert IBM dhiebert@us.ibm.comdhiebert@us.ibm.com

IBM Power Systems

© 2008 IBM Corporation

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.

Performance is based on measurements and projections using standard IBM benchmarks in a controlled environment. The actual throughput or performance that any user will experience will vary depending upon considerations such as the amount of multiprogramming in the user's job stream, the I/O configuration, the storage configuration, and the workload processed. Therefore, no assurance can be given that an individual user will achieve throughput or performance improvements equivalent to the ratios stated here.

Prices are suggested U.S. list prices and are subject to change without notice. Starting price may not include a hard drive, operating system or other features. Contact your IBM representative or Business Partner for the most current pricing in your geography.

Photographs shown may be engineering prototypes. Changes may be incorporated in production models.

Trademarks and Disclaimers