471,318 Members | 1,884 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,318 software developers and data experts.

Invalid handle error with XMLHTTP

Hi all

I am trying to execute a WebDAV query against a webmail Exchange inbox using
XMLHttp but I keep getting an error stating "The handle is invalid" when I
call the send() method.

My code is as follows:

MSXML2.ServerXMLHTTP40Class xmlHttp = new ServerXMLHTTP40Class();
string folderQuery = "<?xml version=\"1.0\"?>" + "<g:searchrequest
xmlns:g=\"DAV:\">" + "<g:sql>SELECT TOP 1 \"urn:schemas:httpmail:subject\", "
+ "\"urn:schemas:httpmail:from\", \"DAV:displayname\", " +
"\"urn:schemas:httpmail:textdescription\" " + "FROM SCOPE('shallow traversal
of \"" + serverUrl + "\"') " + "WHERE \"DAV:ishidden\" = False AND
\"DAV:isfolder\" = False " +
"AND \"urn:schemas:httpmail:subject\" LIKE '%" + "Undeliverable" + "%' " +
"ORDER BY \"urn:schemas:httpmail:date\" DESC" + "</g:sql></g:searchrequest>";

// Open a connection to the exchange server.
xmlHttp.open("PROPFIND", serverUrl, false, userName, password);
// Send the request.
xmlHttp.setRequestHeader("SQL", folderQuery);
xmlHttp.setRequestHeader("Content-type", "text/xml");
xmlHttp.setRequestHeader("Depth", "1");

I've tried browsing to the URL in IE and I can access the inbox with the
username and password.

Can anyone help me with this, please?

Thanks as always

Jul 21 '05 #1
0 1016

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Krzysztof Kubiak | last post: by
reply views Thread by nek | last post: by
reply views Thread by Shivonne | last post: by
39 posts views Thread by tydbowl | last post: by
reply views Thread by sonu | last post: by
4 posts views Thread by mirandacascade | last post: by
6 posts views Thread by omerbutt | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.