2015-12-02 04:14:15 +01:00
|
|
|
{ Invokable implementation File for TSOAPCustomer which implements ISOAPCustomer }
|
|
|
|
|
|
|
|
unit SOAPCustomerImplU;
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
uses Soap.InvokeRegistry, System.Types, Soap.XSBuiltIns, SOAPCustomerIntfU;
|
|
|
|
|
|
|
|
type
|
|
|
|
|
|
|
|
{ TSOAPCustomer }
|
|
|
|
TSOAPCustomer = class(TInvokableClass, ISOAPCustomer)
|
|
|
|
public
|
|
|
|
function GetCustomers: string; stdcall;
|
|
|
|
end;
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
uses
|
2017-05-25 16:57:49 +02:00
|
|
|
BOCustomersU, WSHelperCustomersU, System.SysUtils, System.JSON, MVCFramework.Serializer.Defaults;
|
2015-12-02 04:14:15 +01:00
|
|
|
|
|
|
|
function TSOAPCustomer.GetCustomers: string;
|
|
|
|
var
|
|
|
|
WSHelperCustomers: TWSHelperCustomers;
|
|
|
|
Customers: TCustomers;
|
|
|
|
begin
|
|
|
|
WSHelperCustomers := TWSHelperCustomers.Create;
|
|
|
|
try
|
|
|
|
begin
|
|
|
|
Customers := WSHelperCustomers.GetCustomers;
|
|
|
|
try
|
2017-05-25 16:57:49 +02:00
|
|
|
Result := GetDefaultSerializer.SerializeCollection(Customers);
|
2015-12-02 04:14:15 +01:00
|
|
|
finally
|
|
|
|
FreeAndNil(Customers);
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
finally
|
|
|
|
FreeAndNil(WSHelperCustomers);
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
|
|
|
initialization
|
|
|
|
|
|
|
|
{ Invokable classes must be registered }
|
|
|
|
InvRegistry.RegisterInvokableClass(TSOAPCustomer);
|
|
|
|
|
|
|
|
end.
|