Re: Webdav & Exchange 2003 on Windows 2003 server
- From: Sebastian <jsv.hall@xxxxxxxxx>
- Date: Mon, 24 Jul 2006 04:07:01 -0700
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?
.
- Follow-Ups:
- Re: Webdav & Exchange 2003 on Windows 2003 server
- From: Sebastian
- Re: Webdav & Exchange 2003 on Windows 2003 server
- Prev by Date: Re: How do I know the format of the message
- Next by Date: Re: Can I redist CDO.DLL 1.2.1 with my application
- Previous by thread: Re: Cannot obtain the security descriptor of the "Domain EXServers" group
- Next by thread: Re: Webdav & Exchange 2003 on Windows 2003 server
- Index(es):
Relevant Pages
|