高分求正确使用RIO.HTTPWebNode.ConnectTimeout的方法(即设置WebService客户端超时)

applebomb 2007-11-04 10:14:19
以下是WSDL产生的框架代码

function GetCommonWebServicePortType(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): CommonWebServicePortType;
const
defWSDL = 'C:\Documents and Settings\Administrator\桌面\CommonWebService.xml';
defURL = 'http://localhost:8080/xxx/service/CommonWebService';
defSvc = 'CommonWebService';
defPrt = 'CommonWebServiceHttpPort';
var
RIO: THTTPRIO;
begin
Result := nil;
if (Addr = '') then
begin
if UseWSDL then
Addr := defWSDL
else
Addr := defURL;
end;
if HTTPRIO = nil then
RIO := THTTPRIO.Create(nil)
else
RIO := HTTPRIO;

RIO.HTTPWebNode.ConnectTimeout := 10000; //<<--该句是我加的

try
Result := (RIO as CommonWebServicePortType);

if UseWSDL then
begin
RIO.WSDLLocation := Addr;
RIO.Service := defSvc;
RIO.Port := defPrt;
end else
RIO.URL := Addr;
finally
if (Result = nil) and (HTTPRIO = nil) then
RIO.Free;
end;
end;

如上,当我使用RIO.HTTPWebNode.ConnectTimeout设置SOAP超时时,弹出错误“传递给系统调用的数据区域太小”,去GOOGLE也一无所获,只得求助CSDN高手了。
...全文
493 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
Blessed_Chuan 2011-12-29
  • 打赏
  • 举报
回复
顶上去
applebomb 2007-11-23
  • 打赏
  • 举报
回复
自己顶最后一次
applebomb 2007-11-08
  • 打赏
  • 举报
回复
king_xing 你说做参数是什么意思?
我只想改变Webservice发送超时设置,没有使用参数传入,是函数内Create的,我试过,即使做参数传入,也无法改变超时设置。
hui717 2007-11-08
  • 打赏
  • 举报
回复
king_xing 2007-11-08
  • 打赏
  • 举报
回复
建议:看看2ccc的楠楠绝密三层文档,再亲自跟踪一下Web services的运行,了解它的一些原理和细节
king_xing 2007-11-07
  • 打赏
  • 举报
回复
我用了很多Web services,从未用THTTPRIO作参数,它只是Web services初始化时创建,不宜作参数!
applebomb 2007-11-07
  • 打赏
  • 举报
回复
再顶,没人知道?SOA现在这么火,难道没人做Webservice这方面的研究?
applebomb 2007-11-05
  • 打赏
  • 举报
回复
自己顶,没人知道?

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧