2012-09-05 46 views
1

我創建了一個wcf(C#Visual Studio 2010),並將該wsp安裝在SharePoint 2010 Server(不在同一臺計算機上)上。在der Studio-Project中,svc和config文件位於映射的ISAPI文件夾的子文件夾中。在SharePoint中的部署工作良好,IIS7.5上虛擬_vti_bin文件夾中的svc文件是可瀏覽的。在測試客戶端中,我可以設置對該服務的引用。當我打電話給我一個「Hello World」的方法時沒問題。但是,當我嘗試讀取從SharePoint值,然後我拿到永諾以下情況除外:對於部署爲SharePoint 2010解決方案的wcf,「訪問被拒絕」

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知識非常小。

+0

測試客戶端是否是任何機會的控制檯應用程序? – Truezplaya

+0

testclient是一個winform應用程序 – bruxlee

+0

您是否設置了代理類? – Truezplaya

回答

0

還請檢查wcf端口是否未被防火牆阻止。

相關問題