cancel
Showing results for 
Search instead for 
Did you mean: 

Java HTTP receiver with dynamic URL

Former Member
0 Kudos

We are in the planning stages of migrating from dual stack PI 7.0 to single stack PI 7.4. I don't have a PI 7.4 sandbox to play in - so the question.

We currently have an IDOC to HTTP interface where the URL on the HTTP receiver is derived dynamically. The plain HTTP receiver adapter is defined with

AddressingType = HTTP Destination

HTTP Destination = DynamicallySet

We have SM59 destinations defined in the PI ABAP stack. We use a UDF to derive the SM59 destination dynamically and the message is routed to the proper partner destination. The UDF uses DynamicConfiguration, and then sets the HTTP destination in ASMA

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

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

conf.put(key1, httpDest);

With us moving to a single stack Java landscape., we obviously cannot use this same approach since there will no more be a PI ABAP stack. Is there another place these SM59 destinations can be defined which can be accessed by the Java HTTP receiver ? Or would we just have to store the URLs in value mapping or something of that sort and then use dynamic URL in a UDF  ? Thank you for any help

Accepted Solutions (1)

Accepted Solutions (1)

turmoll
Active Contributor
0 Kudos

Hello,

The latter.

You need to use URL but you can set it dynamically.

Regards,

/k

turmoll
Active Contributor
0 Kudos

Actually,

you cannot do it dynamically using HTTP adapter:

but you can use SOAP adapter with "Do not use SOAP Envelope":

which basically will do same trick as HTTP adapter.

Regards,

/k

bhavesh_kantilal
Active Contributor
0 Kudos

Unfortunately I have to agree with Jakub.

Infact even using the SOAP Adapter might not work as as I understand you are setting the HTTP Destination dynamically which means multiple properties including User Name / Password / Authentication details etc are required to be set Dynamically.

The HTTP_AAE adapter does not provide a option to provide a Destination and the URL has to be provided in the channel including any credentials etc.

In your case, as the HostName's will be different I assume the Credentials are also different which means you would need to redesign this Interface. You need multiple Receiver HTTP_AAE channels and accordingly you would need to have multiple inbound Interfaces in the "Receiver Interfaces" to be able to route to different channels. You would need to use a XPATH in your Receiver Interfaces to set the corresponding target Interface etc..

Regards

Bhavesh

Former Member
0 Kudos

Thank you Jakub. I do have another doubt though. Currently the logon credentials for the various sites are stored on the SM59 destination

I understand how to specify the URL dynamically but how does one specify the credentials dynamically ?

Former Member
0 Kudos

You kind of guessed my question, Bhavesh ! Thank you both for your useful suggestions

bhavesh_kantilal
Active Contributor
0 Kudos

Hello Anil,

Do you always use Basic Authentication? If yes, you might have some options to tweak this by adding the Basic Authentication as a Base64 Encoded String into the HTTP Header from the Mapping / ASMA Configuration.

This blog describes this approach that would work even for a receiver SOAP Adapter : 

Basically within your mapping configure the authentication base64 encoded string and then set the same in a ASMA Parameter and set this in XHeaderName1 etc.

It might not be the best solution though and I would ideally prefer to keep the Authentication control within the channel than this approach ..

Regards

Bhavesh

turmoll
Active Contributor
0 Kudos

If you could switch from user authentication to certificate authentication then you could makie it dynamically ... otherwise rather not:

Anyway, you will have to change sth.

/k

bhavesh_kantilal
Active Contributor
0 Kudos

Jakub you are bang on once more

Infact you can use the TAUTH Key to set multiple users and their corresponding password to the SOAP Adapter :

Hello Anil,

So, what does this mean - as long as the user name is different for each URL that is being triggered from the SOAP Adapter with the Do not use SOAP Envelope, a single SOAP Receiver Adapter can be used. For each URL, the corresponding TAuthKey ( UserName ) will need to be set in the PI ASMA UDF..

Regards,

Bhavesh

Answers (0)