XML Element must have CDATA tages around it.

Discussion in 'ASP .Net Web Services' started by Mike, Mar 4, 2005.

  1. Mike

    Mike Guest

    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
    Mike, Mar 4, 2005
    #1
    1. Advertising

  2. Mike

    Dan Rogers Guest

    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" <>
    >Subject: XML Element must have CDATA tages around it.
    >Date: Fri, 4 Mar 2005 11:16:53 -0700
    >Lines: 19
    >X-Priority: 3
    >X-MSMail-Priority: Normal
    >X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
    >X-RFC2646: Format=Flowed; Original
    >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
    >Message-ID: <>
    >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
    >
    >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, Mar 7, 2005
    #2
    1. Advertising

  3. Mike

    Mike Guest

    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



    "Dan Rogers" <> wrote in message
    news:...
    > 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" <>
    >>Subject: XML Element must have CDATA tages around it.
    >>Date: Fri, 4 Mar 2005 11:16:53 -0700
    >>Lines: 19
    >>X-Priority: 3
    >>X-MSMail-Priority: Normal
    >>X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
    >>X-RFC2646: Format=Flowed; Original
    >>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
    >>Message-ID: <>
    >>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
    >>
    >>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
    >>
    >>
    >>

    >
    Mike, Mar 8, 2005
    #3
  4. Mike

    Dan Rogers Guest

    I suppose you could embed the string CDATA[] around your real customer
    name, and strip it off when you see it.
    --------------------
    >From: "Mike" <>
    >References: <>

    <>
    >Subject: Re: XML Element must have CDATA tages around it.
    >Date: Tue, 8 Mar 2005 10:28:55 -0700
    >Lines: 70
    >X-Priority: 3
    >X-MSMail-Priority: Normal
    >X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
    >X-RFC2646: Format=Flowed; Original
    >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
    >Message-ID: <>
    >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
    >
    >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
    >
    >
    >
    >"Dan Rogers" <> wrote in message
    >news:...
    >> 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" <>
    >>>Subject: XML Element must have CDATA tages around it.
    >>>Date: Fri, 4 Mar 2005 11:16:53 -0700
    >>>Lines: 19
    >>>X-Priority: 3
    >>>X-MSMail-Priority: Normal
    >>>X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
    >>>X-RFC2646: Format=Flowed; Original
    >>>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
    >>>Message-ID: <>
    >>>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
    >>>
    >>>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, Mar 8, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Davison
    Replies:
    1
    Views:
    580
    Hal Rosser
    Jul 7, 2004
  2. Replies:
    3
    Views:
    747
    Joe Kesselman
    Mar 6, 2006
  3. Network/Software Buyer
    Replies:
    0
    Views:
    412
    Network/Software Buyer
    May 23, 2010
  4. c676228
    Replies:
    11
    Views:
    901
    Jesse
    Mar 24, 2010
  5. doug
    Replies:
    2
    Views:
    255
Loading...

Share This Page