static void Main(string[] args) { InventoryRequest request = GenerateHeader(); BuildLine(request, "00030291053409", "1"); ImWrapper imWrapper = new ImWrapper(); string message; XmlSerializer x = new XmlSerializer(request.GetType()); using (StringWriter textWriter = new StringWriter()) { x.Serialize(textWriter, request); message = textWriter.ToString(); } imWrapper.Execute(message); }
public void SendToInventory(object obj) { InventoryMessage inventoryMessage = (InventoryMessage)obj; InventoryRequest request = GenerateHeader(inventoryMessage.BusinessUnit); BuildLine(request, inventoryMessage.ProductId, inventoryMessage.Inventoy); ImWrapper imWrapper = new ImWrapper(); string message; XmlSerializer x = new XmlSerializer(request.GetType()); using (StringWriter textWriter = new StringWriter()) { x.Serialize(textWriter, request); message = textWriter.ToString(); } imWrapper.Execute(message); }