cancel
Showing results for 
Search instead for 
Did you mean: 

HTTP adapter URL Parameter

Former Member
0 Kudos

HI we are currently integrating a http to rfc connection with the URL in the format of

http://sdn.sap.com?name=Joe&country=India

we want to pass the url parameters name and country to a rfc in sap but we are having difficulties using the apply URL Parameters on the sender http adapter when it comes to message mapping. can you give a sample xml that will be generated when we received the said URL and how we can map these on the receiver RFC. Thank you in advance'

Accepted Solutions (0)

Answers (1)

Answers (1)

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

we want to pass the url parameters name and country to a rfc in sap but we are having difficulties using the apply URL Parameters on the sender http adapter when it comes to message mapping.

You need to tick ASMA and then under apply URL parameters your entry should be like this:


Parameter1       name
Parameter2       country

http://help.sap.com/saphelp_nwpi71/helpdata/EN/43/64db4daf9f30b4e10000000a11466f/content.htm

And then retrieve the name and country via dynamic configuration in message mapping using the technical name specified by SAP Help above


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

DynamicConfigurationKey name = DynamicConfigurationKey.create(
    "http://sap.com/xi/XI/System/HTTP","URLParamOne");
DynamicConfigurationKey country = DynamicConfigurationKey.create(
    "http://sap.com/xi/XI/System/HTTP","URLParamTwo");

String uName = conf.get(name);
String uCountry = conf.get(country);

PS: You cannot test dynamic configuration in ESR. You have to do at least the HTTP to PI testing on your part to see if your config works.

Hope this helps,

Mark

Edited by: Mark Dihiansan on Apr 7, 2011 7:27 AM

Former Member
0 Kudos

how is the name and country declared on the signature variables? and since it already accepts the 2 values (name and country) how can it be mapped on the RFC's name, country fields

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

how is the name and country declared on the signature variables?

In your UDF declaration, choose context type UDF and then use two result lists in your parameters and then map accordingly

e.g


result.addValue(name);
result2.addValue(country);

Hope this helps,

Mark

Former Member
0 Kudos

thank you Mark for the help, but upon testing the UDF and mapping the corresponding results on the RFC we've received the following values on our SAP system,

name = <namespace>http://sap.com/xi/XI/System/HTTP</namespace><name>UrlParamOne</name>

country = <namespace>http://sap.com/xi/XI/System/HTTP</namespace><name>UrlParamTwo</name>

result1.addValue(name) - this is the one that we've appled for the result on UDF

result2.addValue(country) -

what we need is the values for name ie Joe

and country ie India

former_member207622
Contributor
0 Kudos

Hi Angelica

Can you try to access the complete URL by manipulating the code given in this blog

I think you have to access the complete url and then extract the relevant fields

/people/william.li/blog/2007/09/07/posting-and-testing-using-xipi-http-adapter

thanks

ninad

Former Member
0 Kudos

yup have tried that one but we don't have any payload XML since the parameter Values are all on the URL. and I'm wondering how he've set up his sender adapter on the Blog to be able to have the data type with url and parmvalue to have the values from the URL sample he've given <http://nspad391.pal.sap.corp/displayPostData1.asp?firstname=joe&lastname=smith&state=california>

that's why we've set up the sender HTTP adapter with URL parameters for the name and country. When checking the RWB we can see the name and country on UrlParamOne and UrlParamTwo, problem is we cannot map this on just an ordinary message mapping since it is not on te xml body/payload

Edited by: Ma. Angelica A. Estacio on Apr 7, 2011 1:25 PM

former_member207622
Contributor
0 Kudos

I think you can try creating a sender structure which is very ordinary having just a root node and two fields name and country under it ,

Map this structure with your receiver RFC and test end to end

I think it will work , becasue as I see we dont have any specifc sender structure framed for aHTTP sender like JDBC receiver

I hope I got your point

thanks

Ninad

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

The technical names are case sensitive, please use URLParamOne and URLParamTwo instead of UrlParamOne and UrlParamTwo.

Regards,

Mark

Former Member
0 Kudos

@Ninad that's okay if we have a XML payload and it will just pass to the data type structures to the receiver rfc structures, but the problem we have is that the data is on the URL. ex. http://sap.sdn.com?name=joe&country=India.

@Mark you mean on the Java program on the UrlParamOne? the one I've posted is the data I've got when applying the UDF.