cancel
Showing results for 
Search instead for 
Did you mean: 

Changing Content-Type to "Content-Type: "text/xml;charset=utf-8" "

Former Member
0 Kudos

Hi,

I have a problem with the java component of an netweaver2004s system. The system sends xml pages to a non-sap System. In the header the string for the content-Type is: Content-Type: "text/xml;

Unfortunaltelly the receiving system interprets this as US-ASCII.

Does anyone know where I could change this default setting to "Content-Type: "text/xml;charset=utf-8" "

Thanks in advance,

Ulrike

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

The SOAP sender adapter can accept any character encoding supported by the local JDK. When you are using a particular character encoding with content type text/xml, you must make sure that the encoding name given in the content type and in the XML declaration must be consistent. What makes this more complex is that the default values. The default encoding for "text/xml" is US-ASCII, whereas the default encoding for the XML declaration is UTF-8 or UTF-16. The following examples show several valid combinations of content-type and XML declartion:

text/xml

<?xml version='1.0' encoding='us-ascii'?>

text/xml; charset='utf-8'

<?xml version='1.0' encoding='utf-8'?>

text/xml; charset='utf-8'

no declaration

text/xml; charset='iso-8859-1'

<?xml version='1.0' encoding='iso-8859-1'?>

application/xml

<?xml version='1.0' encoding='iso-8859-1'?>

The response message from the SOAP sender is normally encoded in UTF-8. If you want to change this encoding, for instance to iso-8859-1, you can supply the encoding information with the xmlenc variable in the request URL as in:

http://host:port /XISOAPAdapter/MessageServlet?channel=p:s:c&xmlenc=iso-8859-1 .

Also check Note 1309717 - SOAP 1.1 Error Page - Incorrect Content-Type.

Thank you,

Shyam

Former Member
0 Kudos

Dear Shyam,

perhabs I didn't described exactly the background of the problem:

We are using a 7.00 Web AS Java. We got a new service which is not SAP standard but a third party product. This service interacts with a non-SAP server.

The question is:

Do I have to change something on the Web AS in generell, or does this change has to be done in the "coding" of the service.

The result should be, hat in the header of the xml-page the string will be "Content-Type: "text/xml;charset=utf-8" ".

Regards

Ulrike