缺少 SOAP 顶级节点
我已经导入了 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
谢谢大家的宝贵时间。
I've imported a WSDL(using autoversion detect...), now when I attempt to use it I get an error similar to "top level node missing, Line: 0", I've spent a lot of hours on google to find a fix for this and I've seen that a lot of people have experienced same issue, however I couldn't find a fix for it.
I'm pretty sure a lot of you developers out there have fixed this issue, so my question is HOW?!
When imported the WSDL it generated the main interface which has helper methods and a special function which returns the main interface, example:
type
array_of_string = array of string;
ASpecialInterface = interface(IInvokable)
//...
function ASpecialMethod(const dummyArg: string): array_of_string; stdcall;
//...
end;
and a method which returns ASpecialInterface, example:
function GetASpecialInterface(const UseWSDL: Boolean; const addr: string; const ahttprio: THTTPRio): ASpecialInterface;
here is my issue:
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;
Now, I'm not sure if this is valuable but the connection is made using SSL, i.e. https://domain.com/...
EDIT: I'm sorry, forgot to mention that I'm using Delphi 2010
Thank you all for your time.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 Delphi 2010 中,soaphttptrans.pas 中存在错误。当由于某种原因找不到服务器时,您得到的异常是 EDOMParseError 而不是像以前一样的 ESOAPHTTPException。更多信息可以在这里找到:https://forums.embarcadero.com/ thread.jspa?threadID=44545&tstart=0
In Delphi 2010 there is bug in soaphttptrans.pas. When the server for some reason is not found the exception you get is EDOMParseError instead of a ESOAPHTTPException, as it was before. More info can be found here: https://forums.embarcadero.com/thread.jspa?threadID=44545&tstart=0