Z
Zen
I have the following sample code, which works fine if the URL is not SSL.
(https)
Once I switch the URL to be SSL, it works fine for the first time, but the
2nd time the function is called, it throws exception when writing data to
request string.
The message from the exception is : "A blocking operation is currently
excuting"
and the Error code for the exception is 10036
(Note: I did install the Root CA on my handheld.)
Appricate all the help!!!
----------------------------------------------------------------------------
------------------------------------
public string MyFunction()
{
HttpWebRequest myRequest;
HttpWebResponse myResponse;
string postData;
Byte[] postBytes;
Stream requestStream;
Stream responseStream;
StreamReader sr;
string fullResponse = "";
myRequest =
(HttpWebRequest)WebRequest.Create(https://server.domain.com/virtualDir/page.
asp);
myRequest.Method = "POST";
//Populate post data
myRequest.ContentLength = postData.Length;
postBytes = Encoding.ASCII.GetBytes(postData);
requestStream = myRequest.GetRequestStream();
requestStream.Write(postBytes, 0, postData.Length); //Exception throw at
the second call: "A blocking operation is currently excuting"
requestStream.Close();
//get response
myResponse = (HttpWebResponse)myRequest.GetResponse();
responseStream = myResponse.GetResponseStream();
sr = new StreamReader(responseStream);
fullResponse = sr.ReadLine();
responseStream.Close();
}
(https)
Once I switch the URL to be SSL, it works fine for the first time, but the
2nd time the function is called, it throws exception when writing data to
request string.
The message from the exception is : "A blocking operation is currently
excuting"
and the Error code for the exception is 10036
(Note: I did install the Root CA on my handheld.)
Appricate all the help!!!
----------------------------------------------------------------------------
------------------------------------
public string MyFunction()
{
HttpWebRequest myRequest;
HttpWebResponse myResponse;
string postData;
Byte[] postBytes;
Stream requestStream;
Stream responseStream;
StreamReader sr;
string fullResponse = "";
myRequest =
(HttpWebRequest)WebRequest.Create(https://server.domain.com/virtualDir/page.
asp);
myRequest.Method = "POST";
//Populate post data
myRequest.ContentLength = postData.Length;
postBytes = Encoding.ASCII.GetBytes(postData);
requestStream = myRequest.GetRequestStream();
requestStream.Write(postBytes, 0, postData.Length); //Exception throw at
the second call: "A blocking operation is currently excuting"
requestStream.Close();
//get response
myResponse = (HttpWebResponse)myRequest.GetResponse();
responseStream = myResponse.GetResponseStream();
sr = new StreamReader(responseStream);
fullResponse = sr.ReadLine();
responseStream.Close();
}