Maybe this question is frequent in the forums, but After days of searching the forum without success, I decided to ask for help.
I am trying to send to my web service an array of objects in JSON format, but without success, I always get a 500 error on the server side, I try different ways (especially found here) but I keep getting the same error.
the json format I get form a jquery plugin that transforms a table into JSON code.
this is the message from the navegator
Message: "Invalid web service call. Missing value for parameter: 'totalKilos'."
And this is my JSON Code
{
"lista": [
{
"idSolVenta": "1",
"rutEmpresa": "123456789",
"idDetalleSolicitud": "1",
"idCategoria": "3",
"idSubcategoria": "8",
"CantidadKilos": "123456"
},
{
"idSolVenta": "1",
"rutEmpresa": "123456789",
"idDetalleSolicitud": "1",
"idCategoria": "3",
"idSubcategoria": "8",
"CantidadKilos": "123456"
}
]
}
//and more, it's dinamic
And this is my Ajax code
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "http://localhost:63160/WebServiceDetalleSolicitudVenta.asmx/insertarSolicitudVenta",
data:salida,
//crossDomain: true,
dataType: "json",
beforeSend: function (x) {
if (x && x.overrideMimeType) {
x.overrideMimeType("application/j-son;charset=UTF-8");
}
},
success: function () {
alert("SUCCESS!");
},
error: function (msg, source, lineNo, columnNo, error) {
alert("Error: " + msg +
"\nScript: " + source +
"\nLine: " + lineNo +
"\nColumn: " + columnNo +
"\nStackTrace: " + error);
}
I am really desperate, I hope you can help me find an answer thank you very much to all