-1

我们有一个 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
4

1 回答 1

0

由我自己解决。

  1. 在 IIS 中创建一个新的应用程序池
  2. 将 AppPool 的身份更改为有权访问 FileShare 的用户
  3. 将 WCF 服务应用程序池更改为新的应用程序池
于 2013-02-15T12:17:40.443 回答