【问题标题】:SOAP top level node missing缺少 SOAP 顶级节点
【发布时间】:2011-01-30 01:18:04
【问题描述】:

我已经导入了一个 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

感谢大家的宝贵时间。

【问题讨论】:

  • 你用的是什么Delphi版本?在 D2010 中,当找不到服务器时会出现此错误。 forums.embarcadero.com/thread.jspa?threadID=44545&tstart=0
  • @Mikael Eriksson 对不起,我忘了提,我使用的是 Delphi 2010,我真的不认为他们的服务器已关闭或其他什么,但是,我只是 ping,似乎找不到其中一个地址,真的很奇怪:-\
  • @Mikael Eriksson 看来您的答案是正确的,请将其作为答案发布,以便我选择它。

标签: delphi soap delphi-2010


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 2013-06-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-26
    • 2023-03-23
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多