Skip to Content
author's profile photo
Former Member

PI - HTTP receiver and REST Web service

Hi,

i have customer which is using simple REST webservices. As there are many, we are considering using HTTP adapter, let's say Proxy-to-HTTP scenarios. Customer has some simple web service which expects HTTP GET with parameter in URL or POST with some data in Body of HTTP protocol. Parameter is simple, date and url looks like server.domain.hr/some_path/?date=29.04.2011

With help of prolog(hardcoded) i got following HTTP protocol:

POST / HTTP/1.0
content-type: text/plain; charset=iso-8859-2
content-length: 152
connection: close
accept: */*
user-agent: SAP NetWeaver Application Server (1.0;711)
host: 10.3.64.75:8080
accept-encoding: gzip

&datum=28.04.2011<?xml version="1.0" encoding="iso-8859-2"?>
<ns0:DatumStr_Req xmlns:ns0="urn:xxx.hr:Proxy_to_HTTP">?datum=28.04.2011</ns0:DatumStr_Req>

Customer is claiming that this should work, only not to send XML in body, means only "&datum=28.04.2011" or use

HTTP GET with parameter &datum=28.04.2011.

My question is, is this doobale in SAP PI with help of HTTP and which way is better?

Also, is there any parameter in which can I with help of DynamicConfiguration change Prolog and/OR Epilog?

Also how to send empty message , because then it would work, according to customer.

thx

Edited by: Mario Slopar on Apr 29, 2011 7:15 PM

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    Posted on May 02, 2011 at 01:51 AM

    Hello,

    Had a scenario that is very similar to yours. But the one that was used for us was that we are connecting to a jsp page that uses rest webservices.

    Customer has some simple web service which expects HTTP GET with parameter in URL or POST with some data in Body of HTTP protocol. Parameter is simple, date and url looks like server.domain.hr/some_path/?date=29.04.2011

    The get is easier since the parameters are placed in the URL. For POST, what you need to do is to use Java Mapping to generate the HTTP Body (prologpayloadepilog). We did not use the Plain HTTP Adapter because it is not possible to use dynamic values in an HTTP destination. So SOAP Adapter with No SOAP envelope was used.

    With regards to sending an empty message, it is possible to send an empty payload but not an empty HTTP Body.

    Hope this helps,

    Mark

    Add comment
    10|10000 characters needed characters exceeded