OfficeDev / ews-java-api

A java client library to access Exchange web services. The API works against Office 365 Exchange Online as well as on premises Exchange.
MIT License
868 stars 559 forks source link

Other environments Lucee #752

Open ASKemp opened 2 years ago

ASKemp commented 2 years ago

I'm trying to make use of this api from within a Lucee application but making slow progress.

I have... <cfset userName = "abcde"> <cfset password = "12345"> <cfset domain = "xyz"> <cfset serverAddress = "https://ourserver/EWS/Exchange.asmx"> <cfset javaPath = "D:\pathToJarFiles">

<cfset exchangeVersion = createObject("java","microsoft.exchange.webservices.data.core.enumeration.misc.ExchangeVersion",javaPath).Exchange2010_SP2> <cfset exchangeService = createObject("java","microsoft.exchange.webservices.data.core.ExchangeService",javaPath).init(exchangeVersion)> <cfset webCredentials = createObject("java","microsoft.exchange.webservices.data.credential.WebCredentials",javaPath).init(userName,password,domain)>

<cfset exchangeService.setCredentials(webCredentials)>

<cfset uri = createObject("java","java.net.URI",javaPath)> <cfset serverUri = uri.create(serverAddress)> <cfset exchangeService.setUrl(serverUri)>

<cfset wellKnownFolderName = createObject("java","microsoft.exchange.webservices.data.core.enumeration.property.WellKnownFolderName",javaPath)> <cfset folderClass = createObject("java","microsoft.exchange.webservices.data.core.service.folder.Folder",javaPath).init(exchangeService)> <cfset inbox = folderClass.bind(exchangeService,wellKnownFolderName.Inbox)>

But at the final point, of setting a variable to the inbox, I'm getting an error of 'javax/xml/ws/http/HTTPException' - any ideas?