From: pheppler on
Hi all!
I'm trying to get my calendar from Exchange 2007.
First i tried to get my emails, to test if the Exchange is configured well.

<cfexchangeconnection
action="open"
username ="myname"
password="pass"
server="mailer.mycompany.com"
connection="testconn1"
protocol="https">

<cfexchangemail action="get" folder="Posteingang" name="weeksMail"
connection="testconn1">
</cfexchangemail>

<cfdump var="#weeksMail#">
<cfexchangeconnection action="close" connection="testconn1">

This works fine. I get all my emails.

But if i try this:

<cfexchangeconnection
action="open"
username ="myname"
password="pass"
server="mailer.mycompany.com"
connection="testconn1"
protocol="https">

<cfexchangecalendar action="get"
name = "theUID"
connection = "testconn1">
<cfdump var="theUID">

I get an Error:
Requested Exchange resource was not found on the server.

Now the main question is to find out if coldfusion is the issue or the
exchange is misconfigured?
Sorry for the poor english ;)

Using ColdFusion 8 with Apache on a Windows 2003 Standard.
Exchange 2007 runs on a different machine, also with Windows 2003 Standard.

From: Dipanwita S on
Hi,

Calendar events retrieval does work fine on Exchange 2007. Can you try
creating a calendar event with a particular subject say 'test
cfexchangeCalendar tag' and then try retrieving it using cfexchangeCalendar as
in:

<cfexchangecalendar action="get" name = "theUID" connection = "testconn1">
<cfexchangeFilter name="subject" value="cfexchangeCalendar">
</cfexchangeCalendar>
<cfdump var="#theUID#">

If this retrieves the newly created event, then it might be a data issue with
some events for that account. Could you check this and then let me know what
you observe?

Thanks & Regards,
Dips

From: pheppler on
Hi,
i created an entry in outlook, called "Test CF". Then i checked in the Outlook
Web Access, that the calendar is synchronized.
Then i used that code attached and got htis Error:
Requested Exchange resource was not found on the server.

The error occurred in
D:\IntranetServer\apache\htdocs\cronjobs\exchangecal.cfm: line 10

8 :
9 : <cfexchangecalendar action="get" name = "theUID" connection = "testconn1">
10 : <cfexchangeFilter name="subject" value="Test CF">
11 : </cfexchangeCalendar>
12 : <cfdump var="#theUID#">

I would use CF to enter events in the exchange calender, based on entries in
our intranet calendar.
I can query my Mails with the same connection. Maybe the exchange is
misconfigured?

<cfexchangeconnection
action="open"
username ="myaccount"
password="mypass"
server="mailer.company.com"
connection="testconn1"
protocol="https">

<cfexchangecalendar action="get" name = "theUID" connection = "testconn1">
<cfexchangeFilter name="subject" value="Test CF">
</cfexchangeCalendar>
<cfdump var="#theUID#">

From: pheppler on
Now tried another example code and got this:
Exchange resource conflict error.
Possible reasons: - The client has provided a value, the semantics of which
are not appropriate for the property , for example, trying to set a read-only
property. - Cannot put a resource if all ancestors do not already exist.
The error occurred in
D:\IntranetServer\apache\htdocs\cronjobs\exchangecal.cfm: line 47

45 : server="mailer.company.com"
46 : event="#sEvent#"
47 : result="theUID" protocol="https">
48 : <!--- Output the UID of the new event. --->
49 : <cfif isDefined("theUID")>

<!--- Create a structure to hold the event information. --->
<!--- A self-submitting form for the event information --->
<!--- This example omits recurrence to keep the code relatively simple --->
<cfparam name="form.eventID" default="0">

<!--- If the form was submitted, populate the event structure from it. --->
<cfif isDefined("Form.Submit")>
<cfscript>
sEvent.AllDayEvent="no";
sEvent=StructNew();
sEvent.Subject=Form.subject;
if (IsDefined("Form.allDay")) {
sEvent.AllDayEvent="yes";
sEvent.StartTime=createDateTime(Year(Form.date), Month(Form.date),
Day(Form.date), 8, 0, 0);
}
else {
sEvent.StartTime=createDateTime(Year(Form.date), Month(Form.date),
Day(Form.date), Hour(Form.startTime), Minute(Form.startTime),
0);
sEvent.EndTime=createDateTime(Year(Form.date), Month(Form.date),
Day(Form.date), Hour(Form.endTime), Minute(Form.endTime), 0);
}
sEvent.Location=Form.location;
sEvent.RequiredAttendees=Form.requiredAttendees;
sEvent.OptionalAttendees=Form.optionalAttendees;
//sEvent.Resources=Form.resources;
if (Form.reminder NEQ "") {
sEvent.Reminder=Form.reminder;
}
else {
sEvent.Reminder=0;
}
sEvent.Importance=Form.importance;
sEvent.Sensitivity=Form.sensitivity;
sEvent.message=Form.Message;
</cfscript>

<!--- If this is the first time the form is being submitted
Create a new event. --->
<cfif form.eventID EQ 0>
<!--- Create the event in Exchange --->
<cfexchangecalendar action="create"
username ="myaccount"
password="mypass"
server="mailer.company.com"
event="#sEvent#"
result="theUID" protocol="https">
<!--- Output the UID of the new event. --->
<cfif isDefined("theUID")>
<cfoutput>Event Added. UID is#theUID#</cfoutput>
<cfset Form.eventID = theUID >
</cfif>
<cfelse>
<!--- The form is being resubmitted with new data, so update the event.
--->
<cfexchangecalendar action="modify"
username ="myaccount"
password="mypass"
server="mailer.company.com"
event="#sEvent#"
uid="#Form.eventID#" protocol="https">
<cfoutput>Event ID #Form.eventID# Updated.</cfoutput>

</cfif>
</cfif>

<cfform format="xml" preservedata="yes" style="width:500" height="600">
<cfinput type="text" label="Subject" name="subject" style="width:435"><br
/>
<cfinput type="checkbox" label="All Day Event" name="allDay">
<cfinput type="datefield" label="Date" name="date" validate="date"
style="width:100">
<cfinput type="text" label="Start Time" name="startTime" validate="time"
style="width:100">
<cfinput type="text" label="End Time" name="endTime" validate="time"
style="width:100"><br />
<cfinput type="text" label="Location" name="location"
style="width:435"><br />
<cfinput type="text" label="Required Attendees" name="requiredAttendees"
style="width:435"><br />
<cfinput type="text" label="Optional Attendees" name="optionalAttendees"
style="width:435"><br />
<cfinput type="text" label="Resources" name="resources"
style="width:435"><br />
<cfinput type="text" label="Reminder (minutes)" validate="integer"
name="reminder"
style="width:200">
<cfselect name="importance" label="Importance" style="width:100">
<option value="normal">Normal</option>
<option value="high">High</option>
<option value="low">Low</option>
</cfselect>
<cfselect name="sensitivity" label="Sensitivity" style="width:100">
<option value="normal">Normal</option>
<option value="company-confidential">Confidential</option>
<option value="personal">Personal</option>
<option value="private">Private</option>
</cfselect>
<cfinput type="textarea" label="Message" name="message" style="width:435;
height:100">
<cfinput type="hidden" name="eventID" value="#Form.EventID#">
<cfinput type="Submit" name="submit" value="Submit">
</cfform>

From: Dipanwita S on
Hi,

I tried reproducing the issue with both the code samples you provided, but
they do work fine at my end.

Can you try creating a simple event directly in Outlook client/Outlook on Web
and then try retrieving it using CF.

The 2nd piece of code where you have a form for entering calendar event
details do work fine for me and calendar events get created and retrieved
correctly.

So, could you check with your Exchange Admin as to whether there is any issue
with calendar configuration on Exchange side? I remember initially I had some
issues sending mail using <cfmail> tag on Exchange 2007. Anonymous SMTP
connection permission was missing for which explicit permission was set by our
exchange admin using exchange management shell command. I suggest you check
once with Exchange admin whether this is a similar issue for calendar events.

Thanks & Regards,
Dipanwita