This is my jquery
var selectedCampaigns = $("#campaignDiv input:checkbox:checked").map(function () {
return $(this).val();
}).get();
console.log(selectedCampaigns);
$.getJSON(webServiceUrl,
{ fromDate: valFrom, toDate: valTo, campaigns: selectedCampaigns })
.done(function (result) {
This is the request :
Request URL:http://localhost:4025/vmp_webservice.asmx/LoadService2Daily?fromDate=2014-05-26+00%3A00%3A00&toDate=2014-05-26+23%3A59%3A01&campaigns%5B%5D=direct&campaigns%5B%5D=Sales
This is the response (500 internal error):
System.NullReferenceException: Object reference not set to an instance of an object.
at System.Web.Services.Protocols.ValueCollectionParameterReader.Read(NameValueCollection collection)
at System.Web.Services.Protocols.UrlParameterReader.Read(HttpRequest request)
at System.Web.Services.Protocols.HttpServerProtocol.ReadParameters()
at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()
The web service is not envoke at all because I put breakpoints in the first line but the break point is not fired.
Note
If i removed the string array from my jquery and from my web service, the web service works perfectly so 100% the problem from the string array
am i passing the array correctly?
web service
[WebMethod]
[ScriptMethod(UseHttpGet = true)]
public void LoadService2Daily(string fromDate, string toDate, string[] campaigns)
{
Please help me I really don't know what to do