从MVC xml响应中删除默认xsd和xsi命名空间

从MVC xml响应中删除默认xsd和xsi命名空间,xml,asp.net-mvc,xsd,xml-namespaces,xsi,Xml,Asp.net Mvc,Xsd,Xml Namespaces,Xsi,我需要从MVCAPI响应中删除xsd和xsi名称空间,但无法使其正常工作。(我需要删除它们的原因是因为我们正在将其发送给第三方地图提供商,如果包含它们,则无法正常工作。)我阅读了许多其他问题,例如,这些问题问的是完全相同的问题,但答案不起作用,我尝试按照实现自定义格式化程序,但不幸的是,也没有成功。有人知道我需要做什么吗?我应该放弃使用处理器吗 型号: [XmlType(TypeName = "MapPoints")] [XmlRoot(DataType = "", Namespace = "h

我需要从MVCAPI响应中删除xsd和xsi名称空间,但无法使其正常工作。(我需要删除它们的原因是因为我们正在将其发送给第三方地图提供商,如果包含它们,则无法正常工作。)我阅读了许多其他问题,例如,这些问题问的是完全相同的问题,但答案不起作用,我尝试按照实现自定义格式化程序,但不幸的是,也没有成功。有人知道我需要做什么吗?我应该放弃使用处理器吗

型号:

[XmlType(TypeName = "MapPoints")]
[XmlRoot(DataType = "", Namespace = "http://tempuri.org/XMLFile1.xsd")]
public class MapPointList
{
    public MapPointList()
    {
        Points = new List<MapPoint>();
    }

    [XmlElement("Point")]
    public List<MapPoint> Points { get; set; }
}
[XmlType(TypeName=“MapPoints”)]
[XmlRoot(数据类型=”,命名空间=”http://tempuri.org/XMLFile1.xsd")]
公共类映射点列表
{
公共映射点列表()
{
点=新列表();
}
[XmlElement(“点”)]
公共列表点{get;set;}
}
控制器:

    public class MyController : ApiController
{
    public MyController()
    {
        var xmlFormatter = GlobalConfiguration.Configuration.Formatters.XmlFormatter;
        xmlFormatter.SetSerializer<MapPointList>(new XmlSerializer(typeof (MapPointList)));
        xmlFormatter.SetSerializer<MapPoint>(new XmlSerializer(typeof (MapPoint)));
    }

    [HttpGet]
    public MapPointList SearchMap()
    {
        var items = new MapPointList();
        // get the items

        return items;
    }
}
公共类MyController:ApiController
{
公共MyController()
{
var xmlFormatter=GlobalConfiguration.Configuration.Formatters.xmlFormatter;
SetSerializer(新的XmlSerializer(typeof(MapPointList));
SetSerializer(新的XmlSerializer(typeof(MapPoint));
}
[HttpGet]
公共MapPointList SearchMap()
{
var items=new MapPointList();
//拿到物品
退货项目;
}
}
我的根应该如下所示:

<MapPoints xmlns="http://tempuri.org/XMLFile1.xsd">

如果需要添加更多信息,请告诉我