cancel
Showing results for 
Search instead for 
Did you mean: 

Restful Service

0 Kudos

Hi All,

Below is the interface design steps to be done in PI. Kindly suggest best flow to implement the scenario and the adapter to be used to connect to restservice.

SAP <-> PI <-> RestService

Below are the Mutliple calls to be done in SAP PI 7.3.

  1. SAP/PI requests HTTP POST to http://xxxxx/services/rest/org/venue  
  2. Above Service returns a URL as response like this  http://xxxxxxx/services/rest/org/venue/101497  
  3. SAP/PI requests HTTP GET to the above service (Step 2)
  4. SAP/PI receives back the Response XML of Venue Details.

Response to first step will be as

response_line : HTTP/1.1 201 Created

server_protocol : HTTP/1.1

status_code : 201

status_reason : Created

server : Apache-Coyote/1.1

location : http://xxxxxx/services/rest/org/venue/175150

content-type : application/xml

content-length : 0

date : Fri, 04 Jan 2013 16:58:42 GMT

connection : close

Regards,

Sabitha

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Sabitha,

The KaTe RESTful adapter for PI / slideshare can handle such scenarios (support for resource links, etc)

With best regards

                  Sebastian

markangelo_dihiansan
Active Contributor
0 Kudos

Hello Sabitha,

Below are the Mutliple calls to be done in SAP PI 7.3.

  1. SAP/PI requests HTTP POST to http://xxxxx/services/rest/org/venue  
  2. Above Service returns a URL as response like this  http://xxxxxxx/services/rest/org/venue/101497  
  3. SAP/PI requests HTTP GET to the above service (Step 2)
  4. SAP/PI receives back the Response XML of Venue Details.

You actually have two options:

1. Use two separate synchronous scenarios for the HTTP Post and HTTP Get e.g execute the Post and then if you get a response, then use trigger the HTTP Get.

2. Use just one scenario, you would need to use a Java User-Defined Function to work. For preference, I would choose to use the HTTP Post for the UDF.

Question: Can the HTTP Adapter of 7.3 handle an empty HTTP Body response for the HTTP Post method?

Hope this helps,

Mark

Former Member
0 Kudos
0 Kudos

Hi Beena Thekdi,

I have gone through all the above links.

The scenario here is different from the above. Here we are having two synchronous messages.

Regards,

Sabitha

Former Member
0 Kudos

Hi Sabitha,

As you need to do only GET and POST operations it should be possible to do so by using HTTP/SOAP AXIS adapter:

Please check Q 34 in FAQ note.

Can I send a plain XML message to a REST service? 

See a sample configuration of posting to a REST based service by setting the enableREST context property using MessageContextPropertiesHandler. For calling a REST service using the GET method, the soap12.webmethod property must be set to GET.

Also check below blog

http://scn.sap.com/community/pi-and-soa-middleware/blog/2012/03/07/integrating-rest-services-on-pi

So I think the approach you have mentioned should work. However you will have to use dynamic configuration to set the URL received from POST operation to set it in adapter. Please check this link:

http://help.sap.com/saphelp_nwpi711/helpdata/en/43/64dbb0af9f30b4e10000000a11466f/frameset.htm

Please udpate this thread if this solution works for you. It will be helpful

Thanks,

Beena.

0 Kudos

Hi,

As the dynamic URL configuration is not supporting for HTTP GET method of restservice in PI 7.31.

We are planning to design using JAVAProxy.