30 using System.Xml.Serialization;
32 namespace OpenSim.Framework.Servers.HttpServer
37 where TRequest : new()
42 : this(httpMethod, path, method, null, null) {}
46 : base(httpMethod, path, name, description)
51 protected override void ProcessRequest(
string path, Stream request, Stream responseStream,
55 using (XmlTextReader xmlReader =
new XmlTextReader(request))
57 XmlSerializer deserializer =
new XmlSerializer(typeof (TRequest));
58 deserial = (TRequest) deserializer.Deserialize(xmlReader);
61 TResponse response = m_method(deserial);
63 using (XmlWriter xmlWriter = XmlTextWriter.Create(responseStream))
65 XmlSerializer serializer =
new XmlSerializer(typeof (TResponse));
66 serializer.Serialize(xmlWriter, response);
RestDeserialiseHandler(string httpMethod, string path, RestDeserialiseMethod< TRequest, TResponse > method)
Base handler for writing to an output stream
override void ProcessRequest(string path, Stream request, Stream responseStream, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
delegate TResponse RestDeserialiseMethod< TRequest, TResponse >(TRequest request)
RestDeserialiseHandler(string httpMethod, string path, RestDeserialiseMethod< TRequest, TResponse > method, string name, string description)