cancel
Showing results for 
Search instead for 
Did you mean: 

RFC to HTTP Synchronous Interface with URL parameters

Former Member
0 Kudos

HI All,

I'm creating one interface of RFC to HTTP wherein I have to pass two parameters in API format only as below,

http://sumone.com/dacx/sumthng?command=single&data={"number":"8800229729","apiKey":"pmgxuoro0qriu","categories":["isCallOk"]}

OR
http://sumone.com/dacx/sumthng?command=multi&data={"number":["8800229723","8800229723"] ,"apiKey":"pmgxuoro0qriu","categories":["isCallOk"]}

But this HTTP link/API gives below response when entered into the browser,
For 1st API with command=single,
{"status":"OK","number":"8800229729","call":"OK"}
OR
{"status":"OK","number":"8800229729","call":"NOT_OK"}
OR
{"status":"NOT_OK","errorReason":"Invalid Api Key","errorCode":5}

For 2nd API with command=multi,
{"status":"OK","beans":[{"status":"OK","number":"8800229723","call":"OK"},{"status":"OK","number":"8800229724","call":"OK"}]}

OR

{"status":"NOT_OK","errorReason":"Invalid Api Key","errorCode":5}

Can this response be captured in SAP PI Netweaver 7.3?
How to tackle/capture this kind of response which is not in XML format? What adapters/java mapping I have to use?

How will I design and configure this whole scenario?

I can create the request with sender adapter-RFC and receiver adapter-HTTP with below UDF/java mapping.

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

DynamicConfigurationKey parmValue;

// TargetURL

parmValue = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/HTTP", "TargetURL");

conf.put(parmValue, url);

// URL Parameters

parmValue = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/HTTP", "UrlParamOne");

conf.put(parmValue, command);

parmValue = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/HTTP", "UrlParamTwo");

conf.put(parmValue, data);

return "";

Is this correct for creating HTTP request with URL patameters?


Kindly guide me at the earliest.

Regards,

Amit Patil

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi All,

Any update on how to configure such scenario?

Regards,

Amit Patil