diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Servers/RestDeserialiseHandler.cs | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/OpenSim/Framework/Servers/RestDeserialiseHandler.cs b/OpenSim/Framework/Servers/RestDeserialiseHandler.cs index 28084e2..adf5c3f 100644 --- a/OpenSim/Framework/Servers/RestDeserialiseHandler.cs +++ b/OpenSim/Framework/Servers/RestDeserialiseHandler.cs | |||
@@ -1,6 +1,3 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | using System.IO; | 1 | using System.IO; |
5 | using System.Xml; | 2 | using System.Xml; |
6 | using System.Xml.Serialization; | 3 | using System.Xml.Serialization; |
@@ -20,22 +17,22 @@ namespace OpenSim.Framework.Servers | |||
20 | m_method = method; | 17 | m_method = method; |
21 | } | 18 | } |
22 | 19 | ||
23 | public void Handle(string path, Stream request, Stream responseStream ) | 20 | public void Handle(string path, Stream request, Stream responseStream) |
24 | { | 21 | { |
25 | TRequest deserial; | 22 | TRequest deserial; |
26 | using (XmlTextReader xmlReader = new XmlTextReader(request)) | 23 | using (XmlTextReader xmlReader = new XmlTextReader(request)) |
27 | { | 24 | { |
28 | XmlSerializer deserializer = new XmlSerializer(typeof(TRequest)); | 25 | XmlSerializer deserializer = new XmlSerializer(typeof (TRequest)); |
29 | deserial = (TRequest)deserializer.Deserialize(xmlReader); | 26 | deserial = (TRequest) deserializer.Deserialize(xmlReader); |
30 | } | 27 | } |
31 | 28 | ||
32 | TResponse response = m_method(deserial); | 29 | TResponse response = m_method(deserial); |
33 | 30 | ||
34 | using (XmlWriter xmlWriter = XmlTextWriter.Create( responseStream )) | 31 | using (XmlWriter xmlWriter = XmlTextWriter.Create(responseStream)) |
35 | { | 32 | { |
36 | XmlSerializer serializer = new XmlSerializer(typeof(TResponse)); | 33 | XmlSerializer serializer = new XmlSerializer(typeof (TResponse)); |
37 | serializer.Serialize(xmlWriter, response ); | 34 | serializer.Serialize(xmlWriter, response); |
38 | } | 35 | } |
39 | } | 36 | } |
40 | } | 37 | } |
41 | } | 38 | } \ No newline at end of file |