public List<Email> GetEmails(UUID objectID) { OSDMap map = new OSDMap(); map["ObjectID"] = objectID; map["Method"] = "getemails"; List<Email> Messages = new List<Email>(); try { List<string> urls = m_registry.RequestModuleInterface<IConfigurationService>().FindValueOf("RemoteServerURI"); foreach (string url in urls) { OSDMap result = WebUtils.PostToService(url + "osd", map, true, false); OSDArray array = (OSDArray) OSDParser.DeserializeJson(result["_RawResult"]); foreach (OSD o in array) { Email message = new Email(); message.FromOSD((OSDMap) o); Messages.Add(message); } } return Messages; } catch (Exception e) { MainConsole.Instance.DebugFormat("[AuroraRemoteEmailConnector]: Exception when contacting server: {0}", e); } return Messages; }
public byte[] InsertEmail(OSDMap request) { Email message = new Email(); message.FromOSD(request); OSDMap map = new OSDMap(); map["Result"] = true; EmailConnector.InsertEmail(message); string xmlString = OSDParser.SerializeJsonString(map); UTF8Encoding encoding = new UTF8Encoding(); return encoding.GetBytes(xmlString); }