Quantcast
Channel: SCN : Popular Discussions - SAP Process Orchestration
Viewing all articles
Browse latest Browse all 1306

REST ADAPTER - Dynamic attributes to get XML Input

$
0
0

Hi All,

 

I have an REST<–> PI <–> RFC scenario with a PI 7.4 system. We had a requirement for Exposing the Function module as RESTful service. In that I am using  Synchronous Sender Rest Adapter where I want to give 2 Runtime parameters

(TOKEN, INPUTREQUEST) as input in the URL and the same should pass to RFC and get the response back.

 

 

The sample Request URL will be like:

 

 

http://Host:Port/RESTAdapter/Demo/PO?TOKEN=12345&XMLREQUEST=<?xml version="1.0" encoding="UTF-8" ?>

<Z_Request>

<REGION>ASIA</REGION>

<SOURCE_SYSTEM>PRO</SOURCE_SYSTEM>

<item>

<KOKRS>1000</KOKRS>

<BUKRS>100</BUKRS>

</item>

</Z_Request>

 

Here is the UDF  for getting the inputs from the URL:

 

Map<String, Object> all = container.getInputHeader().getAll();

DynamicConfiguration dynConf = (DynamicConfiguration)all.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create( namespace, attribute);

String xml = dynConf.get(key);

return xml;

 

When we place the URL in Rest Client tool, SAP PI takes the two parameters through GET variable but the value of XMLREQUEST is getting truncated as "<?xml version". We are not able to get the complete xml from "XMLREQUEST" and

pass as an input to RFC.

 

Kindly suggest some ideas/solutions for this issue.

 

Many Thanks,

Ezhil.


Viewing all articles
Browse latest Browse all 1306

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>