Carriage Return in WebMethod parameters

A

Alin Popovici

Hi!

I have this 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
 
J

Jan Tielens

I've experienced this problem too, and it's posted in the newsgroups a few
time also. The probleem seems to be the \r\n sequence changes when a string
is serialized to xml and back. The only solution I've seen is to replace the
carriage return when receiving the parameter with the proper \r\n sequence.

--
Greetz

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

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,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top