From 750cf8f8cfb6a8c7eba3137ebc57572bbae8525e Mon Sep 17 00:00:00 2001 From: inoussa Date: Thu, 25 Sep 2008 02:14:56 +0000 Subject: [PATCH] Generated proxy creation function now take 3 parameters for easy usage : * AFormat * ATransport * AAddress git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@570 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- wst/trunk/ws_helper/generator.pas | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/wst/trunk/ws_helper/generator.pas b/wst/trunk/ws_helper/generator.pas index 8db3d2ce1..45b9b20ca 100644 --- a/wst/trunk/ws_helper/generator.pas +++ b/wst/trunk/ws_helper/generator.pas @@ -446,11 +446,11 @@ var try FDecProcStream.NewLine(); FDecProcStream.Indent(); - FDecProcStream.WriteLn('Function wst_CreateInstance_%s(const AFormat : string = %s; const ATransport : string = %s):%s;',[AIntf.Name,QuotedStr('SOAP:'),QuotedStr('HTTP:'),AIntf.Name]); + FDecProcStream.WriteLn('Function wst_CreateInstance_%s(const AFormat : string = %s; const ATransport : string = %s; const AAddress : string = ''''):%s;',[AIntf.Name,QuotedStr('SOAP:'),QuotedStr('HTTP:'),AIntf.Name]); if HandleEasyIntf then begin FDecProcStream.Indent(); FDecProcStream.WriteLn( - 'Function wst_CreateInstance_%s%s(const AFormat : string = %s; const ATransport : string = %s):%s%s;', + 'Function wst_CreateInstance_%s%s(const AFormat : string = %s; const ATransport : string = %s; const AAddress : string = ''''):%s%s;', [AIntf.Name,sEASY_ACCESS_INTERFACE_PREFIX,QuotedStr('SOAP:'),QuotedStr('HTTP:'),AIntf.Name,sEASY_ACCESS_INTERFACE_PREFIX] ); end; @@ -551,15 +551,23 @@ Var procedure WriteDec(); begin NewLine(); - WriteLn('Function wst_CreateInstance_%s(const AFormat : string; const ATransport : string):%s;',[AIntf.Name,AIntf.Name]); + WriteLn('Function wst_CreateInstance_%s(const AFormat : string; const ATransport : string; const AAddress : string):%s;',[AIntf.Name,AIntf.Name]); + WriteLn('Var'); + IncIndent(); + Indent(); WriteLn('locAdr : string;'); + DecIndent(); WriteLn('Begin'); IncIndent(); + Indent(); WriteLn('if ( locAdr = '''' ) then'); + IncIndent(); + Indent(); WriteLn('locAdr := GetServiceDefaultAddress(TypeInfo(%s));',[AIntf.Name]); + DecIndent(); Indent(); WriteLn( 'Result := %s.Create(%s,AFormat+%s,ATransport + %s);', [ strClassName,QuotedStr(AIntf.Name), Format('GetServiceDefaultFormatProperties(TypeInfo(%s))',[AIntf.Name]), - QuotedStr('address=') + Format(' + GetServiceDefaultAddress(TypeInfo(%s))',[AIntf.Name]) + QuotedStr('address=') + ' + locAdr' ] ); DecIndent(); @@ -568,14 +576,14 @@ Var if HandleEasyIntf then begin WriteLn( - 'Function wst_CreateInstance_%s%s(const AFormat : string; const ATransport : string):%s%s;', + 'Function wst_CreateInstance_%s%s(const AFormat : string; const ATransport : string; const AAddress : string):%s%s;', [AIntf.Name,sEASY_ACCESS_INTERFACE_PREFIX,AIntf.Name,sEASY_ACCESS_INTERFACE_PREFIX] ); WriteLn('Begin'); IncIndent(); Indent(); WriteLn( - 'Result := wst_CreateInstance_%s(AFormat,ATransport) as %s%s;', + 'Result := wst_CreateInstance_%s(AFormat,ATransport,AAddress) as %s%s;', [AIntf.Name,AIntf.Name,sEASY_ACCESS_INTERFACE_PREFIX] ); DecIndent();