无法在任何其他计算机上找到使用核心服务创建的项目,除非安装了Tridion CMS

时间:2012-08-29 11:16:48

标签: tridion tridion-2011

我无法找到使用核心服务从任何其他计算机创建的任何项目(架构/组件),除非安装了Tridion CMS,但是当我在使用相同控制台安装Tridion CMS的计算机上创建任何项目时应用程序然后我能够找到具有TCM URI的特定项目。是否需要在配置文件中定义任何配置(我认为此问题与刷新或清除浏览器缓存无关)以及从其他计算机生成TCM URI时,即使从CMS服务器所在的位置也无法搜索该项目安装。请建议......

更多信息: -

我正在开发SDL Tridion 2011 GA,下面是创建我正在使用的组件的示例代码: -

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

3 个答案:

答案 0 :(得分:8)

该项目存在或不存在。它不是在你似乎正在经历的任何“创造背景”知识的情况下创建的。

您确定在所查找的同一出版物中创建了该项目吗?物品是否已登记?

如果它不是那样的话,我建议与我们分享你的代码的关键部分:可能是创建连接并在其上设置用户凭据的部分(当然是空白的实际值)和调用的部分Save上的UpdateCreateCoreServiceClient方法。

更新

您添加的代码对我来说很好。但是您可能需要检查一些事项:

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

鉴于您 正在创建 新组件,CurrentMigrationComponent变量的Idtcm:0-0-0。你在newTCMID得到什么价值?如果你搜索那个TCM URI(使用GUI中的搜索功能),它能找到什么吗?

答案 1 :(得分:3)

当你说“其他机器”时,你的意思是其他服务器运行核心服务客户端控制台应用程序吗?检查计算机是否在同一网络域中,并且可以从它们连接到Tridion。还要检查是否存在阻止服务器计算机上的传出http请求的网络策略限制。

如果您提供错误输出,将会有所帮助。

答案 2 :(得分:0)

请检查app.config文件中的部分,可能是您的地图到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>