Re: Webdav & Exchange 2003 on Windows 2003 server

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Thanks for the link!
But now i got the problem that somehow the cookie's aren't made.
But I am sure that the logon credentials are correct **

**When the login was successful, you will receive two cookies that you must
pass along with all further requests. If no cookies are returned, the logon
was not successful.**

The error that is returned is a 502 proxy not found so i think i did
something wrong with the paths like this one
<<https://serverName.domain.local/public>>.

The new code looks as follow:

_______________________________

<html>

<head>

<script language="JavaScript" type="text/javascript">

function getMessages()

{

var strCookies;

var strRequest;

var objXmlResult;

try

{

strCookies = doFBALogin(
"https://serverName.domain.local/public","tktserver";, "domain\user",
"Password" );

strRequest = "<D:searchrequest xmlns:D = \"DAV:\"
<D:sql>SELECT\"DAV:displayname\" FROM
\"https://servername.domain.local/public\"; WHERE\"DAV:ishidden\" =
false</D:sql></D:searchrequest>";

objXmlResult = Search( "https://servername.domain.local/public",strRequest,
strCookies );

//Do something with the XML object

}

catch( e )

{

// Handle the error!

alert( e );

}

return( false );

}

function Search( strUrl, strQuery, strCookies )

{

// Send the request to the server

var xmlHTTP = new ActiveXObject( "Microsoft.xmlhttp" );

var i;

xmlHTTP.open( "SEARCH", strUrl, false );

xmlHTTP.setRequestHeader( "Content-type:", "text/xml" );

// Add the cookies to the request. According to Microsoft article
Q234486,the cookie has to be set two times.

xmlHTTP.setRequestHeader( "Cookies", "Necessary according to Q234486" );
xmlHTTP.setRequestHeader( "Cookies", strCookies );



xmlHTTP.send( strQuery );

return( xmlHTTP.responseXML );

}

function doFBALogin( strDestination, strServer, strUsername, strPassword )



{

var xmlHTTP = new ActiveXObject( "Microsoft.XMLHttp" );

var strUrl;

var strContent;

var arrHeader;

var strCookies;

var intCookies;

var i;

// Prepare the URL for FBA login

strUrl = "https://"; + strServer + "/exchweb/bin/auth/owaauth.dll";

xmlHTTP.open( "POST", strUrl, false );

xmlHTTP.setRequestHeader(
"Content-type:","application/x-www-form-urlencoded" );

// Generate the body for FBA login

strContent = "destination=" + strDestination + "&username=" + strUsername +
"&password=" + strPassword;

xmlHTTP.send( strContent );

alert( xmlHTTP.responseText );

// Get all response headers

arrHeader = xmlHTTP.getAllResponseHeaders().split( "\n" );

//aangepast
strCookies = "";

intCookies = 0;

// Iterate through the collection of returned headers

for( i = 0; i < arrHeader.length; i++ )

{

// If the entry is a cookies, extract the name/value

if( arrHeader[i].indexOf( "Set-Cookie" ) != -1 )

{

strCookies += arrHeader[i].substr( 12 ) + "; ";

intCookies++;

}

}

// Check if two cookies have been returned. Otherwise throw an exception

if( intCookies < 2 )

{

throw "Could not log in to OWA!";

}

return( strCookies );

}

</script>

</head>

<body>

<font face='Verdana' size='2'>

Mailbox name:<br>

<input type='text' name='mailbox' value=""><br>

<input type='button' name='getMessages' value=' GO 'onClick="return(
getMessages() );"><br>

</body>

</html>
____________
Thanks for the help in advanced!


Is there maybe something wrong with the setting off the exchange server?



.



Relevant Pages

  • Re: WebDAV - 440 Login Timeout
    ... the KB article states that the first call to setRequestHeader is ignored. ... did you check the cookies that came back from the server? ... xmlHTTP.setRequestHeader("Cookies", strCookies); ... var strCookies; ...
    (microsoft.public.exchange.development)
  • Re: WebDAV - 440 Login Timeout
    ... xmlHTTP.setRequestHeader("Cookies", strCookies); ... var strCookies; ... function Search(strUrl, strQuery, strCookies) ...
    (microsoft.public.exchange.development)
  • Re: Webdav & Exchange 2003 on Windows 2003 server
    ... strCookies = doFBALogin( ... If no cookies are returned, ... var strCookies; ...
    (microsoft.public.exchange2000.development)
  • Re: Webdav & Exchange 2003 on Windows 2003 server
    ... We also have ISA server 2004 running can this be the problem why the cookies ... Because when I login with the same logon credentials on the ... var strCookies; ...
    (microsoft.public.exchange2000.development)
  • cookies and login
    ... I'm trying to do a login section ... simply has text fields UserName password and submits to ... the cookies show as set. ... var rsLogin_numRows = 0; ...
    (microsoft.public.scripting.jscript)