none
Exchange 2007 EWS create an appointment RRS feed

  • Question

  • I'm using Exchange 2007, Coldfusion 9, and EWS API 1.2 to send an email;

    <cfobject type="Java" class="microsoft.exchange.webservices.data.ExchangeService" name="service">

    <cfobject type="Java" class="microsoft.exchange.webservices.data.ExchangeVersion" name="version">
    <cfset service.init(version.Exchange2007_SP1)>

    <cfobject type="Java" class="microsoft.exchange.webservices.data.WebCredentials" name="credentials">
    <cfset credentials.init("z@x.com","password")>
    <cfset service.setCredentials(credentials) />
    <cfobject type="Java" class="java.net.URI" name="uri">
    <cfset uri.init("https://owa016.msoutlookonline.net/EWS/Exchange.asmx?wsdl")>
    <cfset service.setUrl(uri) />
    <cfobject type="Java" action="create" class="microsoft.exchange.webservices.data.EmailMessage" name="message">
    <cfset message = message.init(service) />
    <cfset message.SetSubject("EWSTest")>
    <cfset messageBody = CreateObject("java", "microsoft.exchange.webservices.data.MessageBody")>
    <cfset messageBody.init("My EWS test message again")>
    <cfset message.SetBody( messageBody )>
    <cfset message.ToRecipients.Add("v@gmail.com") >

    <cfset message.SendAndSaveCopy() >

    And that works just fine.  But when I try to create an appointment;

    <cfobject type="Java" class="microsoft.exchange.webservices.data.ExchangeService" name="service">

    <cfobject type="Java" class="microsoft.exchange.webservices.data.ExchangeVersion" name="version">
    <cfset service.init(version.Exchange2007_SP1)>

    <cfobject type="Java" class="microsoft.exchange.webservices.data.WebCredentials" name="credentials">
    <cfset credentials.init("z@x.com","password")>
    <cfset service.setCredentials(credentials) />
    <cfobject type="Java" class="java.net.URI" name="uri">
    <cfset uri.init("https://owa016.msoutlookonline.net/EWS/Exchange.asmx?wsdl")>
    <cfset service.setUrl(uri) />
    <cfobject type="Java" class="microsoft.exchange.webservices.data.ExchangeService" name="appointment">
    <cfset appointment.Start = createDateTime(Year('2014/03/29'), Month('2014/03/29'), 
     Day('2014/03/29'), Hour('09:00'), Minute('09:00'), 0)>
    <cfset appointment.End = createDateTime(Year('2014/03/29'), Month('2014/03/29'), 
     Day('2014/03/29'), Hour('10:00'), Minute('10:00'), 0)>
    <cfset appointment.Subject("Dentist Appointment")>
    <cfset appointment.Body = "The appointment is with Dr. Smith.">
    <cfset appointment.Save(SendInvitationsMode.SendToNone)>

    I get the following error;

    START

    java.lang.NoSuchFieldException: START
    	at coldfusion.runtime.StructBean.bindName(StructBean.java:243)
    	at coldfusion.runtime.Scope.put(Scope.java:74

    And when I use setStart I get a similar error.

    I'm not finding a solution anywhere.

    Thursday, March 27, 2014 7:20 PM