.NETGURU
Ampersands in the result, xmldatadocument
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.aspnet.webservices.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Post a new message to this list...

David Bartosik MSFT MVP (VIP)
I am returning an XMLDataDocument in my service since my client cannot
consume the dataset. The resulting XML does not replace ampersand characters
in the string values with & - for example -

<field>David & David</field>

The clients parser chokes on that. Is there something I can do with the
XMLDataDocument to replace such characters?

--
David Bartosik - MS MVP
www.publishermvps.com

Reply to this message...
 
    
Steven Cheng[MSFT] (VIP)
Hi David,

As for the XmlDataDocument, generally if you are using .net framework at
both client and serverside, it'll auto escape and descape those characters.
What's the client you used to consume the webservice? In addition, I think
you can try using the CDataSection to wrapper the certain field which may
contain those charaters. We can use the XmlDataDocument's
"CreateCDataSection" method to create a XmlCDataSection and insert into the
document.

#XmlCDataSection Class
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemxmlxmldatadocumentclasstopic.asp

#XmlDocument.CreateCDataSection Method
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemxmlxmldatadocumentclasstopic.asp

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Reply to this message...
 
    
David Bartosik - MSFT MVP (VIP)
The client is using Axis. Java. I tried a typed dataset but they don't seem
to know what they would need to do with that so that's why I'm trying the
XML now. But they now say their parser chokes on any special characters.
Is this your only suggestion ?

--
David Bartosik MS MVP
www.davidbartosik.com
www.barvin.com

"Steven Cheng[MSFT]" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
Steven Cheng[MSFT] (VIP)
Hi David,

As for the special characters, I think it is likely due to the different
implementing on soap message of the axis and .net framework webservice. If
both the client and server use the .net framework the speical characters
will be processed correctly internally. But as for the axis, since it is
not designed right compatible with .net , I think it better to use CData
Section to ensure the text data be escaped.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Reply to this message...
 
    
David Bartosik - MSFT MVP (VIP)
ok, thanx.

--
David Bartosik
Microsoft MVP
www.davidbartosik.com

"Steven Cheng[MSFT]" <Click here to reveal e-mail address> wrote in message
news:Rzkgx%Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
 
System.Xml.XmlCDataSection
System.Xml.XmlDataDocument
System.Xml.XmlDocument




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification