473,761 Members | 1,784 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.ServerXM LHTTP40 server = new MSXML2.ServerXM LHTTP40();
server.open("SE ARCH", mailbox, false, mUsername, mPassword);
server.setReque stHeader("Depth ", "1");
server.setReque stHeader("Conte nt-type", "text/xml");
server.setReque stHeader("Range ", "Rows=0-0");

string select = "<?xml version=\"1.0\" ?>"
+ "<D:searchreque st xmlns:D = \"DAV:\">"
+ "<D:sql>"
+ "SELECT \"DAV:href\" , "
+ "\"urn:schemas: httpmail:subjec t\", "
+ "\"urn:schemas: httpmail:textde scription\", "
+
"\"urn:schemas: httpmail:htmlde scription\", "
+ "\"urn:schemas: httpmail:datere ceived\", "
+ "\"urn:schemas: httpmail:from\" "
+ "FROM scope('shallow traversal of \"" + mailbox + "\"')"
+ "WHERE \"DAV:ishidden\ "=false "
+ "AND \"DAV:isfolder\ "=false "
+ "ORDER BY \"urn:schemas:h ttpmail:daterec eived\""
+ "</D:sql></D:searchrequest >";
server.send(sel ect);

XmlDataDocument dataDoc = new XmlDataDocument ();
dataDoc.LoadXml (server.respons eText);

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 1449

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

Similar topics

0
4194
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 Framework and Microsoft .NET Compact Framework. Built from same source code all classes and methods support Microsoft .NET Framework and Microsoft .NET Compact Framework. The WebDAV .NET fully supports WebDAV protocol RFC 2518. Written in C#,
0
2233
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 is a way to integrate WebDAV into an ASP application. Initially I tought, that if WebDAV is enabled, a link such as http://server/app/test.doc would automatically open the document as a WebDAV document. However, this is not so. The document is...
3
5044
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 more support for WebDAV, there may be a way to do it from Access. But by experiment, I believe the only way to do it is to write at the DAO layer. I've been brainstorming IIS tricks to make the WebDAV directory look like an ordinary location to
2
2792
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
2058
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. The organizational structure of the files is virtual and is managed by the database. We find it clunky that in order to manage these documents, the user must download the document, make changes, save the file locally and reupload via a web form...
7
4871
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 work, as I get AUTH FAIL, but if I pass the user name and password by using :
0
1199
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 script sourceaccess. Now, I can access the directory using Windows Auth and SSL andupdate all files including .aspx, .config, etc.. Everything isgreat except... I cannot upload the new compiled dlls because the bin directoryis not accessible. ...
0
3399
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 SecurityException. This is my code to get the appointments: protected void getAfspraken() { NetworkCredential credential = new NetworkCredential("bhees","1234567", "oaicttest"); WebdavSession session = new...
4
11094
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 (Windows 2003 IIS 6) resides in the DMZ. I have created a virtual directory and directed it to a folder stored on the server. Integrated Windows Authentication and Basic Authentication has been enable along with SSL. I have added a handful of user account...
0
9554
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9377
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9989
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9925
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9811
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7358
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5266
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5405
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2788
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.