on 04-07-2011 4:49 AM
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'
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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
@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.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.