M
MikeB
Hello all, I keep getting inconsistant connection failures and can not
figure it out. I have a strong signal (through ATT Network) however I can
run a transaction and it will fail sometimes while the next time it goes
through without a problem. Any ideas, below is my connection code:
Also, this is CF1.1
//Apply Certificate Policy
ServicePointManager.CertificatePolicy = new AcceptUntrustedSSLPolicy();
//URL = HTTPS://www.mysite.com
req = (HttpWebRequest)System.Net.WebRequest.Create(sURL);
//enncode the form data string into a byte array
b = System.Text.Encoding.ASCII.GetBytes(sPayLoad);
//Indicate Method as Post and set the Length and Type of Data being Posted
req.Method = "POST";
req.ContentType = "UTF197/TCS";
req.KeepAlive = false;
req.AllowWriteStreamBuffering = true;
req.Timeout = 60000;
req.Headers.Add("POST","/controller HTTP/1.0");
req.Headers.Add("Auth-MID:" + _strXXNbr);
req.Headers.Add("Auth-TID:" + _strXXID);
req.Headers.Add("Auth-User:" + _strUserID);
req.Headers.Add("Auth-Password:" + _strPassword);
req.Headers.Add("Stateless-Transaction:true");
req.Headers.Add("Header-Record:false");
s = req.GetRequestStream();
s.Write(b, 0, b.Length);
s.Close();
res = (HttpWebResponse)req.GetResponse();
//read the returned page and place into a text control
sr = new StreamReader(res.GetResponseStream());
//Read Result
_strFullResponse = sr.ReadToEnd();
//close opened connections
sr.Close();
res.Close();
return _strFullResponse;
figure it out. I have a strong signal (through ATT Network) however I can
run a transaction and it will fail sometimes while the next time it goes
through without a problem. Any ideas, below is my connection code:
Also, this is CF1.1
//Apply Certificate Policy
ServicePointManager.CertificatePolicy = new AcceptUntrustedSSLPolicy();
//URL = HTTPS://www.mysite.com
req = (HttpWebRequest)System.Net.WebRequest.Create(sURL);
//enncode the form data string into a byte array
b = System.Text.Encoding.ASCII.GetBytes(sPayLoad);
//Indicate Method as Post and set the Length and Type of Data being Posted
req.Method = "POST";
req.ContentType = "UTF197/TCS";
req.KeepAlive = false;
req.AllowWriteStreamBuffering = true;
req.Timeout = 60000;
req.Headers.Add("POST","/controller HTTP/1.0");
req.Headers.Add("Auth-MID:" + _strXXNbr);
req.Headers.Add("Auth-TID:" + _strXXID);
req.Headers.Add("Auth-User:" + _strUserID);
req.Headers.Add("Auth-Password:" + _strPassword);
req.Headers.Add("Stateless-Transaction:true");
req.Headers.Add("Header-Record:false");
s = req.GetRequestStream();
s.Write(b, 0, b.Length);
s.Close();
res = (HttpWebResponse)req.GetResponse();
//read the returned page and place into a text control
sr = new StreamReader(res.GetResponseStream());
//Read Result
_strFullResponse = sr.ReadToEnd();
//close opened connections
sr.Close();
res.Close();
return _strFullResponse;