cancel
Showing results for 
Search instead for 
Did you mean: 

Sender RestAdapter with GET Operation, no data in request payload

Former Member

I just create a sender communication channel with RESTAdapter configured with the operation GET.  I've done everything and moved all the configurations, but I can't get to see the payload in the request and I'm not getting a response message.  I need to set my channel so it can receive a GET request as a REST Service.

I'm using SAP PI 7.4 SP11 and to test the REST Service the Chrome plugin Advanced REST Client

Can somebody help me, or show me an example of how the channel must be configured to make the GET Operation work properly.  Thanks in advance for your help.

This is the Request Datatype

In this tab I matched the datatype field ID, so it can recognize where the data should go

The message mapping shows that we only need that ID as a parameter to the query:

I test this REST Service in the Google Chrome plugin like this:

I get the error InterfaceDetermination did not yield any actual interface, because the message don't get the payload in the request.  How can I fix this?

In the PI Message Monitoring I get this:

The status is Log Version

This is the problem I'm having, I'm not getting the Payload when I use GET Operation (if I try with a different operation like PUT or POST, the payload is shown correctly)

I can see the ID in the message attributes.

If you need more information to review the case, please let me know. Thank you.

Accepted Solutions (1)

Accepted Solutions (1)

vadimklimov
Active Contributor

Hi Manuel,

In the tab "Operation Determination" of REST sender communication channel configuration, fields "Operation" and "Namespace" shall refer to message type name (of a request message type in a respective called service interface operation) and its namespace, correspondingly, and not a service interface name (service operation is determined by a request message type later on by runtime). In your case, value for the field "Operation" shall be MT_RiesgosConsultablesIdReq.

Please also check your mapping: direct 1:1 mapping for the field "id" will not work here since there is no conversion from JSON to XML and payload of an XML document of a source message will not be populated with "id" (it will only contain a root element of a message and child elements - like "id" in your message type - will be missing). To solve this issue, you may retrieve value of a field "id" from corresponding dynamic attribute which is populated by REST adapter. Example of a user defined function coding that can be used to retrieve adapter specific message attribute value and description of how it can be used in a message mapping, can be found in the blog .

Since you don't have a JSON message in a sent REST request, an activated option "Add Wrapper Element" in the tab "General" of a channel configuration, is superfluous here. You may leave it activated, but you can also deactivate it - it shall bring no difference in case of the described interface.

Regards,

Vadim

Former Member
0 Kudos

Thank you very much Vadim, I manage to retrieve the ID parameter using the UDF explained in the link you provided.  I also modify the operation as you told.

Answers (2)

Answers (2)

Former Member

I have the same situation, I can't get the mapping of id data.

vadimklimov
Active Contributor
0 Kudos

Hi Sandra,

Did you use of a custom user defined function / function of a function library for retrieving value of an adapter specific message attribute?

Here is an example of a UDF that can be used:

And a mapping rule that uses it to populate a field "ID":

Parameters for this function are:

  • Attribute name - here, id (assuming, you specified this attribute name in configuration of a REST sender channel - otherwise, adopt accordingly);
  • Attribute namespace - here, http://sap.com/xi/XI/System/REST.

Please refer to a blog - it contains details regarding how this can be implemented.

Regards,

Vadim

Former Member
0 Kudos

Hi Sandra, this dicussion was solved using the advise of , please follow the correct answer marked in this topic.

Former Member
0 Kudos

Thanks a lot Vadim, it works.

former_member186851
Active Contributor
0 Kudos

Hello Manuel,

Remove the SWCV for ICO and test once.

Former Member
0 Kudos

Hi Raghuraman, thank you for your answer.  I tried removing the SWCV in the ICO and it's still the same message.  Do you think it migth be something else?