• Save

Loading…

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

Like this presentation? Why not share!

Intro to SharePoint Web Services

on

  • 5,481 views

 

Statistics

Views

Total Views
5,481
Views on SlideShare
5,481
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
2

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • Great Tutorial Mr. Rackley i am finding about Microsoft SharePoint Web Services, i hope so this is very help full for me.
    Are you sure you want to
    Your message goes here
    Processing…
  • Adding below adds value to the presentation slides:

    SharePoint Web Services are WCF Data Services
    LINQ to Entities can be used to access data by generating ORM without relying on complicated CAML.
    Accessing SharePoint list data or update can be done directly using ORM, Web services is an alternative.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Intro to SharePoint Web Services Intro to SharePoint Web Services Presentation Transcript

  • Introduction To SharePoint Web Services
    Mark Rackley – Solutions Architect
    Email: mrackley@gmail.com
    Blog: http://www.sharepointhillbilly.com
    Twitter: http://www.twitter.com/mrackley
  • Pescadigitation
  • Agenda
    Introduction to Web Services
    Introduction to SharePoint Web Services
    Web Services Programming Fundamentals
    Dissecting a SharePoint Web Service Call
    Demos
    3
  • What We WON’T Cover(but will point out a couple of things)
    Security
    Scalability
    Performance
    5
    Eric Shupps
    Microsoft SharePoint MVP
    “Serve It Up: Building Collaborative Applications with SharePoint Web Services”
    http://www.sharepointcowboy.com
  • Section 1
    Introduction to
    Web Services
    6
  • What is a Web Service?
    7
    According to the World Wide Web Consortium (W3C):
    "a Web service is a software system designed to support interoperable machine-to-machine interaction over a network. It has an interface described in a machine-processable format (specifically WSDL). Other systems interact with the Web service in a manner prescribed by its description using SOAP-messages, typically conveyed using HTTP with an XML serialization in conjunction with other Web-related standards." [W3C04]
  • 8
  • Let’s try it again…
    9
    A simplistic definition:
    "a Web service is a software system for sending and receiving data between computer systems over a network following predefined standards.“
  • Web Services…
    Language independent
    Operating System independent
    Do not use browsers or HTML to communicate
    Machine-to-machine communication
    Do not have a GUI
    Expose an application program interface (API)
    Uses HTTP
    Typically return results as XML
    10
  • See How Easy It Is?
    http://www.webservicex.net/stockquote.asmx?WSDL
    11
  • See How Easy It Is?
    http://www.webservicex.net/stockquote.asmx?WSDL
    12
  • XML Response
    13
    <StockQuotes>
    <Stock>
    <Symbol>MSFT</Symbol>
    <Last>25.10</Last>
    <Date>10/19/2010</Date>
    <Time>4:00pm</Time>
    <Change>-0.72</Change>
    <Open>25.27</Open>
    <High>25.37</High>
    <Low>24.95</Low>
    <Volume>66146964</Volume>
    <MktCap>217.2B</MktCap>
    <PreviousClose>25.82</PreviousClose>
    <PercentageChange>-2.79%</PercentageChange>
    <AnnRange>22.73 - 31.58</AnnRange>
    <Earns>2.101</Earns>
    <P-E>12.29</P-E>
    <Name>Microsoft Corpora</Name>
    </Stock>
    </StockQuotes>
  • Section 2
    Introduction to SharePoint Web Services
    14
  • The Basics
    Provide remote access to a range of object model functionality
    Encapsulate common functions for lists, webs, site collections, and more
    Run on all front-end web servers
    Heavily dependent on XML and CAML
    Reside in physical file system in the 12... Directory and in a virtual file system in /_vti_bin
    15
  • Common Uses
    16
    http://msdn.microsoft.com/en-us/library/cc752745.aspx
  • Common Uses
    17
    http://msdn.microsoft.com/en-us/library/cc824213.aspx
  • What They Do
    Provide programmatic access via .NET and SharePoint Designer
    Deliver relatively robust remote API functionality
    Expose SharePoint data repository to disconnected clients
    Permit inter-farm communication (geographic distribution)
    Integrate well with WinForms, WPF, and SilverLight
    Client Object Model (SP 2010)
    18
  • What They Don’t Do
    Do not provide access to entire object model
    Do not permit manipulation of BLOB objects (documents)
    NTLM and Basic Authentication Only
    No SSO integration
    No extensibility (sealed classes)
    Limited data aggregation
    19
  • When to Use Them
    Remote accessibility
    Integration with backend or legacy systems
    Retrieval of items and content as XML
    Perform large batch updates to lists
    Leverage encapsulated OM functions
    Cross-farm programmability
    Creation of Data Form Web Parts in SharePoint Designer
    Interaction with InfoPath Forms
    20
  • Section 3
    Web Services Programming Fundamentals
    21
  • References
    Add a Web Reference to any project type
    Must specify existing SharePoint site in URL + “/_vti_bin/” + ServiceName + “.asmx”
    Uses existing authentication context, beware permission issues
    Set URL to dynamic
    22
  • Syntax
    XML is your friend
    CAML is the red-headed step child
    All column names are XML encoded and prefixed with “ows_”
    Watch out for spaces, dashes, and other characters in site column/content type/list field names
    Long column names will be truncated in the ows_Name field
    Use ows_DisplayName to match field names in UI
    23
  • CAML
    CAML – Collaborative Application Markup Language
    Think of it as XML SQL?
    Use tools to help generate CAML (YACAMLQT)
    All Query parameters must be provided in CAML syntax
    Return values often include CAML constructs
    List Schema
    View Scheme
    Content Types
    24
  • CAML Examples
    25
    WHERE Email="mrackley@gmail.com"
    <Where>
    <Eq>
    <FieldRef Name="Email" />
    <Value Type="Text">mrackley@gmail.com</Value>
    </Eq>
    </Where>
  • CAML Examples
    26
    WHERE Email<>"mrackley@gmail.com"
    <Where>
    <Neq>
    <FieldRef Name="Email" />
    <Value Type="Text">mrackley@gmail.com</Value>
    </Neq>
    </Where>
  • CAML Examples
    27
    WHERE ID<>null
    <Where>
    <IsNotNull>
    <FieldRef Name="ID" />
    </IsNotNull>
    </Where>
  • CAML Examples
    28
    WHERE ID<>null and Email="mrackley@gmail.com"
    <Where>
    <And>
    <IsNotNull>
    <FieldRef Name="ID" />
    </IsNotNull>
    <Eq>
    <FieldRef Name="Email" />
    <Value Type="Text">mrackley@gmail.com</Value>
    </Eq>
    </And>
    </Where>
  • CAML Examples
    29
    WHERE ID<>null or Email="mrackley@gmail.com"
    <Where>
    <Or>
    <IsNotNull>
    <FieldRef Name="ID" />
    </IsNotNull>
    <Eq>
    <FieldRef Name="Email" />
    <Value Type="Text">mrackley@gmail.com</Value>
    </Eq>
    </Or>
    </Where>
  • CAML Examples
    30
    WHERE (Email<>"mrackley@gmail.com" and
    Email<>"mrackley@unfi.com") OR ID > 10
    <Where>
    <Or>
    <And>
    <Neq>
    <FieldRef Name="Email" />
    <Value Type="Text">mrackley@gmail.com</Value>
    </Neq>
    <Neq>
    <FieldRef Name="Email" />
    <Value Type="Text">mrackley@unfi.com</Value>
    </Neq>
    </And>
    <Gq>
    <FieldRef Name="ID" />
    <Value Type="Integer">10</Value>
    </Gq>
    </Or>
    </Where>
  • CAML Operators
    31
    Source: http://www.a2zdotnet.com/View.aspx?id=90
  • Error Handling
    Most web services will throw SoapException or nothing at all
    Error information is contained within XML result set
    0x00000000 indicates success
    Any other value is error or warning followed by description (hopefully)
    32
  • SharePoint Emoticons
    0;# “12;#Some Value“
    0x0020 Spaces_0x0020_Are_0x0020_Fun
    ows_ All returned fields are prepended
    -1001 Possible Boolean values
    rs:Data
    z:row
    33
  • Large Data Sets
    Batch updates via Web Services surpass OM at ~500 items
    Large batch updates may exceed thresholds
    SOAP exceptions
    Extremely large lists (100k+) non-performant over-the-wire
    Use LINQ to XML to improve query performance
    34
  • Architecture Concerns
    HTTP overhead on WFE’s
    Database impact from large read/write operations
    Site naming conventions
    SPD does not permit spaces in reference name
    Performance impact from parsing large XML sets in memory
    NTLM/Basic Authentication only
  • Section 4
    Dissecting a SharePoint Web Service Call
    36
  • Example Call to GetListItems
    37
  • GetListItems XML Response
    38
    <rs:dataItemCount="1" xmlns:rs="urn:schemas-microsoft-com:rowset">
    <z:row ows_Title="Elmer@Fudd.com"
    ows_MetaInfo="4764;#"
    ows__ModerationStatus="0"
    ows__Level="1"
    ows_ID="4764"
    ows_owshiddenversion="5"
    ows_UniqueId="4764;#{2272A40C-0DA5-4C0D-938D-BFF3AF9C8ACF}"
    ows_FSObjType="4764;#0"
    ows_Created="2009-12-12 12:55:10"
    ows_FileRef="4764;#sps/Contact/test/Lists/Issues/4764_.000"
    xmlns:z="#RowsetSchema" />
    </rs:data>
  • Example Call to UpdateListItems
    39
  • SPServices
    http://spservices.codeplex.com
    jQuery library to call SharePoint Web Services
    40
  • Spservices Example Call
  • DEMOS!
    (Real World Scenario Even)
    42
  • Where We Are – Hey! We have SharePoint.. Let’s use it!
  • First Step – Get New Data in SharePoint
  • Part B – Get Legacy Data into SharePoint
  • Step 3 – Enhance with jQuery
  • Questions?
    Mark Rackley
    mrackley@gmail.com
    www.twitter.com/mrackley
    www.sharepointhillbilly.com
    47