1
public static bool Sinc(int v, out List<Ma> x)
{
try
{
XmlDocument urlData = new XmlDocument();
HttpWebRequest rq = (HttpWebRequest)WebRequest.Create("http://192.168.1.155/Ser.svc/maq/?v=" + v;
rq.Timeout = 30000;
HttpWebResponse response = rq.GetResponse() as HttpWebResponse;
using (Stream responseStream = response.GetResponseStream())
{
XmlTextReader reader = new XmlTextReader(responseStream);
urlData.Load(reader);
}
XmlNodeList companyList = urlData.GetElementsByTagName("VP");
List<Ma> z = new List<Ma>();
foreach (XmlNode node in companyList)
{
......
}
if (z.Count != 0)
{
x = z;
return true;
}
else
{
x = z;
return false;
}
}
catch
{
x = null;
return false;
}
}
I use this function to get data from mine WEBSERVICE
, when I use it the first time works without any kind of problem. When I use it the second time gives me error timeout
, exits the application and goes back and forth correctly. Does anyone know what might be?