I can't get a WCF call to work from jquery while passing two parameters. If I change the code up a bit to pass just one things work ok.
The Javascript:
$.ajax({
type: "POST", //GET or POST or PUT or DELETE verb
url: "/Services/JobNumberService.svc/GetActiveJobNumberByCustomerOrJointBilling", // Location of the service
data: '{"customerId": "' + customerId + '", "departmentId": "' + departmentId + '"}', //Data sent to server
contentType: "application/json; charset=utf-8", // content type sent to server
dataType: "json", //Expected data format from server
processdata: true, //True or False
success: function (msg) {//On Successfull service call
fillDropDownFromLookupList(msg, jobNumberDropDownId);
prependItemToDropDown('', 'NONE', jobNumberDropDownId); //Add blank item to top of list
},
error: ServiceFailed// When Service call fails
});
Service Signature:
public LookupList GetActiveJobNumberByCustomerOrJointBilling(int customerId, int departmentId)
It's got to be something with how I'm formatting the json that's passed in. It's valid according to JSONLint but maybe not what .net expects.
Ideas are appreciated.
EDIT
This is what I get back in the response
HTTP/1.1 500 Internal Server Error
Server: ASP.NET Development Server/11.0.0.0
Date: Thu, 28 Feb 2013 20:30:17 GMT
X-AspNet-Version: 4.0.30319
Cache-Control: private
Content-Length: 0
Connection: Close
O, I also tried to turn off just my code debugging to track down what the error was but I wasn't seeing any exceptions for some reason.
web.configas follows:<system.web><customErrors mode="On" /></system.web>- If that doesn't work, let me know and I'll help you dig in further.customErrorsneeds to be set toOffin order to get verbosity.