【问题标题】:"Access is denied" for a wcf deployed as SharePoint 2010 solution部署为 SharePoint 2010 解决方案的 wcf 的“访问被拒绝”
【发布时间】:2012-08-29 22:08:43
【问题描述】:

我创建了一个 wcf (C# Visual Studio 2010) 并将 wsp 作为解决方案安装在 SharePoint 2010 服务器上(不在同一台机器上)。在 der Studio-Project 中,svc 和配置文件位于映射的 ISAPI 文件夹的子文件夹中。 SharePoint 中的部署运行良好,IIS7.5 上的虚拟 _vti_bin 文件夹中的 svc 文件是可浏览的。在 testclient 中,我可以设置对服务的引用。当我调用一个返回“Hello World”的方法时没问题。但是当我尝试从 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()

没关系,我尝试从Sharepoint读取什么样的信息,错误总是一样的。

我是 wcf 的新手,我对 IIS 的了解非常少。

【问题讨论】:

  • 测试客户端是否是控制台应用程序?
  • testclient是一个winform应用程序
  • 你设置代理类了吗?
  • 在 testclient 中,我设置了对服务器 *.svc 文件的服务引用。然后在代码中创建 wcf 服务对象,例如 SharePointService_Share.SharePointServiceClient svc = new SharePointService_Share.SharePointServiceClient();从那里我可以调用服务方法
  • 通过在应用配置中添加服务引用。XML 被创建在应用配置中,你能在应用配置中看到 以及其他设置的负载吗?

标签: c# wcf sharepoint exception-handling permissions


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-03-05
    • 1970-01-01
    • 2018-01-20
    • 2016-10-13
    • 2020-04-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多