HI all,
I'm using Message Queue to send the data to GP.i'm getting XML data in Message Queue.but that customer data(when i try to insert the customer) is not syncing in GP.Please suggest me for this problem .
My code is below :
eConnectType eConnect = new eConnectType(); // Instantiate an eConnectType schema object
XmlSerializer serializer = new XmlSerializer(eConnect.GetType());// Create an XML serializer object
RMCustomerMasterType[] mySmCustomerMaster = { mySMCustomerMaster };
eConnect.RMCustomerMasterType = mySmCustomerMaster;// Populate the eConnectType object with the RMCustomerMasterType schema object
MemoryStream memoryStream = new MemoryStream();// Serialize the object to produce an XML document
serializer.Serialize(memoryStream, eConnect);
memoryStream.Position = 0;
XmlDocument createCustomerDocument = new XmlDocument();
createCustomerDocument.Load(memoryStream);
//Creating the customer entity
// customerResult = eConnectMethod.CreateEntity(sConnectionString, createCustomerDocument.OuterXml);
// HairDirect Customizations //
MessageQueue queue = new MessageQueue(@".\private$\econnect_incoming");
if (!MessageQueue.Exists(@".\private$\econnect_incoming"))
{
MessageQueue.Create(@".\private$\econnect_incoming");
}
Message message = new Message();
ActiveXMessageFormatter formatter = new ActiveXMessageFormatter();
MessageQueueTransaction transaction = new MessageQueueTransaction();
message.Label = "Customer Creation";
message.Body = createCustomerDocument.OuterXml;
message.Formatter = formatter;
queue.Send(message, "Customer XML Data", transaction);
formatter.Write(message, createCustomerDocument.OuterXml);
transaction.Begin();
transaction.Commit();
queue.Close();
Please tell me if i miss anything in this code.
*This post is locked for comments