3

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

3 に答える 3

8

アイテムが存在するか、または存在しないかのいずれかです。それは、あなたが経験しているように見える「創造の文脈」についての知識を持って創造されたものではありません。

探しているのと同じパブリケーションでアイテムを作成しましたか? アイテムはチェックインされていますか?

そのようなものではない場合は、コードの重要な部分を共有することをお勧めします。おそらく、接続を作成し、それにユーザー資格情報を設定する部分 (もちろん実際の値は空白にします) と、 を呼び出す部分SaveUpdateまたはCreate上のメソッドCoreServiceClient

アップデート

あなたが追加したコードは私にはうまく見えます。ただし、それについて確認したいことがいくつかあります。

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

新しいコンポーネントを作成していることを考えると、CurrentMigrationComponentを持つ変数にはIdof がありtcm:0-0-0ます。どのような値が返されnewTCMIDますか? その TCM URI を (GUI の検索機能を使用して) 検索すると、何かが見つかりますか?

于 2012-08-29T11:19:58.640 に答える
3

「他のマシン」とは、コア サービス クライアント コンソール アプリを実行している他のサーバーのことですか? マシンが同じネットワーク ドメインにあり、そこから Tridion に接続できることを確認します。また、サーバー マシンでの発信 http 要求を防止するネットワーク ポリシーの制限があるかどうかも確認してください。

取得したエラー出力を提供していただけると助かります。

于 2012-08-29T12:45:08.160 に答える
0

app.config ファイルのセクションを確認してください。ローカルホストへのマップのエンドポイントである可能性があります。

<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>
于 2012-08-29T15:41:43.383 に答える