SharePoint 2010 REST-like Services – Getting them to work!

Given that it is only beta, I still have to give SharePoint 2010 some leaway yet, until RTM comes out, who knows if
these things will be the same or not. 

Anyone that has programmed Facebook API, knows they have one of the most intense and best documented REST-ful
service layers on the planet!  I have many applications that use their API and the OpenID login IP-STS.  If you were to
look at Facebook and their implementation, you would know it is the BEST way to implement REST services.  I give them
full credit for the revolution that has started!

Given that, let's look at SharePoint 2010 and its REST-like services.  Here's my issues:

  1. Performance sucks
    1. Implementation should have been with HttpHandler vs "Accept" header in the HTTP request with the requested
      format you want returned.  This adds 23 bytes to every request, oh and wait, it gets better, for some reason you
      need a "if-match" header too, another 15 bytes.  Facebook simply does this in the request URL listdata.atom or
      listdata.xml – wow, how easy is that?
    2. My favorite tweet about this REST Implementation: "Oh my god, they killed REST, you bastards!"
  2. Documentation so far is poor
    1. Take for instance the "POST" for adding a new item, the documentation is wrong, it says to do this:

POST /_vti_bin/ListData.svc/Employees HTTP/1.1
Accept: application/atom+xml
Content-Type: application/atom+xml
Host: www.contoso.com
Content-Length: ###
Expect: 100-continue
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<entry xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"
xmlns="http://www.w3.org/2005/Atom">
<category scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" term="Microsoft.SharePoint.Linq.EmployeesItem" />
<title />
<author>
<name />
</author>
<updated>2009-04-30T02:15:21.1353156Z</updated>
<id />
<link href="http://www.contoso.com/_vti_bin/ListData.svc/Projects(2)"
rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Projects"
type="application/atom+xml;type=feed" />
<link href="http://www.contoso.com/_vti_bin/ListData.svc/Projects(3)"
rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Projects"
type="application/atom+xml;type=feed" />
<content type="application/xml">
<m:properties>
<d:Created m:type="Edm.DateTime" m:null="true" />
<d:FullName>James Earl Jones</d:FullName>
<d:HireDate m:type="Edm.DateTime">1987-04-29T19:15:14.7861156-07:00</d:HireDate>
<d:ID m:type="Edm.Int32">0</d:ID>
<d:Modified m:type="Edm.DateTime" m:null="true" />
<d:Path m:null="true" />
<d:Salary m:type="Edm.Double">195000</d:Salary>
<d:Version m:null="true" />
<d:Owshiddenversion m:type="Edm.Int32" m:null="true" />
</m:properties>
</content>
</entry>

The error is in the "category" element, you are not using "Linq", you should be using "DataService".

Changing the term attribute will fix your issues:

<category scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"
term="Microsoft.SharePoint.Linq.EmployeesItem" />

TO:

<category scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"
term="Microsoft.SharePoint.DataService.EmployeesItem" />

You should also wrap your WebRequest calls in an try/catch handling a WebException.
You can then interrogate the ResponseStream and see what error you are actually getting back and
fix any other issues you might run into!

As always, Enjoy!
Chris

Follow me on twitter!

Office & BCS

This is a great job by Fabian Williams on tracking down the "bcssync.exe" "dllNotFoundException".  Works like a charm!  Good job Fabian!

http://bit.ly/5acgH9

The only thing I would add is that you should try to reinstall the .NET 3.5 SP1 if you can't get past the bcssync.exe error.

Chris

Follow me on twitter!

FAST Search Installer – Getting it to work!

So it won't install eh?  Run this command to extract the files, then just run the files.  Seems the installer wrapper is messed up:

  • en_fast_search_server_sharepoint_2010_beta_x64_x16-29476
    /extract:c: emp

This will extract the files to the temp directory, then you do the following:

  • Run PrerequisiteInstaller
  • Run fsserver

After running fsserver, you will have a new directory on your server called c:FASTSearch, you will need to do the following:

  • Add "C:FASTSearchinstallerscripts" to your path
  • Open SharePoint 2010 Management console
  • Run the following:
    • Psconfig.ps1 –action i –roleName single –userName contosoadministrator –localMachineName <servername> -databaseConnectionString “<dbservername>” –databaseName FASTSearch

As Emeril would say "BAM", you got FAST Search INSTALLED!  Woohoo!

HINTS:

  • If you uninstall FAST Search using "psconfig -action u", you will lose a file called "C:Program FilesCommon FilesMicrosoft SharedULS14ULSControllerService.exe" 
  • The fix for this is to uninstall the ULS components, then reinstall them again.  The file will return and you can reinstall/config FAST Search

Enjoy,
Chris

SharePoint 2010 – Wait, its not working! HELP!

Ok, the two most important things for you to check if something is NOT working in SharePoint 2010

  • Check IIS Application Pool called "SharePoint Web Services" IS RUNNING, and make sure its not runinng as "Local System" but something that has some *UMMPHF* to it!
  • Check Timer Service – this thing seems to shut itself down and doesn't restart!  Make sure it is running or NOTHING will happen in your system

That will solve ALOT of your problems!

Chris

Follow me on twitter!

Sandboxed Solutions – SharePoint 2010

So you have probably heard about this new "Sandboxed" solution "feature" of SharePoint 2010.  Sounds cools right?  Well, let's just wait till your developers get ahold of it and start to screw with your users in production!

So reservations I have include:

  • Point system is too high (300 points/day).  Really?  For each unhandled exception I get 1/50th of a point.  That means it would take  15,000 unhandled exceptions!  

Let me put that into perspective for you.

  • What if you create an event receiver that has an unhandled exception on PURPOSE?
  • Deploy that event receiver to your site for a specific list (let's say only the most important one on the site)
  • Well, your end users will have the joy of trying to add/update an item 15,000 times while getting a nasty modal error popup before you hit 300 points and it is disabled
  • Oh, did I mention they would need to do that every morning?

Sounds fun right? No….

  • How about the fact that the resource points aren't updated but every 15 minutes?  Hmmm, guess that means I can do as many bad things as I want in 15 minutes and go over 300 points!
  • Oh, wait what if the Timer service is NOT running?  No points will be updated…doh!

Not too sure about this whole Sandboxed Solution thang…how about you?

CJG

Follow me on twitter!

State Service Application – SharePoint 2010

 So, you decided not to use the Configuration Wizard to setup your Service Applications like I did eh?  So you probably got as far as I did…one item you can't create from the menu is the "State Service Application".

So how do you create it manually?  Well you could try the PowerShell commands in some order like this (dont do this by the way):

new-SPStateServiceApplication
new-SPStateServiceDatabase
new-SPStateServiceApplicationProxy

This of course will create everything, but for some reason the state service application doesn't see the database.  I'm not a 10 of 10 on PowerShell just yet and b/c I'm currently too lazy to open up Visual Studio and reverse engineer the Object Model, I decided to figure out how to get it to work in some other way!

Turns out, the solution lies in the Configuration Wizard for the farm on the Central Administration site.  Just delete the State Service Application, then run the wizard.  It will give you the options for anything that doesn't exist, that would include our lovely state service application.  It will then build the appropriate connections and ta-da!  it all just magically works.   I'm still not totally satisfied that my PowerShell commands didn't work, but hey, beta right?

One other step, you have to turn on the "In Proc" asp.net session state in the IIS 7.0 Manager for each web application.

Chris

Follow me on twitter!

SharePoint Designer 2010 & Data Views

Couple of interesting things to note so far (I'll add more to this page as I go):

  • DataViews – no ability to add another library from another site
  • Data Source queries – if you have a "dot" in the query, it will ignore everything from the "dot" and onward – ie – no support for database owner/namespaces!
  • ASP Button to cause postback – doesn't work in the old way – no post back occurs
  • BUG – the "Revert to template" keeps adding to the top every time you try to cause a post back

Chris

SharePoint 2010 Content DB versus SharePoint 2007 Content DB

Here are the changes between the content database structure of 2007 and 2010.  AGAIN, this is based on beta!

  • New Tables:
    • AllFileFragments
    • AllListsAux
    • AllListsPlus
    • AllListUniqueFields
    • AllLookupRelationships
    • AllWebParts
    • CustomActions
    • Resources
    • SharedAccessRequests
    • SiteDeletion
    • SolutionResourceUsageDaily
    • SolutionResourceUsageDailyOrdinal
    • SolutionResourceUsageLog
    • SolutionResourceUsageWindowed
    • Solutions
    • WebsPlus
  • Deleted Tables:
    • Categories
    • Image0x
    • WebCat
    • WebParts
  • Added Columns
  • Delete Columns
  • New Stored procedures
  • Deleted Stored Procedures

Enjoy!
Chris

SharePoint 2010 versus SharePoint 2007 Object Model (Microsoft.SharePoint.dll)

There are the differences between the new object model (Microsoft.SharePoint.dll) and the old.  Some classes/interfaces/enums were removed, but nothing that looks to hurt anyone.  The really cool part though…no properties or methods were removed between the two versions (doesn't mean that they are not depreciated however)!  NOTE:This is based on a beta version of SharePoint 2010.

  • Classes/Interfaces/Enums in 2007:   3225
  • Classes/Interfaces/Enums in 2010:   6658
  • New namespaces in 2010:    46
    • Microsoft.BusinessData
      Microsoft.SharePoint.Administration.AccessControl
      Microsoft.SharePoint.Administration.Claims
      Microsoft.SharePoint.ApplicationPages.Calendar
      Microsoft.SharePoint.ApplicationPages.PickerQuery
      Microsoft.SharePoint.Applications.GroupBoard
      Microsoft.SharePoint.Applications.GroupBoard.MobileControls
      Microsoft.SharePoint.Applications.GroupBoard.Utilities
      Microsoft.SharePoint.Applications.GroupBoard.WebControls
      Microsoft.SharePoint.Applications.GroupBoard.WebPartPages
      Microsoft.SharePoint.BusinessData
      Microsoft.SharePoint.BusinessData.Administration
      Microsoft.SharePoint.BusinessData.Infrastructure
      Microsoft.SharePoint.BusinessData.Infrastructure.Collections
      Microsoft.SharePoint.BusinessData.MetadataModel
      Microsoft.SharePoint.BusinessData.MetadataModel.Collections
      Microsoft.SharePoint.BusinessData.MetadataModel.Constants
      Microsoft.SharePoint.BusinessData.MetadataModel.Dynamic
      Microsoft.SharePoint.BusinessData.MetadataModel.Static
      Microsoft.SharePoint.BusinessData.MetadataModel.Static.DataAccess
      Microsoft.SharePoint.BusinessData.Offlining
      Microsoft.SharePoint.BusinessData.Parser
      Microsoft.SharePoint.BusinessData.Runtime
      Microsoft.SharePoint.BusinessData.SharedService
      Microsoft.SharePoint.BusinessData.SharedService.Structs.ExtensionMethods
      Microsoft.SharePoint.BusinessData.SystemSpecific
      Microsoft.SharePoint.BusinessData.SystemSpecific.Db
      Microsoft.SharePoint.BusinessData.SystemSpecific.DotNetAssembly
      Microsoft.SharePoint.BusinessData.SystemSpecific.Wcf
      Microsoft.SharePoint.BusinessData.SystemSpecific.WebService
      Microsoft.SharePoint.BusinessData.Upgrade
      Microsoft.SharePoint.Calculation
      Microsoft.SharePoint.Client
      Microsoft.SharePoint.CoordinatedStreamBuffer
      Microsoft.SharePoint.Diagnostics.ULSEventTemplates
      Microsoft.SharePoint.JSGrid
      Microsoft.SharePoint.JsonUtilities
      Microsoft.SharePoint.MobileMessage
      Microsoft.SharePoint.RBSWrapper
      Microsoft.SharePoint.TenantAdministration
      Microsoft.SharePoint.UserCode
      Microsoft.SharePoint.Utilities.Cab
      Microsoft.SharePoint.Utilities.SimpleParsers
      Microsoft.SharePoint.Utilities.SqlTrace
      Microsoft.SharePoint.Utilities.Win32
      Microsoft.Xslt
  • I have attached lists of
    • All new classes/interfaces
    • All removed classes/interfaces
    • All Property Changes (adds and deletions) to old classes
    • All Methods Changes (adds and deletions) to old classes

Links:

New objects
Delete objects
New Properties
New Methods

Enjoy!
Chris

SharePoint 2010 Records Center Greatly Improved

So far I am very impressed with the new Records Center site definition and architecture of SharePoint 2010.  Some of the new features include:

  • New and informative page for administering the Records Center (allows newbies to work with the record center easily)
  • Routing Rules based on submitted record properties (not just the content type anymore) – COOL
  • Routing to a different site (not just on the Records center site only anymore) – NICE
  • Routing Priority (allows for more complex routing scenarios)
  • Retention expiration can be based off of the typcial fields (ModifyDate, CreateDate) and a new one called "Declared Record" (when it was defined as a record)
  • On Expiration has the following actions:
    • Move to Recycle Bin
    • Permanently Delete
    • Transfer to Another Location
    • Start a workflow
    • Skip to Next Stage
    • delete Previous drafts
    • Delete all previous versions

At a farm level you can:

  • Configure Send To Connections by Web Application (versus Farm in 2007)
  • Allow multiple send to Connections
  • Three options on "Send" event (Copy, Move, Move and leave link)
  • On submission, the final "resting" place is returned for the item

Nice changes!
Chris