Preserving Carriage Return in a Web service

W

Wesley C

I have a web service that keeps converting Carriage
Returns to Line Feeds in my data. I need to preserve
those Carriage Returns. Is there a way to tell the web
service to preserve the white space? It does it when I
send data to a web service and also when I request data
from a web service.

Any help is greatly appreciated.

Wesley
 
J

Jan Tielens

I've encountered this "problem" too, it has to do something with serializing
text into xml (I won't go into details here). Normally the end of the line
is marked by 2 characters (ascii code 10 and 13). When the text is
deserialized from the xml, only one character remains. My solution (it's not
a nice one) is this replace in the string, the left over character with the
2 characters.

Maybe someone else has a better solution?

--
Greetz

Jan Tielens
________________________________
Read my weblog: http://weblogs.asp.net/jan
 
A

Alin Popovici

Hi!

I have the same problem.

I am sending as a parameter for a webmethod a string
containing '\r\n' sequences. For some reason, when I debug
my webmethod, the paramter is received with the carriage
return characters ('\r') stripped. Can someone try this by
creating a simple webmethod that takes a string as a
parameter and returns the same string back. On the client,
create a proxy, call the webmethod and pass: "bla\r\nbla".
If you put a bkpoint inside the webmethod, you will see
the string received does not contain '\r' characters.

[AdvancedDebugging]
I also created a SOAP extension and verified the message
that is received on the server in the AfterDeserialize
stage, and to my surprise, the message contains here the
carriage return characters.

I am using the v1.1.4322 Framework on the client and
server.

Please HELP!

:)

Alin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,983
Messages
2,570,187
Members
46,747
Latest member
jojoBizaroo

Latest Threads

Top