This project has moved. For the latest updates, please go here.

Camlex not working in WebMethod 3.5


Here is my web method that I call with help of Ajax JQuery. When sending a request I receive 500 error.
Commenting string
string caml = Query () Where (x => (string) x [ "Title"] = ""!) .ToString ().;
and Web method works get a 200 response.
In the console application it works but in web method CAMLEX does not work. Please tell me why?
        [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
        public static int CountPromotions(string listName, string configTags)
            using (SPWeb web = new SPSite(SPContext.Current.Web.Url).OpenWeb())
                SPList list = web.Lists[listName];
                var query = new SPQuery();
                string caml =
                        .Where(x => (string)x["Title"] != "").ToString();

                query.Query = caml;
                SPListItemCollection listcol = list.GetItems(query);

                return listcol.Count;