/// <summary> /// Serializes an XML-RPC request to a request stream. /// </summary> /// <param name="requestStream">the <see cref="System.IO.Stream"/> to write</param> /// <param name="request">the <see cref="LX.EasyWeb.XmlRpc.IXmlRpcRequest"/> to serialize</param> /// <param name="config">the context configuration</param> /// <param name="typeSerializerFactory">the <see cref="LX.EasyWeb.XmlRpc.Serializer.ITypeSerializerFactory"/> to get type serializers</param> /// <exception cref="System.Xml.XmlException">failed writing the request XML</exception> public void WriteRequest(Stream requestStream, IXmlRpcRequest request, IXmlRpcStreamConfig config, ITypeSerializerFactory typeSerializerFactory) { using (XmlWriter writer = _xmlWriterFactory.GetXmlWriter(config, requestStream)) { WriteRequest(writer, request, config, typeSerializerFactory); } }
/// <summary> /// Serializes an XML-RPC response to a response stream. /// </summary> /// <param name="responseStream">the <see cref="System.IO.Stream"/> to write</param> /// <param name="response">the <see cref="LX.EasyWeb.XmlRpc.IXmlRpcResponse"/> to serialize</param> /// <param name="config">the context configuration</param> /// <param name="typeSerializerFactory">the <see cref="LX.EasyWeb.XmlRpc.Serializer.ITypeSerializerFactory"/> to get type serializers</param> /// <exception cref="System.Xml.XmlException">failed writing the response XML</exception> public void WriteResponse(Stream responseStream, IXmlRpcResponse response, IXmlRpcStreamRequestConfig config, ITypeSerializerFactory typeSerializerFactory) { XmlWriter writer = _xmlWriterFactory.GetXmlWriter(config, responseStream); WriteResponse(writer, response, config, typeSerializerFactory); writer.Flush(); }