SlideShare a Scribd company logo
1 of 47
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
Web Service Description Path
Alerts Show and delete alerts /_vti_bin/alerts.asmx
Authentication Used for forms-based authentication /_vti_bin/authentication.asmx
Copy Copies files within and between SharePoint sites /_vti_bin/copy.asmx
Document Workspace
Web Service
Manage Document Workspace and data within /_vti_bin/dws.asmx
Forms Shows the forms associated with a list and data about
them
/_vti_bin/forms.asmx
Imaging Work with picture libraries /_vti_bin/imaging.asmx
List Data Pull data from within SharePoint lists /_vti_bin/dspsts.asmx
Lists Work with lists and list data /_vti_bin/lists.asmx
Meetings Create and manage meeting workspaces /_vti_bin/meetings.asmx
People Resolve and find users /_vti_bin/people.asmx
Permissions Work with list and site permissions /_vti_bin/permissions.asmx
Directory Management Manage AD distribution groups and members /_vti_bin/sharepointemailws.
asmx
Site Data Show metadata or list data from sites and lists /_vti_bin/sitedata.asmx
Sites Returns information about site collections or site
templates
/_vti_bin/sites.asmx
Search Allows you to access search results outside of SharePoint /_vti_bin/spsearch.asmx
Users and Groups Work with Users and Groups /_vti_bin/usergroup.asmx
Versions Work with file versions /_vti_bin/versions.asmx
Views Manage list views /_vti_bin/views.asmx
Web Part Pages Work with web part pages /_vti_bin/webpartpages.asmx
Webs Work with sites and subsites /_vti_bin/webs.asmx
http://msdn.microsoft.com/en-us/library/cc752745.aspx
Common Uses
17
Web Service Description Path
Area Area interface for remote clients /_vti_bin/areaservice.asmx
Official File Sending files and file properties to records
repository
/_vti_bin/officialfile.asmx
Published Links Returns list of published links /_vti_bin/publishedlinksservice.asmx
MOSS Search Allows access to the Enterprise Search /_vti_bin/search.asmx
User Profile
Change
Provides remote ability to create or
modify user profiles
/_vti_bin/userprofilechangeservice.asmx
User Profile
Service
Manage user profiles /_vti_bin/userprofileservice.asmx
Workflow Allows starting of workflows and
retrieving information about workflows
/_vti_bin/workflow.asmx
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
Operator Meaning
Eq =
Gt >
Lt <
Geq >=
Leq <=
Neq <>
Contains Like
IsNull Null
IsNotNull NotNull
BeginsWith Text begins with
OrderBy Sort order for a query.
GroupBy Contains a Group By section for grouping the data returned
through a query in a list view
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:data ItemCount="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

More Related Content

What's hot

SPTechCon Dev Days - Third Party jQuery Libraries
SPTechCon Dev Days - Third Party jQuery LibrariesSPTechCon Dev Days - Third Party jQuery Libraries
SPTechCon Dev Days - Third Party jQuery Libraries
Mark Rackley
 
What is SharePoint Development??
What is SharePoint Development??What is SharePoint Development??
What is SharePoint Development??
Mark Rackley
 
Getting The Most Out Of SP Search SPSTC
Getting The Most Out Of SP Search SPSTCGetting The Most Out Of SP Search SPSTC
Getting The Most Out Of SP Search SPSTC
John Ross
 

What's hot (20)

The SharePoint & jQuery Guide - Updated 1/14/14
The SharePoint & jQuery Guide - Updated 1/14/14The SharePoint & jQuery Guide - Updated 1/14/14
The SharePoint & jQuery Guide - Updated 1/14/14
 
SPTechCon Dev Days - Third Party jQuery Libraries
SPTechCon Dev Days - Third Party jQuery LibrariesSPTechCon Dev Days - Third Party jQuery Libraries
SPTechCon Dev Days - Third Party jQuery Libraries
 
SPTechCon DevDays - SharePoint & jQuery
SPTechCon DevDays - SharePoint & jQuerySPTechCon DevDays - SharePoint & jQuery
SPTechCon DevDays - SharePoint & jQuery
 
SPTechCon 2014 How to develop and debug client side code in SharePoint
SPTechCon 2014 How to develop and debug client side code in SharePointSPTechCon 2014 How to develop and debug client side code in SharePoint
SPTechCon 2014 How to develop and debug client side code in SharePoint
 
Introduction to Client Side Dev in SharePoint Workshop
Introduction to Client Side Dev in SharePoint WorkshopIntroduction to Client Side Dev in SharePoint Workshop
Introduction to Client Side Dev in SharePoint Workshop
 
SharePoint & jQuery Guide - SPSTC 5/18/2013
SharePoint & jQuery Guide - SPSTC 5/18/2013 SharePoint & jQuery Guide - SPSTC 5/18/2013
SharePoint & jQuery Guide - SPSTC 5/18/2013
 
SPSNH 2014 - The SharePoint & jQueryGuide
SPSNH 2014 - The SharePoint & jQueryGuideSPSNH 2014 - The SharePoint & jQueryGuide
SPSNH 2014 - The SharePoint & jQueryGuide
 
NOW I Get it!! What SharePoint IS and why I need it
NOW I Get it!! What SharePoint IS and why I need itNOW I Get it!! What SharePoint IS and why I need it
NOW I Get it!! What SharePoint IS and why I need it
 
What is SharePoint Development??
What is SharePoint Development??What is SharePoint Development??
What is SharePoint Development??
 
Using jQuery to Maximize Form Usability
Using jQuery to Maximize Form UsabilityUsing jQuery to Maximize Form Usability
Using jQuery to Maximize Form Usability
 
SharePoint REST vs CSOM
SharePoint REST vs CSOMSharePoint REST vs CSOM
SharePoint REST vs CSOM
 
Introduction to using jQuery with SharePoint
Introduction to using jQuery with SharePointIntroduction to using jQuery with SharePoint
Introduction to using jQuery with SharePoint
 
SPSDenver - SharePoint & jQuery - What I wish I would have known
SPSDenver - SharePoint & jQuery - What I wish I would have knownSPSDenver - SharePoint & jQuery - What I wish I would have known
SPSDenver - SharePoint & jQuery - What I wish I would have known
 
A Power User's intro to jQuery awesomeness in SharePoint
A Power User's intro to jQuery awesomeness in SharePointA Power User's intro to jQuery awesomeness in SharePoint
A Power User's intro to jQuery awesomeness in SharePoint
 
SharePoint Saturday St. Louis - SharePoint & jQuery
SharePoint Saturday St. Louis - SharePoint & jQuerySharePoint Saturday St. Louis - SharePoint & jQuery
SharePoint Saturday St. Louis - SharePoint & jQuery
 
Getting The Most Out Of SP Search SPSTC
Getting The Most Out Of SP Search SPSTCGetting The Most Out Of SP Search SPSTC
Getting The Most Out Of SP Search SPSTC
 
SEF2013 - Create a Business Solution, Step by Step, with No Managed Code
SEF2013 - Create a Business Solution, Step by Step, with No Managed CodeSEF2013 - Create a Business Solution, Step by Step, with No Managed Code
SEF2013 - Create a Business Solution, Step by Step, with No Managed Code
 
The SharePoint & jQuery Guide
The SharePoint & jQuery GuideThe SharePoint & jQuery Guide
The SharePoint & jQuery Guide
 
Utilizing jQuery in SharePoint: Get More Done Faster
Utilizing jQuery in SharePoint: Get More Done FasterUtilizing jQuery in SharePoint: Get More Done Faster
Utilizing jQuery in SharePoint: Get More Done Faster
 
CSOM (Client Side Object Model). Explained @ SharePoint Saturday Houston
CSOM (Client Side Object Model). Explained @ SharePoint Saturday HoustonCSOM (Client Side Object Model). Explained @ SharePoint Saturday Houston
CSOM (Client Side Object Model). Explained @ SharePoint Saturday Houston
 

Similar to Intro to SharePoint Web Services

Ado.Net Data Services (Astoria)
Ado.Net Data Services (Astoria)Ado.Net Data Services (Astoria)
Ado.Net Data Services (Astoria)
Igor Moochnick
 
Wss Object Model
Wss Object ModelWss Object Model
Wss Object Model
maddinapudi
 

Similar to Intro to SharePoint Web Services (20)

CG_CS25010_Lecture
CG_CS25010_LectureCG_CS25010_Lecture
CG_CS25010_Lecture
 
Intro to .NET for Government Developers
Intro to .NET for Government DevelopersIntro to .NET for Government Developers
Intro to .NET for Government Developers
 
The SharePoint and jQuery Guide by Mark Rackley - SPTechCon
The SharePoint and jQuery Guide by Mark Rackley - SPTechConThe SharePoint and jQuery Guide by Mark Rackley - SPTechCon
The SharePoint and jQuery Guide by Mark Rackley - SPTechCon
 
Ado.Net Data Services (Astoria)
Ado.Net Data Services (Astoria)Ado.Net Data Services (Astoria)
Ado.Net Data Services (Astoria)
 
SharePoint 2013 APIs
SharePoint 2013 APIsSharePoint 2013 APIs
SharePoint 2013 APIs
 
InfoPath alternatives and the PowerApps potential
InfoPath alternatives and the PowerApps potentialInfoPath alternatives and the PowerApps potential
InfoPath alternatives and the PowerApps potential
 
Twelve ways to make your apps suck less
Twelve ways to make your apps suck lessTwelve ways to make your apps suck less
Twelve ways to make your apps suck less
 
The future of web development write once, run everywhere with angular js an...
The future of web development   write once, run everywhere with angular js an...The future of web development   write once, run everywhere with angular js an...
The future of web development write once, run everywhere with angular js an...
 
The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...
 
Windows Azure and a little SQL Data Services
Windows Azure and a little SQL Data ServicesWindows Azure and a little SQL Data Services
Windows Azure and a little SQL Data Services
 
Wss Object Model
Wss Object ModelWss Object Model
Wss Object Model
 
ArcReady - Architecting For The Cloud
ArcReady - Architecting For The CloudArcReady - Architecting For The Cloud
ArcReady - Architecting For The Cloud
 
SharePoint for the .NET Developer
SharePoint for the .NET DeveloperSharePoint for the .NET Developer
SharePoint for the .NET Developer
 
Windows Azure for .NET Developers
Windows Azure for .NET DevelopersWindows Azure for .NET Developers
Windows Azure for .NET Developers
 
PPT
PPTPPT
PPT
 
Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...
Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...
Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...
 
Arc Ready Cloud Computing
Arc Ready Cloud ComputingArc Ready Cloud Computing
Arc Ready Cloud Computing
 
Chris O'Brien - Modern SharePoint development: techniques for moving code off...
Chris O'Brien - Modern SharePoint development: techniques for moving code off...Chris O'Brien - Modern SharePoint development: techniques for moving code off...
Chris O'Brien - Modern SharePoint development: techniques for moving code off...
 
Access Apps for Office 365 with Power BI
Access Apps for Office 365 with Power BIAccess Apps for Office 365 with Power BI
Access Apps for Office 365 with Power BI
 
Cloud computing and the Windows Azure Services Platform (KU Leuven)
Cloud computing and the Windows Azure Services Platform (KU Leuven)Cloud computing and the Windows Azure Services Platform (KU Leuven)
Cloud computing and the Windows Azure Services Platform (KU Leuven)
 

More from Mark Rackley (8)

Column Formatter in SharePoint Online
Column Formatter in SharePoint OnlineColumn Formatter in SharePoint Online
Column Formatter in SharePoint Online
 
SharePoint Conference North America - Converting your JavaScript to SPFX
SharePoint Conference North America - Converting your JavaScript to SPFXSharePoint Conference North America - Converting your JavaScript to SPFX
SharePoint Conference North America - Converting your JavaScript to SPFX
 
A Power User's Introduction to jQuery Awesomeness in SharePoint
A Power User's Introduction to jQuery Awesomeness in SharePointA Power User's Introduction to jQuery Awesomeness in SharePoint
A Power User's Introduction to jQuery Awesomeness in SharePoint
 
Citizen Developers Intro to jQuery Customizations in SharePoint
Citizen Developers Intro to jQuery Customizations in SharePointCitizen Developers Intro to jQuery Customizations in SharePoint
Citizen Developers Intro to jQuery Customizations in SharePoint
 
SharePoint and jQuery Essentials
SharePoint and jQuery EssentialsSharePoint and jQuery Essentials
SharePoint and jQuery Essentials
 
Wrapping your head around the SharePoint Beast (For the rest of us)
Wrapping your head around the SharePoint Beast (For the rest of us)Wrapping your head around the SharePoint Beast (For the rest of us)
Wrapping your head around the SharePoint Beast (For the rest of us)
 
What IS SharePoint Development?
What IS SharePoint Development?What IS SharePoint Development?
What IS SharePoint Development?
 
SPSTC - SharePoint & jQuery Essentials
SPSTC - SharePoint & jQuery EssentialsSPSTC - SharePoint & jQuery Essentials
SPSTC - SharePoint & jQuery Essentials
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 

Intro to SharePoint Web Services

  • 1. Introduction To SharePoint Web Services Mark Rackley – Solutions Architect Email: mrackley@gmail.com Blog: http://www.sharepointhillbilly.com Twitter: http://www.twitter.com/mrackley
  • 3. Agenda • Introduction to Web Services • Introduction to SharePoint Web Services • Web Services Programming Fundamentals • Dissecting a SharePoint Web Service Call • Demos 3
  • 4.
  • 5. 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
  • 7. 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. 8
  • 9. 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.“
  • 10. 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
  • 11. See How Easy It Is? http://www.webservicex.net/stockquote.asmx?WSDL 11
  • 12. See How Easy It Is? http://www.webservicex.net/stockquote.asmx?WSDL 12
  • 15. 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
  • 16. Common Uses 16 Web Service Description Path Alerts Show and delete alerts /_vti_bin/alerts.asmx Authentication Used for forms-based authentication /_vti_bin/authentication.asmx Copy Copies files within and between SharePoint sites /_vti_bin/copy.asmx Document Workspace Web Service Manage Document Workspace and data within /_vti_bin/dws.asmx Forms Shows the forms associated with a list and data about them /_vti_bin/forms.asmx Imaging Work with picture libraries /_vti_bin/imaging.asmx List Data Pull data from within SharePoint lists /_vti_bin/dspsts.asmx Lists Work with lists and list data /_vti_bin/lists.asmx Meetings Create and manage meeting workspaces /_vti_bin/meetings.asmx People Resolve and find users /_vti_bin/people.asmx Permissions Work with list and site permissions /_vti_bin/permissions.asmx Directory Management Manage AD distribution groups and members /_vti_bin/sharepointemailws. asmx Site Data Show metadata or list data from sites and lists /_vti_bin/sitedata.asmx Sites Returns information about site collections or site templates /_vti_bin/sites.asmx Search Allows you to access search results outside of SharePoint /_vti_bin/spsearch.asmx Users and Groups Work with Users and Groups /_vti_bin/usergroup.asmx Versions Work with file versions /_vti_bin/versions.asmx Views Manage list views /_vti_bin/views.asmx Web Part Pages Work with web part pages /_vti_bin/webpartpages.asmx Webs Work with sites and subsites /_vti_bin/webs.asmx http://msdn.microsoft.com/en-us/library/cc752745.aspx
  • 17. Common Uses 17 Web Service Description Path Area Area interface for remote clients /_vti_bin/areaservice.asmx Official File Sending files and file properties to records repository /_vti_bin/officialfile.asmx Published Links Returns list of published links /_vti_bin/publishedlinksservice.asmx MOSS Search Allows access to the Enterprise Search /_vti_bin/search.asmx User Profile Change Provides remote ability to create or modify user profiles /_vti_bin/userprofilechangeservice.asmx User Profile Service Manage user profiles /_vti_bin/userprofileservice.asmx Workflow Allows starting of workflows and retrieving information about workflows /_vti_bin/workflow.asmx http://msdn.microsoft.com/en-us/library/cc824213.aspx
  • 18. 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
  • 19. 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
  • 20. 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
  • 22. 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
  • 23. 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
  • 24. 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
  • 25. CAML Examples 25 WHERE Email="mrackley@gmail.com" <Where> <Eq> <FieldRef Name="Email" /> <Value Type="Text">mrackley@gmail.com</Value> </Eq> </Where>
  • 26. CAML Examples 26 WHERE Email<>"mrackley@gmail.com" <Where> <Neq> <FieldRef Name="Email" /> <Value Type="Text">mrackley@gmail.com</Value> </Neq> </Where>
  • 28. 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>
  • 29. 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>
  • 30. 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>
  • 31. CAML Operators 31 Operator Meaning Eq = Gt > Lt < Geq >= Leq <= Neq <> Contains Like IsNull Null IsNotNull NotNull BeginsWith Text begins with OrderBy Sort order for a query. GroupBy Contains a Group By section for grouping the data returned through a query in a list view Source: http://www.a2zdotnet.com/View.aspx?id=90
  • 32. 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
  • 33. 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
  • 34. 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
  • 35. 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
  • 36. Section 4 Dissecting a SharePoint Web Service Call 36
  • 37. Example Call to GetListItems 37
  • 38. GetListItems XML Response 38 <rs:data ItemCount="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>
  • 39. Example Call to UpdateListItems 39
  • 40. SPServices • http://spservices.codeplex.com • jQuery library to call SharePoint Web Services 40
  • 43. Where We Are – Hey! We have SharePoint.. Let’s use it!
  • 44. First Step – Get New Data in SharePoint
  • 45. Part B – Get Legacy Data into SharePoint
  • 46. Step 3 – Enhance with jQuery