异常:服务器无法处理请求。 --->数据为空
以下是调用 Web 方法的以下代码行抛出的详细异常
string[] results = webservice.getResultsArray(strUser, inputArray);
服务器无法处理请求。 --->数据为空。这个方法 或无法对 Null 值调用属性。
在 System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage 消息、WebResponse 响应、流响应Stream、布尔值 异步调用)在 System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(字符串 方法名,Object[]参数)
实际上,我在调用 getResultsArray Web 方法之前进行了检查,这
if(strUser!=null && inputArray !=null)
string[] results = webservice.getResultsArray(strUser, inputArray);
首先确保传递的参数不为空。
但似乎仍然没有解决问题,并且继续抛出相同的异常,这确实让我很头疼。
以前有人遇到过这个问题吗?有什么见解或建议吗?多谢。
Here is the detailed Exception thrown by the following line of code which calls a web method
string[] results = webservice.getResultsArray(strUser, inputArray);
Server was unable to process request. ---> Data is Null. This method
or property cannot be called on Null values.
at
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage
message, WebResponse response, Stream responseStream, Boolean
asyncCall) at
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters)
I have actually put checks before calling getResultsArray
web method, which goes
if(strUser!=null && inputArray !=null)
string[] results = webservice.getResultsArray(strUser, inputArray);
to make sure that the passing parameters are not null in the first place.
But it still doesn't seem to solve the issue and continues to throw the same exception, which really gives me a headache.
Has anyone ever experienced this issue before? Any insight or suggestions? Thanks a lot.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是MS论坛之一的解释。
发生的情况是您调用的特定方法导致抛出异常。
您是否对 WCF 服务进行了正确的错误处理以返回错误或返回错误契约?
您的代码是否有日志记录/跟踪,以便您可以看到发生了什么?
查看事件日志,看看您的 WCF 服务是否引发任何错误
http:// /forums.asp.net/t/1659885.aspx/1
=============================
这是另一个之前的帖子。
我不知道导致此问题的原因,因此这不是您问题的答案,而只是进一步研究问题的方法的建议
尝试使用嗅探器查看机器之间发送的实际数据并找出哪些数据问题是。我曾经成功使用过一次Wireshark。
System.Web.Services.Protocols.SoapException:服务器无法处理请求。 ---> System.ArgumentNullException
This was the explanation on one of MS forums.
What happened is the specific method you are calling is causing an exception to be thrown.
Do you have proper error handling on the WCF service to either return faults or return a fault contract?
Do you have logging/tracing on your code so you can see what is happening?
Have a look at the event log to see if your WCF service is throwing any errors
http://forums.asp.net/t/1659885.aspx/1
=============================
This is another post from previous SO.
I have no idea what causes this so this is not an answer to your question, but only a suggestion for a way to look further into the problem
Try using a sniffer to look at the actual data being sent between the machines and find out on which side the problem is. I've used Wireshark successfully once.
System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.ArgumentNullException