Re: Close OWA Connection

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Thanks - I have tried to implement this as a GET call (hacked from a function
performing a POST call), but it returns a "Cannot send a content-body with
this verb-type" error <see code snippet below>

Is there (yet again) something obvious that I am doing wrong? Also, it
suprises me a little that I don't need to use the cookies gained when I
established my connection to OWA to terminate the connection?!?

----- code snippet -----

public void BreakAuthentication(string uri)
{
//Paramters
HttpWebRequest request;
HttpWebResponse response;
byte[] body;
Stream stream;
string uriToUse;

//Update URI
uriToUse = uri.Substring(0, uri.IndexOf("/", 8)) + "/?Cmd=logoff";

//Build request
request = GetRequestObject(uriToUse, "GET");

//This is probably the problem?!? What sort of Content-Type should I
//use?
request.ContentType = "application/x-www-form-urlencoded";

//Send request to server
stream = request.GetRequestStream();
stream.Close();

//Get response
response = (HttpWebResponse)request.GetResponse();

}

---- end code snippet ----



"Glen Scales [MVP]" wrote:

Are you using Exchange 2003 is so you could just make a call to the OWA
Logoff command eg

GET /exchange/user/?Cmd=logoff

cheers
Glen
"NgelW" <NgelW@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:77572BDF-93BC-4C03-B904-264774EEE3DE@xxxxxxxxxxxxxxxx
Hi,

In a c# app, I have established a connection to OWA, and done what I need
to
do on the exchange server, and would now like to close that connection
rather
then allowing it to time-out. Can anyone explain how this can be done?

Many thanks,

Nigel



.



Relevant Pages

  • Re: HttpWebRequest.GetRequestStream times out
    ... When I encounter this exception, this is printed in the log: ... Stream sendStream = httpReq.GetRequestStream; ... you never read more than 1 kB of the response, ... The request timeout is set to 100 seconds, and the requests that time out ...
    (microsoft.public.dotnet.framework.performance)
  • Re: Problems with access to a web page
    ... Server: Apache ... Connection: close ... Look what I get now when I send the exact same request ... and got exactly the same 0 length response ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • RE: problem WebRequest and WebResponse
    ... HttpWebRequest request = ... WebResponse response = null; ... System.Net.Sockets.SocketException: A connection attempt failed ... connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: problem WebRequest and WebResponse
    ... the Stream and the WebResponse instances. ... HttpWebRequest request = ... WebResponse response = null; ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: NotificationSampleWebDav-Monitor OWA Inbox
    ... re-login or update your cookie with each response you get... ... Warning: Exiting Action with an exception: The remote server returned an ... // Create request object and assign credentials. ... Stream newStream = Request.GetRequestStream; ...
    (microsoft.public.exchange.applications)