Click here to Skip to main content
15,888,802 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi All,

I am developing a windows mobile application which works with web service.

In my application i am calling a WebMethod which takes dataset as parameter and returns a integer value.

but when i make a call to web method i am getting this error
Error occurs on calling the WebMethod "Client found response content type of 'text/html; charset=us-ascii', but expected 'text/xml'.

here is the webmethod code
C#
[WebMethod]
    public int  GetServices(DataSet ds)
    {
        SqlConnection con = new SqlConnection(constring);
        int rows = ds.Tables[0].Rows.Count;
        int srows = 0;
        foreach(DataRow dr in ds.Tables[0].Rows)
        {
            string query = "insert into Services(tckid,dscr,lngdesc,loc,asset,rptdt,crdt) values('"+dr[0].ToString()+"','"+dr[1].ToString()+"','"+dr[2].ToString()+"','"+dr[3].ToString()+"','"+dr[4].ToString()+"','"+dr[5].ToString()+"')";
            SqlCommand cmd = new SqlCommand(query, con);
            con.Open();
            int r = cmd.ExecuteNonQuery();
            if (r == 1)
            {
                srows = srows + 1;
            }
           
        }
        return srows;
        
    }

can any one have idea about this?if yes please share with me.

Thanks,Balu
Posted
Updated 9-Jan-12 22:30pm
v3

1 solution

Use a tool like TCP Monitor to debug the request/response and ensure you are passing / receiving values correctly.
 
Share this answer
 
v2
Comments
Balu199 10-Jan-12 5:00am    
Thanks for reply.i will try it.

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



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