Consume OData Service from Visual Studio 2017

最后都变了- 提交于 2019-12-20 02:36:31

问题


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.

  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:

For me it works perfectly.



来源:https://stackoverflow.com/questions/53335235/consume-odata-service-from-visual-studio-2017

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!