Quantcast
Channel: Web API
Viewing all articles
Browse latest Browse all 4850

web api 2 removal of schema information from XML

$
0
0

I've added this to my 4.5 web api 2 C# project to use the XMl Serializer.

GlobalConfiguration.Configuration.Formatters.XmlFormatter.UseXmlSerializer = true;

I've added this per another post to clean up my markup (i.e. remove the '<ArrayOf>' tag.

[XmlRoot(ElementName = "Vehicles", Namespace = "")]
public class Vehicles : List<Vehicle> { }

But I wanted to removed the schema information now.

<?xml version="1.0" encoding="utf-8"?><Vehicles xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

Easy way to do it? Thanx.


Viewing all articles
Browse latest Browse all 4850

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>