I was just sent some code that inserts an xml file via eConnect. It uses a class called eConnectMethods(). My current reference for eConnect does not recognize the eConnectMethods class. Has its use been discontinued? What is its replacement?
foreach (var fi in aryFi)
{
strArchiveFolder = My.MySettingsProperty.Settings.Archive;
strFileName = fi.FullName;
strFileNameNoExt = Path.GetFileNameWithoutExtension(strFileName);
streConnectException = My.MySettingsProperty.Settings.ErrorLog + strFileNameNoExt + "_Error.txt";
using (var eConCall = new eConnectMethods())
{
try
{
var xmldoc = new System.Xml.XmlDocument();
xmldoc.Load(strFileName);
SOPDocument = xmldoc.OuterXml;
string ConnectionStringGP = My.MySettingsProperty.Settings.Server;
1234567890abcdefghijklmnopqrstuvw = eConCall.CreateTransactionEntity(ConnectionStringGP, SOPDocument);
if (File.Exists(strArchiveFolder + fi.Name))
{
File.Delete(strArchiveFolder + fi.Name);
File.Move(fi.FullName, strArchiveFolder + fi.Name);
}
else
{
File.Move(fi.FullName, strArchiveFolder + fi.Name);
}
}
catch (eConnectException exp)
{
Console.Write(exp.ToString);
var SW = new StreamWriter(streConnectException);
SW.WriteLine(exp.ToString);
if (File.Exists(My.MySettingsProperty.Settings.Hold + fi.Name))
{
File.Delete(My.MySettingsProperty.Settings.Hold + fi.Name);
File.Move(fi.FullName, My.MySettingsProperty.Settings.Hold + fi.Name);
}
else
{
File.Move(fi.FullName, My.MySettingsProperty.Settings.Hold + fi.Name);
}
SW.Close();
}
}
File.Delete(fi.FullName);
}