问题
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.
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.
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:
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.
回答1:
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.
- Open http://myWeb:8145/DynamicsNav90_Desa/OData/$metadata in the browser and save it on disk
- Use path to this file during adding service reference in Visual Studio:
For me it works perfectly.
来源:https://stackoverflow.com/questions/53335235/consume-odata-service-from-visual-studio-2017