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

时间:2011-06-26 07:06:13

标签: delphi soap reporting-services wsdl

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

1 个答案:

答案 0 :(得分:3)

Delphi 7 WSDL导入程序(wsdlimp.exe)有一个可以从Embarcadero ID: 24535, Delphi SOAP Runtime and Importer Update下载的更新

以下是3篇资料性文章。在Delphi中使用ASMX Web服务非常简单,无论是Delphi 7还是更新版本。

1. Consuming C# Web Services with Delphi 7 Professional

2. Delphi 2010 and WCF Clients

3. Introduction to WCF Programming in Delphi

除此之外,在开发过程中,您可以尝试将您的Web服务调用包含在此类

之外的块中
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;

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