3

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;
    }
  • Are you sure tcm:0-31371-66560 exists in the Tridion instance the CoreService is trying to connect. – Likhan Oct 3 '13 at 6:02
  • It's not happening only for this. I am getting same exception even when I am scheduling the publish for a page tcm:22-7550-64 – AlokBhatt Oct 3 '13 at 6:33
  • 1
    What I meant to validate is that the 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. – Likhan Oct 3 '13 at 6:38
  • I have installed my application as windows service on CMS server. And the instance is pointing to localhost only – AlokBhatt Oct 3 '13 at 6:40
  • Thanks Likhan. You directed me in to right direction. The serverbaseurl was the issue. – AlokBhatt Oct 3 '13 at 6:42
7

Please validate that the 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.