This data.gov website为OData数据导出提供了使用链接http://data.cms.gov/OData.svc/97k6-zzx3
(在Nugeting Install-Package Microsoft.Data.Services.Client
版本5.6.1之后)我尝试在Visual Studio 2012或Visual Studio 2013中使用“添加服务引用”的完整链接到我的C#项目,我得到There was an error downloading 'http://data.cms.gov/OData.svc/97k6-zzx3/_vti_bin/ListData.svc/$metadata'.
The request failed with HTTP status 404: Not Found. ...
如果我将URL截断为http://data.cms.gov/OData.svc
,那么我会更进一步,但仍然是错误The custom tool 'DataServicesCoreClientGenerator' failed. Data service client code-generation failed: Schema specified is not valid. Errors: ... The 'Name' attribute is invalid - the value '97k6-zzx3' is invalid according to its datatype
(我想,因为C#标识符不能以数字开头)
这是data.cms.gov或Visual Studio(等)的错误吗?有没有紧密的解决方法?
谢谢!
答案 0 :(得分:4)
尝试使用https://data.cms.gov/OData.svc/$metadata
。代码生成需要元数据,上面的URL将提供。
网址https://data.cms.gov/OData.svc
是服务文档,而不是元数据。