cancel
Showing results for 
Search instead for 
Did you mean: 

Setting charset for the portal web service response XML

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member97974
Participant
0 Kudos

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

Former Member
0 Kudos

Hello Abhinav

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

Regards

Kalpesh