You have to create a JSON string of Array Object and pass the Object to Web Service. Most Advantages of this type of calling functionality is not need to Type Conversation or Casting.
Step 1: Create Simple html page like.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Page</title>
<script src="js/jquery-1.9.1.js" type="text/javascript"></script>
<script type="text/javascript" src="js/json2.min.js"></script>
</head>
<body>
<script type="text/javascript">
BindContactInfo();
function BindContactInfo() {
//Create an array of Contact Details class.
var contact = new Array();
for (var i = 0; i < 2; i++) {
var ContactInfo = new Object();
if (i == 0) {
ContactInfo["FirstName"] = "Jayendrasinh";
ContactInfo["LastName"] = "Gohil";
ContactInfo["Address"] = "A/74 Ankur";
ContactInfo["City"] = "Ahmedabad";
ContactInfo["State"] = "Guj";
ContactInfo["Zip"] = 382350;
}
else if (i == 1) {
ContactInfo["FirstName"] = "Pratipalsinh";
ContactInfo["LastName"] = "Gohil";
ContactInfo["Address"] = "A/74 Anour";
ContactInfo["City"] = "Vadodara";
ContactInfo["State"] = "Guj";
ContactInfo["Zip"] = 382350;
}
contact[i] = ContactInfo;
}
/* Create a data transfer object (DTO) with the
remember DTO Parameter and Web Sevice Parameter name are same.
*/
var DTO = { 'ContactInfo': contact };
$.ajax({
contentType: "application/json; charset=utf-8",
data: JSON.stringify(DTO),
dataType: "json",
type: "POST",

Dharmendra Kumar PanditPosted Jan 13, 2020, 8:12 AM
Thank you sir...This article helped me a lot . I was searching from a long time. THANKS AGAIN.