Solved

Why does string passed to web service in ASP.NET lose carriage return charcters?

Posted on 2008-06-11
5
279 Views
Last Modified: 2013-11-08
I have a web site written in VB ASP.NET that is consuming a web service on another computer over the internet that I have also writeen in VB ASP.NET. The consuming page sends a string to a service subroutine and the string contains chr(13) & chr(10) sequences to form line breaks in a customer address. The service then calls a SQL stored procedure passing the string. The database only ends up with a char(10) the char(13) being lost somehow.

As a test I created a test service that created a customer record using the same method but created its own test address (i.e. not passed over internet) but using the same stored procedure and same calling routine and the database got both the char(10) and the char(13).

How do I avoid the char(13) being lost when the string is passed to the web service?
0
Comment
Question by:BOIT
  • 3
5 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 21758219
probably because those characters have no representation in HTML. Replace them with <BR>
0
 

Author Comment

by:BOIT
ID: 21758324
No, this is not the problem. The resultant database is being viewed and manipulated by Access not on a web page. The web page is creating the data not viewing it.
0
 
LVL 7

Accepted Solution

by:
Chrisedebo earned 500 total points
ID: 21855351
Web services use XML to transfer data back and forth. The issue could be here. My advice is to check for and add if necessary the chr(13) in the web service after the data has been received but before it's been stored to the db.
0
 

Author Comment

by:BOIT
ID: 21865773
Thanks for the suggestion. I am back on this project in about a week and I will check your suggestion then and get back to you.
0
 

Author Comment

by:BOIT
ID: 22014506
Chrisedebo exactly right the chr(13) seems to be being stripped in the XML.
I inserted code in the web service:

address = replace(address,chr(10),vbcrlf) and then send data to database and all is well.

Thank you for your help.

0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A publishing tool, a Version Control System, or a Collaboration Platform! These can be some of the defining words for the two very famous web-hosting Git repositories: Bitbucket and Github. Git is widely used amongst the programmers and developers f…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This video teaches users how to migrate an existing Wordpress website to a new domain.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question