object IClientMessageFormatter.DeserializeReply(System.ServiceModel.Channels.Message message, object[] parameters)
        {
            object returnValue = null;

            XmlDictionaryReader bodyContentReader = message.GetReaderAtBodyContents();

            bodyContentReader.ReadStartElement(XmlRpcProtocol.MethodResponse);
            bodyContentReader.ReadStartElement(XmlRpcProtocol.Params);
            if (bodyContentReader.IsStartElement(XmlRpcProtocol.Param))
            {
                bodyContentReader.ReadStartElement();
                if (bodyContentReader.IsStartElement(XmlRpcProtocol.Value))
                {
                    bodyContentReader.ReadStartElement();
                    if (bodyContentReader.NodeType == XmlNodeType.Text)
                    {
                        returnValue = bodyContentReader.ReadContentAs(_returnParameter.ParameterType, null);
                    }
                    else
                    {
                        returnValue = XmlRpcDataContractSerializationHelper.Deserialize(bodyContentReader, _returnParameter.ParameterType);
                    }
                    bodyContentReader.ReadEndElement();
                }
                bodyContentReader.ReadEndElement();
                bodyContentReader.ReadEndElement();
            }
            bodyContentReader.Close();
            return(returnValue);
        }
        void IDispatchMessageFormatter.DeserializeRequest(System.ServiceModel.Channels.Message message, object[] parameters)
        {
            int paramCounter = 0;

            XmlDictionaryReader bodyContentReader = message.GetReaderAtBodyContents();

            bodyContentReader.ReadStartElement(XmlRpcProtocol.Params);
            if (parameters.Length > 0)
            {
                while (bodyContentReader.IsStartElement(XmlRpcProtocol.Param) && paramCounter < parameters.Length)
                {
                    bodyContentReader.ReadStartElement();
                    if (bodyContentReader.IsStartElement(XmlRpcProtocol.Value))
                    {
                        bodyContentReader.ReadStartElement();
                        bodyContentReader.MoveToContent();
                        if (bodyContentReader.NodeType == XmlNodeType.Text)
                        {
                            parameters[paramCounter] = bodyContentReader.ReadContentAs(_parameterInfo[paramCounter].ParameterType, null);
                        }
                        else
                        {
                            parameters[paramCounter] = XmlRpcDataContractSerializationHelper.Deserialize(bodyContentReader, _parameterInfo[paramCounter].ParameterType);
                        }
                        bodyContentReader.ReadEndElement();
                    }
                    bodyContentReader.ReadEndElement();
                    bodyContentReader.MoveToContent();
                    paramCounter++;
                }
            }
            bodyContentReader.ReadEndElement();
            bodyContentReader.Close();
        }