首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >System.Web.Services.Protocols.SoapException:服务器无法处理请求-The设备未就绪

System.Web.Services.Protocols.SoapException:服务器无法处理请求-The设备未就绪
EN

Stack Overflow用户
提问于 2011-01-14 02:08:21
回答 1查看 3.8K关注 0票数 2

我已经实现了一个web服务(Classic .Net服务,而不是WCF)来加载数据并返回给用户控件。此user服务是从我创建的用户控件中调用的。但是,当我尝试使用web服务读取文件时,收到的是一个错误,而不是字节数组。就像以前一样,所有的东西在我的本地机器上都能完美地工作,而在开发和升级环境中,所有的地狱都被打破了。作为测试的一部分,我还更改了web服务以返回一个简单的字节数组,这似乎在所有三个实例中都工作得很好,验证了web服务是否按预期工作。下面复制的是错误和返回此错误的web服务的代码。

有什么想法吗?

注意: webmethod是通过传入文件在服务器上的绝对路径而不是相对路径来调用的。

错误:

网页错误详细信息

代码语言:javascript
复制
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; MDDR; .NET4.0C)
Timestamp: Thu, 13 Jan 2011 04:29:30 UTC

Message: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.IO.IOException: The device is not ready.

   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at TXTextControl.LoadSettings.?(String A_0, StreamType A_1, ? A_2, ? A_3)
   at TXTextControl.ServerTextControl.Load(String path, StreamType streamType)
   at DocumentManager.DocumentService.Document.Load(String documentLocation) in C:\Webs\AR\DocumentManager\DocumentManager\Document.asmx.vb:line 21
   --- End of inner exception stack trace ---
Line: 23
Char: 13
Code: 0

代码:

代码语言:javascript
复制
<WebMethod()> _
        Public Function Load(ByVal documentLocation As String) As Byte()
            Dim serverTextControl As New TXTextControl.ServerTextControl()
            Dim documentData As Byte() = Nothing
            Dim docLocation As String = Server.UrlDecode(documentLocation)
            serverTextControl.Create()
            'serverTextControl.Text = "This document has been loaded from the server " & System.DateTime.Now
            serverTextControl.Load(docLocation, textControlUtility.computeStreamType(documentLocation))
            serverTextControl.Save(documentData, TXTextControl.BinaryStreamType.InternalUnicodeFormat)
            serverTextControl.Dispose()

            Return documentData
        End Function
EN

回答 1

Stack Overflow用户

发布于 2011-01-14 02:55:47

听起来你发送的是一个无效的路径。因为错误来自System.IO.IOException。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/4683519

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档