Windows Gadget for Sharepoint 2007 List using SOAP

2019-09-08 10:48发布

I am trying to develop a Gadget for Sharepoint 2007, which will authenticate a user and then fetch him a sharepoint list from a specific URL,

For the last 4 days I have been working on it and came across different ways of making it, but because solutions are either half done, dont work or too confusing to get help from or convert into what I want.

Because Windows Gadget uses Scripting + HTML so I have following options to carry on work with to make this gadget,

  • Create a Visual studio project (dll) which will fetch the list for me using SPLIST/SPWeb of Sharepoint and then I can use JavaScript & Visual Studio "COM" to read that dll ("Classes") and get data in JavaScript + displaying it on HTML. Problem with this approach is, I am not sure, If I create a "dll" with Sharepoint SPLIST and put it into the gadget folder, will it work on Clients (that dont have sharepoint installed on there PCs). While trying to find help regarding this approach to problem I find this project that is doing kinda same thing, but not really sure if i make changes to it and it will gonna work with "dll" I was talking about earlier, here's the Link to Gadget,

Gmail Gadget Using JavaScript to Read Visual studio Dll

  • Second Approach to solve the problem can be, If I use Sharepoint webservices, that will get me all the List Items, but then using Webservices in JavaScript isn't that easy, so if i create a Visual Studio Project, get a web reference to sharepoint webservices, and return a list, which I again use JavaScript to read the results out of DLL, and display them on HTML.

This Link is Using Webservices in a Dot Net Project to Update a List Item, but In comments it also tells how to get List data, but then how I gonna authenticate my users

  • Another solution is to use Jquery to get sharepoint List data, like in link before, but again, how can i authenticate my users @ gadget ?

Using jQuery to fetch List Data

A gadget that is getting News Feed from a website, its sending an HTTPxml request but then asking for a RSS feed, whereas i dont have Rss feedback in sharepoint site I am working on

Cheers for reading this I hope you either gonna increase your knowledge or gonna share it :)

EDIT *I meant using Sharepoint MOSS "SPLIST" or "SPWEB" as Client Object Model, AS I am using Moss I can't use Client Object Model Authentication :(. really sorry for wrong Information*

2条回答
仙女界的扛把子
2楼-- · 2019-09-08 11:22

You're installing this on a users PC so you can't use the standard SharePoint API (Microsoft.SharePoint.dll)

You're using 2007 so you can't use the "Client Object Model" (managed/silverlight or EMCA Script)

That leaves

a) The SharePoint Web Services (either JavaScript or JQuery which IS still JavaScript).

This means that your gadget will be authenticating to SharePoint via the same mechanism that someone browsing to your site would - normally Integrated Windows auth.

The first place to start this is the excellent http://spservices.codeplex.com/ library which allows you to easily call the web services from JQuery). See the documentation for tips on how to use it.

For a half done project how about http://sharepointsidebar.codeplex.com/

b) Create your own custom web services by deploying a dll on the SharePoint server then call those via JavaScript (perhaps usign JSON or similar rather

查看更多
干净又极端
3楼-- · 2019-09-08 11:38

If you can afford deplying a COM component with your Gadget the first approach would work. You wrap your logic in a facade of a CCW .NET class (using the .NET SP Client OM) and register it for COM by regasm. All pure .NET, your class would be declared (and written) COM-compatible.

You may find the second approach too limiting later; SP ClOM supports more functionality that SP WSs. Throwing the jQuery in doesn't change it much. (Unfortunately, SP JS ClOM can be used only on SP pages; not in a Gadget.)

If you go the way of pain (JS ;-) IWA should give you the (Windows) SSO authentication. If you call the SP ClOM from the DLL you can either reuse the Windows session token of the current user (SSO) or authenticate explicitly by a form of yours if the user wished it. (You can login to SP UI as a different user than you are in Windows too.) Both is supported.

I'd first try the DLL approach.

Update: Oops, you're on SP 2007, not on 2010 - no SP ClOM. I should've noticed earlier, sorry... Still, you could create a .NET DLL that would talk to SP via a WS. You can still set DefaultNetworkCredentials to HttpWebRequest.Credentials (REST) or to .Credentials of your WS client class (SOAP) to get SSO authentication. Or create your own NetworkCredential with name and password.

--- Ferda

查看更多
登录 后发表回答