nope
HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create(upsRateUri);
myReq.Headers.Clear();
myReq.Method = "POST";
myReq.ContentType = "application/x-www-form-urlencoded";
myReq.ContentLength = xmlString.Length;
using (StreamWriter sendingData = new
StreamWriter(myReq.GetRequestStream()))
{
sendingData.Write(xmlString);
sendingData.Flush();
sendingData.Close();
}
WebResponse myResponse = myReq.GetResponse();
StreamReader responseStream = new StreamReader
(myResponse.GetResponseStream());
XmlDocument shippingXml = new XmlDocument();
shippingXml.LoadXml(responseStream.ReadToEnd());
responseStream.Close();
myResponse.Close();Still getting the "The underlying connection was closed: Could not establish
trust relationship for the SSL/TLS secure channel" error message, after a
period of time.
"carion1" <dd******@gmail.comwrote in message
news:11**********************@b58g2000hsg.googlegr oups.com...
HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create(upsRateUri);
myReq.Headers.Clear();
myReq.Method = "POST";
myReq.ContentType = "application/x-www-form-urlencoded";
myReq.ContentLength = xmlString.Length;
using(StreamWriter sendingData = new
StreamWriter(myReq.GetRequestStream()))
{
sendingData.Write(xmlString);
sendingData.Flush();
}
WebResponse myResponse = myReq.GetResponse();
On Apr 19, 11:07 am, "Joel Barsotti" <j...@stocklayouts.comwrote:
>I'm working on shipping rate calculator going back and forth via XML. The
thing I'm confused about is that the code works, but after a few hours
and I
don't know how many requests, I start getting the error "The underlying
connection was closed: Could not establish trust relationship for the
SSL/TLS secure channel." I can't imagine UPS's certificate is bad.
Here's my code, let me know if you see any glaring issues.
HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create(upsRateUri);
myReq.Headers.Clear();
myReq.Method = "POST";
myReq.ContentType = "application/x-www-form-urlencoded";
myReq.ContentLength = xmlString.Length;
StreamWriter sendingData = new StreamWriter(myReq.GetRequestStream());
sendingData.Write(xmlString);
sendingData.Close();
WebResponse myResponse = myReq.GetResponse();