public string ReplyOrder() { XmlTextWriter w; try { w = new XmlTextWriter(@"C:\temp\ackorder.xml", Encoding.GetEncoding("iso-8859-15")); w.Formatting = Formatting.None; w.WriteStartDocument(); w.WriteStartElement("SUTI"); Preamble preamb = new Preamble(); //preamb.FromLocal(ref w); w.WriteStartElement("msg"); w.WriteAttributeString("msgType", "2001"); w.WriteAttributeString("msgName", "ORDER CONFIRMATION"); w.WriteStartElement("idMsg"); w.WriteAttributeString("src", preamb.GetLocalName()); w.WriteAttributeString("id", this._msgCounter.ToString()); w.WriteAttributeString("unique", "true"); w.WriteEndElement(); //</idMsg> w.WriteStartElement("referencesTo"); w.WriteStartElement("idMsg"); w.WriteAttributeString("src", preamb.GetRemoteName()); w.WriteAttributeString("id", this._msgID); w.WriteEndElement(); //</idMsg> w.WriteStartElement("idOrder"); w.WriteAttributeString("src", preamb.GetRemoteName()); w.WriteAttributeString("id", this.OrderID); w.WriteEndElement(); // </idOrder> w.WriteStartElement("idOrder"); w.WriteAttributeString("src", preamb.GetLocalName()); w.WriteAttributeString("id", this._tpakID.ToString()); w.WriteEndElement(); // </idOrder> w.WriteEndElement(); // </referencesTo> w.WriteEndElement(); //</msg> w.Close(); } catch (Exception exc) { Console.WriteLine(exc.Message); } XmlDocument xDoc = new XmlDocument(); xDoc.Load(@"C:\temp\ackorder.xml"); log.InfoFormat("<-- {0}", xDoc.OuterXml); return(xDoc.OuterXml); }
public string ReplyCancel() { XmlTextWriter w = new XmlTextWriter(@"C:\temp\ack2.xml", Encoding.GetEncoding("iso-8859-15")); Preamble preamb = new Preamble(); w.Formatting = Formatting.None; w.WriteStartDocument(); w.WriteStartElement("SUTI"); //Preamble preamb = new Preamble(); //preamb.FromLocal(ref w); w.WriteStartElement("msg"); w.WriteAttributeString("msgType", "2011"); w.WriteAttributeString("msgName", "Order Cancellation Accepted"); w.WriteStartElement("idMsg"); w.WriteAttributeString("src", "mbsoft_htd_001"); w.WriteAttributeString("id", msgCount.ToString()); w.WriteEndElement(); //</idMsg> w.WriteStartElement("referencesTo"); w.WriteStartElement("idOrder"); w.WriteAttributeString("src", preamb.GetRemoteName()); w.WriteAttributeString("id", this.sOrderID); w.WriteEndElement(); // </idOrder> w.WriteStartElement("idOrder"); w.WriteAttributeString("src", preamb.GetLocalName()); w.WriteAttributeString("id", this.sTPakNbr); w.WriteEndElement(); // </idOrder> w.WriteEndElement(); // </referencesTo> w.WriteEndElement(); //</msg> w.WriteEndElement(); //</SUTI> w.Close(); // now read the formatted xml doc and send // to server with checksum attached XmlDocument xDoc = new XmlDocument(); xDoc.Load(@"C:\temp\ack2.xml"); log.InfoFormat("<-- {0}", xDoc.OuterXml); return(xDoc.OuterXml); }
public string ReplySyntaxError() { XmlTextWriter w = new XmlTextWriter(@"C:\temp\ack2.xml", Encoding.GetEncoding("iso-8859-15")); w.Formatting = Formatting.None; w.WriteStartDocument(); w.WriteStartElement("SUTI"); Preamble preamb = new Preamble(); w.WriteStartElement("msg"); w.WriteAttributeString("msgType", "7032"); w.WriteAttributeString("msgName", this.ErrorMsg); w.WriteStartElement("idMsg"); w.WriteAttributeString("src", preamb.GetLocalName()); w.WriteAttributeString("id", msgCount.ToString()); w.WriteEndElement(); //</idMsg> w.WriteStartElement("referencesTo"); w.WriteStartElement("idMsg"); w.WriteAttributeString("src", preamb.GetRemoteName()); w.WriteAttributeString("id", this.sID); w.WriteEndElement(); //</idMsg> w.WriteEndElement(); //</referencesTo> w.WriteEndElement(); //</msg> w.WriteEndElement(); //</SUTI> w.Close(); // now read the formatted xml doc and send // to server with checksum attached XmlDocument xDoc = new XmlDocument(); xDoc.Load(@"C:\temp\ack2.xml"); log.InfoFormat("<-- {0}", xDoc.OuterXml); return(xDoc.OuterXml); }