Autocomplete and web service(asp.net

Autocomplete and web service(asp.net

Hello everybody
 
I am novice with Jquery and now going ask stupid question. I am trying to load data from web serivice.I Even manage to call webservice function and get some data.Some reason Google Suggest doesnt work.
 
here is my Autocomplete code:
  1. <script type="text/javascript">

    $(

    function() {

    $(

    "#test").autocomplete({

    source:

    function(request, response) {

    $.ajax({

    type:

    "POST",

    url:

    "Services/PurchaseRecomendationService.asmx/GetProductClient",

    data:

    "{ 'name': '" + request.term + "' }",

    contentType:

    "application/json; charset=utf-8",

    dataType:

    "json",

    success:

    function(msg) {

    return msg.d;

    /* var list = msg.d;

    /*return msg.d;*/

    }

    });

    }

    });

    })

 
Here is my webmethod:
  1. [

    WebMethod]

    public string[] GetProductClient(string name)

    {

    SqlHandler sql = new SqlHandler(ConfigurationManager.ConnectionStrings["EslProConnectionString"].ConnectionString);

    string sqlquery = string.Format("SELECT TOP 10 name FROM Product WHERE name LIKE '{0}%'",name);

    DataTable dt = sql.ExecuteSelectCommand(sqlquery);

    String[] products = new String[dt.Rows.Count];

    for (int i = 0; i < dt.Rows.Count; i++)

    {

    products[i] = dt.Rows[i][

    "name"].ToString() ;

    }

    return products;

    }

  2. I think main prolem is that i dont now how to initialize datasource for autocomplete.Please help me