Skip to Content
Author's profile photo Nigel James

Services for the REST of us

When I heard about Project Gateway at SAPPHIRENOW earlier this year, I immediately saw the potential for what it could do. I immediately started trying to do all I could to get my hands on it. As I was running a SAP Inside Track event in London in July of this year I thought it would be great to try and get hold of it so that the attendees could see what it could do. That did not happen.

TechEd has been and gone and while we have more details on what Gateway is capable of I still have not been able to get hold of it yet. The official release is the first Half of 2011 so lets hope for an announcement at SAPPHIRE next year. (I live in hope).

In the meantime I have been working on a project that required REST services from SAP. So I went digging back into the SAP Developer Network and found all DJ Adams old (like six years old) blogs on how to set upForget SOAP – build real web services with the ICF. This was exactly what I was looking for and I started down this road.

I started simply enough parsing the URI’s with a regular expression (regex) because you don’t want to over complicate things. You have to ‘Code For Today’.

I realised that I needed something a little more scalable that the approach I was taking for the future of the project.

What I was looking for was a really nice way to parse all the different URL’s I wanted to have in my API without having to set up lots of different ICF nodes. Besides you often need to have a uri like:

/airline/flight/{flightcode}/passengerCount

This cannot be defined as a node in the ICF and would need to be parsed by a handy regular expression.

Some time later I came across another blog from DJ about a A new REST handler / dispatcher for the ICF that he was porting from python. At the time I was too busy to look into the details but recently I got some head space to investigate this further and found this was exactly what I was looking for.

What this means is that it is very easy to separate your URI’s from the ICF. Your RESTful API can be defined at one place in the and you can have a class for each URI that you want to processes. This makes it very easy to maintain and expand an API.

In the coming posts in this series I will be coding up a simple proof of concept of a RESTful app. The component parts will be:

     

  1. A single ICF node and handler class
  2.   

  3. Several handler classes
  4.   

  5. Simple transformations

That would be the end of the story for the API. We need an application on top of that.

Once we have an API ready we can then define the applications on top of that. It helps to think of your app with two heads.

If you are wondering why I am linking so much to the PHPAdvent.org articles, it is because these guys are top web developers and they think very hard about what they do. PHP is a messy “get it done” language anyway and it is instructive to learn how other developers approach things – especially when PHP runs most of the web.

This post is just the introduction. Stay with me for the ride and we will see what we can get through.

Assigned Tags

      3 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member
      Hi Nigel,
      I really like the linking out to other articles (in and outside SCN) to bring some good external thinking into this blog. Not to mention the actual content as well of course.
      Looking forward to seeing where you go with this and how you tackle this with the ICF.
      Cheers,
      Matt
      ps. BTW - I might have to borrow some of the style the PHPAdvent blogs have - classy.
      Author's profile photo Nigel James
      Nigel James
      Blog Post Author
      Thanks for your comments Matt. For your interest the design on the phpadvent.org and photoadvent.org calendars have been done by a guy called Jon Tangerine a UK based designer.

      BTW ... I have been working on part two. Coming to a feed reader or twitter client near you soon.

      cheers,
      Nigel

      Author's profile photo Chris Paine
      Chris Paine
      Nigel, like you I only recently got interested in how I could use the ICF directly to communicate with my non-sap based apps in a RESTful manner.

      It's amazing that DJ Adams has been doing/advocating this for years, and we are only now listening. I too have recently been trawling though his blogs and using them as a foundation for building my own RESTful services.

      I wonder if it is the news of Gateway that has us motivated in this space - or is sudden business requirement for mobile connectivity? Certainly it is interesting!