cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Configuration is never triggered

0 Kudos

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;


}

Accepted Solutions (0)

Answers (2)

Answers (2)

nageshwar_reddy
Contributor
0 Kudos

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;

0 Kudos

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.

nageshwar_reddy
Contributor
0 Kudos

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.

  1. To process adapter-specific attributes in the message header of the XI message, select Use Adapter-Specific Message Properties and Variable Transport Binding.

    The following attributes are evaluated in the XI message header:

    • Server URL (technical name: TServerLocation)

      You can set the entire URL.

    • Authentication key (technical name: TAuthKey)
    • Proxy URL (technical name: TProxyLocation)
    • Proxy authentication key (technical name: TProxyAuthKey)
    • SOAP action (technical name: THeaderSOAPACTION)
  2. If you want to transfer header fields, select Variable Header.

    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

0 Kudos

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

nageshwar_reddy
Contributor
0 Kudos

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.

0 Kudos

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?

markangelo_dihiansan
Active Contributor
0 Kudos

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

0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

Hi.

Has you checked on SXI_Monitor Pipiline Call Adapter  - SOAP Header -- Dynamic configuration is present.=?

Regards

Lucho.

0 Kudos

Hi Lucho:

Yes I checked sxi_monitor.  Dynamic Configuration Node is missing.  It never shows up.

-Raj