on 01-27-2014 11:14 PM
Hi All,
I am working on a HTTP to HTTP scenario. I want to get the 6 parameters present in the source url, source URL is something like:
&service=SERVCE_NAME_OB&namespace=abc%3aabc%3axi%3amm%3alu%3asap_appl%3aFinance%3a100&interface=SAPInvoiceDispaly_SYNC_OB&qos=BE%3fcompanyNo%3d1870022212&senderCompanyNo=1870022212&receiverCompanyNo=1111112270&invoiceNo=BP02014000000002&documentType=1&outputType=1
As you can see that there are 6 parameters companyNo senderCompanyNo receiverCompanyNo invoiceNo documentType outputType.
I have to pass these parameters into target HTTP channel with something like :
I am using dynamic config code to get these 6 parameters in XI. I have already checked on sender channel ASMA, 'Apply URL Parameters'. Below is the code I am using to get 6 parameters:
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey senderCompanyNo = DynamicConfigurationKey.create(
"http://sap.com/xi/XI/System/HTTP","URLParamTwo");
String sCNo = conf.get(senderCompanyNo);
DynamicConfigurationKey receiverCompanyNo = DynamicConfigurationKey.create(
"http://sap.com/xi/XI/System/HTTP","URLParamThree");
String rCNo = conf.get(receiverCompanyNo);
DynamicConfigurationKey invoiceNo = DynamicConfigurationKey.create(
"http://sap.com/xi/XI/System/HTTP","URLParamFour");
String inNo = conf.get(invoiceNo);
DynamicConfigurationKey documentType = DynamicConfigurationKey.create(
"http://sap.com/xi/XI/System/HTTP","URLParamFive");
String dTy = conf.get(documentType);
DynamicConfigurationKey outputType = DynamicConfigurationKey.create(
"http://sap.com/xi/XI/System/HTTP","URLParamSix");
String oTy = conf.get(outputType);
String l_companNo = conf.get(companyNo);
String l_senderCompanyNo = conf.get(senderCompanyNo);
String l_receiverCompanyNo = conf.get(receiverCompanyNo);
String l_invoiceNo = conf.get(invoiceNo);
String l_documentType = conf.get(documentType);
String l_outputType = conf.get(outputType);
String targetURL ="ABCD.com/xyz"
String url = targetURL + cNo + sCNo + rCNo + inNo + dTy +oTy;
DynamicConfigurationKey confkey = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/Http", "TargetURL" );
conf.put( confkey, url );
Problem here is that I am getting only targetURL value when I test end to end, no value for any parameter, it is just null for all the 6 parameters.
Am I doing something wrong here.
Any help would be appreciated.
Thanks,
Ravi.
Hi Ravi - I think you should use UrlParamOne, UrlParamTwo instead of URLParamTwo . I believe they are case sensitive
Sap note : Redirecting...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ravi - What is your PI version?
can you also check if the note is applicable
1101338 - Dynamic configuration of HTTP adapter
Also do you find these values under dynamic configuration in sxmb_moni?
Hi Ravi,
The HTTP parameters technical name are correct, please revert to URLParamOne...URLParamSix
As for the receiver parameters, have you configured your HTTP receiver CC accordingly?
The parameters are needed to be entered in the CC.
Regards,
Mark
Hi Ravi
Make sure that you have checked the ASMA in sender HTTP adapter and provide the name of the URL parameters like below
Also the correct namespace would be
http://sap.com/xi/XI/System/HTTP
DynamicConfigurationKey keyurl =DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/HTTP", "TargetURL");
If you are using Java HTTP adapter, then the target URL will not work because we don't have the option to set the target URL in java HTTP receiver adapter.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Indrajit,
I have exactly set up my config as you have said.
Also, the code for putting traget url is working
DynamicConfigurationKey keyurl =DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/HTTP
", "TargetURL");
only problem is that I do not see 6 parameters. These are appearing as null.
So final target url I get is "ABCD.com/xyznullnullnullnullnullnull.
Hi Ravi
I think I have got the error.
Please change the code in the UDF like below
DynamicConfigurationKey senderCompanyNo = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System","URLParamTwo");
Correct namespace is http://sap.com/xi/XI/System
If u see the header in PI message you will see the correct namespace there for URL parameters
Hi Indrajit,
Sorry but your code was not working. What I found was that the source url was not in correct format so I considered a wrong value as URLParamOne.
So the current status is that I am not able to read out the source url parameters. I have now shortened the code to first make it work for the parameter 1.
But the namespace I can see is http://sap.com/xi/XI/System/HTTP not http://sap.com/xi/XI/System.
Btw, I have tried both the namespace but it does not help.
Code I am using to get it:
companyNo = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/HTTP","UrLParamOne");
String cNo;
try
{
cNo = conf.get(companyNo);
}
catch(Exception e)
{
trace.addDebugMessage("ULR parameter " + " not available. Detailed error message: " + e.getMessage());
cNo = "";
}
Finally I see a value "null" for cNo.
Still not working
Hi Ravi
There is a mistake in the line
companyNo = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/HTTP","UrLParamOne");
Correct one should be
companyNo = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/HTTP","UrlParamOne");
Go to the message monitoring in MONI. Click on the inbound message--->soap header--->dynamic configuration
provide us the screen shot.So that we can see what is coming in the header??
Hi Hareesh,
Thanks for the link. I am using PI 7.3. So the link you gave me does not apply for my system. May be something similar is required for PI 7.3.
I have tried various combination of UrLParamOne but does not work at all. Anyway, I am still doing RnD about it, may be I find a way here. Will post the solution if it works.
Thanks,
Ravi.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.