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

不想你离开。 提交于 2020-03-02 05:56:25

问题


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; 
}

回答1:


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?




回答2:


When you say "other machines" do you mean other severs running the core service client console app? Check that the machines are in the same network domain and that you can connect to Tridion from them. Also check if there are any network policy restrictions preventing outgoing http requests on server machines.

It would help if you provide the error output you get.




回答3:


Please check the section in your app.config file, may be your endpoint your map to localhost.

<client>
            <endpoint address="http://[ur]/webservices/CoreService.svc/basicHttp_2010"
                binding="basicHttpBinding" bindingConfiguration="basicHttp_2010"
                contract="CoreService.ICoreService2010" name="basicHttp_2010" />
            <endpoint address="http://[ur]/webservices/CoreService.svc/streamDownload_basicHttp_2010"
                binding="basicHttpBinding" bindingConfiguration="streamDownload_basicHttp_2010"
                contract="CoreService.IStreamDownload2010" name="streamDownload_basicHttp_2010" />
            <endpoint address="http://[ur]/webservices/CoreService.svc/streamUpload_basicHttp_2010"
                binding="basicHttpBinding" bindingConfiguration="streamUpload_basicHttp_2010"
                contract="CoreService.IStreamUpload2010" name="streamUpload_basicHttp_2010" />
            <endpoint address="http://[ur]/webservices/CoreService.svc/wsHttp_2010"
                binding="wsHttpBinding" bindingConfiguration="wsHttp_2010"
                contract="CoreService.ISessionAwareCoreService2010" name="wsHttp_2010">
                <identity>
                    <dns value="localhost" />
                </identity>
            </endpoint>
        </client>


来源:https://stackoverflow.com/questions/12176679/unable-to-find-item-created-using-core-service-from-any-other-machine-except-whe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!