A lot of this information is described in the video attached to this post, so I won't go through every single bit of it.
Since I've been discussing the Exchange Out of Office functionality recently, I thought I needed to implemend a Nintex Workflow User Defined Action that would talk to Exchange and pull out a users out-of-office settings. That way, I can start adding more robustness into my workflows that I design that generate tasks for people.
When building a workflow like that, usually I would rely on a feature of Nintex Workflow called Long Term Delegation. This is where you can click on your name in SharePoint, then in the drop down select Nintex Workflow 2013 > Task Delegation. This functionality allows the task actions in Nintex Workflow to look into those settings and if a task is to be assigned to User1 and they have this enabled, it will automatically delegate that task to the user that is specified in the settings.
You can find more information on Long Term Delegation here : Long Term Delegation
An important link for this post is this : GetUserOofSettings
Calling the Exchange Web Service
The web service url for the Exchange web service looks like this : http://[exchsrv]/ews/exchange.asmx .
What I found is that the web service doesn't seem to expose a WSDL file, which means using the Call Web Service action is not something I can use. But in comes the Web Request action to help. You can still make a SOAP call using this action and that is what I used in this User Defined Action.
Pulling the Out of Office Settings
In the screenshot above, the packet is quite simple. It needs an email address and that is what Exchange uses to lookup the Oof settings for that user.
The rest of the design of the UDA, is making sure that I get a valid HTTP response and then pulling out the information I need. As to the information in the XML response from the Exchange web service, there are 3 important pieces of data.
1. OofSettings - this tells me if the user has an Out of Office reply Scheduled or not (Disable).
2. If it is Scheduled, then I need to look further into the XML and pull out the Start and End time for the Out of Office settings. Then I convert the text values from XML into Date/Time variables and pass that back to the calling workflow.
What Else Can you Do?
There are a bunch of methods that the Exchange web service exposes. It would be nice to have a User Defined Action for each of the methods and if I have time, I'd do it. But if there's something that you need, take a look at the MSDN site for the methods that are exposed.
The UDA that is associated with this post and you can download below, requires 2 Workflow constants. EwsUrl which is the URL to the Exchange webservice and also EwsAdminCredential which is the account that has the permission to query for the Oof information in Exchange.
But a fair bit of warning is needed for the video. I didn't edit it, so it sounds quite raw :).