简体   繁体   English

对于部署为SharePoint 2010解决方案的WCF,“访问被拒绝”

[英]“Access is denied” for a wcf deployed as SharePoint 2010 solution

I've created a wcf (C# Visual Studio 2010) and installed the wsp on a SharePoint 2010 Server (not on the same machine) as solution. 我创建了一个wcf(C#Visual Studio 2010),并将该wsp安装在SharePoint 2010 Server(而不是同一台计算机)上作为解决方案。 In der Studio-Project, the svc and config files are located in a subfolder of the mapped ISAPI-Folder. 在der Studio项目中,svc和config文件位于映射的ISAPI文件夹的子文件夹中。 The deployment in SharePoint works good and the svc-file in the virtual _vti_bin folder on IIS7.5 is browsable. SharePoint中的部署工作良好,并且可以浏览IIS7.5上虚拟_vti_bin文件夹中的svc文件。 In a testclient I can set the reference to the service. 在testclient中,我可以设置对服务的引用。 No problem when I call a method which gives me back a "Hello World". 调用使我返回“ Hello World”的方法没问题。 But when I try to read values from Sharepoint, then I allways get the following exception: 但是,当我尝试从Sharepoint读取值时,我总是得到以下异常:

System.ServiceModel.Security.SecurityAccessDeniedException was unhandled
  Message=Access is denied.
  Source=mscorlib
  StackTrace:
    Server stack trace: 
       at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)
       at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
       at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]: 
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at mgbahn.sharepoint.test.forms.SharePointService_Share.ISharePointService.GetDocumentTitles()
       at mgbahn.sharepoint.test.forms.SharePointService_Share.SharePointServiceClient.GetDocumentTitles() in D:\MGBScratch\src\sharepoint\mgbahn.sharepoint.test.forms\Service References\SharePointService_Share\Reference.cs:line 57
       at mgbahn.sharepoint.test.forms.TestFormWCF..ctor() in D:\MGBScratch\src\sharepoint\mgbahn.sharepoint.test.forms\TestFormWCF.cs:line 23
       at mgbahn.sharepoint.test.forms.Program.Main() in D:\MGBScratch\src\sharepoint\mgbahn.sharepoint.test.forms\Program.cs:line 15
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()

It makes no difference, what kind of information I try to read from the Sharepoint, the error is always the same. 我尝试从Sharepoint读取什么样的信息都没有关系,错误始终相同。

I'm really new in wcf and my knowledges in IIS are very small. 我真的是wcf的新手,我对IIS的了解很少。

还要检查wcf端口是否未被防火墙阻止。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM