以下是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高手了。

解决方案 »

  1.   

    再顶,没人知道?SOA现在这么火,难道没人做Webservice这方面的研究?
      

  2.   

    我用了很多Web services,从未用THTTPRIO作参数,它只是Web services初始化时创建,不宜作参数!
      

  3.   

    king_xing 你说做参数是什么意思?
    我只想改变Webservice发送超时设置,没有使用参数传入,是函数内Create的,我试过,即使做参数传入,也无法改变超时设置。
      

  4.   

    建议:看看2ccc的楠楠绝密三层文档,再亲自跟踪一下Web services的运行,了解它的一些原理和细节