Creating Custom SharePoint Service Applications 101 - PowerPoint PPT Presentation

slide1 n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Creating Custom SharePoint Service Applications 101 PowerPoint Presentation
Download Presentation
Creating Custom SharePoint Service Applications 101

play fullscreen
1 / 37
Creating Custom SharePoint Service Applications 101
301 Views
Download Presentation
nemo
Download Presentation

Creating Custom SharePoint Service Applications 101

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. OSP402 Creating Custom SharePoint Service Applications 101 Todd C. Bleeker Chief Software Architect Mindsharp

  2. Required Slide Track PMs will supply the content for this slide, which will be inserted during the final scrub. Agenda • n-Tier History • Topologies • The Service Application Framework • SharePoint History • Service Application Anatomy • Service • Service Instance • Service Application • Service Proxy • Service Proxy Application

  3. n-Tier

  4. MTS \ COM+

  5. J2EE

  6. Conceptual Topology • Distributed • Scalable • Fault Tolerance • Load Balancing • Process Isolation • JIT Activation (vs. Instantiation) of Pooled Resources • Role Based Security • Transactions (Distributed Across Systems) DB WFE APP DB

  7. Actual Topology • .NET Framework Enterprise Services • First Two Tiers = Relatively Balanced • Cheaper (one or even two less servers) • Broader Fault Tolerance (three deep rather than two) • Better Load Balancing DB WFE APP DB

  8. Actual Topology Exception (Historical) • Reporting • Search Indexing \ Querying • Heavy Number Crunching • Business Data Catalog • Excel Services DB WFE APP DB

  9. Why Use an Application Layer • Offload Resource Consumption • Load Balanced • Process Isolation • Added Resource • Centralized State (according to Todd) • Cached • Common • Performant • Cross Platform (Farm)

  10. ASMX Web Service or WCF Service • Traditional Approach (Simple) • Custom Management • External (Software \ Hardware) Load Balancing • Direct Web Method Calls • Custom Disaster Recovery (DR) • Boolean Permission Management

  11. The Service Application Framework • Hosted, middle-tier services (similar to COM+ or J2EE) • Scalable Shared Services • Consumed by Multiple SharePoint Web Applications or even External Consumers • Extensible!

  12. Service Applications Also Provide • Provisioning • Of the Service Application (Manual or Automatic) • PowerShell, Farm Configuration Wizard, and\or Central Administration • Creation of a new Application Pool • Configuration and\or Content Database • Optional Management Pages • Create, Manage, and Properties page • Claims aware • Backup, restore, upgrade support • Pluggable round robin load balancer • Custom permissions

  13. SharePoint History • SharePoint 2003 Server • Web Application-based Shared Services Portals • Search, User Profiles, Audiences, and My Sites • Limitations • One Shared Service or up to 20 Unique Services • SharePoint 2007 Server • Shared Services Providers (SSPs Supersede Portals) • Search, User Profiles, Audiences, My Sites, BDC, Excel Services • Limitations • Web Application configured to an SSP collection of services, Could not mix and match • Not Extensible

  14. SharePoint 2010 Foundation • Service Applications supersede SSPs and they are now baked into the core platform • Web Applications are related to a collection of independent Service Applications • Big win for Hosted, Multi-tenant Implementations • Managed in Central Administration • Built on WCF (Secure, Runs on Port 80) • Extensible, Hence This Talk • Every component is heavily abstracted \ pluggable

  15. A Few SharePoint 2010 Examples • Offload Resource Consumption • Excel Services • PerformancePoint • Search • Centralized State (according to Todd) • Web Analytics • Managed Metadata • Cross Platform (Farm) • Managed Metadata • Search

  16. Custom Service Application Examples • Offload Resource Consumption • Resume Crunching • Centralized State (according to Todd) • Who’s Online • Cross Platform (Farm) • “My Company” Sandboxed Solution Gallery

  17. Service Application Anatomy • Service to Surface (typically WCF) • SVC (http:\\tinyurl.com\ReplacableParameters) • TokenReplacementFileExtensions • Contract (behavioral \ data Interface) • {SharePointRoot}\WebServices • {SharePointRoot}\WebClient • DLL to GAC

  18. Service Application Anatomy (Cont.) • Use Core Component Names as Class Suffixes: • *Service • *ServiceInstance • *ServiceApplication • *ServiceProxy • *ServiceApplicationProxy

  19. Service Application Optional Extensions • PostDeploy.ps1 PowerShell Script • Provision Service Instance • Provision Service Application • Provision Service Application Proxy • Add to Default Application Proxy Grou • Alternative ways to create New Service Applications • FeatureReceiver (FeatureInstalled\FeatureUninstalling) • _Admin\Project\New.aspx Admin Page • PowerShell Script/Cmdlet • Farm Configuration Wizard • Web Application Create Page

  20. Optional Extensions (cont.) • Optional Pages Surfaced in Central Administration • New.aspx • Manage.aspx • Properties.aspx • Publish \ Connect • Identification of Administrators • Custom SAF Permissions

  21. Optional Extensions (cont.) • Auto-Provision Custom SAF Databases • Auto-Backup and Restore Custom SAF Databases • Custom Timer jobs • Runs on server running Custom SAF Service Instance • Custom Load Balancer

  22. Core Components • All classes are public • Most Inherit from a base class _and_Implement an interface • For serialization: • Decorate with a System.Runtime.InteropServices.Guid • Include a parameter-less, default 'ctor • Override TypeName and supply a nice string • Like most of SharePoint, These Must be Installed on Every Server so that Any Server can be Added to the Pool

  23. Service • Inherits SPIisWebService (or just SPService for no WCF) • Implements IServiceAdministration • Establishes characteristics of the Custom Service • Name – GetApplicationTypeDescription() • CreateApplication • CreateProxy • Create.aspx URL - GetCreateApplicationLink • Instances collection property of Service Instances running on various servers in the Farm

  24. Service Instance • Inherits SPIisWebServiceInstance • 'started' or 'stopped' Instance of a service on a specific server in the farm using Manage Services on Server • Only one instance of each Service runs on any one server • Defines that public Interface available to consumers(think Web Methods or WSDL) • The Service is fully functional whenever at least one Service Instance is online (basically running on a server somewhere) • This is the list that populates the New dropdown in SCA • Called in sequence using the Pluggable Load Balancer

  25. Service Application • Inherits SPIisWebServiceApplication • Implements [IMyServiceContract] • Hosted by a Service Instance • Like a Web Application runs on one or more WFEs, the Service Application runs on one of more APs in the Farm • Establishes characteristics of the Service Application • Location of the: SVC file, WCF endpoints web.config • Manage.aspx URL – ManageLink • Properties.aspx URL – PropertiesLink • Contains administrator settings • May manage data

  26. Service Endpoints • SVC file is typically deployed to: • {SharePointRoot}\ISAPI (AKA _vti_bin) • {SharePointRoot}\WebServices\[subfolder]\*.SVC • WCF Configuration, when needed • {SharePointRoot}\WebServices\[subfolder]\web.config • {SharePointRoot}\WebClients\[subfolder]\web.config • Autogenerated MEX Endpoints or Custom Endpoints • Bindings • Authentication Mechanisms • Magic Numbers

  27. Service Proxy • Inherits SPIisWebServiceProxy • Implements IServiceProxyAdministration • Identifies the Service Applications that SharePoint can Connect To • Class factory for Service Application Proxies

  28. Service Application Proxy • Inherits SPIisWebServiceApplicationProxy • Public (front-end) interface to a Service Application • Handles all communication between the Consumer and the server selected by the Load Balancer on which the Service Application is running • Requires the use of a ChannelFactory • Similar to the proxy that is created by Visual Studio for us when we add a Web Reference or a Service Reference • It interrogates the SharePoint Farm for the dynamic WCF Endpoint location • It must understand all the methods and their parameters • Similar to a reflected invoke on a private member

  29. SCA Administrative Pages • Deployed to {SharePointRoot}\TEMPLATE\ADMIN folder • New.aspx • Application Pool Creation Control • Creates a new Instance and associates it with the current server • Online in code = "started" in the UI • Also creates a new Proxy to consumers can call it • Manage.aspx • Properties.aspx

  30. Consumers • Web Parts • Pages • PowerShell • Applications running outside of SharePoint • Provide others with a Service Consumer Client • They then just call your methods to: • Creates an instance of the Service Application Proxy • Invoke the method on the dynamic channel • Receive the results

  31. Developing First Service Application • Create WCF service; host in IIS • Test service with WcfClientTest.exe • Write 5 classes of SA (3 server, 2 client) • Add GUID; default 'ctors, other 'ctors, TypeName • Farm Feature Receiver creates/destroys: • Service (1/Farm) • Service Instance (1 each server) • Service Proxy (1/Farm) • Proxy Groups – Web Application Association • PowerShell to Auto-Create • _Layouts\Project \Consumer.aspx (Application page)

  32. Resources • Connect. Share. Discuss. http://northamerica.msteched.com Learning • Sessions On-Demand & Community • Microsoft Certification & Training Resources www.microsoft.com/teched www.microsoft.com/learning • Resources for IT Professionals • Resources for Developers • http://microsoft.com/technet • http://microsoft.com/msdn

  33. Complete an evaluation on CommNet and enter to win!

  34. © 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.