Error calling http: metadata request failed:

I have a BreezeController in a WebApi 2 project:

[BreezeController] public class BreezeController : ApiController { private readonly IBreezeRepository _repo; public BreezeController(IBreezeRepository repo) { _repo = repo; } [HttpGet] public string Metadata() { return _repo.MetaData; } [HttpGet] public IQueryable<Property> Properties() { return _repo.Properties; } } 

In my client application, this code is for data usage:

 var mgr = new breeze.EntityManager({ serviceName: "http://localhost:24830/breeze/breeze/" }); EntityQuery .from('Properties') .select('ID') .using(mgr) .execute() .then(querySucceeded, _queryFailed); function querySucceeded(data) { return data.results; } function _queryFailed(error) { alert("Error while making http call: " + error.message); } 

When I launch my application - this is a mobile application and it opens in Ripple - I can debug it in javascript. It runs in the _queryFailed method, and I get this error message:

Failed to complete metadata request for: http: // localhost: 24830 / breeze / breeze / Metadata ; undefined

The server also runs in the debugger. It does not hit the breakpoint in the Metadata() method. But this will happen if I put the path in the browser and return MetaData.

What can I do now to investigate the problem?

EDIT I tried something else. I opened separate projects in separate instances of Visual Studio (I am using VS 2015 RC). Now I hit a breakpoint on the server, and my client goes into the querySucceeded function. Such a success. So the question is changing. Is there a way to set up the environment to work in only one instance of Visual Studio?

+5
source share
1 answer

Have you tried to manually obtain metadata?

 function fetchMetadata() { var manager = new breeze.EntityManager("api/breeze"); if (manager.metadataStore.isEmpty()) { return manager.fetchMetadata(); } return Q.resolve(); } function start() { fetchMetadata().then(function () { // Metadata fetched. // Do something here. }); } 

source: breeze fetch metadata if not

+1
source

All Articles