cancel
Showing results for 
Search instead for 
Did you mean: 

HTTP Adapter and outputting plain text message

Former Member
0 Kudos

Hi,

I've looked in various threads and wonder whether XI can actually do this.....

I want to send a plain text stream (actually multipart HTTP request message) to a remote server. No XML tags. Text would be something like this:-

BOUNDARY

Content-type: xxxxxx.......

Content-length: nnnn

xxxxxxxx..........data body........xxxxxx

BOUNDARY

I have the feeling that anything I do using the XI HTTP adapter will have the message wrapped in XML tags.

Can it be done or should I look elsewhere / write a program?

Many Thanks, Andy Tinsley

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Andy !!

Maybe you will need to develop your own Java Proxy Server, that is, define the interface message for the inbound message (the one that goes from XI to outside) and use the generate java proxy option to have the template for your development. There you should implement the method that received the message as parameter and use your own code the access the HTTP destination and do the post.

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d06315a6-e66e-2910-039c-ba8bbbd2...

Another idea could be to use the StrictXml2PlainBean adapter module to convert XML to Plain text inside the adapter.

http://help.sap.com/saphelp_nw04/helpdata/en/82/f4993c03e0cd37e10000000a11405a/content.htm

http://help.sap.com/saphelp_nw04/helpdata/en/44/748d595dab6fb5e10000000a155369/frameset.htm

Regards,

Matias.

ps: please award points if helpful.

Answers (3)

Answers (3)

Former Member
0 Kudos

My problem does seem to be Unicode related. If I use an ABAP to read the data in Binary mode, create the Body of the request in binary mode and then Send it (HTTP Post) things work!

Former Member
0 Kudos

Hi,

Sadly the XI HTTP Adapter does not have a 'modules' tab (it is greyed out). This is different from the File Adapter which does allow modules. I think this is correct.

Meanwhile, I have also been trying to code using an ABAP and the IF_HTTP_CLIENT/REQUEST/RESPONSE objects. This has been quite successful, but I can't see how to switch off some of the automatically added header items i.e. 'user-agent' and 'sap-language'. There is the 'DELETE_HEADER_FIELDS' method, but you can't delete what isn't set up (some of these fields appear to be setup during the actual execution of the SEND method itself).

POST http://www.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx HTTP/1.1

Content-Type: multipart/mixed; boundary=ejjeeffe0

Content-Length: 1075

user-agent: SAP Web Application Server (1.0;700)

host: www.xxxxxxxx.com

sap-language: E

Also, it would be nice to understand where the 'ejjeeffe0' value for the Boundary is generated, as I would like to overide it.

Any ideas?

Regards, Andy

Former Member
0 Kudos

Hi Matias,

Thanks, but being an ABAP rather than a JAVA guy, I'd prefer an ABAP solution. I had not noticed the bit of text in the Help "However, using the plain HTTP adapter you can also send and receive data in HTML and ASCII. In this case you must use a Java mapping". I wonder if an ABAP mapping can help or whether I should try using a free-standing ABAP and try to call an HTTP function module (like is mentioned in another SDN thread). Ideally, I'd just like to use proper XI - if only it was possible.

I wonder what other possibilities there might be?

Regards, Andy

Former Member
0 Kudos

Hi Andy !

I think that you can use the StrictXml2PlainBean adapter module in the "Module" tab of the HTTP receiver adapter in the communication channel.

Check the reference help:

http://help.sap.com/saphelp_nw04s/helpdata/en/44/748d595dab6fb5e10000000a155369/content.htm

and also this blog as a reference, for the part of the StrictXML2PlainBean usage.

/people/stefan.grube/blog/2007/02/20/working-with-the-payloadzipbean-module-of-the-xi-adapter-framework

This approach does not need any java development.

Regards,

Matias.