Webservice problem

Hi

I have some issues calling webservices. I have a server running on a wireless network that hosts the webservice im trying to access. This webservice has 3 simple methods that return string arrays and a dataset.

My problem is that everyonce in a while the webservice stops responding and the pocket application justs gets stuck, sometimes it will achieve 10 calls sucessfully on a row, and sometimes in the first call it fails.

Any ideas why is this happening, or what am I missing? I tried to add a timer, wait for 10 seconds to get the response and then abort the call, however it didnt work that well.

the code is quite simple:

VinosWeb.VinosWeb dataaccess =new VinosWeb.VinosWeb();
int[]lista =this.dataaccess.getPais(param);

and the webservice getPais call:

[WebMethod]

publicint[] getPais(int t)

{

SqlConnection con =new SqlConnection("workstation id=localhost;packet size=4096;integrated security=SSPI;data source=localhost;persist security info=False;initial catalog=Vino");

String s = "SELECT DISTINCT Pais FROM Vino WHERE Tipo = '"+t+"';";
SqlDataAdapter da =
new SqlDataAdapter(s,con);
DataSet ds =
new DataSet();
da.Fill(ds);
int[] lista =newint[ds.Tables[0].Rows.Count];
for(int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
lista[i ] =
int.Parse(ds.Tables[0].Rows[i ]["Pais"].ToString());
}
return lista;

}

[2453 byte] By [Albino] at [2007-12-16]
# 1

The troubleshooting steps in your case could be the following:

- Try to call the same web service from a desktop with a reliable network connection and see if you'd get any handgups. If yes, then it's a problem in the web service method call.

- If you'd not get any problems from a desktop client then most probably you're loosing connection.

AlexY at 2007-9-9 > top of Msdn Tech,Smart Device Development,.NET Compact Framework...
# 2
Thanks for the reply

I tried calling the web service from my desktop as you said and it worked, so it was the wireless network that was giving problems, however i couldnt change this conection.
I fixed the problem using async calls to the webservice, plus a timeouthandler, whenever the webservice hanged for over 10 seconds i aborted the async call and retry the call.

Albino at 2007-9-9 > top of Msdn Tech,Smart Device Development,.NET Compact Framework...
# 3

Hi,

I seem to be having the same problem. Does setting the timeout on a syncronous call work? Why did you move to async.


Thanks!

InquiringMinds at 2007-9-9 > top of Msdn Tech,Smart Device Development,.NET Compact Framework...