>I run:
JaySvcUtil.exe --metadataUri http://localhost:1578/Service.svc/$metadata --out Model.js -- namespace Model --v V2
输出为:
Requesting: http://localhost:1578/Service.svc/$metadata... done.
OData version: V2
和结果文件:
(function(global, $data, undefined) {
})(window, $data);
各种 OData 版本有多个 edm 命名空间。我首先尝试避免使用--v开关,让JaySvcUtil.exe尝试确定正确的开关。
如果这不起作用,请检查支持的命名空间版本,https://github.com/jaydata/JaySvcUtil/blob/master/Program.cs
public static Dictionary<string, string> NamespaceVersions = new Dictionary<string,string>
{
{"http://schemas.microsoft.com/ado/2007/05/edm", "V11" },
{"http://schemas.microsoft.com/ado/2006/04/edm", "V1" },
{"http://schemas.microsoft.com/ado/2008/09/edm", "V2" },
{"http://schemas.microsoft.com/ado/2009/08/edm", "V21" },
{"http://schemas.microsoft.com/ado/2009/11/edm", "V3" }
};
如果由 localhost:1578/Service.svc/$metadata 生成的那个不在其中,请在 https://github.com/jaydata/JaySvcUtil/issues 处添加一个请求