cancel
Showing results for 
Search instead for 
Did you mean: 

HTTP Receiver Adapter : Dynamic URL

Former Member
0 Kudos

Hi,

I have a scenario where I wish to build a dynamic URL for the HTTP Receiver Adapter. The URL will contain a customer number which is present in the mapping.

The help seems to suggest that this is possible :

<i>If you want to use an HTTP destination or URL set by the mapping, set the URL or HTTP Destination indicator. (The indicator displayed depends on the Addressing Type you selected above). If you set the indicator, the URL or HTTP destination set dynamically is called by HTTP.

If the message header does not contain the URL or the HTTP destination, and you have set the Fail If Adapter-Specific Message Attributes Missing indicator, the XI message is set to status System Error. If you do not set the indicator, the URL or HTTP destination defined statically in the communication channel is used.</i>

However, it is not very clear where the URL needs to be set dynamically.

Does anyone know how to achieve this ?

Cheers

Colin.

Accepted Solutions (1)

Accepted Solutions (1)

bhavesh_kantilal
Active Contributor
0 Kudos

Colin,

This can be done using Message Mapping.

Eg coding in this link,

http://help.sap.com/saphelp_nw04/helpdata/en/43/03612cdecc6e76e10000000a422035/content.htm

Let us know if you need any inputs.

Regards,

Bhavesh

former_member206604
Active Contributor
0 Kudos

Hi,

Check out this link

http://help.sap.com/saphelp_nw04/helpdata/en/43/64dbb0af9f30b4e10000000a11466f/content.htm

See the adapter specific message attributes section.

Thanks,

Prakash

Former Member
0 Kudos

Hi,

This is useful as it tells me what needs to be set on the communication channel.

However where is the field TargetURL in the message mapping ? I would not expect it on the payload of the message as this would screw up the HTTP request wouldn't it ?

Help as I am now 99% there thanks to your excellent advice.

Cheers

Colin.

bhavesh_kantilal
Active Contributor
0 Kudos

Colin,

you will have to use this code in your message mapping in any UDF,

DynamicConfiguration conf = (DynamicConfiguration) container

.getTransformationParameters()

.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create(

“http://sap.com/xi/XI/System/Http”,

“TargetURL”);

conf.put(key, <b>"VALUEOFURL"</b>);

Regards,

Bhavesh

Message was edited by: Bhavesh Kantilal

Former Member
0 Kudos

Hi,

But part of the URL is the customer number that is on the HTTPrequest message ?

How do I get hold of this value and include it as part of the URL ?

Cheers

Colin.

former_member206604
Active Contributor
0 Kudos

Hi,

Bhavesh gave you the code using Adater specific message attributes. You can pass the customer number as input to the user defined function and in the target url include customer no where ever you need to do it.

Thanks,

Prakash

Former Member
0 Kudos

Hi,

Pls check the weblog:

/people/william.li/blog/2006/04/18/dynamic-configuration-of-some-communication-channel-parameters-using-message-mapping

Regards,

Bill

deidre_logan
Participant
0 Kudos

hello to all,

We have a unique issue with one of our customers that is limited to 100 character URL. The current url is http://mycompany.com/sap/xi/adapter_plain?namespace=urn%3Agoodyear%2Ecom%3AAIT%3AInventoryCheck&inte...

Is there a way to have a URL like

http://mycompany.com/sap/xi/adapter_plain?namespace=urn%3Agoodyear%2Ecom%3AAIT%3AInventoryCheck

and then somewhere in the process add... &interface=AITInventoryCheck_Abs&service=HTTP_AIT_InvChk&QOS=BE&sap-client=010&sap-language=EN

So the data comes to an F5 through the DMZ to the SAP webdispatcher then to the SAP XI system.

Any ideas if this is possible or how you could start with a shorter URL?

Thanks,

Dede

Former Member
0 Kudos

Dede

Did you ever find a way to setup your dynamic URL?

We had the same issue where we did'nt want our trading partners need tochange the URL to include the service, namespace, and interface in their URL. Plus if the trading partner sends several messages, they need to change the URL for each interface thatthey want to send you via HTTP. We went and copied the HTTP handler , and made a change to read the content of the incoming XML message, and used a custom table to poplulate the service, interface , and namespace. I am interested in any other soulutions around this. We also used the SAP webdispatcher to forward the HTTP request to XI.

So now our trading partners can use a URL like:

http://mycompany/sap/xi/zcontent

our handler does the rest...

deidre_logan
Participant
0 Kudos

We have 2 XI teams one in the US and one in Europe. We have two different solutions. The one solution was to copy the class that is attached to the service in transaction SICF /sap/xi/adapter_plain... that looks up the namespace, interface name and the other parameters that are needed...

The other solution was they wrote a java servlet that process the URL and some information in the header of the XML message that tells if the transaction is an order inquiry, inventory lookup or create order.

I am not sure of more specifics.

Dede

Answers (0)