on 07-14-2012 12:06 AM
Hi Experts:
I have written UDF and calling it in message mapping. UDF will construct target URL based on input from abap
program. We are using abap proxy.
I am using SOAP adapter and made all required chnages in communication channel - advanced tab for ASMA & variable
transport binding.
Problem is Dynamic Config is never triggered. All works well if I hardcode url & supply authentication details in
general tab.
Kindly help. Following is UDF code:
try{
DynamicConfiguration conf1 = (DynamicConfiguration) container.getTransformationParameters().get
(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key1 = DynamicConfigurationKey.create( "http:/"+"/sap.com/xi/XI/System/SOAP",
"FnoLocation" );
String link = "http://rnointlicqas1.is.ad.igt.com/flexnet/services/ProductPackagingService?wsdl";
conf1.put(key1, link);
DynamicConfigurationKey key2 = DynamicConfigurationKey.create( "http:/"+"/sap.com/xi/XI/System/SOAP",
"FnoUid" );
String uid = "igtbg";
conf1.put(key2, uid);
return "AllGoodSoFar";
} catch( Exception e) {
String err = e.toString();
return err;
}
What version of PI are you using? Where are you using the UDF? Are you sure it is triggered all the time? To ensure that it is always called you can use the UDF at root element.
If you are trying to set SOAP Target URL, you must set the TServerLocation key. i do not see that you are using that in Dynamic configuration. Similarily for soap action you must use THeaderSOAPACTION key.
To set soap action, you can use the following code. Similarily you can try for target url
// soapAction should be the input to the UDF
DynamicConfiguration conf = (DynamicConfiguration)container.getGlobalContainer().getInputParameters().getValue(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/SOAP","THeaderSOAPACTION");
conf.put(key, soapAction);
return soapAction;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the reply nageshwar.
We are on PI 7.1. Yes, Im calling udf from root level. everything works well if I hardcode url in comm channel (general tab).
I tried TServerLocation many times. Mentioned the same name in Varaible Header (XHeaderName1). I guess it does'nt matter whatever name you give DynamicConfigurationKey.create( , 'whateverName') - I think you have to specify same name in comm channel..is that right?
I am hardocding soap action in general tab of comm channel as the action is always static. hence I am not coding the same in udf.
I tried TServerLocation many times. Mentioned the same name in Varaible Header (XHeaderName1). I guess it does'nt matter whatever name you give DynamicConfigurationKey.create( , 'whateverName') - I think you have to specify same name in comm channel..is that right?
You must use TServerLocation. 'whateverName' will not work. If you fill in TServerLocation adapter knows to use it as Target URL.
Now coming back to UDF calling issue. Please try these:
1. You should add trace information and ensure that UDF is triggered.
2. You should change your code and use the following line to get DynamicConfiguration object. It has changed(do not know the exact version from which it has changed.
DynamicConfiguration conf = (DynamicConfiguration)container.getGlobalContainer().getInputParameters().getValue
(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
Additional details are available @ http://help.sap.com/saphelp_nw73ehp1/helpdata/en/48/327519a3af58d8e10000000a421937/frameset.htm
*--- Extract FYI
Select the Advanced tab page.
The following attributes are evaluated in the XI message header:
Server URL (technical name: TServerLocation)
You can set the entire URL.
The technical names of the fields are XHeaderName1, XHeaderName2, and XHeaderName3.
The parameters are included in the HTTP request under the names specified here.
The attribute namespace for the adapter is http://sap.com/xi/XI/System/SOAP
Nageshwar: thank you for the details.
I tried modifiying conf statement with what you gave. Also modified technical name to TServerLocation and TAuthKey. No Luck yet. Rest all the steps I did exactly the same from day 1.
Problem is I cannot see the node "DynamicConfiguration" in sxi_monitor SOAP Header.
Can you please tell how/ how to add trace messages in UDF & where to check them after call.
Thank you,
Raj
Use the below piece of code.
// get trace objectr using container
AbstractTrace trace = container.getTrace();
// If dynamic configuration object is null, return
if(conf == null){
trace.addInfo(funcName + "Unable to get dynamic configuration. Returning. ");
return soapAction;
}
You can test your message map and you will find the trace information in output window.
Hi Nageshwar:
testing the message map never works from ESR window. Test output window throws Null Pointer Exception. I think because, udf takes container as input param. I think "container" can only be passed when called by XI runtime.
Is there anyway to check the trace msg's after the runtime has completed executing?
Hello,
I tried TServerLocation many times. Mentioned the same name in Variable Header (XHeaderName1).
I guess it does'nt matter whatever name you give DynamicConfigurationKey.create( , 'whateverName') - I think you have to specify same name in comm channel..is that right?
Nope, you do not need to specify it in the comm channel. The XHeaders are used if you an XI Header Field (up to 3) to be seen by the receiving system in their HTTP Header.
As a rule, once you have used dynamic config to build the URL, you also need to place the credentials into the authentication keys (up to 10) and call the authentication key via UDF too(TAuthKey).
What is the error that you are getting by the way?
Hope this helps,
Mark
Mark:
Thanks for the details. I corrected TServerLocation. No Luck yet. I am not sure if that is the real cause of the issue . I just discovered an OSS note: 1470127. I am waiting for my Basis to allow me apply this note. Hopefully this might fix it. Will publish the results after I pursue this route.
thank you,
Raj Chintam
This OSS note is note applicable to us as we are 7.11 SP 07. I just opened a ticket with SAP. lets see thier response.
I had some progress, though. In my current scenario, BPM needs to make 7 SOAP calls to external website. luckily first call is succesful now. PI is able to determine dynamic config. But 2nd call, same old problem - missing SOAP header for dynamic config.
I tried both the following code variants in 2nd call - msg mapping UDF. no luck.
1. DynamicConfiguration conf = (DynamicConfiguration) container.getGlobalContainer().getInputParameters().getValue(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
2. DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
any ideas are appreciated. thanks much.
-Raj
Hi.
Has you checked on SXI_Monitor Pipiline Call Adapter - SOAP Header -- Dynamic configuration is present.=?
Regards
Lucho.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
9 | |
9 | |
7 | |
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.