コード例 #1
0
ファイル: XmlRpcProxy.cs プロジェクト: lulzzz/SmartWorld
        /// <summary>
        /// Sends request to server via HTTP and deserialize string response
        /// </summary>
        /// <param name="request">MethodCall object</param>
        /// <returns>MethodResponse object</returns>
        public async Task <MethodResponse> SendRequestAndDeserialize(MethodCall request)
        {
            if (m_Uri != null)
            {
                string xmlRpcString   = XmlRpcSerialization.XmlRpcSerialize(request);
                string responseString = await this.postHttp(xmlRpcString);

                MethodResponse response = XmlRpcSerialization.XmlRpcDeserialize(responseString);

                return(response);
            }
            else
            {
                throw new InvalidOperationException();
            }
        }
コード例 #2
0
ファイル: XmlRpcProxy.cs プロジェクト: lulzzz/SmartWorld
 /// <summary>
 /// Deserializes Response from string
 /// </summary>
 /// <param name="responseString">response string</param>
 /// <returns>MethodResponse object</returns>
 public MethodResponse DeserializeResponse(string responseString)
 {
     return(XmlRpcSerialization.XmlRpcDeserialize(responseString));
 }