Ejemplo n.º 1
0
        /// <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();
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Serializes request as Method Call object into XML-type
 /// </summary>
 /// <param name="request">MethodCall object</param>
 /// <returns>serialized string</returns>
 public string SerializeRequest(MethodCall request)
 {
     return(XmlRpcSerialization.XmlRpcSerialize(request));
 }