diff --git a/wst/trunk/ws_helper/command_line_parser.pas b/wst/trunk/ws_helper/command_line_parser.pas index e7e063c9f..cf9d7f19d 100644 --- a/wst/trunk/ws_helper/command_line_parser.pas +++ b/wst/trunk/ws_helper/command_line_parser.pas @@ -29,7 +29,7 @@ Type TComandLineOption = ( cloInterface, cloProxy, cloImp, cloBinder, cloWsdl, cloXsd, cloOutPutDirRelative, cloOutPutDirAbsolute, cloHandleWrappedParameters, - cloGenerateDocAsComments + cloGenerateDocAsComments, cloGenerateObjectCollection ); TComandLineOptions = set of TComandLineOption; @@ -54,7 +54,7 @@ begin AAppOptions := []; c := #0; repeat - c := GetOpt('u:pibo:a:wxyd'); + c := GetOpt('u:pibo:a:wxydg:'); case c of 'u' : begin @@ -78,6 +78,11 @@ begin 'x' : Include(AAppOptions,cloXsd); 'y' : Include(AAppOptions,cloHandleWrappedParameters); 'd' : Include(AAppOptions,cloGenerateDocAsComments); + 'g' : + begin + Include(AAppOptions,cloGenerateObjectCollection); + OptionsArgsMAP[cloGenerateObjectCollection] := OptArg; + end; end; until ( c = EndOfOptions ); Result := OptInd; diff --git a/wst/trunk/ws_helper/generator.pas b/wst/trunk/ws_helper/generator.pas index 1892dde18..4f61eab44 100644 --- a/wst/trunk/ws_helper/generator.pas +++ b/wst/trunk/ws_helper/generator.pas @@ -34,7 +34,8 @@ type TGeneratorOption = ( goDocumentWrappedParameter { .Net style wrapped parameters }, - goGenerateDocAsComments { Documentation include in the XSD/WSDL schema will be generated as comments } + goGenerateDocAsComments { Documentation include in the XSD/WSDL schema will be generated as comments }, + goGenerateObjectCollection { Generate object "collection" instead of "array" } ); TGeneratorOptions = set of TGeneratorOption; @@ -2560,7 +2561,9 @@ begin classItemArray := SymbolTable.IsOfType(eltType,TPasClassType) or SymbolTable.IsOfType(eltType,TPasArrayType); if classItemArray then begin - if FSymbolTable.IsCollection(ASymbol) then + if ( goGenerateObjectCollection in Options ) or + FSymbolTable.IsCollection(ASymbol) + then WriteObjectCollection(ASymbol) else WriteObjectArray(ASymbol); diff --git a/wst/trunk/ws_helper/ws_helper_prog.inc b/wst/trunk/ws_helper/ws_helper_prog.inc index 8a63c151a..ab1645cd9 100644 --- a/wst/trunk/ws_helper/ws_helper_prog.inc +++ b/wst/trunk/ws_helper/ws_helper_prog.inc @@ -1,8 +1,11 @@ resourcestring - sUSAGE = 'ws_helper [-uMODE] [-p] [-b] [-i] [-w] [-x] [-y] [-d] [-oPATH] [-aPATH] inputFilename' + sNEW_LINE + + sUSAGE = 'ws_helper [-uMODE] [-gOPTION] [-p] [-b] [-i] [-w] [-x] [-y] [-d] [-oPATH] [-aPATH] inputFilename' + sNEW_LINE + ' -u MODE Generate the pascal translation of the WSDL input file ' + sNEW_LINE + - ' MODE value may be U for used types or A for all types' + sNEW_LINE + + ' MODE value may be U for used types or A for all types' + sNEW_LINE + + ' -g Code generation option, with the following options : ' + sNEW_LINE + + ' A : object arrays are generated as "array" derived from TBaseObjectArrayRemotable' + sNEW_LINE + + ' C : object arrays are generated as "collection" derived from TObjectCollectionRemotable' + sNEW_LINE + ' -p Generate service proxy' + sNEW_LINE + ' -b Generate service binder' + sNEW_LINE + ' -i Generate service minimal implementation. This will erase any existing implementation file!' + sNEW_LINE + @@ -64,7 +67,9 @@ var if AnsiSameText('A',Trim(GetOptionArg(cloInterface))) then begin parserMode := pmAllTypes; end; - + if AnsiSameText('C',Trim(GetOptionArg(cloGenerateObjectCollection))) then begin + Include(AppOptions,cloGenerateObjectCollection); + end; if ( sourceType = sftXsd ) then begin AppOptions := AppOptions - [ cloProxy, cloImp, cloBinder, cloWsdl ]; end; @@ -185,6 +190,8 @@ var g := TInftGenerator.Create(symtable,srcMngr); if wrappedParams then g.Options := g.Options + [goDocumentWrappedParameter]; + if ( cloGenerateObjectCollection in AppOptions ) then + g.Options := g.Options + [goGenerateObjectCollection]; g.Execute(); FreeAndNil(g); end;