Now  that a few months have passed since SAP released NetWeaver Gateway, and  we’re starting to see more implementations of it in the wild, I’m seeing more and more discussions in the community about the finer points of Gateway and REST in general.

One opinion I have come across is that NetWeaver Gateway should be merged with PI rather than remain as a separate product with its own technology  stack. That way, PI will remain SAP’s “go to” integration hub and customers can avoid standing up further systems and the maintenance overhead that entails.

As a relatively recent convert to the ‘religion’ of RESTafarianism, and having done a bit of PI work over the past few years, I of course have an opinion here: “Don’t do it!”.

Let me explain:

 

REST is not a Protocol

REST is an architectural style; a way of architecting system interfaces rather than a formal protocol which one can implement. REST defines a set of principles and constraints. When we design interfaces within these boundaries, then we have something which is RESTful. This can take many shapes of course, as there is no check list or W3C standards document or reference implementation which someone can comply with.

SOA is another, different architectural style. It requires system interfaces to be self-contained services, with defined inputs and outputs, which are separable, minimise side effects, etc. It does not require per se the use of Enterprise Service Buses, UDDI directories, etc. - these things usually appear in specific implementations of an architecture following the SOA style.

There are other architectural styles pertaining to system integration of course. Message Oriented styles come to mind, and there are others which are (unfortunately?) still used such as database integration. In fact, Wikipedia has a list of some.

 

Of Adapters and Middlewares

SAP NetWeaver PI has been designed from the ground up as a message oriented middleware product with some ESB features. Over time, these ESB  features have grown as SOA architectures became more common and desirable, and that’s A Good Thing. A good middleware product can speak as many protocols as possible, because there are many different implementations of those message-oriented architectural principles. It’s also likely that your middleware product will need to talk to another middleware product, and lots of protocol adapters help bridge the divides between two different implementations of the same architectural style.

But REST is not a protocol, and that is why the idea of a “REST adapter” doesn’t make sense to me. How do you write an adapter into a different  architecture? If all you need is to simply send one request to one RESTful endpoint, PI already has the HTTP adapter which will be perfectly suitable for some simple scenarios. But beyond that, the fundamental differences between the SOA and MOM (Message-Oriented Middleware) architectural styles in  PI’s DNA, and those of a good REST API, will be simply too great to bridge with an adapter.

Let me try to explain this gap by way of some examples:

  • REST talks about clients and servers, and doesn’t talk about middleware. PI is middleware.
  • RESTful APIs present hyperlinks to clients, which follow the links to modify state. How would PI do this?
  • REST mandates no content format. In fact, it allows any content format you can think of. PI really only handles XML.
  • REST requires clients to keep state in interactions with the server. PI is  not good at that. (NW BPM will probably change this. NetWeaver BPM as a  REST adapter? Now we might be onto something...)
  • PI works best with asynchronous processing. REST does away with abstraction layers providing asynchronicity and relies on natural request/response mechanisms.

 

Now, I do think that PI should have the ability to interact with RESTful APIs; as middleware, its job is to talk to as many other things as possible. But the fundamental differences between these two worlds will preclude such an approach from being comprehensive or good for all use cases. It may work for really simple things, but it won’t be nearly enough to position PI as the “REST Adapter” into SAP systems. And that’s okay. We don’t need one integration hub to rule them all!

For my money, the NetWeaver Gateway team made the right architectural choices: hosted on an ABAP stack and with good tooling for accessing BAPIs,  custom code, database tables and other APIs internal to an ABAP-based SAP system, rather than loosely coupled to the backend, hosted on a Java stack, or designed around existing functionality of existing products.

That’s not to say that Gateway is perfect, and there are some features which I would dearly love to see in the product. But in my opinion, SAP got the basics right by avoiding the temptation to make PI do something which it wasn’t designed for.


Image by Derick Bailey. Thanks for the Creative Commons license mate!

After hearing about folks hacking Apple’s Siri to do things like starting their Viper and controlling their thermostat, I thought about utilizing voice based integration with SAP to retrieve data. By default, Apples technology is pretty well locked down, but it didn’t take long for a developer to introduce a small workaround using a ruby app and a DNS filter. The filter intercepts the call to apple and allows you to inject your own questions, responses and data. If you are interested in learning more, this summary can guide you through the process of setting up and actually communicating with SAP from Siri.

 

Click here for a short demo video on youtube.

 
What you will need:
-          iPhone 4S – (SiriProxy has a test console, if you don’t have one)
-          Ubuntu (Virtual Box Virtual Machine) – this is quick and easy to download, and get up and running quickly with Oracle’s VirtualBox. (Download)
-          SiriProxy – You can use this guide from within your Ubuntu box to get this up and running in less than a hour. (Download & Install Instructions)
-          SiriSAP Plugin – You can download this here from the SDN CodeExchange (Download)
 
 
How does SiriProxy work?
SiriProxy intercepts the iPhones DNS calls to Apple (specifically guzzoni.apple.com) and reviews your request, in the event a loaded plugin contains the requested text, it will process the request “locally” rather than sending it to Apple.

Below is the general network path a Siri requests traverses.

 

With SiriProxy and SiriSAP Plugin, the calls are routed through your Ubuntu server and essentially "preprocessed":

 

How does SiriSAP Plugin work?
The plugin gives you  the ability to write your own search text and pulls data from SAP's  Gateway system. As an example, you could say something like: "Show  account name", the plugin will process the request, pull data from SAP CRM (Using Gateway) and present the results to the user.

The plugin is written in Ruby as a gem and utilizes a HTML/XML Parser called NokoGiri which makes processing very quick and easy. One limitation I found with SiriProxy is the inability to have your own custom response types, for example, SiriProxy only supports "Answer snippets", maps, and answers. Below is an example of how a simple interaction would occur:

 

In this example we:

1. Intercept the call
2. Let the user know we are processing their request
3. Remove any spaces
4. Pass the account number to a method (show_account_name).
5. The method Opens the SAP Gateway CRM request "Account Collection"
6. We use NokoGiri to parse the HTML/XML
7. We search the HTML/XML for "orginizationname" and return the contents

 

      

 

Click here for a short demo video on youtube.

This week, I got a request through for us to urgently architect SAP NetWeaver Gateway into our internal systems at Bluefin. It immediately started a argument - I mean discussion - because a number of us fundamentally disagreed about the approach to architecting this solution. So, I stuck the question out on Twitter, which immediately caused a disagreement between some of the most respected members of the SAP Community. Here's a few tweets (note John and Sascha are colleagues!): 

This week, I got a request through for us to urgently architect SAP NetWeaver Gateway into our internal systems at Bluefin. It immediately started a argument - I mean discussion - because a number of us fundamentally disagreed about the approach to architecting this solution. So, I stuck the question out on Twitter, which immediately caused a disagreement between some of the most respected members of the SAP Community. Here's a few tweets (note John and Sascha are colleagues!):

Thomas Jung: @applebyj The developer in me likes it standalone so it can be upgraded independent of the NetWeaver layer under your ERP #shinyobjects

Vijay Vijaysankar: @applebyj my guess is probably 80% peeps can use it on business suite server itself..choosing a stand alone for complex landscapes

DJ Adams: @thomas_jung @applebyj yes, all the usual advantages of standalone 'gateway' apply, nicely enough. Independent, positionable as app-firewall

John Moy: @applebyj SAP says "For a prod env, we recommend that you install the SAP NW Gateway system separately from the application back-end sys."

Sascha Wenninger: @applebyj Integrated IMHO. I see GW as being analogous to the SOAP runtime rather than Yet Another Middleware, plus REST is abt efficiency.

So with this in mind, I spend some time on research and found that none of the documents I could find gave a straight answer. The main articles I found were the NetWeaver Gateway Deployment Guide:

http://help.sap.com/saphelp_gateway20/helpdata/en/62/91ad98b19b4a91bca737fbe442273f/content.htm

And the NetWeaver Gateway Guidelines for Best-Built Applications:

http://wiki.sdn.sap.com/wiki/display/BBA/Chapter+10.+NetWeaver+Gateway+Guidelines+for+Best-Built+Applications

For my money, they are confusing and don't give clear architectural guidelines. So here's my analysis. Feel free to argue in the comments section below:

Overview of SAP NetWeaver Gateway

SAP NetWeaver Gateway is a mechanism by which developers can connect stuff to SAP using standards-based RESTful Web Services. The first application that used it was Duet Enterprise, which connects share point to the SAP Business Suite, but you can now use it generically to get information in - and out - of SAP. It is now in version 2.0 and quite a lot of content is supported and SAP are releasing more and more content with each service release.

Gateway is great because is allows easy access to the core of SAP using standards-based REST interfaces. It's great for non-SAP people because they can access SAP easily. It's great for SAP people because the Sybase Unwired Platform uses REST/OData to connect online mobile apps back to the SAP Business Suite.

It is an Add-In to the SAP Business Suite - an ABAP Add-In - and can be installed on any SAP system based on NetWeaver 7.02 or above. That means SAP NetWeaver BW 7.02, SAP ERP 6.0 EhP5 and SAP CRM 7.0 EhP1, to mention just a few. If you don't have one of these versions then you can install Gateway on its own NetWeaver 7.02 instance, and connect it back to almost any version of SAP software - back to R/3 4.6c.

For clarity, SAP talk about a local and remote deployment model. And a standalone and embedded model. When you install Gateway on your ERP system (as an ABAP Add-In), it is a local or embedded model. When you install a separate system away from your ERP system, it is a remote or standalone model. There you go.

The question is, in what circumstances should you use which architectural model, and why. Here's my thoughts - which should take you through a thought process to allow you to decide the right way to architect Gateway.

Scenario 1: Security is paramount

If you are deploying applications that allow access from the outside world, like mobile apps, into your SAP network, and security is paramount, then you should deploy a separate instance of NetWeaver Gateway into a demilitarised zone or DMZ. This provides separation between your core SAP network and your edge. You can get the network team to lock down the NetWeaver Gateway system which will make it very difficult for unwanted visitors to penetrate your network.

Scenario 2: Old versions need to be supported

If you need NetWeaver Gateway to provide access to older versions of SAP R/3 or ERP, then you must put Gateway on a separate system. If you need to reduce cost then you could put this on the same physical system as some other SAP environment like ERP or TREX. In any case, you can't install Gateway as an add-in to your ERP environment so you need a separate system.

Scenario 3: Agility is most important

If your core Business Suite / ERP moves slowly or you are unable to update to a recent version, then it is smart to install Gateway as a separate system. This is especially true if you have very strong change management policies around your ERP environment, as you may not be able to update Gateway as often as you would like, because it will be tied to your ERP update process. This is particularly true if you operate a consolidated or global ERP environment for a large number of users or regions. If this is the case, then installing Gateway separately will afford you much needed agility.

Scenario 4: Duet Enterprise

Apparently Duet Enterprise requires a standalone version of NetWeaver Gateway. So there.

Scenario 5: Capital cost to be minimised

If capital cost should be minimised and you want access to predominately one application - and you are on ERP 6.0 EhP5 or any other NetWeaver 7.02 based platform, then you should install NetWeaver Gateway as an Add-In. I know that this is the last scenario - and all the other scenarios mean a standalone Gateway - but it works best this way.

Note that Gateway when installed as an Add-In doesn't have any technical limitations over the standalone version. In contrast to SAP's documentation, you can do everything you can do on the standalone, with the Add-In version. The SAP Help guide suggests that routing and composition of multiple systems aren't possible in the local deployment model, but there is no supporting evidence.

You probably won't upgrade to ERP 6.0 EhP5 just so you can have support for Gateway, but it is a nice benefit for customers who have just upgraded and are already there, or who are on a regular Enhancement Pack cycle. Enjoy.

Conclusions

My main view is that it's not obvious - even for the technically gifted, like some of the SAP Mentors mentioned above - what the right way to architect Gateway is. And what's more, it's not clear what the right integration strategy for SAP is. Take some of the following tweets as evidence:

Tobias Hoffman: @sufw @jhmoy @applebyj I'm always honest. SAP should make 1 product that combines all alternatives of accessing and exchanging data with SAP

Jan Penninkhof: @BoobBoo @applebyj which gateway: ABAP, Mobile or project Gateway << It's time for SAP to consolidate its middleware into one bundle.

John Moy: @applebyj Funny, @sufw sits next to me and we just gave you differing opinions. Just keeping you on your toes ;-)

Tammy Powlas: @jhmoy @applebyj I am glad you are talking about #SAP Gateway, as we just had this discussion at work today

Jon Wilson: @tobiashofmann Umm, isn't that what Process Integration is supposed to be? Gateway should just be another adapter cc @sufw @jhmoy @applebyj

Martijn Linssen: @tobiashofmann @applebyj @integrationer @sufw one single product that can handle and transform any message syntax and any transport protocol

Yes - if you get the point, people are confused. They are confused about SAP's integration strategy with Process Integration and Gateway. I think this is exacerbated by the rekindled relationship with TIBCO, which might spark rumours of an acquisition (if TIBCO weren't too expensive). Some clarity and better architectural guidelines would be of benefit for all.

It all started with a tweet by SAP Mentor John Appleby (@applebyj)...
@applebyj: Question SAPpers, should you install NW Gateway as standalone or integrated? What are the decision criteria?

Quite a few people responded in short order via twitter with their thoughts on the topic. Aside from John being well known (and followed on twitter), this is surely indicative of the level of interest in the technology. Kudos to SAP for getting the community excited with their products! On a complete tangent, I just love how twitter has this ability to stimulate such exchanges in 140 characters or less!

@vijayasankarv: @applebyj my guess is probably 80% peeps can use it on business suite server itself..choosing a stand alone for complex landscapes

@thomas_jung: @applebyj The developer in me likes it standalone so it can be upgraded independent of the NetWeaver layer under your ERP #shinyobjects

@qmacro: @applebyj @thomas_jung yes need to balance those factors also. Middleware is always good (dislike the term, but I have nothing better).

@jhmoy: @applebyj SAP says: For a prod env, we recommend that you install the SAP NW Gateway system separately from the application back-end sys.

 

So far so uncontroversial. Many of the conceptual architecture diagrams I have seen at TechEd and elsewhere follow this approach - like this one from MOB130 at TechEd 2011:

Vison: People-Centric Content from Multiple Sources

 

However, my position on the matter was a little different:

@sufw: @applebyj Integrated IMHO. I see GW as being analogous to the SOAP runtime rather than Yet Another Middleware, plus REST is abt efficiency.

 

Go for Integrated Deployment

My response runs counter to the recommendation made in the admin guide quoted by John Moy, so let me try to explain why I feel an integrated (i.e. remote) installation of NetWeaver Gateway is usually most appropriate architectural choice.

 

NetWeaver Gateway is not that different

Like others, I generally see Gateway in much the same way as the SOAP Runtime or the Proxy framework which already exist in ABAP systems – an add-on to an existing system which provides interfaces by facading internal APIs like RFCs and BAPIs. Gateway provides another set of doors alongside the existing SOAP-based openings through which other systems can gain access to the data and functionality of the Business Suite. Those consuming systems need not worry about the proprietary protocols required for RFC communication but can choose to interact using open standards. Gateway simply provides another, different open standard in the form of OData to complement existing SOAP-based interfaces.

From what I saw during our hands-on work on the NW Gateway 1.0 “beta” program, and from keeping abreast of the evolution of this into v2.0, the product isn’t complex enough to warrant a separate installation in my opinion.

 

NetWeaver Gateway is not middleware

Gateway’s raison d’etre is to expose representations of internal resources (in the REST sense) from Business Suite systems. However, it doesn’t provide any tools for building OData representations by composing or re-composing existing data from multiple systems, or even from multiple different BOR objects, into a new aggregate representation. Essentially, anything which isn’t a subset of a single BAPI return requires custom ABAP code to be written.

In a central, stand-alone installation as shown on conceptual architecture diagrams like the one above, this ABAP code would have to get data from the various underlying sources from which the single exposed OData resource is composed from. How would this work? Gateway doesn’t (yet) provide any mechanisms for consuming SOAP enterprise services and only relies on RFC calls. Not nice. In order to call SOAP web services, I would have to write custom code to aggregate the returns of multiple calls to ABAP consumer proxies into something the Gateway runtime can then transform into OData. So lots of "glue code". Of course, anything is possible using custom code, but I would expect some actual tooling here if the vision of a central, stand-alone Gateway deployment is to be realised. Middleware systems like PI do provide such tooling and don't require developers to write lots of mundane glue code...

This leads me to conclude that a single, detached layer of Gateway composing OData resources from a variety of backends is essentially wishful future-state thinking rather than something which customers can adopt right now using Gateway 2.0 and without much fuss and coding. I do have some ideas on what I’d love to see in Gateway 3.0, but that’s the subject of a future blog...

 

Efficiency wins!

One of the appeals of designing APIs in accordance with REST principles is their greater simplicity compared to SOAP and the associated WS-* mess. To me, any kind of “application gateway”-style translation or bridging – such as building up a RESTful representation by making 3 SOAP/RFC calls to the same backend – negates a lot of the efficiency benefits of REST. One could even argue that it makes things worse by adding another layer of complexity/failure.

 

When all else fails...

Security, rate-limiting and auditing benefits of a stand-alone instance are pretty weak arguments here as well. Maybe I’m being cynical here, but I only ever see these come up once all other arguments have been exhausted.

I struggle to see customers exposing any ABAP stack to the Internet without some kind of application gateway or reverse proxy in front of it. Once you have that layer, the security arguments espoused in the admin guide become moot. Those specialised tools are much better at security, auditing and rate limiting than Gateway or any other general-purpose system is ever going to be. It’s their bread and butter after all! Specialist vendors like apigee, Layer7 or Mashery offer API gateway products with very impressive features around load balancing, throttling, DoS protection, SLA enforcement and versioning of Internet-facing APIs. Companies are likely to want only one such API gateway because there are economies of scale here. And since they will likely want to provide APIs from non-SAP systems as well, using Gateway for this role does not seem attractive.

 

Go for the simple option!

So in my mind, installing Gateway on each Business Suite system is preferable as it is the simplest option and provides some advantages over a stand-alone deployment.

Companies with multiple systems such as CRM, ECC and SRM may end up with multiple Gateway installs. But because Gateway is pretty painless to install and configure and essentially runs itself, this should not cause any discomfort.

If there ever is a requirement for a stand-alone instance, and the product has some decent tooling which makes such a thing worthwhile, then this can always be retrofitted to result in a hybrid landscape. Nothing wrong with that. In my mind, that is no different to modern SOA deployment architectures, whereby most systems have SOAP stacks which may (or may not, depending on your beliefs) be supplemented with a central SOAP stack in the form of an ESB.

 

...but it depends...

One big hurdle right now is the fairly demanding version requirements. Unless you’re running NetWeaver 7.02 SP7 or later in your Business Suite system, an integrated install is a non-starter. However I am sure this will change for the better; it was mentioned in passing at TechEd that Gateway is planned to be on its own release track in the future and this could improve the situation, or (fingers crossed!) even result in it becoming available for older releases?

If you must have NetWeaver Gateway right now and your Business Suite does not meet the version requirements, then a stand-alone install on a small ABAP stack is always an option, and it’s great that SAP have provided a choice here. However, I would only ever regard this as a tactical solution.

The above does not apply to the Sybase Unwired Platform in my mind. SUP is a much more complex (read fully-featured) product with its own architecture, persistence, management mechanisms, etc. and is not closely coupled to any backend implementation in the same way NetWeaver Gateway is. In my opinion, SUP is well deserving of its own installation, and I can see a single instance serving all connected mobile devices and backends.

Thanks are also due to my colleagues John Moy (@jhmoy) and Jacek Klatt (@yatzeck) for being passionate and knowledgeable discussion partners in an email exchange of views on John Appleby’s tweet which ultimately led to this blog.

Filter Blog

By author:
By date: By tag: