
Hi guys,
I'm trying to create Customer by using Microsoft Message Queue Incoming services and i'm using econnect 12.0
and my code is like below.
eConnectType eConnect = new eConnectType();
SMCustomerMasterType CustomerType = new SMCustomerMasterType();
taUpdateCreateCustomerRcd MyCustomer = new taUpdateCreateCustomerRcd();
//Serialization objects
XmlSerializer serializer = new XmlSerializer(typeof(eConnectType));
MemoryStream MemStream = new MemoryStream();
string sCustomerXmlDoc = null;
//Populate the MyCustomer object with data.
var _with1 = MyCustomer;
_with1.CUSTNMBR = "JOEH0001";
_with1.CUSTNAME = "Joe Healy";
_with1.ADRSCODE = "PRIMARY";
_with1.ADDRESS1 = "789 First Ave N";
_with1.CITY = "Rollag";
_with1.STATE = "MN";
_with1.ZIPCODE = "23589";
//Build the XML document
CustomerType.taUpdateCreateCustomerRcd = MyCustomer;
// ERROR: Not supported in C#: ReDimStatement
eConnect.SMCustomerMasterType(0) = CustomerType;
//eConnect.RMCustomerMasterType(0) = customertype;
//Serialize the XML document
serializer.Serialize(MemStream, eConnect);
MemStream.Position = 0;
//Use the Memory Stream to create an xml string
XmlTextReader xmlreader = new XmlTextReader(MemStream);
while (xmlreader.Read)
{
customerxml = customerxml + xmlreader.ReadOuterXml + Constants.vbCr;
}
//Create the MSMQ queue and message objects
MessageQueue MyQueue = new MessageQueue(".\\private$\\econnect_incoming");
Message MyMessage = new Message();
MessageQueueTransaction MyQueTrans = new MessageQueueTransaction();
ActiveXMessageFormatter MyFormatter = new ActiveXMessageFormatter();
//Build the MSMQ message and send it to the queue
MyMessage.Label = "eConnect Test with ActiveXMessageFormatter";
MyMessage.Body = sCustomerXmlDoc;
MyMessage.Formatter = MyFormatter;
MyFormatter.Write(MyMessage, customerxml);
MyQueTrans.Begin();
MyQueue.Send(MyMessage, MyQueTrans);
MyQueTrans.Commit();
MyQueue.Close();
im getting error at SMCustomerMasterType as shown in Red mark in the code.my question is how can i use the SMCustomerMasterType class in my code.I gave the reference econnect classes and systm.messageing even though im geting the error.please give me any ideas ?.
Thanks and Regards,
Pavan G.
*This post is locked for comments
I have the same question (0)