Home > AS/400 Tips > > Web services for the iSeries
iSeries 400 Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 


Web services for the iSeries


Jim Mason
05.06.2004
Rating: -3.57- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


Web services overview

A Web service is basically a transaction service that runs over the Web using effectively an XML remote procedure call (RPC). At the simplest level, a client encodes a request as an XML message and sends it over the Web to an application service running on a server. The server processes the request, encodes a response as an XML message and returns it to the client.

Web services runtime environments are implemented by many vendors on many platforms. Often, Web services are used in places where other distributed transaction technologies were once used:

Why are Web services useful?
The advantages and weaknesses depend on what option above you are comparing to Web services.

Here are some advantages to Web services that apply to some of the options above:

Issues for Web services compared with other options:

WebSphere, WebSphere Express and other application servers such as Tomcat, Jboss and others can run Java-based Web services applications well.

If you look at the issues listed above, probably the BIGGEST on the list is IT lack of experience creating, setting up and running Web services. That's the biggest hurdle I've faced so far.

Basics of a Web service invocation
The steps in a SIMPLE point-to-point Web service are as follows:

Web services can be discovered dynamically using a broker
A more complex Web service would involve all the steps in a Web service life cycle and use a broker (or registry) to discover the service and how to invoke it as well. The steps in this scenario are more complex but are summarized below:

Attributes of Web services

Some attributes that distinguish Web services from other types of distributed applications include the following:

What can be converted to run as a Web service?
Most server resources can be converted or "wr


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


RELATED CONTENT
Web Development
Migrating from RPG to EGL on IBM i
Groovy programming on IBM i
Running PHP open source applications: NOBODY needs authority
Zend Web software teams up with IBM System i
The best technologies and tools for System i programmers in 2009
Seven IBM i project lessons learned in 2008
AS/400 lessons from the past, present, and future: A holiday tale
Application modernization strategies for System i
RPG application modernization for i5
Web skills crucial to iSeries programmer professional development

Web Servers
System i no longer the stepchild of IBM's world
Connecting WebSphere to AS/400 for image retrieval
Weaving in WebSphere
SOA enhancements drive IBM WebSphere feature packs
SOA means money for IT workers
Enable J2EE app on WAS to access DB2
Securing Apache: Keeping patches current
IBM runs USOpen.org on Power boxes
MoMA's IT makeover a mix of old and new
How does RPG talk to a browser?

Web Tools
Programming for the Web on the IBM i, what is possible
Zend Web software teams up with IBM System i
Using geocoding on AS/400 to enhance your Web presence
The iSeries Blog has a new home on IT Knowledge Exchange
The best technologies and tools for System i programmers in 2009
Search400.com Products of the Year 2008
Application modernization strategies for System i
Natively supported Web applications for Power running i
System i PHP authoring tool tries to fill void in Web-coding know-how
Lazy coder: What does PHP on the i5 mean?

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
WebSphere Development Studio Client (WDSC)  (Search400.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


apped" to create a Web service.

Web services roles
A complex Web service involves a provider that creates and runs a Web service, a broker using a UDDI-compliant registry that offers Web services to clients (users or requestors) and the client who finds and uses a Web service. The activities for each role are summarized below. For a simple Web service, you skip publishing the service to a broker or registry and just publish the URL to access the Web service with the WSDL document directly to the client you want to call your service.

Provider:
Creates a Web service
Publishes a Web service to a registry
Runs a Web service

Broker:
Provides a registry for published services
Clients search the registry for matching Web services

Requestor:
Searches a registry for a Web service
Finds a service
Binds to a service
Runs a service

Web services life cycle
For a complex Web service, all the steps below would be included during the life cycle of a Web service:

Create:
Design and create the Web service

Publish:
Publish the service to a registry, either private or public
Registry can be a broker, database or directory server

Advertise:
Promote the service to targeted clients via URL or a registry

Discover:
Clients search a registry to locate a service

Bind:
Clients use service definition to bind to the service

Invoke:
Clients invoke the service

A simple Web service would publish the URL and WSDL document directly to a specific client. The majority of Web services today are simple point-to-point connections either between businesses or run internally to integrate different applications on different platforms.

An example business case for Web services

I developed an APPC link to banks for a credit company. Every time we needed to link to a new bank, I had to create a new link similar to an existing one and usually make small modifications to the APPC code to fit the new bank's data and transaction formats.

Our Web services case study: credit verifications
A credit services company performs consumer credit verifications for banks when customers open new accounts.

Business keys to the verification service:

Options implemented:

A call center staffed with representatives to answer verification calls
The original solution to deliver credit verification services.

Issues with the call center approach

A Web application to enter verification requests remotely
A simple Web application written in Visual Basic running on IIS server uses IBM MQ to send a message to an AS/400 request handling COBOL program that performs a complex lookup in an RPG program.

Benefits

Issues with the Web application approach

A better option is a simple JSP that runs a stored procedure call to RPG program.

An APPC application linking bank desktop to credit company
Generation 1 B2B. Created custom APPC applications for a credit company and bank. The bank sent a request to the credit company APPC handler, which calls RPG lookup program and returns results.

Benefits

Issues with the APPC approach

A Web service application linking bank desktops to the credit company
A common Web service application can connect ANY bank to the credit company to automatically process verifications. A client application for the Web service will be supplied to each bank that includes a user-definable data map for request inputs and response outputs to map data into the client database WITHOUT programming. The Web service client securely links to credit company server over existing Web links.

Benefits

Issues

Clearly, the Web services approach will allow the credit company to rapidly expand its existing business-to-business sales and customer base at a low cost and with minimal requirements for IT services on the banks end -- a MAJOR victory.

J2EE technologies for Web services

Web services run as either J2EE client or server applications. The client portion creates the request and receives the response. The server processes the request returning a response. J2EE technologies that can be used in a Web services implementation include the following:

Other Web Services frameworks

All of the OTHER Web services frameworks listed above are available in WebSphere Network Deployment server version 5.02 today.

Building a simple Web service in WDSC

Use the WDSC Web interaction wizard for iSeries Web services

IBM WDSC offers a great tool to build simple iSeries-hosted Web services quickly: the Web Interaction wizard. I've used it for several years and like it. With no technical knowledge of Web services and only a conceptual model of creating an RPC that runs over the Web to your server, you can easily generate and test a simple Web service in three basic steps:

  • Test the Web service in WDSC with the WebSphere Test environment
    You can launch the Web service automatically at the end of the generation in step 2 or manually. You launch the Web service running on the server first and then invoke the client application in another browser window in WDSC to access it. If you want, you can even test the client application for the service remotely from another desktop PC in your company be specifying the name or IP address of your PC instead of localhost in the URL.
  • The only issue I've found at times with the WDSC Web interaction wizard for creating Web services is the need for fix packs to solve problems with the generation. Fix packs to solve most problems are usually already available when you need them. The automated update manager for fix packs in version 5.1.0.2 has had problems running correctly for some customers as well, so it's safer at this point to manually download fix packs from the IBM Web site.

    Other options for creating Web services
    I see three other options you might look at IF you're NOT creating an iSeries-hosted Web service (e.g., calling an RPG server program for the service):

    1. Using general Web services wizards included in WDSC
    WDSC in version 5.1 now includes other tools that can generate a Web service. Not QUITE as simple as the iSeries Web services, the Web interaction wizard can generate Web services for OTHER scenarios: a Java application running on any server, a DB2 stored procedure call on any server or just any simple Java bean.

    2. Using command line tools in WDSC Advanced
    You can use command line tools to create a Web service from any Java bean or a WSDL document. These tools MIGHT be useful if you needed to programmatically create a Web service.

    3. Writing a Web services application in Java
    You can also write a Web service directly in Java using new Java frameworks for Web services. IF you have good Java skills and DON'T have WDSC, you can write a simple Web service fairly easily using an IDE such as Eclipse. Writing a Web service and a client application in Java is not that difficult with the new Java frameworks in J2EE v1.4. You can download a Web services toolkit to add to Eclipse from the Sun Java Web site that will give you the jar files you need to add to your project for these frameworks. Building a simple Web service is a lot like writing an RMI distributed application. You only have to write the basic server and client code as if you were writing ANY Java application. You use command line tools: wscompile, wsdeploy to generate all the Web services coding you need for SOAP, etc.

    Most of the time, you can avoid having to deal with SOAP coding in Java.

    Next steps on the road to Web services

    To learn more about Web services for iSeries development, you can visit several resources:

    ---------------------------------------

    About the author: Jim Mason, president of ebt-now, is an iSeries WebSphere architect, trainer and developer. ebt-now provides iSeries WebSphere, WebFacing engineering, development and training services. You can reach Jim at jemason@ebt-now.com.

    Rate this Tip
    To rate tips, you must be a member of Search400.com.
    Register now to start rating these tips. Log in if you are already a member.




    DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



    iSeries Security - Security Tools, Physical Security and System Security
    HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersProducts
    About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
    SEARCH 
    TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

    TechTarget Corporate Web Site  |  Media Kits  |  Site Map




    All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
      TechTarget - The IT Media ROI Experts