.st0{fill:#FFFFFF;}

What is a webservice and how does it work on AS400, iSeries or IBM i Server? 

 November 1, 2013

By  NickLitten

A Web Service is a program that talks to *something* on the WEB.

You might be asking yourself “What is a webservice?” or “What is an AS400 webservice?”. First of all, I am not going to rant about how its not an AS400 webservice, nor is it an iSeries webservice — it’s an IBM i webservice. IBM dont make the old AS400 and iSeries machines anymore, so stop calling the IBM i System that #endofmessage.

Anyway, lets look at what a webservice is and perhaps do a quick, high level overview to explain the basics.

How does an IBM i Server talk to the Internet?

Here is a question frequently asked in IBM i programming forums:

How do I write (an IBM-i program) RPG, to talk to the internet and receive or send parms to a website or webservice? For example, how can I receive an order number and return the order line information in XML?

Sounds kind of complicated, doesnt it?

What is a webservice

Actually, its not šŸ™‚

Luckily for us, this is an area where the bods at IBM have implemented a really cool server on our beloved IBM I operating system that makes this process so simple, it’s really quite astounding. All we have to do is write a program that does the business logic (for example, receive an order number parameter, read the order line details and return those parameters back). Then we can simply use the IWS* (Integrated Web Server) to share that information with the world wide web.

  • NOTE: the IWS happens to be the APACHE SERVER. But I guess this could change at some point in the future so I’m going to call the IWS rather than the Apache Server.

The IWS is easily used from any web browser that can talk to your IBM i Server and it has a very simple wizard that will create a webservice from your RPG program. Not only that, but it will automagically create a WSDL*, and deploy the webservice to its application server. The IWS is free and comes automatically with the system.

There are lots of ways to do this and its much easier than you may think.

*What is the IWS? The integrated Web services server for IBM i enables the deployment of ILE-based program objects as Web services. The IWS is free and comes included with IBM i you simply need to start the server and start using it.

*What is a WSDL? A WSDL is an XML document that describes a web service. It actually stands for Web Services Description Language.

*What is SOAP? SOAP is a technique that lets you exchange info over a particular protocol (can be HTTP or SMTP, for example) between applications.

*What is a XML and JSON? Think of these as the language of the webservice. Webservices write their messages in JSON or XML so that the program (or browser) the other end can easily read what they are sending or receiving over the web.

Don’t get scared by all the buzzwords like server, serving, consuming, publishing, soap, rest, xml, json…. take a deep breath and dont panic.

If this is the first time you have written a webservice, or if you just want to see some alternative RPG code examples then look at these blogs

Does this make sense? Still with me? Then lets read a Primer on Webservices

NickLitten


IBM i Software Developer, Digital Dad, AS400 Anarchist, RPG Modernizer, Shameless Trekkie, Belligerent Nerd, Englishman Abroad and Passionate Eater of Cheese and Biscuits. Nick Litten Dot Com is a mixture of blog posts that can be sometimes serious, frequently playful and probably down-right pointless all in the space of a day. Enjoy your stay, feel free to comment and remember: If at first you don't succeed then skydiving probably isn't a hobby you should look into.

Nick Litten

related posts:

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}
__CONFIG_colors_palette__{"active_palette":0,"config":{"colors":{"cff50":{"name":"Main Accent","parent":-1},"a344d":{"name":"Accent Transparent","parent":"cff50"}},"gradients":[]},"palettes":[{"name":"Default","value":{"colors":{"cff50":{"val":"var(--tcb-skin-color-0)"},"a344d":{"val":"rgba(46, 138, 229, 0.85)","hsl_parent_dependency":{"h":210,"l":0.54,"s":0.78}}},"gradients":[]},"original":{"colors":{"cff50":{"val":"rgb(0, 178, 255)","hsl":{"h":198,"s":1,"l":0.5}},"a344d":{"val":"rgba(0, 178, 255, 0.85)","hsl_parent_dependency":{"h":198,"s":1,"l":0.5}}},"gradients":[]}}]}__CONFIG_colors_palette__

Get In Touch

Iā€™m always looking for awesome input, feedback and critique!

>