title: Rendering Component link with Tridion2011 OData Linking.svc
body: <p>We are using custom-written proxy class for handling the Web Service communication provided by Mihai Cadariu (screenshot attached) for resolving dynamic linking.
  For forming the LinkUrl parameters to resolve dynamiclink/component link we are following the below sample approach. But its throwing error (stacktrace,debug error)attached .Please validate and provide the inputs where we are going wrong. Please let us know the parameters we are passing are correct or not</p>
  
  <p><strong>Approach we used:</strong></p>
  
  <p>-->We have two components Comp1,Comp2 (can be created of same/different schema guess it not any issue)</p>
  
  <p>-->Comp2 is being used as component link inside Comp1 (we have a component link field in comp1)</p>
  
  <p>-->Created two dynamic CT’s DCT1, DCT2 for each comp (CT’s have simple DWT, Default finish actions)
  Note: also tried keeping  DD4T TBBs in similar set of CT’s as other approach but final got same error result</p>
  
  <p>-->DWT code has --> SomeLink (to render component link so that LinkResolver TBB will resolve the links)
  Also kept OTHWayLink (for cross checking)</p>
  
  <p>-->Created two Pages Page1 (has Comp1+DCT1), Page2 (has Comp2 +DCT2) and published both pages to broker DB</p>
  
  <p>-->Our goal is to resolve component link (Comp2) which is present inside Comp1 content so,</p>
  
  <p>-->For GetDynamicLink() we provided parameters as given below. Which throwed error :400 (bad request) and exception in log trace attached above.</p>
  
  <pre><code>   Param’s List --&gt; string targetPageUri, string targetComponentUri, string targetTemplateUri, string linkText, bool showTextOnFail, string linkTagAttributes
  
     Param’s we passed--&gt; Page2 tcmid, Comp2 tcmid, DCT2 tcmid ,”some link txt”,true,”some string”;
  </code></pre>
  
  <p>-->For GetComponentLink()we provided parameters as given below. In this case we tried keeping both dynamic and non dynamic CT’s combination inside pages, Which also throwed error :400 (bad request) and exception in log trace attached above.</p>
  
  <pre><code>   Param’s List --&gt; string targetComponentUri, string sourcePageUri, string excludeTemplateUri, string linkText, bool showTextOnFail, bool showAnchor, string linkTagAttributes
  
     Param’s we passed --&gt; Comp2 tcmid, Page1 tcmid, DCT1 tcmid, “some link txt”,true,true,”some string” ;
  </code></pre>
  
  <p>we are refering <a href="http://sdllivecontent.sdl.com/LiveContent/web/pub.xql?action=home&amp;pub=SDL_Tridion_2011_SPONE&amp;lang=en-US#addHistory=true&amp;filename=CDWSLinkingAPI.xml&amp;docid=reference_277A2D7264B04A39870C3FE18EF245BB&amp;inner_id=&amp;tid=&amp;query=&amp;scope=&amp;resource=&amp;eventType=lcContent.loadDocreference_277A2D7264B04A39870C3FE18EF245BB" rel="nofollow noreferrer">Live documentation</a> for Linking.</p>
  
  <p>Mihai Proxy Code sample: <img src="https://i.stack.imgur.com/hyGAp.jpg" alt="Proxy class code">
  Error message: <img src="https://i.stack.imgur.com/Vs9wP.jpg" alt="Error"></p>