BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Memory leaks calling web service functions

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi WebServices SOAP
View previous topic :: View next topic  
Author Message
sandokan
Guest





PostPosted: Thu May 17, 2007 11:37 pm    Post subject: Memory leaks calling web service functions Reply with quote



If I watch my app in the task manager, I see it's memory usage
increase every time I call a web service function.

I'm using

Borland® Developer Studio for Microsoft® Windows™ Version
10.0.2288.42451 Update 2 Copyright © 2005 Borland® Software
Corporation. All Rights Reserved.

and the Jean-Marie Babet WSDL importer downloaded from
http://cc.codegear.com/Item/24535

My generated service.pas is:

//
************************************************************************ //
// The types declared in this file were generated from data read from
the
// WSDL File described below:
// WSDL : http://xxxxxxxxxxx.xxxxxx.com/parkings/service.asmx?WSDL
// >Import : http://xxxxxxxxxxx.xxxxxx.com/parkings/service.asmx?WSDL:0
// Encoding : utf-8
// Version : 1.0
// (17/05/2007 17:19:41 - - $Rev: 5569 $)
//
************************************************************************ //

unit WebService;

interface

uses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;

const
IS_OPTN = $0001;
IS_UNBD = $0002;
IS_NLBL = $0004;
IS_UNQL = $0008;
IS_ATTR = $0010;
IS_TEXT = $0020;

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"
// !:dateTime - "http://www.w3.org/2001/XMLSchema"
// !:int - "http://www.w3.org/2001/XMLSchema"
// !:float - "http://www.w3.org/2001/XMLSchema"
// !:long - "http://www.w3.org/2001/XMLSchema"
// !:boolean - "http://www.w3.org/2001/XMLSchema"

CabeceraAut = class; { "http://
xxxxxxxxxxx.xxxxxx.com/parkings"[Hdr][GblCplx] }
CabeceraAut2 = class; { "http://
xxxxxxxxxxx.xxxxxx.com/parkings"[Hdr][GblElm] }

//
************************************************************************ //
// XML : CabeceraAut, global, <complexType>
// Namespace : http://xxxxxxxxxxx.xxxxxx.com/parkings
// Info : Header
//
************************************************************************ //
CabeceraAut = class(TSOAPHeader)
private
FUsername: WideString;
FUsername_Specified: boolean;
FPassword: WideString;
FPassword_Specified: boolean;
procedure SetUsername(Index: Integer; const AWideString:
WideString);
function Username_Specified(Index: Integer): boolean;
procedure SetPassword(Index: Integer; const AWideString:
WideString);
function Password_Specified(Index: Integer): boolean;
published
property Username: WideString Index (IS_OPTN) read FUsername
write SetUsername stored Username_Specified;
property Password: WideString Index (IS_OPTN) read FPassword
write SetPassword stored Password_Specified;
end;

//
************************************************************************ //
// XML : CabeceraAut, global, <element>
// Namespace : http://xxxxxxxxxxx.xxxxxx.com/parkings
// Info : Header
//
************************************************************************ //
CabeceraAut2 = class(CabeceraAut)
private
published
end;

//
************************************************************************ //
// Namespace : http://xxxxxxxxxxx.xxxxxx.com/parkings
// soapAction: http://xxxxxxxxxxx.xxxxxx.com/parkings/%operationName%
// transport : http://schemas.xmlsoap.org/soap/http
// style : document
// binding : WebServiceParkingsSoap
// service : WebServiceParkings
// port : WebServiceParkingsSoap
// URL : http://xxxxxxxxxxx.xxxxxx.com/parkings/service.asmx
//
************************************************************************ //
WebServiceParkingsSoap = interface(IInvokable)
['{3B683DE0-25FB-DD52-219C-2E5B994A508D}']
function CheckEstado: WideString; stdcall;
function CheckEstadoBD: WideString; stdcall;

// Headers: CabeceraAut:pIn
function AmbitosLista(const TPVID: WideString): WideString;
stdcall;

// Headers: CabeceraAut:pIn
function TarjetaActiva(const TPVID: WideString; const tarjetaID:
WideString): WideString; stdcall;

// Headers: CabeceraAut:pIn
function TarjetaInformacion(const TPVID: WideString; const
tarjetaID: WideString): WideString; stdcall;

// Headers: CabeceraAut:pIn
function TarjetaActualizacion(const TPVID: WideString; const
FechaActualizacionTPV: TXSDateTime): WideString; stdcall;
function TarjetaActualizacionPruebas: WideString; stdcall;

// Headers: CabeceraAut:pIn
function TarjetaActualizacionPaginada(const TPVID: WideString;
const FechaActualizacionTPV: TXSDateTime; const RegistrosDevueltos:
Integer; const UltimoRegistro: WideString): WideString; stdcall;

// Headers: CabeceraAut:pIn
function TarjetaActualizacionPendiente(const TPVID: WideString;
const FechaActualizacionTPV: TXSDateTime): WideString; stdcall;

// Headers: CabeceraAut:pIn
function TPVValida(const TPVID: WideString; const ambitoID:
Integer): WideString; stdcall;

// Headers: CabeceraAut:pIn
function OperacionValida(const TPVID: WideString; const
tarjetaID: WideString; const importeOperacion: Single): WideString;
stdcall;

// Headers: CabeceraAut:pIn
function OperacionInserta(const TPVID: WideString; const
ambitoID: Integer; const TPVOperacionID: Integer; const fecha:
TXSDateTime; const tarjetaID: WideString; const importe: Single;
const operacionAnuladaID: Int64; const
fuerzaInsercion: Boolean): WideString; stdcall;

// Headers: CabeceraAut:pIn
function SesionInserta(const TPVID: WideString; const ambitoID:
Integer; const proceso: WideString; const resultadoSesion: WideString;
const logSesion: WideString): WideString; stdcall;

// Headers: CabeceraAut:pIn
function TPVRegistra(const TPVID: WideString; const ambitoID:
Integer; const serial: WideString; const servicio: WideString):
WideString; stdcall;
end;

function GetWebServiceParkingsSoap(UseWSDL: Boolean=System.False;
Addr: string=''; HTTPRIO: THTTPRIO = nil): WebServiceParkingsSoap;

implementation
uses SysUtils;

function GetWebServiceParkingsSoap(UseWSDL: Boolean; Addr: string;
HTTPRIO: THTTPRIO): WebServiceParkingsSoap;
const
defWSDL = 'http://xxxxxxxxxxx.xxxxxx.com/parkings/service.asmx?
WSDL';
defURL = 'http://xxxxxxxxxxx.xxxxxx.com/parkings/service.asmx';
defSvc = 'WebServiceParkings';
defPrt = 'WebServiceParkingsSoap';
var
RIO: THTTPRIO;
begin
Result := nil;
if (Addr = '') then
begin
if UseWSDL then
Addr := defWSDL
else
Addr := defURL;
end;
if HTTPRIO = nil then
RIO := THTTPRIO.Create(nil)
else
RIO := HTTPRIO;
try
Result := (RIO as WebServiceParkingsSoap);
if UseWSDL then
begin
RIO.WSDLLocation := Addr;
RIO.Service := defSvc;
RIO.Port := defPrt;
end else
RIO.URL := Addr;
finally
if (Result = nil) and (HTTPRIO = nil) then
RIO.Free;
end;
end;

procedure CabeceraAut.SetUsername(Index: Integer; const AWideString:
WideString);
begin
FUsername := AWideString;
FUsername_Specified := True;
end;

function CabeceraAut.Username_Specified(Index: Integer): boolean;
begin
Result := FUsername_Specified;
end;

procedure CabeceraAut.SetPassword(Index: Integer; const AWideString:
WideString);
begin
FPassword := AWideString;
FPassword_Specified := True;
end;

function CabeceraAut.Password_Specified(Index: Integer): boolean;
begin
Result := FPassword_Specified;
end;

initialization
InvRegistry.RegisterInterface(TypeInfo(WebServiceParkingsSoap),
'http://xxxxxxxxxxx.xxxxxx.com/parkings', 'utf-8');

InvRegistry.RegisterDefaultSOAPAction(TypeInfo(WebServiceParkingsSoap),
'http://xxxxxxxxxxx.xxxxxx.com/parkings/%operationName%');
InvRegistry.RegisterInvokeOptions(TypeInfo(WebServiceParkingsSoap),
ioDocument);
InvRegistry.RegisterHeaderClass(TypeInfo(WebServiceParkingsSoap),
CabeceraAut2, 'CabeceraAut', 'http://xxxxxxxxxxx.xxxxxx.com/
parkings');
RemClassRegistry.RegisterXSClass(CabeceraAut, 'http://
xxxxxxxxxxx.xxxxxx.com/parkings', 'CabeceraAut');
RemClassRegistry.RegisterXSClass(CabeceraAut2, 'http://
xxxxxxxxxxx.xxxxxx.com/parkings', 'CabeceraAut2', 'CabeceraAut');
end.

Any idea?
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi WebServices SOAP All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.