mirror of
https://github.com/danieleteti/delphimvcframework.git
synced 2024-11-17 00:35:55 +01:00
80a0bc8f8c
ObjectMappers DataSetToObject support boolean types Sample\SoapRest Example application server providing both SOAP and REST webservices
49 lines
1008 B
ObjectPascal
49 lines
1008 B
ObjectPascal
{ 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
|
|
BOCustomersU, WSHelperCustomersU, System.SysUtils, System.JSON,
|
|
ObjectsMappers;
|
|
|
|
function TSOAPCustomer.GetCustomers: string;
|
|
var
|
|
WSHelperCustomers: TWSHelperCustomers;
|
|
Customers: TCustomers;
|
|
begin
|
|
WSHelperCustomers := TWSHelperCustomers.Create;
|
|
try
|
|
begin
|
|
Customers := WSHelperCustomers.GetCustomers;
|
|
try
|
|
Result := Mapper.ObjectListToJSONArray<TCustomer>(Customers).ToJSON;
|
|
finally
|
|
FreeAndNil(Customers);
|
|
end;
|
|
end;
|
|
finally
|
|
FreeAndNil(WSHelperCustomers);
|
|
end;
|
|
end;
|
|
|
|
initialization
|
|
|
|
{ Invokable classes must be registered }
|
|
InvRegistry.RegisterInvokableClass(TSOAPCustomer);
|
|
|
|
end.
|