gpt4 book ai didi

tridion - 在 ASP.NET 中使用 Tridion 2011 linking.svc 服务

转载 作者:行者123 更新时间:2023-12-02 02:48:11 25 4
gpt4 key购买 nike

尝试在 ASP.NET 应用程序中添加对/linking.svc 的服务引用时收到以下错误:

There was an error downloading http://localhost:82/linking.svc/. The request failed with HTTP status 404: Not Found. Metadata contains a reference that cannot be resolved: http://localhost:82/linking.svc/. There was no endpoint listening at http://localhost:82/linking.svc/ that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. The remote server returned an error: (404) Not Found. If the service is defined in the current solution, try building the solution and adding the service reference again.

我认为我可以像 odata 一样使用链接服务(在 Visual Studio 中添加服务引用),因为 odata 对我来说工作得很好。我检查了服务安装的 web.config,两个端点看起来都配置正确。

<!-- HTTP support -->
<service name="Tridion.ContentDelivery.Webservice.ODataService">
<endpoint behaviorConfiguration="webHttp" bindingConfiguration="HttpBinding" binding="webHttpBinding" contract="Tridion.ContentDelivery.Webservice.IODataService" />
</service>
<service name="Tridion.ContentDelivery.Webservice.LinkingService">
<endpoint behaviorConfiguration="webHttp" bindingConfiguration="HttpBinding" binding="webHttpBinding" contract="Tridion.ContentDelivery.Webservice.Ilinking" />
</service>
<service name="Tridi

我假设我正在尝试以错误的方式使用 linking.svc。

我的问题...我是否遵循在 Visual Studio ASP.NET 项目中使用 linking.svc 服务的正确过程?如果没有,请您帮我了解如何使用这个 api。

非常感谢

最佳答案

您是否考虑过为链接服务编写自己的客户端?它是一个非常简单的 REST-ful Web 服务,因此您可以使用标准 WebClient 访问它:

来自 Mihai Cadariu 的示例:

WebClient client = new WebClient();
string linkingServiceUrl = "http://tridion.server:8080/services/linking.svc";
string COMPONENT_LINK = "/componentLink?sourcePageURI={0}&targetComponentURI={1}&excludeTemplateURI={2}&linkTagAttributes={3}&linkText={4}&showTextOnFail={5}&showAnchor={6}";
string url = linkingServiceUrl +
string.Format(COMPONENT_LINK,
sourcePageUri,
targetComponentUri,
excludeTemplateUri,
HttpUtility.UrlEncode(linkTagAttributes),
HttpUtility.UrlEncode(linkText),
showTextOnFail,
showAnchor);
return client.DownloadString(url);

关于tridion - 在 ASP.NET 中使用 Tridion 2011 linking.svc 服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12286635/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com