Search code examples
odatabreeze

BreezeJS/Odata - metadata location/url


In our odata service implementation, the autogenerated metadata can be accessed at:

https://<ourserver>/v1/$metadata

But the BreezeJS tries to access it from https://<ourserver>/v1/Metadata. And it gets a 404 error as the metadata is not served at this location.

How to instruct BreezeJs to find the metadata at any given URL?

The code entityManger.fetchMetadata() is trying reach metadata at https://<ourserver>/v1/Metadata and not at where it is available https://<ourserver>/v1/$metadata


Solution

  • You need to tell Breeze that you are using OData, by default it assumes WebApi. So:

    breeze.config.initializeAdapterInstances({ dataService: "OData" });
    

    Also see: http://www.breezejs.com/documentation/odata