2. About Us: Strongback Consulting
IBM Advanced Business Partner
– Rational, WebSphere, Lotus, Information Management SVP certified
– Strongly focused on Enterprise Modernization and application lifecycle management
– Key Industries Served: Finance, Insurance, Healthcare, Manufacturing, Government
– Rational Design Partner for HATS and other Rational enterprise modernization technologies
Discover us at:
http://www.strongback.us
Subscribe to us at
http://blog.strongbackconsulting.com
Socialize with us on Facebook & LinkedIn
http://www.facebook.com/StrongbackConsulting
http://www.linkedin.com/company/290754
3. About HATS
IBM® Rational® Host Access Transformation Services (HATS) transforms traditional text-
based interfaces into web, portlet, rich client or mobile device interfaces.
Supports 3270, 5250 and virtual terminal (VT) applications
Allows for extending these applications as standard web services.
Rules based engine to transform your existing, proven applications to a modern UI.
Extend 3270, 5250, and VT green screens as standard Web services.
Broadens the reach of IBM i applications with support for mobile web access from devices
such as smartphones, tablets, and handheld computers.
Provides standard JSR 286 and JSR 168 portlet support, including built-in inter-portlet
communication.
3
4. About HATS
With Rational HATS you can easily convert traditional text-based host application screens to
user-friendly GUIs.
4
6. HATS: The Tactical Advantage
Rational HATS allows you to reuse and repurpose your existing assets.
– Out of the box
– Additional ROI on your existing applications
– Low cost and low risk: No need to rewrite or refactor existing applications
Cuts training costs.
– Increase productivity and reduce training costs and data entry errors with workflow and navigation
improvements
Extend your reach.
– Extend host application to new users who do not directly have access to the host system.
Very Fast Time To Market
– A large financial company went from start to production in 39 days
– Smaller companies could have an application ready in an afternoon
6
7. HATS: The Strategic Advantage
Extend your existing applications and assets
Find new streams of revenue for your legacy applications
– Applicable to ISV’s, service providers
Use to abstract your systems into web services short term to protect long term architectures
– Easy to create web services
– Web services “hide” the underlying technology
Integrate with external resources
– Any resource!
Portalization
– Integrate at the glass with other enterprise systems
7
8. Extending with Web Services
The W3C defines web services as:
“a software system designed to support interoperable machine-to-machine interaction over
a network. It has an interface described in a machine-processable format
(specifically WSDL). Other systems interact with the Web service in a manner prescribed by
its description using SOAP messages, typically conveyed using HTTP with
an XML serialization in conjunction with other Web-related standards.”
The W3C also states:
– REST-compliant Web services, in which the primary purpose of the service is to manipulate XML
representations of Web resources using a uniform set of "stateless" operations; and
– arbitrary Web services, in which the service may expose an arbitrary set of operations.
Provides a way to communicate between applications running on different operating
systems, with different technologies and programming languages.
SOAP…. REST…. XML… JSON… HATS does it all.
8
9. SOAP Web Services
SOAP: Simple Object Access Protocol
XML-based protocol to let applications exchange information over HTTP or JMS (or really
ANY transport).
Often described by a WSDL: Web Services Description Language
– WSDL is an XML-based language for describing Web services and how to access them.
– Makes services easier for clients to consume.
SOAP is highly extensible, but you only use the pieces you need for a particular task.
9
10. RESTful
Use HTTP methods explicitly.
Are stateless.
– Clients send complete, independent requests.
Expose directory structure-like URIs.
Transfer XML, JavaScript Object Notation (JSON), or both.
10
11. Creating a web service using HATS
Create a standard HATS project
Create macros
Create Integration Objects
Create Web Services (REST or SOAP)
Deploy to WebSphere
12. Key Function in Macros
• Skip-screen
• Skip-screen macros are navigational macros that move the user from one
screen to another screen without displaying intervening screens.
• Prompt
• Prompt macros contain events to request input from users during the host
session.
• They can also set prompts from a user list.
• For example, you can use a prompt macro to ask a user for their user ID
and password before logging them into a host application.
• Extract
• Extract macros contain events to extract host screen information as a
string, data as a table or even a global variable.
• You can use an extract macro to connect to a directory-type host
application and extract the results of doing a search in the directory.
13. Create a Macro
Utilize the Host Terminal Emulator to record your macro.
Utilize the Visual Macro Editor (VME) to edit your macro.
– Add prompts (the inputs of your web service)
– Add extracts (the outputs of your web service)
13
15. Host Terminal
Used for Host Navigation to create:
– Screen Customizations
– Screen Captures
– Transformations
– Macros
Allows Macro Recording and Editing
Allows Macro Playback and Testing
Open Play Record Stop Save
Resume
Prompt
Extract
Record
Loop
Prompt
All
Fields
Extract
All
Fields
Step
Into
Step
Over
Step
Return
Step
Over
16. Visual Macro Editor
16
• Allows you to
visually see your
macro flow
• Easiest way to
update existing
macros
• Drag / drop
functionality
19. Macro Editing
• Tabbed Editor – description, timing, name
• Advanced Editor
• Create/edit macro variables
• SQL calls
• Macro Navigator (in Host Terminal)
• Recording macros
• Appending to macros (less preferred method)
• Debugging / testing macros
• Visual Macro Editor – Most of your editing
• Editing Actions
• Rename screens
• Re-ordering screen flow
• Drag/drop screens onto the editors
20. Integration Objects
Reusable, JEE, Java Beans that encapsulate interaction with a host system.
Can be created from Macros
20
Integration
Object Java
Beans
21. Integration Objects
Created automagically!
Select the macro, right click and select Create
Integration Object
Once created, the Integration Object will appear
in the HATS Project View in the Source ->
IntegrationObject folder
21
22. From Integration Objects to Web Service Support Files
Utilize wizard from context menu
Right click on the Integration Object
and select Create Web Service
Support Files
22
23. Create Web Service Support Files
This is a web service, which may
contain a collection of operations.
Choose the name of your service
to reflect this.
23
24. More
Select the Integration Objects you wish to
include in this service.
Each Integration Object will reflect one
operation of your service.
Click the properties button to alter the input
and outputs selected for each operation.
24
25. Selecting Properties
The selected properties will determine
the inputs and outputs of your service.
See the hPub properties? These are
used internally by HATS and can be
safely excluded.
25
26. Web Service Support Files
26
The artifacts created will reside in the Source -> webserviceclasses folder.
27. Create a SOAP Web Service
27
From the project explorer, right click on the
web service support file you created. Select
Web Services -> Create Web Service from
the context menu.
This will launch the Web Service wizard. This
wizard allows you to generate a WSDL file
and also lets you deploy the service to an
application server.
Optionally, it also allows you to create a
sample client for the service.
28. More
Construct your web service as a Bottom
up Java Bean Web Service. A bottom up
service is built using your existing Java
bean and this wizard will generate the
WSDL and other Java classes to
facilitate the service.
Other options available:
- Generate a client
- Select a server runtime
- Change the EAR for deployment
28
29. Service Endpoint Interface
The service endpoint is the
client’s view of the service,
hiding the session bean from
the client.
Here you can modify the
interface to use, the
deployment scope, the
soapAction field for the
generated WSDL and whether
to map to WSDL 1.1 MIME
types.
29
30. Web Service Java Bean Identity
Here you can modify the
WSDL file name and select
which methods to expose via
your service.
In our example, the
getNestedBeanNames
method is not a method we
want to expose.
Once complete, click Finish to
create your WSDL and
service interfaces.
30
32. RESTful
Like the SOAP services before, you can
begin creating REST based services from
an Integration Object.
Right clicking on the Integration Object in
the projects view allows us to select Create
RESTful Service Files from the context
menu. This will launch the wizard to create
our interfaces.
32
33. Producing REST Web Services with HATS
Specify the class and package
names.
33
34. Producing REST Web Services with HATS
Choose the Integration Object and the HTTP
method type.
Then select the input and output parameters.
34
35. Configuring the JAX-RS Resource Method
Here we can define a great many properties
of our service interface:
- Method Name
- URI suffix
- Mime type that is produced
- Add, edit or remove parameters
Below you see the JAX-RS annotation
signature for the method the wizard will
produce.
35
36. Producing REST Web Services with HATS
Here we could add additional
methods.
Click Finish to complete the wizard
and generate the JAX-RS resource.
36
40. HATS Business Logic
Business Logic:
– Java code that can be invoked when ANY HATS event occurs.
– Include and manipulate HATS global variables
HATS Events:
– Application startup
– Screen recognition
– Error
40
42. Introducing The IBM Toolbox for Java
A set of Java classes that allow you to use Java programs to access data on your IBM I
servers via their host servers as access points. With these you can utilize:
Database -- JDBC (SQL) and record-level access (DDM)
Integrated File System
Program calls (RPG, COBOL, service programs, etc)
Commands
Data queues
Data areas
Print/spool resources
Jobs and job logs
Messages, message queues, message files
42
43. Obtaining the Toolbox
43
The IBM Toolbox for Java Jar files are installed in the integrated file system of IBM i, under
directory /QIBM/ProdData/OS400/jt400/
IBM Toolbox for Java is also available in an open source version. You can download the
code and get more information from the JT Open Web site.
45. Where and How could I use the toolbox in HATS?
46
Terminal
Connection
46. Program Call Markup Language
A tag language that allows one to call IBM I server programs.
XML based syntax that fully describes the input and output parameters for the program.
Extensible Program Call Markup Language (XPCML). XPCML enhances the functionality
and usability of PCML by offering support for XML schemas.
Allows you to write less code; your calls to the server, utilizing the IBM Toolbox for Java,
handles the interaction and provides the interface.
Also available to be consumed from within the server environment by other host programs.
Available since IBM I v5r3
47
50. Consuming PCML with HATS
Utilize within Business Logic to call out to other host programs.
– Retrieve other records
– Lookup data that could be inserted into your host application
Use within Screen Customizations
– Retrieve result sets for a search
– Get a list of values a user could select to auto populate other fields
51
51. SQL Integration with IBM i
The IBM Toolbox for Java JDBC driver allows you to use JDBC API interfaces to issue
structured query language (SQL) statements to and process results from databases on the
IBM i.
– JDBC is an API that enables Java programs to connect to a wide range of databases.
52
Hats
Application
JDBC
Driver
IBM i
52. SQL: Structured Query Language
A programming language designed for managing data held in relational database
management systems.
53
SELECT Book.title AS Title, COUNT(*)
AS Authors FROM Book JOIN Book_author
ON Book.isbn = Book_author.isbn GROUP
BY Book.title;
Title Authors
---------------------- -------
SQL Examples and Guide 4
The Joy of SQL 1
An Introduction to SQL 2
Pitfalls of SQL 1
53. Utilize SQL within Business Logic
Problem: Your host applications often have short, cryptic record identifiers and often the
description is not included with them on the current screen.
Solution: Use HATS Business Logic and JDBC to query the database for the full description
that you store in a global variable. Then utilize that variable within the Screen Customization.
54
55. Calling RDBMS From Macros
Use the Advanced Editor
Insert raw SQL
Save result set to macro
variable
Macro variable only exists for
the lifecycle of the macro
Use result set to enter data on to
later subsequent screens
56
56. Using servlet filters
For security
For further integration
Intercept inbound request or outbound response
Authentication to an external LDAP registry
Single Sign On
– Could be used in conjunction with Enterprise Identity Manager (EIM)
57
58. Resources
Check out all our links for our presentations, including this one
–https://delicious.com/strongback/tag_bundle/Innovate2013
–“one link to rule them all”
59
59. About Us: Strongback Consulting
IBM Advanced Business Partner
– Rational, WebSphere, Lotus, Information Management SVP certified
– Strongly focused on Enterprise Modernization and application lifecycle management
– Key Industries Served: Finance, Insurance, Healthcare, Manufacturing, Government
– Rational Design Partner for HATS and other Rational enterprise modernization technologies
Discover us at:
http://www.strongback.us
Subscribe to us at
http://blog.strongbackconsulting.com
Socialize with us on Facebook & LinkedIn
http://www.facebook.com/StrongbackConsulting
http://www.linkedin.com/company/290754
Integration Objects are JavaBeans that encapsulate interactions with a host application. If your HATS application will transform a single host application, with no secondary connections, you do not need to use Integration Objects. You may need to use Integration Objects if any of these statements are true:Your application connects to more than one host application. You want to encapsulate your host interactions into Enterprise JavaBeans (EJBs) or Web services. These processes are described in the HATS Programmer's Guide. You want to build Web pages based on the inputs and outputs of a macro.
Service Endpoint Interface Selection page:- You can select to use an existing service endpoint interface (SEI) rather than letting the wizard generate one.- Set the service deploy scope. This indicates how to deploy the server implementation. Application uses one instance of the implementation class for all requests. Request creates a new instance of the implementation class for each request. Session creates a new instance of the implementation class for each session.- Set the SOAP action. This option is used to set the soapAction field in the generated WSDL. Default sets the soapAction field according to the deployment information. None sets the soapAction field to double quotes (""). Operation sets the soapAction field to the operation name.- You can also choose to exclusively map MIME types using WSDL 1.1 standards. If the MIME type cannot map to WSDL 1.1 standards (for example, if the attachment is an array or a Java bean property), the command fails.
Web Service Java Bean Identity page:- Change the WSDL port name or WSDL file name.- Select the methods to expose.- Set the void return - this field is for a Web service method with return type of void that describes whether a response is expected from the Web service. Oneway: this argument is the default for a JMS transport. Twoway: this argument is the default for an HTTP transport.- Select the encoding style. This specifies which style and use combinations are generated into the WSDL file. The combinations are RPC/encoded, RPC/literal, or document/literal. Only document/literal is WS-I compliant.- Select your security options. Security is not WS-I compliant.- Select if you want to customize the package to namespace mappings.- Specify extra and stop classes. Extra specifies other classes that are represented in the WSDL file. You can use the -stopClasses argument to define additional classes that cause the search to stop.
This slide will describe the lifecycle of the HTTP request moving through the layers of the JEE architecture, passing over to the HATS runtime, then the event handling within the HATS runtime. It will be used to illustrate the different points where one could intercept the request and write Java code to manipulate it.