1

我创建了一个 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 的了解非常少。

4

1 回答 1

0

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

于 2013-01-10T08:48:43.483 回答