2012-09-05 6 views
9
में Tridion 2011 linking.svc सेवा उपभोक्ता

मैं निम्न त्रुटि जब मेरे ASP.NET अनुप्रयोग में /linking.svc के लिए एक सेवा संदर्भ जोड़ने का प्रयास प्राप्त करते हैं:ASP.NET

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 (विजुअल स्टूडियो में सेवा संदर्भ जोड़ें) के रूप में लिंकिंग सेवा का उपभोग करें क्योंकि ओडाटा मेरे लिए ठीक काम करता है। मैंने अपनी सेवाओं की स्थापना के 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 को गलत तरीके से उपभोग करने का प्रयास कर रहा हूं।

मेरा प्रश्न ... क्या मैं विजुअल स्टूडियो एएसपी.नेट परियोजना में linking.svc सेवा का उपयोग करने के लिए सही प्रक्रिया का पालन कर रहा हूं? यदि नहीं, तो कृपया आप इस एपीआई का उपयोग करने के तरीके को समझने में मेरी सहायता कर सकते हैं।

बहुत धन्यवाद

उत्तर

2

आप यहाँ प्रलेखन पढ़ी है (प्रवेश करना आवश्यक):

http://sdllivecontent.sdl.com/LiveContent/content/en-US/SDL_Tridion_2011_SPONE/reference_277A2D7264B04A39870C3FE18EF245BB

+0

धन्यवाद: मिहाई Cadariu द्वारा एक उदाहरण से

। मैंने इस दस्तावेज़ीकरण को देखा है लेकिन इसमें उपभोग उपयोग की कमी है। linking.svc और odata.svc फ़ाइलों को decompiling भी मुझे उनके उपयोग को समझने में मदद की। –

6

क्या आप जोड़ने सेवा के लिए अपनी खुद की ग्राहक लिखने पर विचार? यह एक काफी सरल REST-ful वेब सेवा है, तो आप यह एक मानक WebClient साथ उपयोग कर सकते हैं: इस ओर इशारा करते हुए क्रिस के लिए

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); 
+0

धन्यवाद पुफ। वास्तव में यह काम करता है और बाइनरी, गतिशील और पेज लिंक के लिए बढ़ाया जा सकता है। बहुत धन्यवाद –

+0

यदि आप उत्तर से संतुष्ट हैं, तो कृपया इसे सही उत्तर स्वीकार करें। –