views:

70

answers:

1

I need to be able to receive a array (preferably a two dim array) in one of my functions in my webservice. I've tried looking on the internet, but could not find a example piece of code.

Using arrays is fine and normal, but do not have an idea how to make my webservice access them as part of the function parameters. It only needs to be oneway as I will return a string as the function results.

Any help would be appreciated.

Thank you

A: 

There's a demo called EchoService, I think it's in the D2007 (and higher) demo directory. It has about a dozen methods, from simple strings to TDateTime, arrays, and structures. Here is the cut-down, showing just the string array handling. I found it on my system here: C:\Users\Public\Documents\RAD Studio\7.0\Demos\DelphiWin32\VCLWin32\WebServices\EchoService EchoService_CGI.dpr

  IEchoService = interface(IInvokable)
  ['{EE714217-1763-4EFF-93D7-85C6D5E8180C}']
    function echoStringArray(const value: ArrayofString): ArrayofString; stdcall;
  end;

  TEchoService = class(TInvokableClass, IEchoService)
  public
    function echoStringArray(const value: ArrayofString): ArrayofString; stdcall;
  end;

function TEchoService.echoStringArray(const value: ArrayofString): ArrayofString;
begin
  Result := value;
end;
Chris Thornton