xmlroot

XmlRoot() for Xml Serilization does not work

I'm trying to get my httphandler to print out an XML file with the format: <ScheduledShows> <ScheduledShowElement>...</ScheduledShowElement> <ScheduledShowElement>...</ScheduledShowElement> <ScheduledShowElement>...</ScheduledShowElement> </ScheduledShows> But for some reason, the attribute XmlRoot("ScheduledShowElement") ...

XmlSerializer Deserializing Array/List of Multiple Objects at Root

I'm trying to deserialize the following XML output: <?xml version="1.0" encoding="ISO-8859-1"?> <Foo> <Val>Data1</Val> </Foo> <Foo> <Val>Data2</Val> </Foo> (This is output from a hardware device, and cannot be changed) I have an XML type defined as: [XmlType(AnonymousType=true, Namespace="")] public class Foo { ...

WCF, XmlRoot, and optional parameters

I have a WCF service and cannot use DataContracts since I need more control over the XML received and sent to this service. As such, I use XmlRoot, and XmlElement... the problem I'm running into now is that my class that the receiving xml gets deserialized into and the serialized response both need to have the same root name, and when I ...

Rename serializable class

If i Serializable the following code using XmlSerializer. [XmlRoot("products")] public class Products : List<Product> { } public class Product { } I get the following xml <ArrayOfProduct> <Product/> </ArrayOfProduct> How to i write to get the following naming of the tags (products and lower case product)? <products> <product/>...