It takes more than 30 seconds to load and process a xml hosted in HTTPS
i used following code access service hosted in https. out put need process xml document takes time (30 seconds) after application being idle more 10 minutes. please me finding issue this. public lbslocation getlbslocationinfo(string mobileno)
{
lbslocation location = new lbslocation();
try
{
string url ="https://125.214.169.85/gmlc/legacy?classid=web_engine_v2&methodid=handler&username=abc&password=1234ff&clientcode=abb&phoneno=777733773"
xmldocument doc = new xmldocument();
httpwebrequest rq = (httpwebrequest)webrequest.create(url);
system.net.servicepointmanager.servercertificatevalidationcallback = new system.net.security.remotecertificatevalidationcallback(remotecertificatevalidationcallback);
httpwebresponse response = rq.getresponse() httpwebresponse;
using (stream responsestream = response.getresponsestream())
{
xmltextreader reader = new xmltextreader(responsestream);
doc.load(reader);
xmlnodelist nodelist = doc.getelementsbytagname("location");
(int = 0; < nodelist.count; i++)
{
xmlnode n = (xmlnode)nodelist[i];
location.latitude = n.childnodes[0].innertext;
location.longitude = n.childnodes[1].innertext;
location.locationname = n.childnodes[2].innertext;
}
}
return location;
}
catch (exception ex)
{
throw ex;
}
}
public static bool remotecertificatevalidationcallback(object sender, x509certificate certificate,
x509chain chain, sslpolicyerrors errors)
{
return true;
}
thank you,
damith
damith,
try code own webserver , see if delay in program or in server.
if tracert website takes @ least 30 seconds (i stopped in middle)
success
cor
Visual Studio Languages , .NET Framework > Visual C#
Comments
Post a Comment