ThomasSteiner avatar image
0 Votes"
ThomasSteiner asked TheobaldDu-MSFT commented

webHttp request returns double escaped NewLine

I have a WCF-service which returns a string containing NewLines. The service is deployed to azure.

The returned string looks good if I use wsHttp-binding. The NewLine is correctly escaped as '\r\n' and displays with proper line breaks.

If I use the same service via webHttp-binding with WebRequest, the returned string contains double-escaped like '\\r\\n'.

I checked numerous variants of <globalisation> in <system.web> and also in the webHttp-behaviour and its defaultOutgoingResponseFormat.

The same scenario works fine when I deploy it to a onPrem VM.

Thomas Steiner

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @ThomasSteiner, can you provide the implementation code of your Task<string> GetFormattedAddress(string licenseKey, string language) method?

0 Votes 0 ·

The function is: public async Task<string> GetFormattedAddress(string licenseKey, string language)

It returns Address.Name + Environment.NewLine

This is the description in the dataContract:

Task<string> GetFormattedAddress(string licenseKey, string language);

0 Votes 0 ·

Hi @ThomasSteiner , from the information you have given, I cannot reproduce your error. I need your code to implement GetFormattedAddress().

0 Votes 0 ·

0 Answers