I am using Tridion core service to delete failed publish transactions and reschedule them. But I am get the following error:
System.ServiceModel.FaultException`1[ABC.CoreServiceReference.CoreServiceFault]: The item tcm:0-31371-66560 does not exist.
This is happening in every method I have created whenever I am trying to access any Tridion Item.
Code snippet:
To Create the Connection I am using the following code:
private bool CreateCoreServiceClientInstance()
{
try
{
m_serverBaseUrl = ConfigurationManager.AppSettings[CommonConstants.CmsServerBaseURL];
//m_serverBaseUrl = (string)serverConfSection["serverBaseURL"];
if (m_serverBaseUrl == null)
{
throw new Exception("Error in getting serverBaseURL from the web.config");
}
var netTcpBinding = new NetTcpBinding
{
MaxReceivedMessageSize = 2147483647,
ReaderQuotas = new System.Xml.XmlDictionaryReaderQuotas
{
MaxStringContentLength = 2147483647,
MaxArrayLength = 2147483647
}
};
//Core service connection through TCP binding
var remoteAddress = new EndpointAddress("net.tcp://" + m_serverBaseUrl +
":2660/CoreService/netTcp_2010");
m_objChannelFactory = new ChannelFactory<ISessionAwareCoreService2010>
(netTcpBinding, remoteAddress);
m_coreServiceInstance = m_objChannelFactory.CreateChannel();
m_coreServiceInstance.Impersonate(UserId);
return true;
}
catch (Exception ex)
{
CloseCoreServiceClientInstance();
throw ex;
}
}
Code I am using with the client to delete the transaction:
public Boolean DeleteTransaction(string transactionId)
{
Boolean result = false;
try
{
UtilityHelper.LogInTextFile("Client Creation Started");
CreateCoreServiceClientInstance();
UtilityHelper.LogInTextFile("Client Created Started");
m_coreServiceInstance.Delete(transactionId);
UtilityHelper.LogInTextFile(transactionId + " Deleted");
CloseCoreServiceClientInstance();
result = true;
}
catch (Exception exc)
{
UtilityHelper.LogInTextFile(exc.ToString());
CloseCoreServiceClientInstance();
}
return result;
}
tcm:0-31371-66560
exists in the Tridion instance the CoreService is trying to connect.m_serverBaseUrl
that you are using is the right one, where your data is, it so often happens that we keep connecting to a different instance.