Ver Mensaje Individual
  #3  
Antiguo 20-07-2012
matiaslegnazzi matiaslegnazzi is offline
Registrado
NULL
 
Registrado: jul 2012
Posts: 6
Reputación: 0
matiaslegnazzi Va por buen camino
Egostar, gracias por tu respuesta. Adjunto el codigo completo.
Es la primera vez que utilizo TRemotable y creo que mi problema es que no inicializo Items (arrayofitem). Pero ya lo intenté y no se como hacerlo.
Saludos y Gracias

Código Delphi [-]
Invoice_Body = class(TRemotable)
  private
    FItem_Descripcion: string;
    FItem_Value: Currency;
   published
    property Item_Descripcion: string read FItem_Descripcion write FItem_Descripcion;
    property Item_Value: Currency read FItem_Value write FItem_Value;

  end;
  ArrayOfItem = array of Invoice_Body;

   TInvoice = class(TRemotable)
  private
    FBranch_Code: Integer;
    FItems: ArrayOfItem;
  public
   published
    property Branch_Code: Integer read FBranch_Code write FBranch_Code;
    property Items: ArrayOfItem read FItems write FItems;
  end;

   { Invokable interfaces must derive from IInvokable }
  IwsEPS30 = interface(IInvokable)
  ['{43B60693-DBC8-4874-8267-A93FB02EAD08}']

   function WSEPS30_Invoice(ParamsStr:trParams): tInvoice; stdcall;

Luego en el código de WSEPS30_Invoice....
Código Delphi [-]
function twsEPS30.WSEPS30_Invoice(ParamsStr:trParams): tInvoice; stdcall;
var ck: widestring;
    cal: currency;
    tr_bl: OleVariant;
begin
 svr:= CoEps30Svr.create();
 result := tInvoice.Create;
 svr.LogOnEx(ParamsStr.SystemName,Paramsstr.ClientId,Paramsstr.UserName,Paramsstr.Password,Paramsstr.  AppName,ck);
 svr.PrepareByMoney(ck, Paramsstr.ClientId, Paramsstr.MeterNumber, Paramsstr.Money, 0, cal);
 tr_bl:= svr.GetInvoiceData(ck,svr.Confirm(ck));
 With Result do
 Begin
  Branch_Code := tr_bl[0][1];
  Items[0].Item_Descripcion := tr_bl[1][0][0];
  Items[0].Item_Value := tr_bl[1][0][1];
 End;
End;

Última edición por Casimiro Notevi fecha: 20-07-2012 a las 19:46:43.
Responder Con Cita