private UserAccount SendAndGetReply(Dictionary<string, object> sendData)
{
string reply = string.Empty;
string reqString = ServerUtils.BuildQueryString(sendData);
// m_log.DebugFormat("[ACCOUNTS CONNECTOR]: queryString = {0}", reqString);
try
{
reply = SynchronousRestFormsRequester.MakeRequest("POST",
m_ServerURI + "/accounts",
reqString);
if (reply == null || (reply != null && reply == string.Empty))
{
m_log.DebugFormat("[ACCOUNT CONNECTOR]: GetUserAccount received null or empty reply");
return null;
}
}
catch (Exception e)
{
m_log.DebugFormat("[ACCOUNT CONNECTOR]: Exception when contacting user account server: {0}", e.Message);
}
Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
UserAccount account = null;
if ((replyData != null) && replyData.ContainsKey("result") && (replyData["result"] != null))
{
if (replyData["result"] is Dictionary<string, object>)
{
account = new UserAccount((Dictionary<string, object>)replyData["result"]);
}
}
return account;
}