Delphi Win32 从 ASP.NET 服务接收数据表

发布于 2024-12-13 15:30:59 字数 1216 浏览 0 评论 0原文

我正在构建一个 Delphi Win32 应用程序,它应该使用 Soap 服务,结果是一个基于 .NET 的应用程序。一个函数返回一个数据表。当然,Delphi Win32(不是 Delphi .NET)本身无法理解这一点。

我有什么办法可以让它发挥作用吗?我也很乐意手动解析 XML,但我不知道如何获取原始 XML 响应。

WSDL:https://stratus.voxamvia.co.za/api.asmx?WSDL< /a>

函数:GetNotifications 返回 GetNotificationsResult,其构建为:

  GetNotificationsResult = class(TRemotable)
  private
    Fnamespace: WideString;
    Fnamespace_Specified: boolean;
    FtableTypeName: WideString;
    FtableTypeName_Specified: boolean;
    procedure Setnamespace(Index: Integer; const AWideString: WideString);
    function  namespace_Specified(Index: Integer): boolean;
    procedure SettableTypeName(Index: Integer; const AWideString: WideString);
    function  tableTypeName_Specified(Index: Integer): boolean;
  published
    property namespace:     WideString  Index (IS_ATTR or IS_OPTN) read Fnamespace write Setnamespace stored namespace_Specified;
    property tableTypeName: WideString  Index (IS_ATTR or IS_OPTN) read FtableTypeName write SettableTypeName stored tableTypeName_Specified;
  end;

任何帮助表示赞赏!

如果我实现 RemObjects 有帮助吗?

I'm building a Delphi Win32 app that should consume a Soap Service, which turns out to be a .NET based app. One function returns a DataTable. Of course, Delphi Win32 (not Delphi .NET) has no way of understanding this natively.

Any way I can make it work? I'll be happy to parse the XML manually too, but I've no idea how to get hold of the raw XML response.

The WSDL: https://stratus.voxamvia.co.za/api.asmx?WSDL

The function: GetNotifications which returns GetNotificationsResult, which builds as:

  GetNotificationsResult = class(TRemotable)
  private
    Fnamespace: WideString;
    Fnamespace_Specified: boolean;
    FtableTypeName: WideString;
    FtableTypeName_Specified: boolean;
    procedure Setnamespace(Index: Integer; const AWideString: WideString);
    function  namespace_Specified(Index: Integer): boolean;
    procedure SettableTypeName(Index: Integer; const AWideString: WideString);
    function  tableTypeName_Specified(Index: Integer): boolean;
  published
    property namespace:     WideString  Index (IS_ATTR or IS_OPTN) read Fnamespace write Setnamespace stored namespace_Specified;
    property tableTypeName: WideString  Index (IS_ATTR or IS_OPTN) read FtableTypeName write SettableTypeName stored tableTypeName_Specified;
  end;

Any help appreciated!

Would it help if I implement RemObjects?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

你又不是我 2024-12-20 15:30:59

您可以从 xml 构建数据集。这应该为您提供一个起点: http://www.gekko-software.nl/DotNet /Art07.htmhttp://www.gekko-software.nl/DotNet/Art08.htm

我没有使用过 RemObjects 中的 DataAbstract,所以我无法给出建议。

LE:您可以按照 drbob 写的这篇简单文章来访问和使用 .net 编写的 Web 服务 - Consuming C# Web Services with Delphi 7 Professional

其中还包含一个关于如何动态构建以及如何使用 THttpRio 的小示例(与 Mikael 的相同)埃里克森的回答)

You can build your dataset from xml. This should give you a starting point: http://www.gekko-software.nl/DotNet/Art07.htm and http://www.gekko-software.nl/DotNet/Art08.htm.

I haven't used DataAbstract from RemObjects, so I can not give an advice on it.

LE: you can access and consume a web service written in .net by following this simple article well written by drbob - Consuming C# Web Services with Delphi 7 Professional

which contains also a small example on how to build dynamically and how to use the THttpRio (is the same as the Mikael Eriksson's answer)

几度春秋 2024-12-20 15:30:59

有什么办法可以让它发挥作用吗?我很乐意手动解析 XML
我也是,但我不知道如何获取原始 XML 响应。

您可以在 OnAfterExecuteEvent 中获取它在你的THTTPRIO 组件。在那里您将有 SOAPResponse: TStream 作为参数。

更新:

要触发事件,您需要添加 THTTPRIO 组件、创建事件处理程序并使用 RIO 组件作为 GetAPISoap 的第三个参数。

这对我有用。 HTTPRIO1 是表单上的一个组件。

procedure TForm7.Button1Click(Sender: TObject);
var
  A: APISoap;
begin
  A := GetAPISoap(False, '', HTTPRIO1);
  A.Validate_User('', '');
end;

Any way I can make it work? I'll be happy to parse the XML manually
too, but I've no idea how to get hold of the raw XML response.

You can get it in the OnAfterExecuteEvent on your THTTPRIO component. There you will have SOAPResponse: TStream as a parameter.

Update:

To get the event to fire you add a THTTPRIO component, create the event handler and use the RIO component as the third parameter to GetAPISoap.

This worked for me. HTTPRIO1 is a component on the form.

procedure TForm7.Button1Click(Sender: TObject);
var
  A: APISoap;
begin
  A := GetAPISoap(False, '', HTTPRIO1);
  A.Validate_User('', '');
end;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文