SOAP顶级节点丢失

时间:2011-01-29 13:49:43

标签: delphi soap delphi-2010

我已经导入了一个WSDL(使用自动检测...),现在当我尝试使用它时,我得到类似于“顶级节点丢失,行:0”的错误,我花了很多时间在谷歌找到一个解决方案,我已经看到很多人都遇到过相同的问题,但我找不到它的修复。

我很确定很多开发人员已经解决了这个问题,所以我的问题是如何?!

当导入WSDL时,它生成了主接口,该接口具有辅助方法和返回主接口的特殊函数,例如:

type
  array_of_string = array of string;
  ASpecialInterface = interface(IInvokable)
    //...
    function ASpecialMethod(const dummyArg: string): array_of_string; stdcall;
    //...
  end;

和返回ASpecialInterface的方法,例如:

function GetASpecialInterface(const UseWSDL: Boolean; const addr: string; const ahttprio: THTTPRio): ASpecialInterface;

这是我的问题:

procedure TMyForm.OnAButtonClick(Sender: Tobject);
var 
  LArrayOfString: array_of_string;
  LSpecialIntf: ASpecialInterface;
begin
  // this works without any issue whatsoever
  LSpecialIntf := GetASpecialInterface; // I call it with default params
  // the next code raises the exception mentioned above
  LArrayOfString := LSpecialIntf.ASpecialMethod(EmptyStr); // no param passed since the dummyArg is dummy
end;

现在,我不确定这是否有价值但是使用SSL建立连接,即https://domain.com/ ......

编辑:对不起,忘了提我正在使用Delphi 2010

谢谢大家的时间。

1 个答案:

答案 0 :(得分:3)

在Delphi 2010中,soaphttptrans.pas中存在错误。当由于某种原因找不到服务器时,您获得的异常是EDOMParseError而不是之前的ESOAPHTTPException。更多信息可以在这里找到:https://forums.embarcadero.com/thread.jspa?threadID=44545&tstart=0

相关问题