cancel
Showing results for 
Search instead for 
Did you mean: 

HTTP adapter - change encoding from UTF-8 to ISO-8859-1

Former Member
0 Kudos

Hi,

I am trying to change the encoding used by the HTTP sender adapter in a scenario.

However, when I enter ISO-8859-1 in the XML Code under XI Payload Manipulation on the comms channel it has no effect - the paylad still shows as UTF-8 in SXI_MONITOR.

Am I missing a step or entering the field incorrectly ??

Thanks

Colin.

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi,

Got sender to change on their side.

stefan_grube
Active Contributor
0 Kudos

Here is a sample XSLT for changing the encoding:

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="ISO-8859-1"/>
<xsl:template match="/">
<xsl:copy-of select="*" />
</xsl:template>
</xsl:stylesheet>

Former Member
0 Kudos

Hi,

From help

Enhancing the Payload

Some external systems, for example, Web servers in marketplaces, can only process data if it is sent as an HTML form using HTTP.

A typical HTML form comprises named fields. When transferring a completed form to the server or a CGI program, the data must be transferred in such a way that the CGI script can recognize the fields that make up the form, and which data was entered in which field.

The plain HTTP adapter constructs this format using a prolog and an epilog. Therefore, there is a particular code method that separates form fields and their data from each other. This code method uses the following rules:

Individual form elements, including their data, are separated from each other by the character &.

The name and data of a form element are separated from each other by an equals sign (=).

Blanks in the entered data (for example, in multiple words) are replaced by a plus sign (+).

All characters with the (enhanced) ASCII values 128 to 255 (hexadecimal 80 to FF) are transcribed using a hexadecimal sequence, beginning with a percentage sign (%) followed by the hexadecimal value of the character (for example, the German umlaut ö in the character set ISO-8859-1 is transcribed as %F6).

All characters that occur in these rules as control characters (&, +, =, and %) are also transcribed hexadecimally in the same way as high value ASCII characters

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

Regards

Chilla

stefan_grube
Active Contributor
0 Kudos

This is not possible. You have to change the encoding with Java Mapping or XSLT mapping. The HTTP adapter does not provide any functionality to change the encoding.

Regards

Stefan

bhavesh_kantilal
Active Contributor
0 Kudos

Hi Stefan,

I just tried posting data with a HTTP Client.

The Source XML had an encoding of "ISO-8859-1" and the message in MONI also retained the same encoding.

I am not sure if i have understood the requirement here or are my answers atleast relevant?

Regards

Bhavesh

stefan_grube
Active Contributor
0 Kudos

Colin talks about "XI Payload Manipulation", so I think he uses a receiver channel, not a sender channel.

In the receicer channel the "XML Code" is just a declaration and does not affect the message.

Regards

Stefan

Former Member
0 Kudos

Hi Stefan,

This is correct - it is a synchronous interface - HTTP adapter is sending a request to a 3rd party application and receiving an HTTP response.

It is in the HTTP response I need to use the other character set as the 3rd party application is not Unicode compliant and uses the character set ISO-8859-1

Is there any way to cope with this ??

Kind regards

Colin.

stefan_grube
Active Contributor
0 Kudos

Hi Colin,

I do not get the point.

Du you want to change the request to ISO-8859-1 or do you want to work with ISO-8859-1 responses? The latter is no problem, when the declaration is correct, the XI converts it correctly to UTF-8 in mapping.

Regards

Stefan

Former Member
0 Kudos

Hi

I want to work with ISO-8859-1 responses.

When I look at the response in the monitor, it is showing encoding as UTF-8 and there are some strange characters showing - Spanish characters are not showing correctly for instance.

Therefore what do I need to do to ensure XI is showing them correctly as currently it is not.

Kind regards

Colin.

stefan_grube
Active Contributor
0 Kudos

Can you explain in detail:

Is the response an XML message?

Is the XML declaration correct ISO-8859-1?

How do the spanish characters look like?

Do you use mapping?

Is there any issue in the sender of the message?

bhavesh_kantilal
Active Contributor
0 Kudos

Colin,

If i got you correct, you are using a Sender HTTP adapter ( basically the HTTP Client ) ,to send data to XI and want the encoding to be "ISO -" , why not make the XML payload in the HTTP Client with the corrssponding encoding?

or have you done this already?

Regards

Bhavesh