Skip to Content
avatar image
Former Member

Setting charset for the portal web service response XML

Hello

We have developed a portal service which is exposed as a web service. The web service is being consumed by a .net client. We have some international character data in the EP system, which we are trying to stream across, the issue we are encountering is we are not able to see the international characters in .NET. The characters are encoded to ???.

I captured the SOAP response using web service checker in NWDS, and i am able to see proper data. I searched the net and found out that it may be issue with the content-type header not being set properly. The content-type header i capture is as follows

Content-Type= "text/xml", but it should have been Content-Type="text/xml; charset=UTF-8".

Has anyone come across a similar issue? How do i set the charset part of the Content-Type string in the portal service or do i need to set it at the SAP j2ee engine level.

Any help would be very much appreciated.

Regards

Kalpesh

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Oct 30, 2008 at 02:08 PM

    Hello Kalpesh,

    In SAP you can set the XML header using the following Method,

    CALL METHOD http_client->request->set_header_field

    EXPORTING

    name = 'Content-Type'

    value = 'text/xml; charset=utf-8'.

    With this u will be able to send the relevant encoding.

    Regards,

    Abhinav

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hello Abhinav

      I want to set char set from inside the portal web service, how can i achieve that through code?

      Regards

      Kalpesh