XML Serializer modification

I have a client that's calling a web service that I wrote. The
webservice returns a string. The string is actually XML that I'm
creating by serializing an object.

However, they want a response WITHOUT the

<?xml version="1.0"?>

tag at the top. Yes, I know, it's technically not XML at that
point.

Any way to eliminate that when doing the serialization, or do I just
need to strip it out manually?
Larry Bud [ Fr, 11 April 2008 21:44 ] [ ID #1940224 ]

Re: XML Serializer modification

Hi

The XmlWriterSettings class has an OmitXmlDeclaration property. For an
example, check out http://msdn2.microsoft.com/en-us/library/system.xml.xmlwrite rsettings.omitxmldeclaration.aspx

=============
Regards,
Steve
www.stkomp.com

Larry Bud wrote:
> I have a client that's calling a web service that I wrote. The
> webservice returns a string. The string is actually XML that I'm
> creating by serializing an object.
>
> However, they want a response WITHOUT the
>
> <?xml version="1.0"?>
>
> tag at the top. Yes, I know, it's technically not XML at that
> point.
>
> Any way to eliminate that when doing the serialization, or do I just
> need to strip it out manually?
wisccal [ So, 13 April 2008 18:07 ] [ ID #1941491 ]

Re: XML Serializer modification

On Apr 13, 12:07=A0pm, wisc... [at] googlemail.com wrote:
> Hi
>
> The XmlWriterSettings class has an OmitXmlDeclaration property. For an
> example, check outhttp://msdn2.microsoft.com/en-us/library/system.xml.xmlw=
ritersettings...
>
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> Regards,
> Stevewww.stkomp.com
>
>
>
> Larry Bud wrote:
> > I have a client that's calling a web service that I wrote. =A0The
> > webservice returns a string. =A0The string is actually XML that I'm
> > creating by serializing an object.
>
> > However, they want a response WITHOUT the
>
> > <?xml version=3D"1.0"?>
>
> > tag at the top. =A0Yes, I know, it's technically not XML at that
> > point.
>
> > Any way to eliminate that when doing the serialization, or do I just
> > need to strip it out manually?- Hide quoted text -

Thanks, but I'm not using the XML Writer, I'm using Serialization.
Larry Bud [ So, 13 April 2008 19:02 ] [ ID #1941495 ]
Microsoft » microsoft.public.dotnet.framework.aspnet » XML Serializer modification

Vorheriges Thema: inheriting behavior file
Nächstes Thema: ASP Ajax Update Panel