Skip to Content
Author's profile photo Alexander Bundschuh

New adapter in SAP Process Integration for consumption and provisioning of REST based services

For those of you who were following our roadmap sessions at teched and other events, you were probably eagerly awaiting this announcement. I am more than happy to tell you that we have finally shipped our own so called REST (Representational State Transfer) adapter with the latest SP of SAP Process Integration / SAP Process Orchestration. The REST adapter has been supported as of 7.31 SP14 / 7.4 SP09.

In a nutshell, the following is supported:

  • Consumption and provisioning of REST based services
  • Default and custom url pattern of http end point for provisioning
  • Basic and client certification based authentication
  • Mapping of REST operations to service interface operations
  • Support for XML and JSON message format
  • JSON to XML conversion
  • Determine channel based on JSON element
  • Limit channel to particular operation
  • Extracting information from url and http operations

For more details about the adapter concept, its capabilities, and how it is configured, refer to the release notes of 7.31 SP14.

Furthermore, we have published a couple of blogs where we describe the concept and configuration along sample use cases, see PI REST Adapter – Blog Overview.

Further features have been shipped with 7.31 SP15 / 7.4 SP10, see also release notes of 7.31 SP15:

  • Logging of raw JSON content before and after conversion
  • Authentication with OAuth 2.0 and SAML Bearer Token profile
  • JSON to XML conversion enhancements to escape invalid XML name and XML name start characters
  • Setting of custom HTTP header elements in REST receiver adapter
  • Custom error handling

The following feature has been shipped with 7.31 SP16 / 7.4 SP11, see release notes of 7.31 SP16:

  • Sender side polling

The following features have been shipped with 7.31 SP17 / 7.4 SP13, see release notes of 7.31 SP17:

  • Namespace support and XML/JSON conversion
  • Further XML/JSON conversion options
  • Support for cross origin resource sharing (CORS)
  • Access Control List (ACL)
  • OAuth 2.0 Native Flow for Concur
  • Support for custom actions for a missing or empty incremental token
  • Custom error handling has been enhanced
  • Custom http header of response

Assigned Tags

      61 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Hareesh Gampa
      Hareesh Gampa

      Most awaited.. Thanks Alex..

      So this adapter only shipped as part of support pack but not like an add-on ?

      Author's profile photo Shabarish Nair
      Shabarish Nair

      Finally 🙂

      Hope this is not a separate licence.

      Author's profile photo Alexander Bundschuh
      Alexander Bundschuh
      Blog Post Author

      Hello Shabarish,

      no additional license is required, it's included in PI/PO license

      Regards

      Alex

      Author's profile photo Jose Nunes
      Jose Nunes

      Great news.

      All I can think of right now is: why it took so long?

      The same happened with B2B add-on and Security add-on, that IMHO, should come out-of-the-box with a middleware like PI/PO.

      Author's profile photo Jacek Kopcinski
      Jacek Kopcinski

      Is it possible to add a custom HTTP Header field to HTTP request in the receiver REST adapter?

      BTW: FAQs about REST adapter (SAP Note 2032345 ) is not released yet,

      Author's profile photo Alexander Bundschuh
      Alexander Bundschuh
      Blog Post Author

      Hi Jacek,

      this is not supported yet, it will come with the next SP

      Alex

      Author's profile photo Former Member
      Former Member

      So it is available the new SP and we can install new SAP PO with this features included?

      regards, it should be helpful in my current project.

      Author's profile photo Former Member
      Former Member

      is there any downport option for this adapter...

      If customer is not using latest version ,but wanted to use this adapter is that not possible ?

      Regards

      Rajesh

      Author's profile photo Alexander Bundschuh
      Alexander Bundschuh
      Blog Post Author

      Hi Rajesh,

      sorry, but there aren't any plans for downporting, you would need to update to the latest SP

      Alex

      Author's profile photo Adam Smith
      Adam Smith

      HI Alexander,

      I've just upgraded our demo system to SP13  a few weeks ago, but I can't choose the WS_AAE adapter in a communication channel.

      The WS_AAE adapter is part sp13 and is not delivered part of a add-on right?Can you tell me which software component it is in? 

      Regards

      Adam

      Author's profile photo Alexander Bundschuh
      Alexander Bundschuh
      Blog Post Author

      Hi Adam,

      have you uploaded the latest adapter metadata after the update?

      The adapter metadata is shipped with the SAP Basis SWCV, and needs to be imported into ESR.

      Alex

      Author's profile photo Adam Smith
      Adam Smith

      HI Alex, The embarrassing answer is no, I must have forgotten to do to that. After having done so the adapter can be selected. 😳

      Thanks

      Adam

      Author's profile photo Former Member
      Former Member

      Thanks for the info Alexander.  We were just about to go out an buy a Rest adapter.  One thing I cant see is available in the options for this REST is "OAuth",  is this available for use in this adapter please?

      Author's profile photo Alexander Bundschuh
      Alexander Bundschuh
      Blog Post Author

      Hi Alex,

      OAuth is on our roadmap, we plan to ship it with 7.31 SP15 / 7.4 SP10, I will update the blog accordingly

      Alex

      Author's profile photo Challa Challa
      Challa Challa

      Hi Alex,

      We have installed 7.31 sps 14 recently. We configured a scenario with rest. What would be the URL construction to test for rest sender?

      Tried the help.sap, But <host>:<port>/RestAdapter/<endpoint name>/. is giving message resource not found.


      Would like to see blogs with use cases of rest.

      Author's profile photo Alexander Bundschuh
      Alexander Bundschuh
      Blog Post Author

      Hi Challa,

      the endpoint starts with http(s)://<host>:<port>/RESTAdapter, the rest of the url path is constructed from what you specify on the Channel Selection tab and the REST Resources tab. Let me explain this by example.

      Assuming you have chosen the Specify Endpoint check box on the channel selection tab, i.e., a custom end point, and have maintained /demo as Endpoint.

      On the REST Resources tab you can maintain an url pattern using placeholder variables. The values of the variables are then stored in dynamic attributes during runtime. For instance, we have chosen the pattern /{service}/{resource}/{id}.

      Then your endpoint may look like

      http(s)://<host>:<port>/RESTAdapter/demo/HR/employee/123

      with service=HR, resource=employee, and id=123

      or

      http(s)://<host>:<port>/RESTAdapter/demo/banking/acount/456

      with service=banking, resource=account, and id=456

      If you don't need the pattern part simply choose /, then you would end up with the url:

      http(s)://<host>:<port>/RESTAdapter/demo

      hope this helps, blogs are still in progress but we try our best to get them published soon

      Alex

      Author's profile photo Challa Challa
      Challa Challa

      Hi Alexander,

      Wer do we  configure Service, Resource and ID. Is it in xi Dynamic attributes?

      Author's profile photo Alexander Bundschuh
      Alexander Bundschuh
      Blog Post Author

      Hi Challa,

      service, resource, and id are variables or placeholders that you set during runtime by specifying the url correspondingly. You can then store those values in adaper specific attributes. We support by default adapter specific attributes to store service, resource, and id because from our experience those are very commonly used for RESTful services. You can also define your own adapter specific attributes. And you can use any other pattern with any arbitrary variables name. Above is just an example.

      Alex

      Author's profile photo Challa Challa
      Challa Challa

      Hi Alexander,

      Thanks. I figured out the issue with url.

      URL should be

      http(s)://<host>:<port>/RESTAdapter  

      Instead of

      http(s)://<host>:<port>/RestAdapter

      Author's profile photo Sandhya Tai
      Sandhya Tai

      Hi Alexander,

      We have a difficulty in sending a payload using using GET method to

      PI, from REST client .

      REST Request URL is:

      http://<host>:<port>/RESTAdapter/MT_Source/Name=4444

      Issue is , we were able to form/Generate URL with dynamic Parameters

      in it . But we are not able to send any data as Payload and it appears

      that the Payload XML is not being generated during testing.

      Below is channel configurations :

      URLParameter.PNG

      In a short description: WE could send URL from REST client, But not

      Payload data and ending up with the mapping error due to request payload is not being sent to PI.

      Could you please help us. Do we need to do any other required configurations to make it work?

      Regards,

      Sandhya.

      Author's profile photo Kiran Sakhardande
      Kiran Sakhardande

      Hi Sandhya,

      Were you able to get it working. We are also trying to use Get to send payload ?

      Thanks,

      Kiran

      Author's profile photo Sandhya Tai
      Sandhya Tai

      Hi Kiran,

      Yes. It got worked out for me.

      To form request payload/To extract data from the URL, needs write a small udf in mapping.

      For Example:

      REST URL:

      http://Hostname:port/RESTAdapter/MT_Source?OneNetID=AAAA

      UDF:

      DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

      DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/REST","OneNetID");

       

      String OneNetId = conf.get(key);

      return OneNetId;

      Regards,

      Sandhya.

      Author's profile photo Kiran Sakhardande
      Kiran Sakhardande

      Thanks Sandhya !!

      We wanted to know that can we use GET and send a JSON request payload with it without using URL parameters ? Similar to the way we do it for POST. Does PI support it ?

      Thanks,

      Kiran

      Author's profile photo Tahir Öz
      Tahir Öz

      Hi Alexander,

      Thanks for the info about the REST.

      We have deployed the adapter succesfully.

      I specified endpoint but when i try to send request. I get "404 not found".

      Is there anything missed ? or Do i need to configure some where else too ?

      Tahir

      Author's profile photo Alexander Bundschuh
      Alexander Bundschuh
      Blog Post Author

      Hi Tahir,

      I guess that you have used the wrong end point URL, see answer to question above

      Alex

      Author's profile photo Tahir Öz
      Tahir Öz

      Hi Alex,

      Thank you that solved my problem.

      Tahir

      Author's profile photo Former Member
      Former Member

      Hi Alexander,

      we have recently upgraded to SP14 and now we can use REST adapter. To work on this,I have started doing one test scenario. I have configured all the parameters and when I try to test this interface,I am getting the below error. Please let me know is this related to deployment issue or some channel configuration issue?

      Error Log Details:

      "Exception caught by adapter framework: HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is not permitted. "

      "Returning to application. Exception: com.sap.engine.interfaces.messaging.api.exception.MessagingException: org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is not permitted. "

      Thanks,

      Leela

      Author's profile photo Former Member
      Former Member

      Hi Leela, where you able to sort out the HIERARCHY_REQUEST_ERR error ?

      I have just configured a scenario and when testing I am getting exactly the same message ? 🙂

      Author's profile photo Rajiv Kurra
      Rajiv Kurra

      HI Agnieszka/Leela,

      I am testing IDOC to REST scenario, I am also getting same HIERARCHY_REQUEST_ERR , please let me know if you already got any solution:

      Error Log Details:

      "Exception caught by adapter framework: HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is not permitted. "

       

      "Returning to application. Exception: com.sap.engine.interfaces.messaging.api.exception.MessagingException: org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is not permitted. "

      Author's profile photo Former Member
      Former Member

      For the HIERARCHY_REQUEST_ERR in REST Adapter, Please check SAP Note 2305614 (https://launchpad.support.sap.com/#/notes/2305614)

      Author's profile photo Ali Ismail
      Ali Ismail

      hello,

       

      but in my scenario i have to check the strip operation outer element, there's another solution ?

       

      Regards.

       

       

       

      Author's profile photo Ali Ismail
      Ali Ismail

      Hi,

       

      but in my scenario i should select the strip operation from message , do you have another solution ?

       

      Regards.

      Author's profile photo Former Member
      Former Member

      Hi Alex,

            Is it available for 7.1 ? if not then what would be the best work around.

      Thanks,

      TA

      Author's profile photo Alexander Bundschuh
      Alexander Bundschuh
      Blog Post Author

      Hello TA,

      it is not supported in lower releases, and we don't have any plans to downport it.

      The solution would be to add a non-central adapter engine of latest release to your existing PI system, and run the REST scenarios there.

      We have just recently changed the SAP note 1916146 (Version interoperability of distributed PI/PO landscapes) which supports this scenario.

      Alex

      Author's profile photo Former Member
      Former Member

      Hello Alex,

      Thanks for your blog.

      For receiver rest adapter i need to generate dynamic URL. How can i use xptah expression or other way?

      Nurhan

      Author's profile photo Alexander Bundschuh
      Alexander Bundschuh
      Blog Post Author

      Hi Nurhan,

      check out the blog series that we have just published on SCN.

      http://scn.sap.com/docs/DOC-60854

      It describes along sample scenarios the various capabilities of the REST adapter. Your specific question should be answered here:

      http://scn.sap.com/docs/DOC-60856

      Alex

      Author's profile photo Former Member
      Former Member

      Thank you Alex

      Author's profile photo FAZIL KURUCU
      FAZIL KURUCU

      Hi Alex,

      I updated my nw system, nw7.4 sp5 to nw 7.4 sp9. But i can't see rest adapder in Integration Builder.  What is the issue i don't now please help.

      Author's profile photo Alexander Bundschuh
      Alexander Bundschuh
      Blog Post Author

      Hi Fazil,

      I would guess that you have forgotten to import the latest adapter metadata, see my comment above to Adam

      Alex

      Author's profile photo FAZIL KURUCU
      FAZIL KURUCU

      Thank you Alex,

      I didn't realize...

      Author's profile photo Former Member
      Former Member

      Hi Alex

      Currently we have both Odata and REST adapter.

      Instead of Odata adapter i can also use REST Adapter to get data from ODATA exposed using netweaver Gateway on ECC.

      PLease correct me if my understanding is wrong .

      Regards

      Sandeep

      Author's profile photo Alexander Bundschuh
      Alexander Bundschuh
      Blog Post Author

      Hi Sandeep,

      might be possible although I wonder if this really would make sense

      Alex

      Author's profile photo Former Member
      Former Member

      Hi Alex,

      Great news. How does the authentication setting work for the REST sender channels? I assume that client certificate authentication works for the REST sender if the Authentication Policy Configuration in NWA is set for ClientCertLoginModule - but it is not possible to increase the minimum authentication level for a specific REST sender channel, for example in order to block for Basic Authentication (like in the SOAP sender channels).

      Are these assumptions correct?

      Also, will the access to PO provided REST services using the REST adapter support the 'Assigned User' check in the Integrated Configurations?

      /wp-content/uploads/2015/01/2015_01_06_100540_619314.jpg

      I have not had a chance to test yet, since our upgrade to 7.4 SP9 is planned end of month.

      Thanks,

      Emil

      Author's profile photo IDC PI Team PI team
      IDC PI Team PI team

      HI Alex,

      I am not able to find the Software component in Service Market Place to deploy the REST adapter. We have already already upgraded our PI 7.31 system to SP 14. Can you please help with the path?

      Author's profile photo Alexander Bundschuh
      Alexander Bundschuh
      Blog Post Author

      The REST adapter automatically comes with the update to SP14 of 7.31, no further deployment required. If you cannot see it in the list of adapters when maintaining a channel, most likely you have missed to import the latest SWCV SAP BASIS to ESR to update the adapter metadata.

      Alex

      Author's profile photo Praveen Varriam
      Praveen Varriam

      Hi Alex,

      We have recently added support pack SP10 to our PI 7.4 box.

      Currently we have SalesForce application integration in the landscape and looking to explore the PI REST Adapter with OAuth features. It would be great if you share some tips to handle the same.

      Right now I am trying ECC -->PI-->Salesforce[REST Api].

      How to build the OAuth feature in PI REST Adapter?

      Thanks!

      Praveen

      Author's profile photo Alexander Bundschuh
      Alexander Bundschuh
      Blog Post Author

      Hi Praveen,

      for integration with Salesforce I would refer to a partner solution

      Salesforce.com-Adapter | SFDC-Adapter | itelligence Deutschland

      Alex

      Author's profile photo Praveen Varriam
      Praveen Varriam

      Hi Alex,

      Thanks for your reply and suggestions.

      I was looking for option to leverage SAP own developed REST adapter for cloud based applications integration and thus to lower TCO and 3rd party dependency.

      If we have the OAuth and SAML Bearer authentication features in PI REST adapter, I think most of the cloud based apps could be connected.

      Some of the other leading middleware tool in the market is using CastIron or Mule or Apigee to connect cloud based apps which actually brings additional layer of monitoring & maintenance.

      I am trying to place PI as single tool which can do every type of integration features in single box.

      I would like to hear from you on the latest features which SAP promised to release in SP10 for REST adapter. We have the PI 7.4 SP10 in our landscape and looking for the latest features.

      Please let me know.

      Thanks!

      Praveen

      Author's profile photo Vikas Kaul
      Vikas Kaul

      Can i use REST adapter with PI 7.4 (Dual Stack) also?

      Author's profile photo Alexander Bundschuh
      Alexander Bundschuh
      Blog Post Author

      Hi Vikas,

      sure, the REST adapter runs on an adapter engine and hence on a PI dual stack as well

      Alex

      Author's profile photo Peter Chezowitch
      Peter Chezowitch

      How can we secure REST sender channels? We are on a PO 7.4 SP10 but I cannot find any setting in order to require authentication from the client.

      In fact I can just call PUT/POST/DELETE services from Postman plugin and it does not require any form of authentication with the standard settings.

      Author's profile photo Alexander Bundschuh
      Alexander Bundschuh
      Blog Post Author

      Hi Peter,

      it definitely requires authentication, either basic or client certification, you cannot send a message to a REST endpoint without having authenticated. If you use a plugin in your browser to test RESTful services, I guess that in your very first call you were asked to provide authentication, and now your credentials may be cached.

      Alex

      Author's profile photo Former Member
      Former Member

      Hi,

      Firstly, thank you for your very nice pi rest adapter concept blog series.

      I've read your series, some discussions like that

      Thereupon, i also started a discussion on this issue. Plz have a look at that

      Not still sure/aware to make it feasible and how to.

      We have PI 7.4 SP9. Which strategy should i follow about oauth2 authentication implementation?

      Regards

      Author's profile photo Former Member
      Former Member

      Hi Alexander,

      We came across a problem when using the REST Adapter with modern web services that send gzip compressed data.

      It seem that the REST (sender) adapter is not handling gzip transport compression, even when the http header Content-Encoding: gzip is set by the sender, as per http standard.

      We tried the same with the HTTP adapter, and it is able to handle it and automatically decompresses gzip the payload when it receives a call with the mentioned header set!

      So I wonder if this has been forgotten in the implementation of the REST adapter by SAP. Can that be?

      I also tried to write an adapter module that decompresses the message, but it seems the adapter somehow "corrupts" the binary data it receives, so that decompression fails with "not a gzip string" error (of course we unchecked “Convert to XML” so that the adapter should not try to convert the compressed string – we would do that in the custom module later).

      Thanks,

      Philippe

      Author's profile photo Varun K
      Varun K

      Hi All,

       

      Regarding handling Binary data from Rest adapter refers to the SAP note 2435422 which is for PI 7.5 SP 10. But my PI version is 7.31 SP 19, how do I know that this version supports Binary data ?

       

      Please advise.

       

      Thanks,

      Varun

      Author's profile photo Alexander Bundschuh
      Alexander Bundschuh
      Blog Post Author

      Hi Varun,

      it's only supported in 7.5, we haven't down ported the feature to 7.31 nor do we have any plans to do so, this blog is from 2014, then our code line was 7.31/7.4, nowadays we ship new features in 7.5 only

      Alex

      Author's profile photo Vijay K
      Vijay K

      Hi Alex,

      SAP PI 7.31 i want to add OData adapter. Kindly guide me on this..

      Regards,
      Vijayakumar K

       

      Author's profile photo Alexander Bundschuh
      Alexander Bundschuh
      Blog Post Author

      the OData adapter is part of the connectivity add-on

      check out this note https://launchpad.support.sap.com/#/notes/1961175

       

      Alex

      Author's profile photo Binod Thakur
      Binod Thakur

      Hi Alex,

      I am using 7.40 and Oauth option is available only by SAML Bearer Assertion.

      I don't know how to configure SAML to get oauth token dynamically, even i didn't get any link related to configuration of SAML

       

       

      I have searched so many thing but i didn't get answer anywhere.

      Please suggest me.

      Author's profile photo Rajesh PS
      Rajesh PS

      Hello

      Please suggest. Many Thanks!

       

      https://answers.sap.com/questions/12882619/how-to-store-and-retrieve-oauth-tokens-in-sap-po.html

      Author's profile photo k laxman
      k laxman

      HI experst,

      I need help from you regarding

      passing a parameter value from payload to the target URL for rest receiver channel get operation. and i am using pi 7.5 v.