Solved

XML escape character (&) in writing web services.

Posted on 2008-06-12
1
1,648 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

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…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

688 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