Skip to Content
avatar image
Former Member

HTTP Adapter and outputting plain text message

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Feb 01, 2008 at 12:49 PM

    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-ba8bbbd23702

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 01, 2008 at 02:43 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 06, 2008 at 07:58 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 13, 2008 at 10:28 AM

    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!

    Add comment
    10|10000 characters needed characters exceeded