From c2925dcd404312b1751a03045ddcd35a7c84cd58 Mon Sep 17 00:00:00 2001 From: Dr Scofield Date: Thu, 29 May 2008 13:55:01 +0000 Subject: cleaning up returned XML REST doclet (no more xsi, xsd) --- OpenSim/ApplicationPlugins/Rest/Regions/GETHandler.cs | 2 +- OpenSim/ApplicationPlugins/Rest/Regions/RegionDetails.cs | 2 +- OpenSim/ApplicationPlugins/Rest/Regions/RestRegionPlugin.cs | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) (limited to 'OpenSim/ApplicationPlugins/Rest/Regions') diff --git a/OpenSim/ApplicationPlugins/Rest/Regions/GETHandler.cs b/OpenSim/ApplicationPlugins/Rest/Regions/GETHandler.cs index 81eb5bd..a605d09 100644 --- a/OpenSim/ApplicationPlugins/Rest/Regions/GETHandler.cs +++ b/OpenSim/ApplicationPlugins/Rest/Regions/GETHandler.cs @@ -129,7 +129,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions { // complete region details requested XmlSerializer xs = new XmlSerializer(typeof(RegionDetails)); - xs.Serialize(XmlWriter, details); + xs.Serialize(XmlWriter, details, _xmlNs); return XmlWriterResult; } diff --git a/OpenSim/ApplicationPlugins/Rest/Regions/RegionDetails.cs b/OpenSim/ApplicationPlugins/Rest/Regions/RegionDetails.cs index 681b99f..67af7b5 100644 --- a/OpenSim/ApplicationPlugins/Rest/Regions/RegionDetails.cs +++ b/OpenSim/ApplicationPlugins/Rest/Regions/RegionDetails.cs @@ -35,7 +35,7 @@ using OpenSim.Region.Environment.Scenes; namespace OpenSim.ApplicationPlugins.Rest.Regions { - [XmlRoot(ElementName="region")] + [XmlRoot(ElementName="region", IsNullable = false)] public class RegionDetails { public string region_name; diff --git a/OpenSim/ApplicationPlugins/Rest/Regions/RestRegionPlugin.cs b/OpenSim/ApplicationPlugins/Rest/Regions/RestRegionPlugin.cs index 24bed99..fa5f117 100644 --- a/OpenSim/ApplicationPlugins/Rest/Regions/RestRegionPlugin.cs +++ b/OpenSim/ApplicationPlugins/Rest/Regions/RestRegionPlugin.cs @@ -56,6 +56,8 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions [Extension("/OpenSim/Startup")] public partial class RestRegionPlugin : RestPlugin { + private static XmlSerializerNamespaces _xmlNs; + #region overriding properties public override string Name { @@ -88,6 +90,9 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions return; } m_log.InfoFormat("{0} REST region plugin enabled", MsgID); + + _xmlNs = new XmlSerializerNamespaces(); + _xmlNs.Add(String.Empty, String.Empty); // add REST method handlers AddRestStreamHandler("GET", "/regions/", GetHandler); -- cgit v1.1