Chapter 12

Remote Event Receivers in SharePoint 2013

WHAT YOU WILL LEARN IN THIS CHAPTER:

  • Getting to know remote event receivers (RERs)
  • Understanding how to configure remote event receivers for various authentication methods
  • Introducing app-level remote event receivers

WROX.COM DOWNLOADS FOR THIS CHAPTER

The wrox.com code downloads for this chapter are found at http://www.wrox.com/WileyCDA/WroxTitle/productCd-1118495845.html on the Download Code tab. The code for this chapter is divided into the following major examples:

  • C12DocLibRERO365.zip
  • C12RERO365.zip

Because SharePoint continues to play a deeper and more integral role in corporate business systems and processes, getting beyond farm-level custom solutions and sandbox limitations by being able to call Web services as a result of internal events firing became imperative for SharePoint — and the new app model now supports it! SharePoint has had event receivers for some time, but with previous versions of SharePoint your custom code ran either in full trust as a farm solution or in the sandbox with the constraints it imposed. With SharePoint 2013, rather than calling into code running on SharePoint, remote event receivers can now be built as web services and the URL endpoint can be registered with SharePoint. When an event fires on one or more of the numerous events associated with SharePoint components, the Web service is called, SharePoint passes in the item properties for the event, and the Web service carries out its business. Both synchronous and asynchronous calls to your web service are supported, and the Web service can also call back into SharePoint, authenticated via OAuth, to read and write as needed. Synchronous “before” events denoted with “-ing,” such as adding, deleting, and so on can perform validation and cancel the event. “After” events denoted with “-ed” — for instance, deleted, added, and so on, can either be synchronous or asynchronous.

Additionally, with the new app model for SharePoint, three new app-level events are provided for app life-cycle management: Installed, Uninstalling, and Upgraded. These app-level events also call out to remote event receiver web services you write and host.

This chapter walks you through some of the nuances in how to construct the remote event receivers based on whether you are in a high-trust server-2-server (S2S) protocol, behind the firewall environment, or are using OAuth. Office 365 SharePoint Online with its Internet-facing endpoints uses OAuth, the authentication method for your app, if you need to call back into SharePoint to perform follow-on actions.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.129.211.87