如何在 delphi 中通过 WSDL 使用 SSRS 方法?

发布于 2024-11-17 08:14:25 字数 265 浏览 2 评论 0原文

我使用Delphi7,我需要在delphi中使用我之前在SSRS 2008中制作的一些报告。实际上我想在Delphi中调用它们。我使用了 WSDl 导入器并导入了 reportservice2005.asmx ,delphi 给了我一个包含 SSRS 方法列表的 PAS 文件,但是当我尝试使用 GetReportingService2010Soap 函数创建 ReportingService2010Soap 的实例时,给了我一些错误!有没有地方可以找到使用此 PAS 文件的文档? 谢谢你,请原谅我糟糕的英语!

I use Delphi7 and I need to use some reports I have made before in SSRS 2008 within delphi.Actually I want to call them within Delphi. I have Used a WSDl importer and imported reportservice2005.asmx and delphi gave me a PAS file with list of SSRS methods but when I try to create an instance of ReportingService2010Soap with GetReportingService2010Soap Function gives me some errors!. Is there anywhere to find a Document for using this PAS file?
thank you and excuse my bad English!

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

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

发布评论

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

评论(1

忆伤 2024-11-24 08:14:25

Delphi 7 WSDL 导入器 (wsdlimp.exe) 有一个更新,可以从 Embarcadero ID:24535、Delphi SOAP 下载运行时和导入器更新

这里有 3 篇内容丰富的文章。无论是 Delphi 7 还是更新的版本,在 Delphi 中使用 ASMX Web 服务都非常简单。

1.使用 Delphi 7 Professional 使用 C# Web 服务

2. Delphi 2010 和 WCF 客户端

3. Delphi 中的 WCF 编程简介

除此之外,在开发过程中,您可以将 Web 服务调用封装在 try except 块中,如下所示

uses
  SysUtils,
  ABCService; // .pas unit generated by WSDLIMP.EXE (WSDL Importer)

procedure PerformServiceCall;
var
  MyService: IMyService;
  MyServiceResponse: TMyServiceResponse; // the result returned from the service call
  MyServiceRequest: TMyServiceRequest;   // the parameter passed with the service call
  Connected: boolean;
begin
  MyService := nil;
  try
    try
      MyService := IMyService.GetMyService;
      Connected := (MyService <> nil);
      if Connected then
        MyServiceResponse := MyService.MethodName(MyServiceRequest);
      else
        raise Exception.Create('Could Not Connect');
    except
      on E: Exception do
        ShowMessage(E.ClassName + #13#10 + E.Message);
    end;
  finally
    MyService := nil;
  end;
end;

在这个阶段,我们根据引发的异常中的 ClassName 和 Message 来调查问题,直到我们得到没有例外...然后我们还可以检查其他事情(例如服务当前是否实际启动、寻址、超时、性能、安全性等)。

The Delphi 7 WSDL Importer (wsdlimp.exe) has an update that can be downloaded from Embarcadero ID: 24535, Delphi SOAP Runtime and Importer Update

Here are 3 informative articles. Consuming ASMX web services in Delphi is pretty simple whether it's Delphi 7 or a more recent version.

1. Consuming C# Web Services with Delphi 7 Professional

2. Delphi 2010 and WCF Clients

3. Introduction to WCF Programming in Delphi

Apart from that, during development you can enclose your web service calls in a try except block like this

uses
  SysUtils,
  ABCService; // .pas unit generated by WSDLIMP.EXE (WSDL Importer)

procedure PerformServiceCall;
var
  MyService: IMyService;
  MyServiceResponse: TMyServiceResponse; // the result returned from the service call
  MyServiceRequest: TMyServiceRequest;   // the parameter passed with the service call
  Connected: boolean;
begin
  MyService := nil;
  try
    try
      MyService := IMyService.GetMyService;
      Connected := (MyService <> nil);
      if Connected then
        MyServiceResponse := MyService.MethodName(MyServiceRequest);
      else
        raise Exception.Create('Could Not Connect');
    except
      on E: Exception do
        ShowMessage(E.ClassName + #13#10 + E.Message);
    end;
  finally
    MyService := nil;
  end;
end;

At this stage we investigate issues according to the ClassName and Message in the Exception raised, until we get no exceptions... then there are other things that we could check (like whether the service is actually up at the moment, addressing, timeouts, performance, security, etc.).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文