WCF Web服务的UNC文件共享身份验证
本文关键字:文件共享 身份验证 UNC Web 服务 WCF | 更新日期: 2023-09-27 17:59:34
我们有一个WCF服务,它将分别向FileShare上传文档和从FileShare下载文档。
客户端应用程序将在请求中传递FileShareLocation和FileName。但我们遇到了一些例外,无法得到回应。
FileSharePath示例:''SERVERIP'SHAREDFOLDER
注意:当我不使用网络文件共享时,该服务工作正常。
'. ---> System.Net.WebException: The remote server returned an error: (500) Internal Server Error.
at System.Net.HttpWebRequest.GetResponse()
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
--- End of inner exception stack trace ---
Server stack trace:
at System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResponse(HttpWebRequest request, HttpWebResponse response, HttpChannelFactory factory, WebException responseException, ChannelBinding channelBinding)
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
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 wcfServiceTest.wcfService.ICommonService.UploadDocument(UploadDocumentRequest request)
at wcfServiceTest.wcfService.CommonServiceClient.wcfServiceTest.wcfService.ICommonService.UploadDocument(UploadDocumentRequest request) in D:'Test'CMS'wcfServiceTest'wcfServiceTest'Service References'wcfService'Reference.cs:line 2309
at wcfServiceTest.wcfService.CommonServiceClient.UploadDocument(RequestHeader UploadDocumentReqHdr, Byte[]& UploadDocumentContent) in D:'Test'CMS'wcfServiceTest'wcfServiceTest'Service References'wcfService'Reference.cs:line 2316
at wcfServiceTest.frmMain.DocumentUpload_Click(Object sender, EventArgs e) in D:'Test'CMS'wcfServiceTest'wcfServiceTest'frmMain.cs:line 105
自行解决。
- 在IIS中创建新的应用程序池
- 将AppPool的标识更改为有权访问FileShare的用户
- 将WCF服务应用程序池更改为新的应用程序池