cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic String in URL of Plain HTTP adatper

Former Member
0 Kudos

Hi, buddies.

Recently we are trying to interact with a system by using the GET method of HTTP. Thus the string of URL maybe vary. Can I acheive that in plain http adapter?

Thanks in advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

HI,

i think that should be no problem.

Be sure that the necessary parameters like sendernamespace, interface, service or party, username and password and the servervalues like port, address are used.

What do you think will vary ?

Former Member
0 Kudos

Since we sill use the Get method of HTTP, all the information we send to the external system should be through the URL address.

For instance, if I want to check the information of user userA, the URL gonna be

http://hostname:8000/infoquery?username=userA

if I want to check the information of user userB, the URL gonna be

http://hostname:8000/infoquery?username=userB

My problem is, how can I use the variable string (userA/userB in the above example) in the URL or Http Destination?

Actually I found following information in sap help:

● 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.

The technical names of the fields are:

○ URL: TargetURL

○ HTTP Destination: HTTPDest

But I haven't figured how it works out.

Former Member
0 Kudos

Hello,

Steps..

1. Message Mapping

You need to do Dynamic Configuration.

Use the below code.

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

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

conf.put(key, URL);

return "";

In this URL is the dynamic URL u will be from your mapping..

2. Configure Communication Channel

Pass Addressing Type, Target Host, Service Number

Select Adapter Specific Attributes.

Also choose URL.

This should work.

Regards,