public void Test() { var m = new PSWinCom.Gateway.MMS.Client.MMSMessage(); m.LoadCompressed("testfiles/unziptest.zip"); foreach (int n in m.Parts.Keys) { MMSMessagePart p = m.Parts[n]; p.Save(@"c:\PSWinCom\WebApps\CustomerServices\SMS2Email\Tmp\"); } }
/// <summary> /// Build Xml for a particular message /// </summary> /// <param name="doc">Root Xml Document</param> /// <param name="m">Message object to transform</param> /// <param name="id">index in collection</param> /// <returns>Message as XmlElement</returns> private XmlElement GetMessageXml(XmlDocument doc, MMSMessage m, int id, bool includeContent) { XmlElement elmMsg = doc.CreateElement("MSG"); elmMsg.AppendChild(CreateElement(doc, "ID", id.ToString())); if (m.Network != null && m.Network.Length > 0) { elmMsg.AppendChild(CreateElement(doc, "NET", m.Network)); } elmMsg.AppendChild(CreateElement(doc, "TARIFF", m.Tariff.ToString())); elmMsg.AppendChild(CreateElement(doc, "TEXT", m.Subject)); elmMsg.AppendChild(CreateElement(doc, "OP", "13")); if (m.RequestReceipt) { elmMsg.AppendChild(CreateElement(doc, "RCPREQ", "Y")); } elmMsg.AppendChild(CreateElement(doc, "SND", m.SenderNumber)); elmMsg.AppendChild(CreateElement(doc, "RCV", m.ReceiverNumber)); if (includeContent) { elmMsg.AppendChild(CreateElement(doc, "MMSFILE", Convert.ToBase64String(m.GetCompressed()))); } return(elmMsg); }
public void Add(int key, MMSMessage value) { Dictionary.Add(key, value); }