2012-11-21 24 views
1

我運行:Jaysvcutil不產生類

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); 

回答

3

有幾個EDM-命名空間不同的OData版本。我首先嚐試避免--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" } 
    }; 

檢查名稱空間的支持版本如果由本地主機產生的一個:1578/Service.svc/$元數據是不是在裏面添加要求在https://github.com/jaydata/JaySvcUtil/issues