I've been writing a lot lately about getting SharePoint 2007 operating in the latest-and-greatest environments, and using the latest-and-greatest technology to build its content. With this post, this will all come to fruition, as I add JSON Web Services to the mix. As it stands, in terms of my previous posts, (which make for excellent bathroom reading) here's where we're at:
The only thing missing is JSON Web Services. I have written extensively about these babies in two parts (here and here). When I started adding this technology to my web parts, I was happy to see that I had to do relatively little work to get them up and running.
A lot of this is due to SP1 of SharePoint 2007 and ASP.NET 3.5 both promoting AJAX to being a first class citizen. This has really allowed me to spend much more time playing with AJAX and much less time configuring SharePoint to make it work.
So read those links on how to build the necessary components to be able to use JSON Web Services in your user controls (which will be hosted in SmartParts on your SharePoint site). The "final" step, deployment to SharePoint, is so easy that I can describe it in a bulleted list:
And that's it! You don't have to stray from the WSS_Minimal trust setting in the web.config, you don't have to remove ASMX from the blocked file types, and you don't have to worry about any permission problems common to SharePoint. ASP.NET AJAX 3.5 takes care of everything! Actually, the only thing I had to change in my code was in the code-behind of my control, when I wire up the scripts and services to the Script Manager: I had to preceded the relative URL with a forward slash. That's it! Have fun!