简体   繁体   中英

Visual Studio OData “Add Service Reference” code-gen failing

This data.gov website gives an OData data export with instructions to use the link http://data.cms.gov/OData.svc/97k6-zzx3

https://data.cms.gov/Medicare/Inpatient-Prospective-Payment-System-IPPS-Provider/97k6-zzx3屏幕截图

(After Nugeting Install-Package Microsoft.Data.Services.Client version 5.6.1) I attempt to use the full link to "Add Service Reference" to my C# project in either Visual Studio 2012 or Visual Studio 2013, I get 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. ... 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. ...

Visual Studio错误消息1

If I truncate the URL to http://data.cms.gov/OData.svc then I get one step further, but still an error 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 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 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 (I suppose since C# identifiers cannot begin with digits)

Visual Studio错误消息2

Is this a bug with data.cms.gov or Visual Studio (etc)? Is there a close workaround?

Thanks!

Try using https://data.cms.gov/OData.svc/$metadata . Code-generation needs metadata, the above URL will provide that.

The URL https://data.cms.gov/OData.svc is the service document, not metadata.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM