0

I'm using Coldfusion, IIS 7.0, Windows 2008r2 to insert calendar events on behalf of a user determined in Coldfusion page on a hosted Exchange server. This was working as of a few weeks ago but stopped (cannot connect to exchange server). Tech support for the Exchange server said, when I first started working on the problem, that WebDav was no longer supported. I just got off the phone with them and they say I was told wrong and WebDav is still supported. But, they have no way of testing and supporting Coldfusion. I've been chasing my tail for 2 weeks now. Is there anyone that can help me debug this problem?

<cfscript>      
                // Fill Event Struct From Arguments.
                sEvent.AllDayEvent="no";
                sEvent=StructNew();
                sEvent.Subject= 'Test Exchange';
                sEvent.StartTime=createDateTime(Year(EventStartDateTime), Month(EventStartDateTime),

                Day(EventStartDateTime), evaluate(Hour(EventStartDateTime) - val(attributes.AdminTimeZone)), Minute(EventStartDateTime), 0);
                sEvent.EndTime=createDateTime(Year(EventEndDateTime), Month(EventEndDateTime),
                Day(EventEndDateTime), evaluate(Hour(EventEndDateTime) - val(attributes.AdminTimeZone)), Minute(EventEndDateTime), 0);

                sEvent.Location = '';
                sEvent.Reminder = '';
                sEvent.Importance = "Normal";
                sEvent.Sensitivity = "Normal";
                sEvent.message = 'test exchange';
                sEvent.OptionalAttendees = '';
            </cfscript>

            <cfexchangeconnection action="open" connection="#Application.Exchange.Connector#"
              server="#Application.Exchange.ExchangeHost#"
              username="#UserName#"
              mailboxname="#EmailAddress#"
              password="#Pword#"
              Protocol="#Application.Exchange.Protocol#"
              port="#Application.Exchange.Port#"
              formbasedauthentication="#Application.Exchange.FormBased#"
              formbasedauthenticationURL="#Application.Exchange.FormURL#"
            />

The data I use is:

exch016\george_ttt
Pword1234
04-Nov-13
04-Nov-13
EXVMBX016-5.exch016.msoutlookonline.net
Error:
connection="exchangeConn"
server="XXXXXX016-5.exch016.msoutlookonline.net"
Protocol="https"
port="443"
formbasedauthentication="TRUE"
formbasedauthenticationURL="https://owa016.msoutlookonline.net/owa/auth/logon.aspx"
user990016
  • 3,208
  • 4
  • 20
  • 29
  • 1
    Is this a duplicate question? http://stackoverflow.com/q/19731970/1636917 Please don't ask the same question again. Just update the existing question with new information. – Miguel-F Nov 05 '13 at 17:16
  • 2
    Not sure what you're expecting anyone here to be able to do? If the code worked a few weeks ago, and neither the code nor CF install was modified, it's an issue on the hosting side. – Peter Boughton Nov 05 '13 at 17:16
  • It's not a duplicate question. If you read them you can tell. – user990016 Nov 05 '13 at 17:40
  • Which version of ColdFusion? Is it ColdFusion 10? ColdFusion 10 supports both WebDAV and EWS to connect to the Exchange Server. i.e., ColdFusion 10 can talk to Exchange Server 2007 and below (using WebDAV) as well as Exchange Server 2010 (using EWS). What is the version of Exchange Server you are using? Could you put the stacktrace from the exception.log file? – Paul Nibin Nov 08 '13 at 05:51

1 Answers1

0

From the comments (figured I might as well put it as an answer)

You need to confirm that they are supporting WebDav. It is required for the cfexchange... tags. From the documentation found here:

Note: The ColdFusion exchange tags, including cfexchangeconnection use WebDAV to connect to the exchange server. HTTP access must be enabled on the exchange server to use the tags.

More from that same documentation page:

Note: To establish any connection, the Exchange server must grant you Outlook Web Access. For information on how to enable this access, see Enabling access to the Exchange server in the Developing ColdFusion Applications. Also, you cannot establish a connection to an Exchange server if you require a special authentication step, such as requiring a VPN PIN or performing biometric authentication, on a server that is outside your firewall, and the authentication server then routes the messages to your Exchange server inside the firewall.

High level bullets from Enabling access to the Exchange server:

  • Ensure that IIS is configured for access to the Exchange server
  • Enabling Outlook web access
  • Check and grant web access
  • Enabling HTTPS access to the Exchange server
  • Enabling SSL on the Exchange server system
  • Enabling HTTPS access on the ColdFusion server
Miguel-F
  • 13,450
  • 6
  • 38
  • 63
  • As I said, I just got off the phone with the Exchange host tech support to confirm they are indeed still supporting WebDav. I've verified the settings with them. I've verified that I can access the Exchange server via browser. There are no special authorization steps. – user990016 Nov 05 '13 at 17:49
  • So what changed then? They upgraded Exchange? – Miguel-F Nov 05 '13 at 17:52
  • When I first contacted them they said they had made a change to not allow IP address access but to use a proxy. That's when they said they had disabled WebDav (which turned out to not be true). When I pinged the original url from my server it resolved to an old IP address. When I pinged the new proxy url it resolved to the new IP address. I copied the url from the admin dashboard into my setting but it still didn't work. – user990016 Nov 05 '13 at 18:00
  • I'm getting the following error; Unable to connect to the Exchange server using HTTP/HTTPS protocol. HTTP response code : 400 – user990016 Nov 05 '13 at 18:16
  • You are connecting using HTTPS, right? Have you imported their SSL certificate into the keystore for ColdFusion? I see that you are storing the Exchange connection properties in the Application scope. When you copied the URL into your settings did you also reload the Application scope? – Miguel-F Nov 05 '13 at 18:43
  • I'm not sure about the keystore. Yes, I reload the application.cfm when making changes. – user990016 Nov 05 '13 at 18:55
  • I have updated CF with hotfix4 and Java 7 trying to use EWS as a solution. Can't get EWS to work either but there's no telling what I did wrong. I pointed CF back to Java 6. So, it's completely possible the cacert is not updated properly. How can I check? – user990016 Nov 05 '13 at 18:59
  • Whenever you update the Java version a new cacerts file is used. So even if you had the certificate imported for Java 6, when you updated to Java 7 the new cacerts file does not have the certificate. You will have to reimport the certificate for the Java 7 keystore. [Read my answer to another question on how to import and check for certificates](http://stackoverflow.com/a/19449937/1636917). – Miguel-F Nov 05 '13 at 19:07
  • I imported the cert but I wasn't prompted to trust the certificate. I'm still getting the same error. – user990016 Nov 05 '13 at 20:16
  • Are you sure that you have imported the cert into the correct keystore for the JVM that ColdFusion is using? Regardless, I don't even know if that is your issue. Do you know if they also updated the certificate being used for the Exchange server? – Miguel-F Nov 05 '13 at 20:30
  • I may be confused. I imported the certificate from the Exchange server and stored it in the cacert in coldfusion9\runtime\jre\lib\security. – user990016 Nov 05 '13 at 21:12
  • That should be fine assuming that is the JVM that ColdFusion is running under. – Miguel-F Nov 05 '13 at 21:21
  • CF admin shows Java Virtual Machine Path as C:\Program Files\Java\jdk1.7.0_45\jre. C:\ColdFusion9\runtime\jre\lib\security>dir ca*.* Directory of C:\ColdFusion9\runtime\jre\lib\security 10/04/2010 03:41 PM 68,595 cacerts 10/04/2010 03:41 PM 68,595 cacerts - Copy C:\ColdFusion9\runtime\jre\lib\security>"C:\Program Files\Java\jdk1.7.0_45\bin\k eytool" -import -v -alias exchange -file c:\users\fs23041\desktop\exchangegeotru st.cer -keystore cacerts -storepass changeit Certificate was added to keystore [Storing cacerts] – user990016 Nov 05 '13 at 21:25
  • Then you need to import the certificate under that JVM. `C:\Program Files\Java\jdk1.7.0_45\jre\lib\security\cacerts` And remember that you must restart ColdFusion after importing the certificate. – Miguel-F Nov 05 '13 at 21:27