Solved

XML escape character (&) in writing web services.

Posted on 2008-06-12
1
1,614 Views
Last Modified: 2008-06-13
Suppose I'm writing a web service:

string TestService()
{
...
}

Currently, a client calling the service will get the result string as (If saving the result string as result.xml and opened in XML browser):
Company & Country

instead of Company & Country.

Do I need to write a line at the end of the service something like this:
RegEx.Replace("&", "&");

What is the best way to deal with the 5 XML escape characters in designing my web services so that my service can be consumed without problems for the web services clients with different platforms?
Thanks!
0
Comment
Question by:heyday2004
1 Comment
 
LVL 18

Accepted Solution

by:
philipjonathan earned 500 total points
ID: 21776312
Check out System.Web.HttpUtility class. There are many useful functions there. It should be HtmlEncode() that you are looking for.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

759 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now