0
votes

I built a oData-Service which works well. Now I want to query them with Breeze but I always get an 404 error. In Fiddler I see first a 200 with empty Body and then follows the 404 with "No HTTP resource was found that matches the request URI". But running in a normal browser the odata Service delivers the right data.

I debug it and set a breakpoint on the Server to see if the service is called correctly. After sending the request the breakpoint shows that the Service is called. But parallel to the break breeze calls the fail-method of

manager.executeQuery(query)
                    .then(querySucceeded)
                    .fail(queryFailed);

and e.message is empty.

Any idea??? :-/

Next entry...

I deactivate CORS and now I get the 404 immediately.

Here is the request:

OPTIONS xxx:8080/myDataService/odata/Person?$select=Name HTTP/1.1 Host: xxx:8080 Connection: keep-alive Access-Control-Request-Method: GET Origin:localhost:61244 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.99 Safari/537.36 Access-Control-Request-Headers: dataserviceversion, accept Accept: / Referer: http://localhost:61244/index.html Accept-Encoding: gzip, deflate, sdch Accept-Language: de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4

and here the answer:

HTTP/1.1 404 Not Found Content-Length: 178 Content-Type: application/json; odata.metadata=minimal Server: Microsoft-HTTPAPI/2.0 OData-Version: 4.0 Date: Mon, 19 Jan 2015 12:11:48 GMT

{ "error":{ "code":"","message":"No HTTP resource was found that matches the request URI xxx:8080/myDataService/odata/Person?$select=Name'." } }

1
Include more details about the requests- I think you can copy them out of fiddler and paste them in your question.Jeremy Danyow
The request is the same I can send with a browser and here it works.JMagnat

1 Answers

0
votes

No surprise that the OPTION request passes; you've probably got the server set to say "OK" to every request ... and that's just fine for now.

The rejection has to do with the address of your GET request: xxx:8080/myDataService/odata/Person. Are you sure that's the right endpoint? The path is usually plural (Persons).

It's easy enough to just paste that url into a browser address bar and see what it does.