Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / March 2005

Tip: Looking for answers? Try searching our database.

XML Element must have CDATA tages around it.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mike - 04 Mar 2005 18:16 GMT
I am consuming a web service hosted by one of our clients.  One of the
string properties of the object I am creating to pass to their web service
is called CustomerName. The XML they re receiving I just a standatd xml
elemnt:

   <CustomerName>Joe Friday</CustomerName>

The client has told me that the customer name, Joe Firday, needs to have
CDATA tags around it:

   <CustomerName>![CDATA[Joe Friday]]</CustomerName>

How can I get VS.NET 2003 to serialize the customer name in this way?

Thanks in advance.

Mike R
Dan Rogers - 07 Mar 2005 18:47 GMT
Why would they want to do this?  I'd question that practice since there
really is no reason to expect the XML passed to pass non-safe XML.
--------------------
>From: "Mike" <mraeNOSPAM@NOSPAMATALLcalibrus.com>
>Subject: XML Element must have CDATA tages around it.
[quoted text clipped - 7 lines]
>Message-ID: <uviSZZOIFHA.2752@TK2MSFTNGP12.phx.gbl>
>Newsgroups:
microsoft.public.dotnet.framework.aspnet.webservices,microsoft.public.dotnet
.framework.webservices,microsoft.public.webservices
>NNTP-Posting-Host: 206-169-51-163.gen.twtelecom.net 206.169.51.163
>Path:
TK2MSFTNGXA02.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP0
8.phx.gbl!TK2MSFTNGP12.phx.gbl
>Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.webservices:9614
microsoft.public.webservices:2751
microsoft.public.dotnet.framework.aspnet.webservices:28418
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
>
[quoted text clipped - 15 lines]
>
>Mike R
Mike - 08 Mar 2005 17:28 GMT
Thanks for all your help Dan.

The problem I have here is really the client.  They cannot make any changes
to their web service because of their development cycle will push the
project back 3 months.  I'm having to back my code into a poorly designed
and poorly written web service. Their web service was written by hand and is
not compliant. It's too hard to explain everything going on on their side.
That is why I am having so many problems.  This is another example.

The program that is running on their side will crash is it doesn't see CDATA
tags around the customer name.  So in the SOAP message I send them I need
the CDATA tags around customer name.

Thanks,

Mike

> Why would they want to do this?  I'd question that practice since there
> really is no reason to expect the XML passed to pass non-safe XML.
[quoted text clipped - 39 lines]
>>
>>Mike R
Dan Rogers - 08 Mar 2005 20:31 GMT
I suppose you could embed the string CDATA[] around your real customer
name, and strip it off when you see it.
--------------------
>From: "Mike" <mraeNOSPAM@NOSPAMATALLcalibrus.com>
>References: <uviSZZOIFHA.2752@TK2MSFTNGP12.phx.gbl>
<19IWwY0IFHA.3836@TK2MSFTNGXA02.phx.gbl>
>Subject: Re: XML Element must have CDATA tages around it.
>Date: Tue, 8 Mar 2005 10:28:55 -0700
[quoted text clipped - 6 lines]
>Message-ID: <uG6GPRAJFHA.1392@TK2MSFTNGP10.phx.gbl>
>Newsgroups:
microsoft.public.dotnet.framework.aspnet.webservices,microsoft.public.dotnet
framework.webservices
>NNTP-Posting-Host: 206-169-51-163.gen.twtelecom.net 206.169.51.163
>Path:
TK2MSFTNGXA02.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP0
8.phx.gbl!TK2MSFTNGP10.phx.gbl
>Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.webservices:9681
microsoft.public.dotnet.framework.aspnet.webservices:28498
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
>
[quoted text clipped - 29 lines]
>>>Message-ID: <uviSZZOIFHA.2752@TK2MSFTNGP12.phx.gbl>
>>>Newsgroups:

microsoft.public.dotnet.framework.aspnet.webservices,microsoft.public.dotnet
>> framework.webservices,microsoft.public.webservices
>>>NNTP-Posting-Host: 206-169-51-163.gen.twtelecom.net 206.169.51.163
>>>Path:

TK2MSFTNGXA02.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP0
>> 8.phx.gbl!TK2MSFTNGP12.phx.gbl
>>>Xref: TK2MSFTNGXA02.phx.gbl
[quoted text clipped - 20 lines]
>>>
>>>Mike R

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.