Slide1 l.jpg
This presentation is the property of its rightful owner.
Sponsored Links
1 / 31

It's All About the Services: Developing Custom Applications for Microsoft SharePoint Server 2010 Using Microsoft ASP.NET, WCF, and REST PowerPoint PPT Presentation


  • 84 Views
  • Uploaded on
  • Presentation posted in: General

PR12. It's All About the Services: Developing Custom Applications for Microsoft SharePoint Server 2010 Using Microsoft ASP.NET, WCF, and REST. Maxim Lukiyanov Program Manager Microsoft Corporation. Agenda. SharePoint Web Services REST Client Object Model Custom Web Services.

Download Presentation

It's All About the Services: Developing Custom Applications for Microsoft SharePoint Server 2010 Using Microsoft ASP.NET, WCF, and REST

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Slide1 l.jpg

PR12

It's All About the Services:Developing Custom Applications for Microsoft SharePoint Server 2010 Using Microsoft ASP.NET, WCF, and REST

Maxim Lukiyanov

Program Manager

Microsoft Corporation


Agenda l.jpg

Agenda

  • SharePoint Web Services

  • REST

  • Client Object Model

  • Custom Web Services


Sharepoint web services l.jpg

SharePoint Web Services

Browser

.NET CLR

Other Platforms

Internet

REST

Client OM

ASP.NET

WCF


Slide4 l.jpg

REST

REST

Client OM

ASP.NET

WCF


Slide5 l.jpg

REST

  • Access to SharePoint lists and library data

    • …/_vti_bin/listdata.svc

  • Lists and List items map to resources

    • listdata.svc/Employees(123)

  • Operations map to HTTP verbs

    • GET, POST, PUT, DELETE


Example adding announcement to sharepoint using http post l.jpg

Example: Adding Announcement to SharePoint using HTTP POST

  • POST /_vti_bin/listdata.svc/Announcements HTTP/1.0

  • Content-Type:application/json

  • Accept:application/json

  • Content-Length: 58

  • { Title: ‘New SharePoint REST Interface’,

  • Body: ‘Accessible from any platform with HTTP stack’ }


Based on ado net data services l.jpg

Based on ADO.NET Data Services

  • Flexible URL conventions for querying data

    • listdata.svc/Employees?$filter=JobTitleeq 'SDE'$orderby=Fullname

  • Multiple representations

    • JSON and Atom (full AtomPub support)

      • Feed readers, Excel Power Pivot (Gemini)

  • Batching, ETags, Paging, Documents


Rest atom feeds in the browser l.jpg

REST: Atom feeds in the browser

demo


Example query translation l.jpg

Example: Query Translation

Original REST Query:

  • GET /_vti_bin/listdata.svc/Employees?$filter=Project/Title eq ‘Project1‘ HTTP/1.0

Translated into CAML Query:

<Joins>

<JoinType='LEFT'

ListAlias=‘Projects'>

<Eq>

<FieldRefName=‘Project'RefType='ID'/>

<FieldRefList=‘Projects'Name='ID'/>

</Eq>

</Join>

  • </Joins>

    <ProjectedFields>

    <Field

    Name=‘ProjectTitle'

    Type='Lookup'

    List=‘Projects'

    ShowField='Title'/>

    </ProjectedFields>

    <Query>

    <Where>

    <Eq>

    <FieldRefName=‘ProjectTitle'/>

    <ValueType='Text'>Project1</Value>

    </Eq>

    </Where>

    </Query>


Integrated development experience l.jpg

Integrated Development Experience

  • Visual Studio 2010 & 2008 SP1

    • Client library for .NET and Silverlight

    • IDE integration, “Add Service Reference”

  • Entity based programming

    • Typed experience through code-gen

    • LINQ support

    • Updates

  • Client Libraries for PHP, Java


Rest master detail application l.jpg

REST: Master-Detail Application

demo


Client object model l.jpg

Client Object Model

REST

Client OM

ASP.NET

WCF


Client object model13 l.jpg

Client Object Model

  • Motivation

    • Removes the need for custom wrappers around SharePoint Web Services

  • Unified object model across all clients

    • JavaScript

    • .Net CLR

    • Silverlight CLR


Client object model coverage l.jpg

Client Object Model Coverage

  • Supports broad set of SharePoint objects

    • Site operations

    • Lists, ListItems

    • Content Types, Fields, …

    • But not Administration namespace, Farm objects

  • Implemented as WCF service

    • …/_vti_bin/client.svc

    • Uses Web Binding for request batching


How client object model works l.jpg

How Client Object Model Works

Client Application

Server

Sequence of commands:

Client.svc

command 1;

command 2;

command 3;

Execute commands

in the batch:

XML

command 1;

command 2;

command 3;

context.ExecuteQuery();

JSON

Process results

Send results back


Client object model16 l.jpg

Client Object Model

demo


Other sharepoint web services l.jpg

Other SharePoint Web Services

Web Services

Advanced Operations

SharePoint Server Operations

Client Object Model

Advanced List Operations

Site Operations

Security

  • User Profiles

  • People

  • Search

  • Enterprise Metadata

  • Document Coauthoring

  • Excel REST web services

  • Publishing

  • Workflow

  • BCS web services

  • see MSDN

REST

List data


Custom web services l.jpg

Custom Web Services

REST

Client OM

ASP.NET

WCF


Asp net vs wcf l.jpg

ASP.NET vs WCF

  • ASP.NET web services are supported

  • WCF is recommended for new web services

    • SharePoint 2007 does not support WCF directly

      • Separate Web Application is required or

      • Custom Virtual Path Provider/HTTP Module


Asp net web service development l.jpg

ASP.NET Web Service Development

  • SOAP

    • The same as in SharePoint 2007

    • Deploy ASMX service to ISAPI folder

    • Add ServiceWSDL.aspx and ServiceDisco.aspx files to represent WSDL of your service.

  • REST

    • Place ASHX request handler in ISAPI folder


Slide21 l.jpg

WCF

?

  • Problem

    • IT Admin configures IIS

      • Different Authentication schemes can be configured

        • Basic, Forms, Claims, Windows Integrated, Digest, …

      • Multiple IIS address bindings

    • Developer configures WCF Service endpoint

  • Solution

    • Dynamic (Programmatic) Configuration

      • RTM only, not available in Beta2


Wcf web service development l.jpg

WCF Web Service Development

  • SOAP

    • Specify Service Factory in SVC file

    • Add MEX endpoint behavior attribute to the service class

      • BasicHttpBindingServiceMetadataExchangeEndpoint

    • Deploy SVC service to ISAPI folder

  • REST

    • Specify Service Factory in SVC file

    • Deploy SVC service to ISAPI folder


Wcf s ervice configuration l.jpg

WCF Service Configuration


Custom wcf service l.jpg

Custom WCF Service

demo


Details of wcf service configuration l.jpg

Details of WCF Service Configuration

SharePoint

Service Factory

Service.svc

http://server/_vti_bin/Service.svc/negotiate

http://server/_vti_bin/Service.svc/ntlm

http://server/_vti_bin/Service.svc/anonymous

SharePoint

HTTP Module

HTTP POST

http://server/_vti_bin/Service.svc


Key takeaways l.jpg

Key Takeaways

  • SharePoint 2010 is designed for Services Oriented Applications

  • New REST and Client Object Model provide easy access to SharePoint from client apps

    • SharePoint Lists have enhanced relational capabilities

  • WCF is supported and easy


Related sessions l.jpg

Related Sessions

Questions?


Slide28 l.jpg

YOUR FEEDBACK IS IMPORTANT TO US!

Please fill out session evaluation forms online at

MicrosoftPDC.com


Learn more on channel 9 l.jpg

Learn More On Channel 9

  • Expand your PDC experience through Channel 9.

  • Explore videos, hands-on labs, sample code and demos through the new Channel 9 training courses.

    channel9.msdn.com/learn

Built by Developers for Developers….


  • Login