
Hi,
I am trying with GP Message Queue incoming and Outgoing services and new to GP Message Queue. Can anyone help me on that. When i am trying to send messages to incoming services, those will visible in Message queue after some time that message will disappears (note that econnect incoming service is running) but no record is creating in dynamics GP. Sometimes, the messages will not going to message queue . Below is my C#.net code base:
eConnectType eConnect = new eConnectType();
XmlSerializer serializer = new XmlSerializer(eConnect.GetType());
RMCustomerMasterType mySmCustomerMaster = new RMCustomerMasterType();
RMCustomerMasterType customertype = mySmCustomerMaster;
taUpdateCreateCustomerRcd mycust = new taUpdateCreateCustomerRcd();
XmlSerializer serialize = new XmlSerializer(typeof(eConnectType));
string sCustXmlDoc = string.Empty;
mycust.CUSTNMBR = "JOEH0001";
mycust.CUSTNAME = "Joe Healy";
mycust.ADRSCODE = "PRIMARY";
mycust.ADDRESS1 = "789 First Ave N";
mycust.CITY = "Rollag";
mycust.STATE = "MN";
mycust.ZIPCODE = "23589";
mySmCustomerMaster.taUpdateCreateCustomerRcd = mycust;
mySmCustomerMaster = customertype;
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);
MessageQueue queue = new MessageQueue(@".\private$\econnect_incoming");
if (!MessageQueue.Exists(@".\private$\econnect_incoming"))
{
MessageQueue.Create(@".\private$\econnect_incoming");
}
// Create a new message.
Message msg = new Message();
msg.Body = createCustomerDocument.OuterXml;
// Create a message queuing transaction.
MessageQueueTransaction transaction = new MessageQueueTransaction();
queue.Send(msg, "XML Incoming Message");
or
eConnectType eConnect = new eConnectType();
XmlSerializer serializer = new XmlSerializer(eConnect.GetType());
RMCustomerMasterType mySmCustomerMaster = new RMCustomerMasterType();
RMCustomerMasterType customertype = mySmCustomerMaster;
taUpdateCreateCustomerRcd mycust = new taUpdateCreateCustomerRcd();
XmlSerializer serialize = new XmlSerializer(typeof(eConnectType));
string sCustXmlDoc = string.Empty;
mycust.CUSTNMBR = "JOEH0001";
mycust.CUSTNAME = "Joe Healy";
mycust.ADRSCODE = "PRIMARY";
mycust.ADDRESS1 = "789 First Ave N";
mycust.CITY = "Rollag";
mycust.STATE = "MN";
mycust.ZIPCODE = "23589";
mySmCustomerMaster.taUpdateCreateCustomerRcd = mycust;
mySmCustomerMaster = customertype;
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);
MessageQueue queue = new MessageQueue(@".\private$\econnect_incoming");
if (!MessageQueue.Exists(@".\private$\econnect_incoming"))
{
MessageQueue.Create(@".\private$\econnect_incoming");
}
// Create a new message.
Message msg = new Message();
msg.Body = createCustomerDocument.OuterXml;
MessageQueueTransaction transaction = new MessageQueueTransaction();
ActiveXMessageFormatter MyFormatter = new ActiveXMessageFormatter();
msg.Label = "eConnect Test with ActiveXMessageFormatter";
msg.Body = createCustomerDocument.OuterXml;
msg.Formatter = MyFormatter;
queue.Send(msg, "XML MSMQ", transaction);
MyFormatter.Write(msg, createCustomerDocument.OuterXml);
MessageQueueTransaction MyQueTrans = new MessageQueueTransaction();
MyQueTrans.Begin();
MyQueTrans.Commit();
queue.Close();
Can anyone guide me if i missed anything and tell me that process of Incoming and outgoing services.
Thanks in advance
Mounika.
*This post is locked for comments
I have the same question (0)