473,383 Members | 1,815 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,383 software developers and data experts.

Exchange WebDAV

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 WebdavSession(credential);
session.UserMailbox = "http://192.168.0.56/exchange/bhees/";

Resource resource = new Resource(session);

//retreive single appointment
//Appointment appointment1 = resource.GetAppointment("http://myserver/exchange/Administrator/Calendar/appointment1.eml");

//retrieve all appointments from Calendar folder
Appointment[] allAppointments = resource.GetAppointments();

//retrieve all appointments from specified folder
//Appointment[] testAppointments = resource.GetAppointments("http://myserver/exchange/bhees/Calendar/Test");

//retrieve all appointments from specified public folder
//Appointment[] publicAppointments = resource.GetAppointments("http://myserver/public/Calendar");

Response.Write(allAppointments.ToString());
}

I get following errors:

Regel 98:
Regel 99: //retrieve all appointments from Calendar folder
Regel 100: Appointment[] allAppointments = resource.GetAppointments();
Regel 101:
Regel 102: //retrieve all appointments from specified folder


Bronbestand: \\fs11\ao-ict\UserData\ahoeve\Mijn documenten\Visual Studio 2005\WebSites\WebSite2\Default.aspx.cs Regel: 100

Stacktracering:

[SecurityException: De aanvraag voor machtiging van type System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 is mislukt.]
System.Security.CodeAccessSecurityEngine.Check(Obj ect demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
System.Security.CodeAccessPermission.Demand() +59
System.Net.HttpWebRequest..ctor(Uri uri, ServicePoint servicePoint) +166
System.Net.HttpRequestCreator.Create(Uri Uri) +26
System.Net.WebRequest.Create(Uri requestUri, Boolean useUriBase) +373
System.Net.WebRequest.Create(String requestUriString) +81
Independentsoft.Webdav.Exchange.Resource.r(String A_0) +786
Independentsoft.Webdav.Exchange.Resource.c(String A_0, String A_1) +60
Independentsoft.Webdav.Exchange.Resource.a(String A_0, PropertyName[] A_1) +1593
Independentsoft.Webdav.Exchange.Resource.GetProper ties(String address, PropertyName[] propertyName) +34
Independentsoft.Webdav.Exchange.Resource.d(String A_0) +992
Independentsoft.Webdav.Exchange.Resource.GetMailbo x(String userMailboxAddress) +30
Independentsoft.Webdav.Exchange.Resource.get_Mailb ox() +176
Independentsoft.Webdav.Exchange.Resource.GetAppoin tments(Boolean recursive) +31
Independentsoft.Webdav.Exchange.Resource.GetAppoin tments() +27
_Default.getAfspraken() in \\fs11\ao-ict\UserData\ahoeve\Mijn documenten\Visual Studio 2005\WebSites\WebSite2\Default.aspx.cs:100
_Default.DropDownList1_SelectedIndexChanged(Object sender, EventArgs e) in \\fs11\ao-ict\UserData\ahoeve\Mijn documenten\Visual Studio 2005\WebSites\WebSite2\Default.aspx.cs:114
System.Web.UI.WebControls.ListControl.OnSelectedIn dexChanged(EventArgs e) +105
System.Web.UI.WebControls.DropDownList.RaisePostDa taChangedEvent() +134
System.Web.UI.WebControls.DropDownList.System.Web. UI.IPostBackDataHandler.RaisePostDataChangedEvent( ) +7
System.Web.UI.Page.RaiseChangedEvents() +137
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6953
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +154
System.Web.UI.Page.ProcessRequest() +86
System.Web.UI.Page.ProcessRequestWithNoAssert(Http Context context) +18
System.Web.UI.Page.ProcessRequest(HttpContext context) +49
ASP.default_aspx.ProcessRequest(HttpContext context) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temp orary ASP.NET Files\website2\10a0ed41\15fb0a6\App_Web_kciwksky.2 .cs:0
System.Web.CallHandlerExecutionStep.System.Web.Htt pApplication.IExecutionStep.Execute() +154
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously) +64

Can someone please help me?
Mar 14 '07 #1
0 3378

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Rob | last post by:
Hi all, I have done a lot of researching on the above topic and the only think I now know for sure is that I have to use either CDO or MAPI. What I need to do is this: I want to write a C#...
4
by: Razzie | last post by:
Hey experts, First let me say I know almost nothing about Exchange, so if I say incorrect things about it, forgive me ;) What I need to do is, connect to the local Exchange server and monitor...
2
by: George Durzi | last post by:
We recently upgraded to Exchange2K3/W2K3 from Exchange2K/W2K, and some of my c# code that I used to access users' contacts using WebDAV has stopped working. I'm getting a 401 unauthorized error....
0
by: Brian Henry | last post by:
I want to pull my contact list (personal one) from the exchange server into a local text file. I know how to write stuff into a text file, just getting it from an exchange server is my problem....
11
by: ML | last post by:
What is th best/easiest way to access a public contacts folder on an Exchange server from a winforms vb.net applciation? I would like to be able to provide the user with a list of contacts and...
7
by: Wiebe Tijsma | last post by:
Hi, I'm using C# + webDAV to create a draft message to be sent in a user's Drafts folder. I can create the message successfully, however when I open the message in outlook, it doesn't show...
2
by: =?Utf-8?B?RGF2aWRF?= | last post by:
Hi, I try to connect to Exchange server using MAPI. I need to access a special user inbox and read all his new mails. The code I wrote work good, but I get my inbox instead of the user I need....
0
by: teddy06 | last post by:
I have written code for read mails from exchange server. I have used webdav in my code. Its was working fine once upon a time. Currently configuration settings of client has been changed . so i...
5
by: krasman | last post by:
hi everyone, i hope you might help me on this one. i need to create a contact in a exchange public folder using dotnet (vb or c#) and exchange 2003, without using outlook object model. i'm...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

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.