4

I've a issue consuming Dynamics Nav OData. I'm using Visual Studio Community 2017 (version 15.9.0), and I've installed the extension OData Connected Service (Official Microsoft Extension)1.

Extension installed at Visual Studio

This is my Odata structure:

http://myWeb:8145/DynamicsNav90_Desa/OData

I've verified and the odata is returning 2 values correctly at opera browser.

OData Respone

So far, it's working fine.

The problem is when I go to the visual studio and I try to add a new connected service, It throws the next error 3:

Odata ERROR

Image text:

Connected Services Cannot access http://myWeb:8145/DynamicsNav90_Desa/OData/$metadata

I've checked the firewall and the port information and they are totally open to connect.

ATellez
  • 115
  • 1
  • 11
  • Sounds like an interesting problem, but I am unable to see your screenshots (blocked by our firewall). Maybe you can add the actual text? – johey Nov 16 '18 at 09:54
  • Hello @johey try to refresh, maybe I was editing the publish to add more information. – ATellez Nov 16 '18 at 10:03
  • That won't help, the domain imgur.com is completely blocked by our firewall / proxy server. :-| – johey Nov 16 '18 at 10:26
  • @johey I've added the text error – ATellez Nov 16 '18 at 10:31
  • Thanks for that. The problem does not really ring a bell though. Maybe it is security related? You can check this issue on OData's Github: https://github.com/OData/lab/issues/56 – johey Nov 16 '18 at 11:30
  • Post full steps how to add & invoking OData in ASP.Net. – Magento Nav Nov 15 '19 at 09:24

1 Answers1

4

I had the same issue (I'm also working with Dynamics Nav ;) )

The problem is that OData Connected Service doesn't support authorization.

You need to save metadata file locally and point it when adding OData Service Reference.

  1. Open http://myWeb:8145/DynamicsNav90_Desa/OData/$metadata in the browser and save it on disk
  2. Use path to this file during adding service reference in Visual Studio: List item

For me it works perfectly.

Adrian Bystrek
  • 528
  • 2
  • 6
  • 19
  • 1
    Post full steps how to add & invoking OData in ASP.Net. – Magento Nav Nov 15 '19 at 09:24
  • @MagentoNav take a look at this [guide](https://learn.microsoft.com/en-us/dynamics-nav/walkthrough--creating-and-interacting-with-a-page-web-service--odata-) – Gilbert Aug 04 '21 at 17:39