Search code examples
c#.netwcf-data-services

WCF Data Services - "Bad Request - Error in query syntax."


I have this url in my browser :

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=

and I have the following method in my web service machine :

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

but accessing the url gives me the following exception : "400 Bad Request - Error in query syntax"


Solution

  • Quotation ignored for 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=