Click here to Skip to main content
15,498,652 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to pass the parameter '999999999' to an webservice when i execute iam getting the error System.InvalidOperationException: Missing parameter: callerid.

pls help me out.

function SearchText() {
     $('#<%= txtusername.ClientID%>').autocomplete({
         source: function (request, response) {
                 type: "POST",
                 contentType: "application/json; charset=utf-8",
                 url: "../HttpHandler/Autocomplete.asmx/GetCallername",
                 data: "{'callerid':'" +9999999999+ "'}",
                 dataType: "json",
                 success: function (data) {
                     alert('i enter');
                 error: function (result) {

webservice :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using MSDataAccess;
using System.Data;

namespace Sun.HttpHandler
    /// <summary>
    /// Summary description for Autocomplete
    /// </summary>
    [WebService(Namespace = "")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class Autocomplete : System.Web.Services.WebService

        public string GetCallername(string callerid)
            ConnectionCls clsConObj = new ConnectionCls();

            DataSet ds = null;
            string strPriorityOfCall = null;
            object[] obj = new object[6];
            obj[0] = 1;
            obj[1] = 1;
            obj[2] = 1;
            obj[3] = 1;
            obj[4] = 1;
            obj[5] = callerid;

            ds = DataAccess.ExecuteDataset(clsConObj.getConnectionString(), "sp_autoload", obj);
            if (ds.Tables[0].Rows[0]["CallerName"].ToString() != System.DBNull.Value.ToString())
                return ds.Tables[0].Rows[0]["CallerName"].ToString();
                return "User Doesnt Exist";
Updated 19-Jul-13 0:16am

1 solution

Take the 99999999 out of the quotes. You essentially are adding the number plus the string. Since it is just a hard coded number do it like this:

data: "{'callerid':'9999999999'}",
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900