How to expose a Delphi set type via Soap

Posted by Wouter van Nifterick on Stack Overflow See other posts from Stack Overflow or by Wouter van Nifterick
Published on 2010-05-26T23:34:40Z Indexed on 2010/05/26 23:41 UTC
Read the original article Hit count: 366

Filed under:
|
|

I'm currently creating soap wrappers for some Delphi functions so that we can easily use them from PHP, C# and Delphi.

I wonder what's the best way to expose sets.

type
  TCountry     = (countryUnknown,countryNL,countryD,countryB,countryS,countryFIN,countryF,countryE,countryP,countryPl,countryL);
  TCountrySet  = set of TCountry;

function GetValidCountrySet(const LicensePlate:string; const PossibleCountriesSet:TCountrySet):TCountrySet;

I'm currently wrapping it like this for the soap server:

type 
  TCountryArray = array of TCountry;

function TVehicleInfo.GetValidCountrySet(const LicensePlate:string; const PossibleCountriesSet:TCountryArray):TCountryArray;

It works, but I need to write a lot of useless and ugly code to convert sets-->arrays and arrays-->sets.

Is there an easier, more elegant, or more generic way to do this?

© Stack Overflow or respective owner

Related posts about delphi

Related posts about soap