cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Header Configuration

Former Member
0 Kudos

Hi,

I am having a requirement in which, based on the value of a source node I need to decide what the destination address should be.

E.g.: If source node, Name = sap01, then my message should reach the target with url as http://sap01/Storage/Upload.asmx

In this manner there would be two more conditions. This logic has to be implemented using a DynamicHeaderConfiguration in a mapping.

This is to be used on a SOAP receiver side in SAP-PI.

Please provide pointers on how to solve this.

Thanks,

Abhishek.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

Why dont you create multiple channels with the URL's and then use the conditional receiver determination.

In Mapping you can set the Header.

DynamicConfigurationKey keyHeader1 = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/HTTP", "HeaderFieldOne");

conf.put(keyHeader1, a);

and enable the http header fields in receiver soap

Thanks

Gaurav

former_member200962
Active Contributor
0 Kudos

Hi,

Can you please explain it in more detailed manner. I am totally new to this concept (DynamicHeaderConfiguration)...is there any example that you can provide?

One more doubt...can a single receiver CC be used?...because at present there are only three receivers but there can be a increase in the no. of receivers...

Thanks,

Abhishek.

Edited by: abhishek salvi on Nov 14, 2008 10:31 AM

Former Member
0 Kudos

HI

Check these. it will help

Let us know in case of problems

Thanks

Gaurav

Answers (1)

Answers (1)

former_member200962
Active Contributor
0 Kudos

Hi,

In this scenario it is expected that I achieve the logic in the mapping itself and that there is no need of implementation of any adapter module in the CC (confused with this part).

I have written an UDF to extract the Server name:

DynamicConfiguration conf = (DynamicConfiguration) map.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/SOAP", "TServerLocation");

 serverName = (String) conf.get(key);

return serverName;

Now my question is how to implement the part:

1) If Server name = sap01 then message should be sent to url = http://sap01/sdn/forum/exchange.asmx

2) If Server name = sap02 then message should be sent to url = http://sap02/sdn/forum/exchange.asmx

3) If Server name = sap02 then message should be sent to url = http://sap03/sdn/forum/exchange.asmx

I am using a SOAP receiver adapter; SAP PI 7.1

Thanks,

Abhishek