How do you set a link? (SetLink vs AddLink)

Oct 14, 2009 at 7:50 PM

How do you SetLink?

WHen running the Northwithnds simple sample7, the following code
adds to the $cust collection of links a link to the new order

     $proxy->AddLink($cust, "Orders", $newO);

I want to add a link to the $newO back to the $cust.
     $proxy->AddLink($cust, "Orders", $newO);
     proxy->AddLink($newO, "Customers", $cust)

This fails as follows

     Error: Th   e URI '
     Service.svc/$2/$links/Customers' is not valid for POST operation. For POST opera
     tions, the URI must refer to a service operation or an entity set.<br>Detailed E

Since it is not a collection of links I tried SetLink but that is
not defined. 

     $proxy->AddLink($cust, "Orders", $newO);
     $proxy->SetLink($newO, "Customers", $cust);

     PHP Fatal error:  Call to undefined method NorthwindEntities::SetLink() in C:\Hmm
     m\Sample7.php on line 51

How do I go about adding a link from the order back to the

Oct 16, 2009 at 4:26 PM


This release of toolkit don't have the support for SetLink API, we are working on the next release so we will make sure to include SetLink too.



Mar 17, 2010 at 4:54 AM

Hi vpendroza,

Yesterday we have released a new version of SDK, Please visit the site

This release include support for SetLink, some other new features are:

  • Support for all new OData protocol features (Projections, Server-Side paging, Blobs, RowCounter and Customizable Feeds)
  • Support for Azure authentication (Azure T)
  • Better programming model with APIs for all Query Options
  • More command line options