473,386 Members | 1,679 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Access Denied from WebDAV


I'm trying to write a windows service which reads some emails from Exchange
Server through WebDAV, using C#.NET 2.0. Everything works fine when testing,
using a little Forms application to test all the backend classes. However,
when I try to run the actual service it gets an access denied message when
trying to get the emails.

We have other services written in VB.NET 1.1 which use the exact same
technique, and run on the same server... and they work fine. So why would it
stop working when run as a .NET 2.0 service?

Here is the function which actually gets the email:

protected XmlDataDocument GetOldestEmail(string mailbox)
{
MSXML2.ServerXMLHTTP40 server = new MSXML2.ServerXMLHTTP40();
server.open("SEARCH", mailbox, false, mUsername, mPassword);
server.setRequestHeader("Depth", "1");
server.setRequestHeader("Content-type", "text/xml");
server.setRequestHeader("Range", "Rows=0-0");

string select = "<?xml version=\"1.0\"?>"
+ "<D:searchrequest xmlns:D = \"DAV:\">"
+ "<D:sql>"
+ "SELECT \"DAV:href\", "
+ "\"urn:schemas:httpmail:subject\", "
+ "\"urn:schemas:httpmail:textdescription\", "
+
"\"urn:schemas:httpmail:htmldescription\", "
+ "\"urn:schemas:httpmail:datereceived\", "
+ "\"urn:schemas:httpmail:from\" "
+ "FROM scope('shallow traversal of \"" + mailbox + "\"')"
+ "WHERE \"DAV:ishidden\"=false "
+ "AND \"DAV:isfolder\"=false "
+ "ORDER BY \"urn:schemas:httpmail:datereceived\""
+ "</D:sql></D:searchrequest>";
server.send(select);

XmlDataDocument dataDoc = new XmlDataDocument();
dataDoc.LoadXml(server.responseText);

return dataDoc;
}

The mailbox would be something like
https://owa.companyname.com/exchange/dispatch/IMOnsite and the
username/password are definately correct.

Any thoughts on why I'm getting Access Denied?
Oct 11 '06 #1
0 1428

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Rade Josovic | last post by:
Hi, First implementation of WebDAV protocol is here: WebDAV .NET 1.0 from Independentsoft. Go to http://www.independentsoft.de The WebDAV .NET is WebDAV protocol API for Microsoft .NET...
0
by: Michael G. Schneider | last post by:
I just started playing around with WebDAV. The basic configuration is done and works. For example I am able to open a document via HTTP from within Word and save it. What I am really looking for...
3
by: Glenn Holliday | last post by:
I want an Access application to use an .mdb file via WebDAV in a remote directory. The Access documentation is silent as far as I can find. I've received some opinions that since Office XP adds...
2
by: Raj Dhrolia | last post by:
Hi All, Is there any programmatic way to communicate with WebDav. I only need to upload / download files from IIS 6.0. Thanks, Raj.
0
by: SimpleSimple | last post by:
My company has an IIS 5, ASP.net intranet site that contains documents for employee use. The files are of various types (most often Office) and are stored in blob fields in a SQL2000 database. ...
7
by: Steve Drake | last post by:
All, I am doing a WEBDAV request and I want to pass the users Credentials to the webdav server, eg some code like : Request.Credentials = CredentialCache.DefaultCredentials; This does not...
0
by: Gary Chamberlain via .NET 247 | last post by:
(Type your message here) I created a publish (WebDAV) directory on my server pointing toroot of one of my websites. I want to be able to remotelyupload changed source. I set read, write and...
0
by: arjen1984 | last post by:
I am now working on C# with WebDAV on Exchange now to get appointments. When I work local on the domain where the server is, i can get the appointments no problem. When I work outside of it, i get an...
4
by: DudDav | last post by:
Hi All, I have been trying to configured WebDAV on our current IIS server as an alternative to FTP and have had some mixed success but I've hit a brick wall with one problem. The server...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.