我在ASP中尝试向/linking.svc添加服务引用时收到以下错误。NET应用程序:
下载
http://localhost:82/linking.svc/
时出错。请求失败,HTTP状态为404:未找到。元数据包含无法解析的引用:http://localhost:82/linking.svc/
。在http://localhost:82/linking.svc/
上侦听的终结点无法接受该消息。这通常是由不正确的地址或SOAP操作引起的。有关更多详细信息,请参见InnerException(如果存在)。远程服务器返回错误:(404)找不到。如果服务是在当前解决方案中定义的,请尝试构建解决方案并再次添加服务引用。
我想我可以像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中使用linking.svc服务的正确过程。NET项目?如果没有,请你帮我了解如何使用这个api。
非常感谢
您是否考虑为链接服务编写自己的客户端?这是一个非常简单的RESTful 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);
您是否阅读了此处的文档(需要登录):
http://sdllivecontent.sdl.com/LiveContent/content/en-US/SDL_Tridion_2011_SPONE/reference_277A2D7264B04A39870C3FE18EF245BB