Skip to Content
0
Jan 18, 2019 at 04:07 AM

Unable to retrieve header data in URL to mapping transformation .

1206 Views Last edit May 21, 2020 at 04:42 PM 2 rev

Hi Experts ,

I am trying to retrieve a part of the header in the Iflow . I was able to do that and can see it in my "Header ".

I needed to consume this data in mapping . I did some entries in Content Modifier but no matter how much I try I am not able to :

1. Get the value in my header groovy

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

import com.sap.it.api.mapping.*;

//Add MappingContext as an additional argument to read or set Headers and properties.

def String getHeader1(String header,MappingContext context)

{ String HeaderValue = context.getHeader(CamelHttpQuery);

HeaderValue= HeaderValue.toString();

return HeaderValue; }

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

2. Was planning to use the property groovy , but some how cannot get the data in the exchange properties section so that I can consume it .

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

import com.sap.it.api.mapping.*

def String getProperty(String propertyName,MappingContext context)

{

String PropertyValue= context.getProperty(Prop_propertyName);

PropertyValue= PropertyValue.toString();

return PropertyValue;

}

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

I used the following links for reference , but some how missing something , doing some mistake .

https://answers.sap.com/questions/414765/replacing-header-with-payload-value-using-groovy-s.html

https://answers.sap.com/questions/386514/header-data-from-content-modifier-is-not-passing-a.html

https://archive.sap.com/discussions/message/16812782#16812782

Added pics, can someone help me . Let me know if you have any queries .

Attachments

8.jpg (16.1 kB)
7.jpg (61.5 kB)
6.jpg (57.0 kB)
5.jpg (27.4 kB)
4.jpg (44.7 kB)
3.jpg (28.7 kB)
2.jpg (18.1 kB)
1.jpg (25.4 kB)