Previous Page Arrow Next Page Arrow

14.4 Registration Example

A provider can register its endpoints by POSTing them to the registry. Here is an example:

POST /sdata/$system/registry/-/endpoints
Content-Type: application/atom+xml; type=entry
 
<entry xmlns="http://www.w3.org/2005/Atom">
  <id/>
  <title/>
  <content/>
  <payload xmlns="http://schemas.sage.com/sdata/2008/1">
    <endpoint xmlns="http://schemas.sage.com/sdata/registry/2009">
      <title>Accounts 50 GCRM 1.0 demo</title>
      <description>URL for Accounts 50 GCRM 1.0 demo integration<description>
      <endpointType>dataSet</endpointType>
      <protocol>http</protocol>
      <host>wwww.example.com</host>
      <port>80</prot>
      <applicationName>accounts50</applicationName>
      <contractName>GCRM</contractName>
      <contractVersion>1.0</contractVersion>
      <dataSetName>demo</dataSetName>
      <url>http://www.example.com/sdata/accounts50/gcrm/demo<url>
      <isBrowsable>true</isBrowsable>
      <aliveStamp>2009-04-02T08:32:19Z</aliveStamp>
    </endpoint>
  </payload>
</entry>

The registry provider will respond with a normal SData POST response:

 201 Created   
Content-Type: application/atom+xml; type=entry   
Location: [http://www.example.com/sdata/$system/registry/-/endpoints('1'](http://www.example.com/sdata/$system/registry/endpoints())   
ETag: 2nXz9DZYR2pqmcXi/ZCbYA== 

<!-- same entry as above --> 

A provider can also register all its endpoints in a single batch operation, by posting a batch feed (see Batch Request) to the $system/registry/-/endpoints/$batch URL

A provider can update or delete existing endpoint resources by sending a PUT or DELETE request to the registry.

Every interaction with the registry should be authenticated and all operations on the registry will be controlled by means of access rights. The details are specific to each implementation of the registry.

The providers only need to register their endpoints. The registry will derive the list of contract resources automatically from its list of endpoint resources.


Previous Page Arrow Next Page Arrow