2011-12-06 73 views
1

我的網址,我的瀏覽器:WCF數據服務 - 「錯誤的請求 - 查詢語法錯誤。」

https://localhost/service.svc/Add?clientGuid=cf4cca29-e144-4e6a-8485-792f809d84cc 
           &contractId=6 
           &endSession=False 
           &GroupIds='0,1,2,3,4,5,6,7' 
           &FamilyIds= 
           &PartNumbers= 

,我有下面的方法在我的web服務機:

[WebGet] 
public void Add(string clientGuid, 
       int contractId, 
       bool endSession, 
       string GroupIds, 
       string FamilyIds, 
       string PartNumbers) 
{ 
    ... 
} 

但訪問的URL給了我以下異常:「400錯誤的請求 - 錯誤在查詢語法」

回答

1

報價忽略GUID:

https://localhost/service.svc/Add?clientGuid=guid'cf4cca29-e144-4e6a-8485-792f809d84cc' 
            &contractId=6 
            &endSession=False 
            &GroupIds='0,1,2,3,4,5,6,7' 
            &FamilyIds= 
            &PartNumbers= 
+0

即使用引號,它仍會拋出異常。 – Attilah

+0

也許錯誤而不是False,請參閱http://www.odata.org/developers/protocols/overview#AbstractTypeSystem –

+0

或修改clientGuid = guid'cf4cca29-e144-4e6a-8485-792f809d84cc' –