Things hard and not so hard.... RSS 2.0
# Tuesday, November 20, 2012

While on SharePoint 2013 training we came across all the different ways of calling SharePoint and it’s data through JavaScript, JQuery and all the bits.

It was all looking good until we needed to update sharepoint – e.g. a list, a list item etc.

The MS Course notes say – “if you’re in SharePoint you can get the Form Digest from the main SharePoint Form….”

 

What about if you’re running outside of SharePoint (a Provider App – they now call it, or Cloud Hosted…depending on who wrote the help article)

 

The answer in the notes is… go and make an old fashion call to Sites.asmx SOAP WebService…. from client side javascript this is going to be a feat.

….

The Answer – make a REST call to get the ‘Context Info’ first, then you’ll have the form digest and you’re done.

http://msdn.microsoft.com/en-us/library/fp142386(office.15).aspx#bk_synchronize (just at the top of this page)

 

Table 1. SPContextWebInformation structure initialization properties

Property

Description

webFullUrl

Gets the server-relative URL of the nearest site.

siteFullUrl

Gets the server-relative URL of the root of the site collection that the site is contained within.

If the nearest web is the root of a site collection, then the value of the webFullUrl property is equal to the siteFullUrl property.

formDigestValue

Gets the server's request form digest.

LibraryVersion

Gets the current version of the REST library.

SupportedSchemaVersions

Gets the versions of the schema of the REST/CSOM library that are supported.

To access this information, use the /contextinfo operator. For example:

http://server/web/doclib/forms/_api/contextinfo

To increase security against cross-site scripting attempts, the /contextinfo operator accepts only POST requests.

Tuesday, November 20, 2012 3:43:32 PM (AUS Eastern Daylight Time, UTC+11:00)  #    Comments [0] -
Dev | SharePoint | 2013 | Tips
Archive
<November 2012>
SunMonTueWedThuFriSat
28293031123
45678910
11121314151617
18192021222324
2526272829301
2345678
Blogroll
 AppFabric CAT
AppFabric Windows Server Customer Advisory Team - New Blog.
[Feed] BizTalk 2006 - Windows SharePoint Services adapter
BizTalk 2006 Sharepoint adapter!!
 Breeze SharePoint 2010 Bootcamp
Breeze SharePoint 2010 Bootcamp
[Feed] BTS 2006 R2/EDI
[Feed] Chris Vidotto (MS BTS Legend)
Needs no intro....
 Mark Daunt
BTS/SPS/.NET GURU!!!
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2014
Breeze
Sign In
Statistics
Total Posts: 603
This Year: 7
This Month: 0
This Week: 0
Comments: 270
All Content © 2014, Breeze