Accessing SharePoint content (list) from a WCF service

自闭症网瘾萝莉.ら 提交于 2019-12-04 19:28:56

is the WCF service runnig on the sharepoint computer ? I bet you are trying to use the SharePoint object model outsite the sharepoint box.

If you want to access remotely to the sharepoint data, in a WCF service on your own, or actually any other program, you will have to use the Lists.asmx web service to retrieve your data from sharepoint.

In fact, in your WCF you will have to act as a client to the SP services

[edit] my bet was wrong :) here is another thing to check

Also take a look in your VS project. Setup your target platform to "AnyCpu" or "X64" to ensure the program will use the correct assemblies and registry keys.

The object model will try to open the reg key under HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node node if you process is 32 bits, instead of HKEY_LOCAL_MACHINE\SOFTWARE where the sharepoint config resides

Try to check your sharepoint application pool identity. If you, for example, trying to evelate you priviligies using RunWithEvelatedPrivilegies in your service, and app pool identity doesn't have required permissions, you will get such message.

NLV

Okie. I found the issue. It is related to the same problem which I've been facing since I switched to x64 development in SharePoint 2007. When I deployed the WCF service to IIS everything worked fine.

Using Visual Studio 2010 (no matter what my target platform of my project is) I've never been able to access SharePoint content through a simple console application or a simple asp.net web application. I've clearly understood that the problem is with the x86 x64 stuffs and I've not been able to resolve it till now. I've been haunted by this for so long now.

If you have any comments on this answer please post it.

Old Ref - Filenotfound exception while opening an SPSite object - x64

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!