OData Connected Service version 0.6.0 Release

Elizabeth Okerio

OData Connected Service 0.6.0 has been released and is available in the Visual Studio Marketplace. The new version adds the following features:

  1. Custom Http headers. 
  2. Generation of multiple files.
  3. Writing metadata to a file.

Custom Http Headers 

This feature allows you to add headers that will be sent with the request that fetches the metadata used in generating proxy files. This is actually important when using protected metadata to generate proxy files. To access the metadata endpoint, you may be required to pass authorization headers as shown below. These values are not stored within the OData Connected Service or in your computer and you are required to provide them anytime you update the OData Connected Service.  

HeaderKey1: HeaderValue1
HeaderKey2: HeaderValue2
HeaderKey3: HeaderValue3

Ensure that each header is on a separate line. 

To use this feature, follow the following simple steps:

  1. Right click on the project you are working on from the solution explorer.
  2. Select Add->Connected Service from the context menu.
  3. From the Connected Service Window that opens, select the Microsoft OData Connected Service.
  4. On the wizard window, you will see a provision to input your Custom Headers. Input your headers using the above structure. 

Image configodataendpoint

Generation of Multiple Files

This feature allows OData connected service to generate multiple files. Currently, OData Connected Service generates only one file. The size of this file varies depending on the size of your service’s metadata. If you have a huge metadata, then the generated file will be very huge and may affect the performance of your application. This feature works by generating a file for each entity type and enum type in your service’s metadata file.

If you have the OData Connected Service extension installed,

  1. Right click on the project you are working on from the solution explorer.
  2. Select Add->Connected Service from the context menu.
  3. From the Connected Service Window that opens, select the Microsoft OData Connected Service.
  4. On the wizard window, configure your service endpoint by providing the service name and the OData URL endpoint then click Next.
  5. On the Next page, click on the “AdvancedSettings” link.

Check the checkbox beside the “Generate multiple files” configuration on this page then click finish.

Image advancedsettings

The generated files appear like below: 

Image multiplefiles

Writing metadata to a file

Currently, OData Connected Service writes an endpoint’s metadata to a string in the generated file. This makes the generated file unnecessarily huge and difficult to handle in cases where the metadata is huge. With this feature, an endpoint’s metadata will be written to a file and loaded when the DataServiceContext is initialized.  This file is located within the connected service project folder and is called Csdl.xml.

Update

The feature to support the writing of service metadata to a file introduced a bug to OData Connected Service v0.6.0. It was therefore removed from this particular version and a fix for it was added to the OData Connected Service v0.6.1 release. 

There are more features and fixes coming to OData Connected Service soon, so stay tuned for upcoming releases.

0 comments

Discussion is closed.

Feedback usabilla icon