cancel
Showing results for 
Search instead for 
Did you mean: 

HTTP adapter as receiver to POST name-value pairs - How to?

Former Member
0 Kudos

Hi,

Scenario: HTTP Sender <> XI <> HTTP receiver (Sync throughout; no BPM)

In this scenario, a HTTP channel is configured to the target URL to post data.

The message mapping results in a XML. HTTP posts the same XML to the target URL.

However,the target URL expects data Posted as name-value pairs.

eg. eid=45678&zip=11011&ename=Tom%20Lee

How can we configure HTTP adapter channel to post XML data as

name-value pairs (as in standard HTTP Form Post)?

Any pointers?

thanx,

Pops

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi Pops,

I am also looking for the same kind of solution to the above requirement. Kindly provide way to achieve the requirement using Java Mapping as you have said in this post. I wish to try out the Java Mapping method first for this.

Regards,

S.Santhosh Kumar

Former Member
0 Kudos

Hi Pops,

Did you find any other way for configuring the HTTP Adapter channel for posting name-value pairs without using the Java Mapping program? I am in the same situation and I wanted to make sure if there are any other solutions, before I create the Java Mapping program for doing that.

Thanks,

Hashim

Former Member
0 Kudos

Hi All,

<b><u>Note</u></b>:

In my solution mentioned above (Java mapping) note the following:

When the XML is converted into name-value pairs, the output string looks like:

eg., eid=45678&ename=Tom Lee&zip=11011

To encode the space in "Tom Lee", using URL escaping in HTTP channel is not a choice.

It doesnot solve the problem. It will encode the whole output including the '&' and '=' signs, which should not be encoded.

So, within the Java mapping itself, the names & values have to be URL-encoded and then added by '&' to form the output string. And it should look like:

eg. eid=45678&ename=Tom%20Lee&zip=11011

--- Pops

Former Member
0 Kudos

What woudl be the configuration of HTTP receiver adaptor in this kind of situation. I added some strings to the Prologue section of the receiver adapter but does not seem to work.

http://help.sap.com/saphelp_erp2005/helpdata/en/44/79973cc73af456e10000000a114084/content.htm

I just need to ge the XML body in cmxl = {whole xml body}

does not work..any help would be highly appreciated

Former Member
0 Kudos

Hi Udo,

I currently have a solution (simpler than having a BP), but do not expect it to be the right way of doing.

I am using Java Mapping to convert the XML structure into Name-Value pair. So the output of Mapping is a string like how HTTP post is expected. So the interface mapping having multiple mappings - firstly, the original Message mapping, and then the Java mapping to do the conversion. So, with a small extension, the solution is still kept simple.

However, I thought the POST requirement to HTTP URLs would be a common requirement, and expected the HTTP adapter doing this conversion. So, I am still looking for a straight solution (without any custom extensions).

Any one else faced this situation?

Can't this be handled by HTTP Adapter?

-- Pops V

udo_martens
Active Contributor
0 Kudos

Hi Pops (funny name ),

just a idea:

Take a Busines Process, where u call a transform step. Inside the inteface mapping u call a abap mapping, where u implement interface cl_http_client. So u can use WAS functionality and send a request in the form u like.

HTTP (sync) <-> BP

BP: transform (syncABAP request <-> HTTP receiver)

I think, that will work. I already implemented all single steps. But, of course, it s complex and may be there is an easier way.

Regards,

Udo