Search code examples
tridiontridion-2011

Unable to find item created using core service from any other machine except where Tridion CMS is installed


I am not able to find any item (schema/component) created using core service from any other machine except where Tridion CMS is installed, but when I create any item on the machine where I have Tridion CMS installed using the same console application then I am able to locate that particular item with TCM URI. Is there any configuration need to define in config file (I think this issue is not related with refreshing or clearing browser cache) and also when TCM URI is generated from other machines too, then how that item is not searchable even from where CMS server is installed. Please suggest...

More information:-

I am working on SDL Tridion 2011 GA also below is the sample code of creating a component which I am using:-

public static string CreateComponentStack(string folderUri, string title,
                                          string schemaID)
{
    core_service.ServiceReference1.SessionAwareCoreService2010Client client = 
        new SessionAwareCoreService2010Client();
    client.ClientCredentials.Windows.ClientCredential.UserName = "myUserName";
    client.ClientCredentials.Windows.ClientCredential.Password = "myPassword";
    client.Open();

    ReadOptions readoptions = new ReadOptions();

    string TargetFolderTcmId = folderUri;
    string LinkSchemaTcmId = schemaID;
    ComponentData CurrentMigrationComponent = client.GetDefaultData(
                ItemType.Component, TargetFolderTcmId) as ComponentData;
    LinkToSchemaData SchemaToUse = new LinkToSchemaData();
    SchemaToUse.IdRef = LinkSchemaTcmId.ToString();
    CurrentMigrationComponent.Schema = SchemaToUse;
    CurrentMigrationComponent.Title = title;
    XmlDocument doc = new XmlDocument();

    doc.LoadXml("<Content xmlns='uuid:7289aba9-16de-487c-9142-f6f97dbd2571'>"+
                "</Content>");

    CurrentMigrationComponent.Content = doc.DocumentElement.OuterXml;
    string newTCMID = client.Create(CurrentMigrationComponent, readoptions).Id; 
    Console.WriteLine(CurrentMigrationComponent.Id);
    Console.ReadLine(); 
    return newTCMID; 
}

Solution

  • The item either exists or it does not. It is not created with any knowledge of a "creation context" that you seem to be experiencing.

    Are you sure you created the item in the same publication that you are looking in? Is the item checked-in?

    If it's not something like that, I suggest sharing the crucial bits of your code with us: probably the part that creates the connection and sets the user credentials on it (blank out the actual values of course) and the part that calls the Save, Update or Create methods on the CoreServiceClient.

    Update

    The code you added looks fine to me. But there are a few things you might want to check about it:

    string newTCMID = client.Create(CurrentMigrationComponent, readoptions).Id; 
    Console.WriteLine(CurrentMigrationComponent.Id);
    

    Given that you are creating a new Component, the CurrentMigrationComponent variable with have an Id of tcm:0-0-0. What value do you get back in newTCMID? And if you search for that TCM URI (using the search function in the GUI), does it find anything?