Problema con WebService
Publicado por rq (3 intervenciones) el 26/11/2011 12:57:22
Saludos
Estoy tratando de recibir un valor tipo TXSDecimal desde una funcion en un Webservice, pero Delphi 2007 me presenta el mensaje de error: Range check error.
La unidad generada luego de importar el WSDL es la siguiente:
// Encoding : utf-8
// Version : 1.0
// (20/11/2011 17:41:58 - - $Rev: 10138 $)
// ************************************************************************ //
unit ConsultarBalance;
interface
uses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;
const
IS_OPTN = $0001;
IS_UNBD = $0002;
IS_NLBL = $0004;
IS_REF = $0080;
type
// ************************************************************************ //
// The following types, referred to in the WSDL document are not being represented
// in this file. They are either aliases[@] of other types represented or were referred
// to but never[!] declared in the document. The types from the latter category
// typically map to predefined/known XML or Borland types; however, they could also
// indicate incorrect WSDL documents that failed to declare or import a schema type.
// ************************************************************************ //
// !:string - "http://www.w3.org/2001/XMLSchema"[Gbl]
// !:decimal - "http://www.w3.org/2001/XMLSchema"[Gbl]
ArrayOfString = array of WideString; { "http://tempuri.org/"[GblCplx] }
// ************************************************************************ //
// ************************************************************************ //
ServiceSoap = interface(IInvokable)
['{77573149-9C57-FA51-F11F-EFD527C91BD9}']
function QuerySaleTransaction(const _uniqueKey: WideString; const _stan: WideString; const _terminalId: WideString; const _provider: WideString; const _phone: WideString; const _totalAmount: WideString
): ArrayOfString; stdcall;
function QueryVoidTransaction(const _uniqueKey: WideString; const _stan: WideString; const _terminalId: WideString; const _provider: WideString; const _phone: WideString; const _serialNo: WideString
): ArrayOfString; stdcall;
function GetCurrentBalance(const _key: WideString): TXSDecimal; stdcall;
end;
function GetServiceSoap(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): ServiceSoap;
. . .
y el codigo que utilizo para llamar la funcion es :
procedure TfrmProcesar_Tarjetas_Consulta_Balance.XiButton6Click(Sender: TObject);
Var
sLlave : WideString;
val2 : TXSDecimal;
begin
...
val2 := txsdecimal.Create;
val2 := ConsultarBalance.GetServiceSoap.GetCurrentBalance(
Trim( sLlave) );
...
end
Tambien lo he intentado
...
val2 := txsdecimal.Create;
val2.AsBCD := ConsultarBalance.GetServiceSoap.GetCurrentBalance(
Trim( sLlave) ).AsBCD;
...
Pero me genera el mismo error.
Si alguien me puede ayudar, le agradecere mucho
Estoy tratando de recibir un valor tipo TXSDecimal desde una funcion en un Webservice, pero Delphi 2007 me presenta el mensaje de error: Range check error.
La unidad generada luego de importar el WSDL es la siguiente:
// Encoding : utf-8
// Version : 1.0
// (20/11/2011 17:41:58 - - $Rev: 10138 $)
// ************************************************************************ //
unit ConsultarBalance;
interface
uses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;
const
IS_OPTN = $0001;
IS_UNBD = $0002;
IS_NLBL = $0004;
IS_REF = $0080;
type
// ************************************************************************ //
// The following types, referred to in the WSDL document are not being represented
// in this file. They are either aliases[@] of other types represented or were referred
// to but never[!] declared in the document. The types from the latter category
// typically map to predefined/known XML or Borland types; however, they could also
// indicate incorrect WSDL documents that failed to declare or import a schema type.
// ************************************************************************ //
// !:string - "http://www.w3.org/2001/XMLSchema"[Gbl]
// !:decimal - "http://www.w3.org/2001/XMLSchema"[Gbl]
ArrayOfString = array of WideString; { "http://tempuri.org/"[GblCplx] }
// ************************************************************************ //
// ************************************************************************ //
ServiceSoap = interface(IInvokable)
['{77573149-9C57-FA51-F11F-EFD527C91BD9}']
function QuerySaleTransaction(const _uniqueKey: WideString; const _stan: WideString; const _terminalId: WideString; const _provider: WideString; const _phone: WideString; const _totalAmount: WideString
): ArrayOfString; stdcall;
function QueryVoidTransaction(const _uniqueKey: WideString; const _stan: WideString; const _terminalId: WideString; const _provider: WideString; const _phone: WideString; const _serialNo: WideString
): ArrayOfString; stdcall;
function GetCurrentBalance(const _key: WideString): TXSDecimal; stdcall;
end;
function GetServiceSoap(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): ServiceSoap;
. . .
y el codigo que utilizo para llamar la funcion es :
procedure TfrmProcesar_Tarjetas_Consulta_Balance.XiButton6Click(Sender: TObject);
Var
sLlave : WideString;
val2 : TXSDecimal;
begin
...
val2 := txsdecimal.Create;
val2 := ConsultarBalance.GetServiceSoap.GetCurrentBalance(
Trim( sLlave) );
...
end
Tambien lo he intentado
...
val2 := txsdecimal.Create;
val2.AsBCD := ConsultarBalance.GetServiceSoap.GetCurrentBalance(
Trim( sLlave) ).AsBCD;
...
Pero me genera el mismo error.
Si alguien me puede ayudar, le agradecere mucho
Valora esta pregunta


0