0

我的 Delphi 7 (build 8.1) 应用程序访问 .NET SOAP Web 服务时遇到问题。大多数情况下它工作正常,但有时我们会收到访问冲突。我相信(但不是 100% 肯定)只有当用户在“几个小时”内第一个访问 Web 服务时才会看到错误——例如,我可以在循环中调用它数百次而没有任何问题。

我在所涉及的每台计算机上都禁用了 DEP(数据执行保护),并且我还尝试了从此下载中更新的 WSDL 导入器:http: //cc.embarcadero.com/Item/24535。(但是,我无法遵循有关运行时文件的自述文件,所以这可能是我的实际问题?)

有谁知道如何解决这个问题?

4

2 回答 2

2

See my answer to this question How do I get the SOAP response when there was an exception? Actually, I have two answers there, but the one of interest is the RIO OnAfterExecute handler. There you can log your SOAP responses to a file, and you can see what's happening. I expect that after hours of inactivity, the server may be giving an empty response or is timing out. If the SOAP response XML comes back empty, and you try to treat the response as a SOAP object, it'll be nil and you'll blow up with an A/V for sure. So this way, you get to inspect the raw TEXT coming back, and react accordingly. And you can actually build defensive code in here. For example, if the response is empty, you could swap in some other XML that represents a SOAP fault exception. Now your SOAP handler will know what to do.

于 2013-03-06T15:49:37.167 回答
0

我遇到了类似的问题,我建议您在应用程序中包含异常,而不是 DEP(数据执行保护)中的异常,因此它不会阻止应用程序。尽管如此,在我的情况下,WebService 仍然存在问题,因为该应用程序有 AccessViolation 来返回答案。调用 WebService 后,我必须在您的代码中添加“Application.ProcessMessages”函数。

于 2014-03-27T20:34:02.233 回答