Delphi server side support ( binary, soap, xmlrpc ):

- the Indy http_server compile and works
 - for xml, the Delphi xmldom unit as used ( tested with msxml )

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@213 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
inoussa
2007-07-13 22:33:55 +00:00
parent 65f4a3dffd
commit 5ce9841611
32 changed files with 1787 additions and 334 deletions

View File

@ -46,12 +46,12 @@ object formImport: TformImport
Left = 9
Height = 23
Top = 31
Width = 412
Width = 408
Anchors = [akTop, akLeft, akRight]
TabOrder = 0
end
object Button2: TButton
Left = 439
Left = 435
Height = 25
Top = 31
Width = 40
@ -64,12 +64,12 @@ object formImport: TformImport
Left = 9
Height = 23
Top = 88
Width = 412
Width = 408
Anchors = [akTop, akLeft, akRight]
TabOrder = 2
end
object Button3: TButton
Left = 439
Left = 435
Height = 25
Top = 88
Width = 40
@ -149,8 +149,8 @@ object formImport: TformImport
Left = 294
Height = 13
Top = 56
Width = 155
Caption = 'Implementation Skeletton file'
Width = 152
Caption = 'Implementation Skeleton file'
TabOrder = 4
end
object edtOptionIntfALL: TCheckBox
@ -221,8 +221,8 @@ object formImport: TformImport
Filter = 'WSDL Files ( *.wsdl )|*.wsdl'
FilterIndex = 0
Options = [ofFileMustExist, ofEnableSizing, ofViewDetail]
left = 160
top = 16
left = 272
top = 32
end
object SDD: TSelectDirectoryDialog
Title = 'Choisir un r�pertoire'

View File

@ -14,13 +14,13 @@ LazarusResources.Add('TformImport','FORMDATA',[
+'on File ( WSDL )'#11'ParentColor'#8#0#0#6'TLabel'#6'Label2'#4'Left'#2#9#6'H'
+'eight'#2#14#3'Top'#2'E'#5'Width'#2'Q'#7'Caption'#6#16'Output directory'#11
+'ParentColor'#8#0#0#5'TEdit'#12'edtInputFile'#4'Left'#2#9#6'Height'#2#23#3'T'
+'op'#2#31#5'Width'#3#156#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#8'T'
+'abOrder'#2#0#0#0#7'TButton'#7'Button2'#4'Left'#3#183#1#6'Height'#2#25#3'Top'
+'op'#2#31#5'Width'#3#152#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#8'T'
+'abOrder'#2#0#0#0#7'TButton'#7'Button2'#4'Left'#3#179#1#6'Height'#2#25#3'Top'
+#2#31#5'Width'#2'('#6'Action'#7#11'actOpenFile'#7'Anchors'#11#5'akTop'#7'akR'
+'ight'#0#25'BorderSpacing.InnerBorder'#2#4#8'TabOrder'#2#1#0#0#5'TEdit'#12'e'
+'dtOutputDir'#4'Left'#2#9#6'Height'#2#23#3'Top'#2'X'#5'Width'#3#156#1#7'Anch'
+'dtOutputDir'#4'Left'#2#9#6'Height'#2#23#3'Top'#2'X'#5'Width'#3#152#1#7'Anch'
+'ors'#11#5'akTop'#6'akLeft'#7'akRight'#0#8'TabOrder'#2#2#0#0#7'TButton'#7'Bu'
+'tton3'#4'Left'#3#183#1#6'Height'#2#25#3'Top'#2'X'#5'Width'#2'('#6'Action'#7
+'tton3'#4'Left'#3#179#1#6'Height'#2#25#3'Top'#2'X'#5'Width'#2'('#6'Action'#7
+#10'actOpenDir'#7'Anchors'#11#5'akTop'#7'akRight'#0#25'BorderSpacing.InnerBo'
+'rder'#2#4#8'TabOrder'#2#3#0#0#9'TCheckBox'#15'edtAddToProject'#4'Left'#2#9#6
+'Height'#2#13#3'Top'#3#128#0#5'Width'#3#176#0#7'Caption'#6'"Add the generate'
@ -40,9 +40,9 @@ LazarusResources.Add('TformImport','FORMDATA',[
+#9#5'State'#7#9'cbChecked'#8'TabOrder'#2#2#0#0#9'TCheckBox'#15'edtOptionBind'
+'er'#4'Left'#3'&'#1#6'Height'#2#13#3'Top'#2#8#5'Width'#2'i'#7'Caption'#6#19
+'Service Binder file'#8'TabOrder'#2#3#0#0#9'TCheckBox'#12'edtOptionImp'#4'Le'
+'ft'#3'&'#1#6'Height'#2#13#3'Top'#2'8'#5'Width'#3#155#0#7'Caption'#6#29'Impl'
+'ementation Skeletton file'#8'TabOrder'#2#4#0#0#9'TCheckBox'#16'edtOptionInt'
+'fALL'#4'Left'#2#30#6'Height'#2#13#3'Top'#2' '#5'Width'#2'X'#7'Caption'#6#15
+'ft'#3'&'#1#6'Height'#2#13#3'Top'#2'8'#5'Width'#3#152#0#7'Caption'#6#28'Impl'
+'ementation Skeleton file'#8'TabOrder'#2#4#0#0#9'TCheckBox'#16'edtOptionIntf'
+'ALL'#4'Left'#2#30#6'Height'#2#13#3'Top'#2' '#5'Width'#2'X'#7'Caption'#6#15
+'Parse all types'#7'OnClick'#7#21'edtOptionIntfALLClick'#8'TabOrder'#2#1#0#0
+#0#0#6'TPanel'#6'Panel1'#6'Height'#2'0'#3'Top'#3#234#1#5'Width'#3#14#2#5'Ali'
+'gn'#7#8'alBottom'#12'ClientHeight'#2'0'#11'ClientWidth'#3#14#2#8'TabOrder'#2
@ -59,7 +59,7 @@ LazarusResources.Add('TformImport','FORMDATA',[
+'tion'#6#3'...'#18'DisableIfNoHandler'#9#9'OnExecute'#7#17'actOpenDirExecute'
+#0#0#0#11'TOpenDialog'#2'OD'#5'Title'#6#26'Ouvrir un fichier existant'#6'Fil'
+'ter'#6#28'WSDL Files ( *.wsdl )|*.wsdl'#11'FilterIndex'#2#0#7'Options'#11#15
+'ofFileMustExist'#14'ofEnableSizing'#12'ofViewDetail'#0#4'left'#3#160#0#3'to'
+'p'#2#16#0#0#22'TSelectDirectoryDialog'#3'SDD'#5'Title'#6#21'Choisir un r'
+#233'pertoire'#11'FilterIndex'#2#0#4'left'#3#224#0#3'top'#3#176#0#0#0#0
+'ofFileMustExist'#14'ofEnableSizing'#12'ofViewDetail'#0#4'left'#3#16#1#3'top'
+#2' '#0#0#22'TSelectDirectoryDialog'#3'SDD'#5'Title'#6#21'Choisir un r'#233
+'pertoire'#11'FilterIndex'#2#0#4'left'#3#224#0#3'top'#3#176#0#0#0#0
]);

View File

@ -11,16 +11,33 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
}
unit app_object;
{$INCLUDE wst_global.inc}
{$IFDEF FPC}
//{$UNDEF INDY_9}
//{$DEFINE INDY_10}
{$ELSE}
//{$UNDEF INDY_10}
//{$DEFINE INDY_9}
{$ENDIF}
{$mode objfpc}{$H+}
unit indy_http_server;
interface
uses
Classes, SysUtils,
IdCustomHTTPServer,
IdHTTPServer, IdContext, IdSocketHandle;
IdHTTPServer,
{$IFDEF INDY_10}
IdContext,
{$ENDIF}
{$IFDEF INDY_9}
IdTCPServer,
{$ENDIF}
IdSocketHandle;
{$INCLUDE wst.inc}
{$INCLUDE wst_delphi.inc}
type
@ -34,27 +51,43 @@ type
function GenerateWSDLTable():string;
procedure ProcessWSDLRequest(
{$IFDEF INDY_10}
AContext : TIdContext;
{$ENDIF}
ARequestInfo : TIdHTTPRequestInfo;
AResponseInfo : TIdHTTPResponseInfo;
var APath : string
);
procedure ProcessServiceRequest(
{$IFDEF INDY_10}
AContext : TIdContext;
{$ENDIF}
ARequestInfo : TIdHTTPRequestInfo;
AResponseInfo : TIdHTTPResponseInfo;
var APath : string
);
private
procedure Handler_CommandGet(
{$IFDEF INDY_10}
AContext : TIdContext;
{$ENDIF}
{$IFDEF INDY_9}
AThread: TIdPeerThread;
{$ENDIF}
ARequestInfo : TIdHTTPRequestInfo;
AResponseInfo : TIdHTTPResponseInfo
);
public
constructor Create();
constructor Create(
const AServerIpAddress : string = '127.0.0.1';
const AListningPort : Integer = 8000;
const ADefaultClientPort : Integer = 25000;
const AServerSoftware : string = 'Web Service Toolkit Application'
);
destructor Destroy(); override;
procedure Display(const AMsg : string);
procedure Start();
procedure Stop();
end;
@ -62,11 +95,39 @@ implementation
uses base_service_intf,
server_service_intf, server_service_imputils,
server_service_soap, server_binary_formatter, server_service_xmlrpc,
metadata_repository, metadata_wsdl, DOM, XMLWrite,
metadata_repository, metadata_wsdl,
{$IFNDEF FPC}
ActiveX, XMLDoc,XMLIntf,xmldom, wst_delphi_xml,
{$ELSE}
DOM, XMLWrite, wst_fpc_xml,
{$ENDIF}
metadata_service, metadata_service_binder, metadata_service_imp,
user_service_intf, user_service_intf_binder, user_service_intf_imp;
{$IFNDEF FPC}
type
TwstIndy9Thread = class(TIdPeerThread)
protected
procedure AfterExecute; override;
procedure BeforeExecute; override;
end;
{ TwstIndy9Thread }
procedure TwstIndy9Thread.AfterExecute;
begin
CoUninitialize();
inherited;
end;
procedure TwstIndy9Thread.BeforeExecute;
begin
inherited;
CoInitialize(nil);
end;
{$ENDIF}
const
sSEPARATOR = '/';
sSERVICES_PREFIXE = 'services';
@ -113,7 +174,7 @@ begin
//if ( GetModuleMetadataMngr().LoadRepositoryName(s,rep) > 0 ) then
//rep^.namespace := 'urn:wst';
strm.Clear();
doc := TXMLDocument.Create();
doc := CreateDoc();
GenerateWSDL(rep,doc);
WriteXMLFile(doc,strm);
i := strm.Size;
@ -122,7 +183,7 @@ begin
Move(strm.memory^,Result[1],i);
end;
finally
doc.Free();
ReleaseDomNode(doc);
strm.Free();
GetModuleMetadataMngr().ClearRepository(rep);
end;
@ -163,7 +224,9 @@ begin
end;
procedure TwstWebApplication.ProcessWSDLRequest(
{$IFDEF INDY_10}
AContext : TIdContext;
{$ENDIF}
ARequestInfo : TIdHTTPRequestInfo;
AResponseInfo : TIdHTTPResponseInfo;
var APath : string
@ -189,7 +252,9 @@ begin
end;
procedure TwstWebApplication.ProcessServiceRequest(
{$IFDEF INDY_10}
AContext : TIdContext;
{$ENDIF}
ARequestInfo : TIdHTTPRequestInfo;
AResponseInfo : TIdHTTPResponseInfo;
var APath : string
@ -197,21 +262,23 @@ procedure TwstWebApplication.ProcessServiceRequest(
var
trgt,ctntyp, frmt : string;
rqst : IRequestBuffer;
inStream: TMemoryStream;
inStream : {$IFDEF FPC}TMemoryStream{$ELSE}TStringStream{$ENDIF};
begin
trgt := ExtractNextPathElement(APath);
if AnsiSameText(sWSDL,trgt) then begin
ProcessWSDLRequest(AContext,ARequestInfo,AResponseInfo,APath);
ProcessWSDLRequest({$IFDEF INDY_10}AContext,{$ENDIF}ARequestInfo,AResponseInfo,APath);
Exit;
end;
inStream := nil;
try
try
inStream := TMemoryStream.Create();
inStream := {$IFDEF FPC}TMemoryStream.Create();{$ELSE}TStringStream.Create(ARequestInfo.FormParams);{$ENDIF}
AResponseInfo.ContentStream := TMemoryStream.Create();
ctntyp := ARequestInfo.ContentType;
{$IFDEF FPC}
inStream.CopyFrom(ARequestInfo.PostStream,0);
{$ENDIF}
inStream.Position := 0;
AResponseInfo.ContentType := ctntyp;
frmt := Trim(ARequestInfo.Params.Values['format']);
@ -229,7 +296,12 @@ begin
end;
procedure TwstWebApplication.Handler_CommandGet(
{$IFDEF INDY_10}
AContext : TIdContext;
{$ENDIF}
{$IFDEF INDY_9}
AThread: TIdPeerThread;
{$ENDIF}
ARequestInfo : TIdHTTPRequestInfo;
AResponseInfo : TIdHTTPResponseInfo
);
@ -247,7 +319,7 @@ begin
locPath := ARequestInfo.Document;
locPathPart := ExtractNextPathElement(locPath);
if AnsiSameText(sSERVICES_PREFIXE,locPathPart) then begin
ProcessServiceRequest(AContext,ARequestInfo,AResponseInfo,locPath);
ProcessServiceRequest({$IFDEF INDY_10}AContext,{$ENDIF}ARequestInfo,AResponseInfo,locPath);
if Assigned(AResponseInfo.ContentStream) and ( AResponseInfo.ContentStream.Size > 0 ) then begin
j := AResponseInfo.ContentStream.Size;
SetLength(s,j);
@ -259,24 +331,32 @@ begin
Exit;
end;
ProcessWSDLRequest(AContext,ARequestInfo,AResponseInfo,locPath);
ProcessWSDLRequest({$IFDEF INDY_10}AContext,{$ENDIF}ARequestInfo,AResponseInfo,locPath);
end;
constructor TwstWebApplication.Create();
constructor TwstWebApplication.Create(
const AServerIpAddress : string;
const AListningPort : Integer;
const ADefaultClientPort : Integer;
const AServerSoftware : string
);
var
b : TIdSocketHandle;
begin
inherited Create();
FHTTPServerObject := TIdHTTPServer.Create();
FHTTPServerObject := TIdHTTPServer.Create({$IFNDEF INDY_10}nil{$ENDIF});
{$IFNDEF FPC}
FHTTPServerObject.ThreadClass := TwstIndy9Thread;
{$ENDIF}
b := FHTTPServerObject.Bindings.Add();
b.IP:='127.0.0.1';
b.port:=8000;
FRootAddress := 'http://127.0.0.1:8000/';
b.IP := AServerIpAddress;
b.port := AListningPort;
FRootAddress := Format('http://%s:%d/',[AServerIpAddress,AListningPort]);
FHTTPServerObject.DefaultPort := 25000;
FHTTPServerObject.ServerSoftware := 'Web Service Toolkit Sample WebServer';
FHTTPServerObject.DefaultPort := ADefaultClientPort;
FHTTPServerObject.ServerSoftware := AServerSoftware;
FHTTPServerObject.Active := True;
FHTTPServerObject.OnCommandGet := @Handler_CommandGet;
FHTTPServerObject.OnCommandGet := {$IFDEF FPC}@{$ENDIF}Handler_CommandGet;
end;
destructor TwstWebApplication.Destroy();
@ -287,7 +367,20 @@ end;
procedure TwstWebApplication.Display(const AMsg: string);
begin
WriteLn(AMsg);
//WriteLn(AMsg);
end;
procedure TwstWebApplication.Start();
begin
if not FHTTPServerObject.Active then
FHTTPServerObject.Active := True;
end;
procedure TwstWebApplication.Stop();
begin
if FHTTPServerObject.Active then
FHTTPServerObject.Active := False;
end;
initialization

View File

@ -13,23 +13,23 @@
{$INCLUDE wst_global.inc}
unit metadata_wsdl;
{$INCLUDE wst.inc}
{$INCLUDE wst_delphi.inc}
interface
uses
Classes, SysUtils, TypInfo,
DOM,
{$IFNDEF FPC}xmldom, wst_delphi_xml{$ELSE}DOM{$ENDIF},
base_service_intf, metadata_repository;
{$INCLUDE wst.inc}
{$INCLUDE wst_delphi.inc}
type
IWsdlTypeHandler = interface
['{DA9AF8B1-392B-49A8-91CC-6B5C5131E6FA}']
procedure Generate(
const APascalTypeName : string;
AWsdlDocument : TDOMDocument
AWsdlDocument : TXMLDocument
);
end;
@ -52,7 +52,7 @@ type
protected
procedure Generate(
const APascalTypeName : string;
AWsdlDocument : TDOMDocument
AWsdlDocument : TXMLDocument
);
end;
@ -62,7 +62,7 @@ type
protected
procedure Generate(
const APascalTypeName : string;
AWsdlDocument : TDOMDocument
AWsdlDocument : TXMLDocument
);
end;
@ -72,15 +72,16 @@ type
protected
procedure Generate(
const APascalTypeName : string;
AWsdlDocument : TDOMDocument
AWsdlDocument : TXMLDocument
);
end;
procedure GenerateWSDL(AMdtdRep : PServiceRepository; ADoc : TDOMDocument);
procedure GenerateWSDL(AMdtdRep : PServiceRepository; ADoc : TXMLDocument);
function GetWsdlTypeHandlerRegistry():IWsdlTypeHandlerRegistry;
implementation
uses {$IFNDEF FPC}wst_delphi_rtti_utils{$ELSE}wst_fpc_xml{$ENDIF};
const
sWSDL_NS = 'http://schemas.xmlsoap.org/wsdl/';
@ -250,7 +251,7 @@ begin
inherited Destroy();
end;
function CreateElement(const ANodeName : DOMString; AParent : TDOMNode; ADoc : TDOMDocument):TDOMElement;//inline;
function CreateElement(const ANodeName : DOMString; AParent : TDOMNode; ADoc : TXMLDocument):TDOMElement;//inline;
begin
Result := ADoc.CreateElement(ANodeName);
AParent.AppendChild(Result);
@ -272,8 +273,10 @@ begin
b := ( Length(AStartingWith) = 0);
c := Pred(ANode.Attributes.Length);
if ( AStartIndex >= 0 ) then
i := AStartIndex;
for i := 0 to c do begin
i := AStartIndex
else
i := 0;
for i := i to c do begin
if AnsiSameText(AAttValue,ANode.Attributes.Item[i].NodeValue) and
( b or ( Pos(AStartingWith,ANode.Attributes.Item[i].NodeName) = 1 ))
then begin
@ -288,13 +291,13 @@ end;
function GetNameSpaceShortName(
const ANameSpace : string;
AWsdlDocument : TDOMDocument
AWsdlDocument : TXMLDocument
):string;//inline;
begin
if FindAttributeByValueInNode(ANameSpace,AWsdlDocument.DocumentElement,Result,0,sXMLNS) then begin
Result := Copy(Result,Length(sXMLNS+':')+1,MaxInt);
end else begin
Result := Format('ns%d',[AWsdlDocument.DocumentElement.Attributes.{$IFNDEF FPC_211}Count{$ELSE}Length{$ENDIF}]) ;
Result := Format('ns%d',[GetNodeListCount(AWsdlDocument.DocumentElement.Attributes)]) ;
AWsdlDocument.DocumentElement.SetAttribute(Format('%s:%s',[sXMLNS,Result]),ANameSpace);
end;
end;
@ -306,7 +309,7 @@ begin
Result := AService^.Name + PART_NAME_MAP[AServicePart];
end;
procedure GenerateWSDL(AMdtdRep : PServiceRepository; ADoc : TDOMDocument);
procedure GenerateWSDL(AMdtdRep : PServiceRepository; ADoc : TXMLDocument);
procedure GenerateServiceMessages(
AService : PService;
@ -342,12 +345,15 @@ procedure GenerateWSDL(AMdtdRep : PServiceRepository; ADoc : TDOMDocument);
rspNode := CreateElement(sWSDL_MESSAGE,ARootNode,ADoc);
rspNode.SetAttribute(sWSDL_NAME,Format('%sResponse',[AOperation^.Name]));
cc := AOperation^.ParamsCount;
if ( cc > 0 ) then begin
pp := AOperation^.Params;
for ii := 0 to Pred(cc) do begin
pp := @(AOperation^.Params[ii]);
if ( pp^.Modifier in [opfNone, opfIn] ) then
GenerateParam(pp,qryNode)
else if ( pp^.Modifier in [opfVar, opfOut] ) then
GenerateParam(pp,rspNode);
Inc(pp);
end;
end;
end;
@ -358,8 +364,10 @@ procedure GenerateWSDL(AMdtdRep : PServiceRepository; ADoc : TDOMDocument);
k := AService^.OperationsCount;
if ( k > 0 ) then begin
po := AService^.Operations;
for j := 0 to pred(k) do
GenerateOperationMessage(@(po[j]));
for j := 0 to pred(k) do begin
GenerateOperationMessage(po);
Inc(po);
end;
end;
end;
@ -388,7 +396,8 @@ procedure GenerateWSDL(AMdtdRep : PServiceRepository; ADoc : TDOMDocument);
if ( k > 0 ) then begin
po := AService^.Operations;
for j := 0 to pred(k) do begin
GenerateOperation(@(po[j]),prtTypeNode);
GenerateOperation(po,prtTypeNode);
Inc(po);
end;
end;
end;
@ -453,7 +462,8 @@ procedure GenerateWSDL(AMdtdRep : PServiceRepository; ADoc : TDOMDocument);
if ( k > 0 ) then begin
po := AService^.Operations;
for j := 0 to pred(k) do begin
GenerateOperation(@(po[j]),bndgNode);
GenerateOperation(po,bndgNode);
Inc(po);
end;
end;
end;
@ -537,16 +547,23 @@ begin
if ( c > 0 ) then begin
ps := AMdtdRep^.Services;
for i := 0 to Pred(c) do begin
GenerateServiceMessages(@(ps[i]),defNode);
GenerateServiceMessages(ps,defNode);
Inc(ps);
end;
ps := AMdtdRep^.Services;
for i := 0 to Pred(c) do begin
GenerateServicePortType(@(ps[i]),defNode);
GenerateServicePortType(ps,defNode);
Inc(ps);
end;
ps := AMdtdRep^.Services;
for i := 0 to Pred(c) do begin
GenerateServiceBinding(@(ps[i]),defNode);
GenerateServiceBinding(ps,defNode);
Inc(ps);
end;
ps := AMdtdRep^.Services;
for i := 0 to Pred(c) do begin
GenerateServicePublication(@(ps[i]),defNode);
GenerateServicePublication(ps,defNode);
Inc(ps);
end;
end;
@ -565,7 +582,7 @@ type
protected
procedure Generate(
const APascalTypeName : string;
AWsdlDocument : TDOMDocument
AWsdlDocument : TXMLDocument
);
end;
@ -573,7 +590,7 @@ type
procedure TBaseComplexRemotable_TypeHandler.Generate(
const APascalTypeName : string;
AWsdlDocument : TDOMDocument
AWsdlDocument : TXMLDocument
);
var
typItm, propTypItm : TTypeRegistryItem;
@ -593,7 +610,7 @@ begin
( typItm.DataType^.Kind = tkClass )
then begin
GetNameSpaceShortName(typItm.NameSpace,AWsdlDocument);
defTypesNode := AWsdlDocument.DocumentElement.FindNode(sWSDL_TYPES) as TDOMElement;
defTypesNode := FindNode(AWsdlDocument.DocumentElement,sWSDL_TYPES) as TDOMElement;
Assert(Assigned(defTypesNode));
defSchemaNode := defTypesNode.FirstChild as TDOMElement;
@ -652,12 +669,12 @@ end;
procedure TEnumTypeHandler.Generate(
const APascalTypeName: string;
AWsdlDocument: TDOMDocument
AWsdlDocument: TXMLDocument
);
var
typItm : TTypeRegistryItem;
ns_shortName, s : string;
defTypesNode, defSchemaNode, resNode, restrictNode, eltNode : TDOMElement;
defTypesNode, defSchemaNode, resNode, restrictNode : TDOMElement;
i, c : Integer;
begin
typItm := GetTypeRegistry().Find(APascalTypeName);
@ -667,10 +684,10 @@ begin
if FindAttributeByValueInNode(typItm.NameSpace,AWsdlDocument.DocumentElement,ns_shortName) then begin
ns_shortName := Copy(ns_shortName,Length(sXMLNS+':')+1,MaxInt);
end else begin
ns_shortName := Format('ns%d',[AWsdlDocument.DocumentElement.Attributes.{$IFNDEF FPC_211}Count{$ELSE}Length{$ENDIF}]) ;
ns_shortName := Format('ns%d',[GetNodeListCount(AWsdlDocument.DocumentElement.Attributes)]) ;
AWsdlDocument.DocumentElement.SetAttribute(Format('%s:%s',[sXMLNS,ns_shortName]),typItm.NameSpace);
end;
defTypesNode := AWsdlDocument.DocumentElement.FindNode(sWSDL_TYPES) as TDOMElement;
defTypesNode := FindNode(AWsdlDocument.DocumentElement,sWSDL_TYPES) as TDOMElement;
Assert(Assigned(defTypesNode));
defSchemaNode := defTypesNode.FirstChild as TDOMElement;
@ -700,7 +717,7 @@ end;
procedure TFakeTypeHandler.Generate(
const APascalTypeName: string;
AWsdlDocument: TDOMDocument
AWsdlDocument: TXMLDocument
);
begin
end;
@ -712,16 +729,18 @@ begin
r := GetWsdlTypeHandlerRegistry();
r.RegisterDefaultHandler(tkInteger,TSimpleItemFactory.Create(TFakeTypeHandler) as IItemFactory);
r.RegisterDefaultHandler(tkInt64,TSimpleItemFactory.Create(TFakeTypeHandler) as IItemFactory);
{$IFDEF FPC}
r.RegisterDefaultHandler(tkQWord,TSimpleItemFactory.Create(TFakeTypeHandler) as IItemFactory);
r.RegisterDefaultHandler(tkSString,TSimpleItemFactory.Create(TFakeTypeHandler) as IItemFactory);
r.RegisterDefaultHandler(tkLString,TSimpleItemFactory.Create(TFakeTypeHandler) as IItemFactory);
r.RegisterDefaultHandler(tkAString,TSimpleItemFactory.Create(TFakeTypeHandler) as IItemFactory);
r.RegisterDefaultHandler(tkWString,TSimpleItemFactory.Create(TFakeTypeHandler) as IItemFactory);
r.RegisterDefaultHandler(tkWString,TSimpleItemFactory.Create(TFakeTypeHandler) as IItemFactory);
r.RegisterDefaultHandler(tkBool,TSimpleItemFactory.Create(TFakeTypeHandler) as IItemFactory);
{$ENDIF}
r.RegisterDefaultHandler(tkLString,TSimpleItemFactory.Create(TFakeTypeHandler) as IItemFactory);
r.RegisterDefaultHandler(tkWString,TSimpleItemFactory.Create(TFakeTypeHandler) as IItemFactory);
r.RegisterDefaultHandler(tkWString,TSimpleItemFactory.Create(TFakeTypeHandler) as IItemFactory);
r.RegisterDefaultHandler(tkEnumeration,TSimpleItemFactory.Create(TEnumTypeHandler) as IItemFactory);
@ -757,7 +776,7 @@ end;
procedure TBaseArrayRemotable_TypeHandler.Generate(
const APascalTypeName: string;
AWsdlDocument: TDOMDocument
AWsdlDocument: TXMLDocument
);
function GetNameSpaceShortName(const ANameSpace : string):string;//inline;
@ -765,7 +784,7 @@ procedure TBaseArrayRemotable_TypeHandler.Generate(
if FindAttributeByValueInNode(ANameSpace,AWsdlDocument.DocumentElement,Result,0,sXMLNS) then begin
Result := Copy(Result,Length(sXMLNS+':')+1,MaxInt);
end else begin
Result := Format('ns%d',[AWsdlDocument.DocumentElement.Attributes.{$IFNDEF FPC_211}Count{$ELSE}Length{$ENDIF}]) ;
Result := Format('ns%d',[GetNodeListCount(AWsdlDocument.DocumentElement.Attributes)]) ;
AWsdlDocument.DocumentElement.SetAttribute(Format('%s:%s',[sXMLNS,Result]),ANameSpace);
end;
end;
@ -786,7 +805,7 @@ begin
( arrayTypeData^.ClassType.InheritsFrom(TBaseArrayRemotable) )
then begin
GetNameSpaceShortName(typItm.NameSpace);
defTypesNode := AWsdlDocument.DocumentElement.FindNode(sWSDL_TYPES) as TDOMElement;
defTypesNode := FindNode(AWsdlDocument.DocumentElement,sWSDL_TYPES) as TDOMElement;
Assert(Assigned(defTypesNode));
defSchemaNode := defTypesNode.FirstChild as TDOMElement;

View File

@ -0,0 +1,44 @@
-$A8
-$B-
-$C+
-$D+
-$E-
-$F-
-$G+
-$H+
-$I+
-$J-
-$K-
-$L+
-$M-
-$N+
-$O+
-$P+
-$Q-
-$R-
-$S-
-$T-
-$U-
-$V+
-$W-
-$X+
-$YD
-$Z1
-cg
-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
-H+
-W+
-M
-$M16384,1048576
-K$00400000
-N"obj"
-LE"c:\program files\borland\delphi7\Projects\Bpl"
-LN"c:\program files\borland\delphi7\Projects\Bpl"
-U"..\..\..\;..\..\;..\..\..\wst_rtti_filter"
-O"..\..\..\;..\..\;..\..\..\wst_rtti_filter"
-I"..\..\..\;..\..\;..\..\..\wst_rtti_filter"
-R"..\..\..\;..\..\;..\..\..\wst_rtti_filter"
-DINDY_9
-w-UNSAFE_TYPE
-w-UNSAFE_CODE
-w-UNSAFE_CAST

View File

@ -0,0 +1,159 @@
[FileVersion]
Version=7.0
[Compiler]
A=8
B=0
C=1
D=1
E=0
F=0
G=1
H=1
I=1
J=0
K=0
L=1
M=0
N=1
O=1
P=1
Q=0
R=0
S=0
T=0
U=0
V=1
W=0
X=1
Y=1
Z=1
ShowHints=1
ShowWarnings=1
UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
NamespacePrefix=
SymbolDeprecated=1
SymbolLibrary=1
SymbolPlatform=1
UnitLibrary=1
UnitPlatform=1
UnitDeprecated=1
HResultCompat=1
HidingMember=1
HiddenVirtual=1
Garbage=1
BoundsError=1
ZeroNilCompat=1
StringConstTruncated=1
ForLoopVarVarPar=1
TypedConstVarPar=1
AsgToTypedConst=1
CaseLabelRange=1
ForVariable=1
ConstructingAbstract=1
ComparisonFalse=1
ComparisonTrue=1
ComparingSignedUnsigned=1
CombiningSignedUnsigned=1
UnsupportedConstruct=1
FileOpen=1
FileOpenUnitSrc=1
BadGlobalSymbol=1
DuplicateConstructorDestructor=1
InvalidDirective=1
PackageNoLink=1
PackageThreadVar=1
ImplicitImport=1
HPPEMITIgnored=1
NoRetVal=1
UseBeforeDef=1
ForLoopVarUndef=1
UnitNameMismatch=1
NoCFGFileFound=1
MessageDirective=1
ImplicitVariants=1
UnicodeToLocale=1
LocaleToUnicode=1
ImagebaseMultiple=1
SuspiciousTypecast=1
PrivatePropAccessor=1
UnsafeType=0
UnsafeCode=0
UnsafeCast=0
[Linker]
MapFile=0
OutputObjs=0
ConsoleApp=1
DebugInfo=0
RemoteSymbols=0
MinStackSize=16384
MaxStackSize=1048576
ImageBase=4194304
ExeDescription=
[Directories]
OutputDir=
UnitOutputDir=obj
PackageDLLOutputDir=
PackageDCPOutputDir=
SearchPath=..\..\..\;..\..\;..\..\..\wst_rtti_filter
Packages=vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;dsnapcon;vcldb;soaprtl;VclSmp;dbexpress;dbxcds;inetdb;bdertl;vcldbx;webdsnap;websnap;adortl;ibxpress;teeui;teedb;tee;dss;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOfficeXP;FIBDBMidas7;Jcl;JclVcl;JvCoreD7R;JvSystemD7R;JvStdCtrlsD7R;JvAppFrmD7R;JvBandsD7R;JvDBD7R;JvDlgsD7R;JvBDED7R;JvCmpD7R;JvCryptD7R;JvCtrlsD7R;JvCustomD7R;JvDockingD7R;JvDotNetCtrlsD7R;JvEDID7R;JvGlobusD7R;JvHMID7R;JvInterpreterD7R;JvJansD7R;JvManagedThreadsD7R;JvMMD7R;JvNetD7R;JvPageCompsD7R;JvPluginD7R;JvPrintPreviewD7R;JvRuntimeDesignD7R;JvTimeFrameworkD7R;JvUIBD7R;JvValidatorsD7R;JvWizardD7R;JvXPCtrlsD7R;dxForumLibD7;cxLibraryVCLD7;cxPageControlVCLD7;dxBarD7;dxComnD7;dxBarDBNavD7;dxBarExtItemsD7;dxBarExtDBItemsD7;dxsbD7;dxmdsD7;dxdbtrD7;dxtrmdD7;dxorgcD7;dxdborD7;dxEdtrD7;EQTLD7;ECQDBCD7;EQDBTLD7;EQGridD7;dxGrEdD7;dxExELD7;dxELibD7;cxEditorsVCLD7;cxGridVCLD7;dxThemeD7;cxDataD7;cxGridUtilsVCLD7;dxPSCoreD7;dxPsPrVwAdvD7;dxPSLnksD7;dxPSTeeChartD7;dxPSDBTeeChartD7;dxPSdxDBTVLnkD7;dxPSdxOCLnkD7;dxPSdxDBOCLnkD7;dxPScxGridLnkD7;dxPSTLLnkD7;qrpt
Conditionals=INDY_9
DebugSourceDirs=
UsePackages=0
[Parameters]
RunParams=
HostApplication=
Launcher=
UseLauncher=0
DebugCWD=
[Language]
ActiveLang=
ProjectLang=
RootDir=C:\Program Files\Borland\Delphi7\Bin\
[Version Info]
IncludeVerInfo=0
AutoIncBuild=0
MajorVer=1
MinorVer=0
Release=0
Build=0
Debug=0
PreRelease=0
Special=0
Private=0
DLL=0
Locale=1036
CodePage=1252
[Version Info Keys]
CompanyName=
FileDescription=
FileVersion=1.0.0.0
InternalName=
LegalCopyright=
LegalTrademarks=
OriginalFilename=
ProductName=
ProductVersion=1.0.0.0
Comments=
[Excluded Packages]
C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPSdxDBTLLnkD7.bpl=ExpressPrinting System ReportLink for ExpressQuantumDBTreeList by Developer Express Inc.
C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPSdxDBGrLnkD7.bpl=ExpressPrinting System ReportLink for ExpressQuantumGrid by Developer Express Inc.
C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPSdxInsLnkD7.bpl=ExpressPrinting System ReportLink for ExpressInspector by Developer Express Inc.
C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPSdxOILnkD7.bpl=ExpressPrinting System ReportLink for ExpressRTTIInspector by Developer Express Inc.
C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPSdxMVLnkD7.bpl=ExpressPrinting System ReportLink for ExpressMasterView by Developer Express Inc.
C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPSdxFCLnkD7.bpl=ExpressPrinting System ReportLinks for ExpressFlowChart by Developer Express Inc.
C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPScxSSLnkD7.bpl=ExpressPrinting System ReportLink for ExpressSpreadSheet by Developer Express Inc.
[HistoryLists\hlConditionals]
Count=1
Item0=INDY_9
[HistoryLists\hlUnitAliases]
Count=1
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
[HistoryLists\hlSearchPath]
Count=4
Item0=..\..\..\;..\..\;..\..\..\wst_rtti_filter
Item1=..\..\..\;..\..\
Item2=..\..\..\
Item3=..\
[HistoryLists\hlUnitOutputDirectory]
Count=1
Item0=obj

View File

@ -0,0 +1,40 @@
program http_server;
{$APPTYPE CONSOLE}
uses
SysUtils,
Classes,
{$IFNDEF FPC}
ActiveX,
{$ENDIF}
indy_http_server,
metadata_service,
logger_extension,
wst_delphi_rtti_utils in '..\..\..\wst_delphi_rtti_utils.pas';
var
AppObject : TwstWebApplication;
begin
{$IFNDEF FPC}
CoInitialize(nil);
try
{$ENDIF}
AppObject := TwstWebApplication.Create();
try
WriteLn('"Web Service Toolkit" HTTP Server sample listening at:');
WriteLn('');
WriteLn('http://127.0.0.1:8000/');
WriteLn('');
WriteLn('Press enter to quit.');
ReadLn;
finally
FreeAndNil(AppObject);
end;
{$IFNDEF FPC}
finally
CoUninitialize();
end;
{$ENDIF}
end.

View File

@ -12,7 +12,7 @@
<MainUnit Value="0"/>
<IconPath Value="./"/>
<TargetFileExt Value=".exe"/>
<ActiveEditorIndexAtStart Value="0"/>
<ActiveEditorIndexAtStart Value="1"/>
</General>
<VersionInfo>
<ProjectVersion Value=""/>
@ -34,33 +34,31 @@
<PackageName Value="indylaz"/>
</Item1>
</RequiredPackages>
<Units Count="40">
<Units Count="48">
<Unit0>
<Filename Value="http_server.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="http_server"/>
<CursorPos X="26" Y="14"/>
<CursorPos X="19" Y="10"/>
<TopLine Value="1"/>
<EditorIndex Value="0"/>
<UsageCount Value="56"/>
<UsageCount Value="73"/>
<Loaded Value="True"/>
</Unit0>
<Unit1>
<Filename Value="app_object.pas"/>
<UnitName Value="app_object"/>
<CursorPos X="41" Y="68"/>
<TopLine Value="50"/>
<EditorIndex Value="3"/>
<UsageCount Value="28"/>
<Loaded Value="True"/>
<CursorPos X="42" Y="214"/>
<TopLine Value="200"/>
<UsageCount Value="36"/>
</Unit1>
<Unit2>
<Filename Value="..\..\base_service_intf.pas"/>
<UnitName Value="base_service_intf"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<EditorIndex Value="19"/>
<UsageCount Value="27"/>
<EditorIndex Value="20"/>
<UsageCount Value="35"/>
<Loaded Value="True"/>
</Unit2>
<Unit3>
@ -68,8 +66,8 @@
<UnitName Value="metadata_wsdl"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<EditorIndex Value="21"/>
<UsageCount Value="28"/>
<EditorIndex Value="22"/>
<UsageCount Value="36"/>
<Loaded Value="True"/>
</Unit3>
<Unit4>
@ -78,7 +76,7 @@
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<EditorIndex Value="8"/>
<UsageCount Value="12"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
</Unit4>
<Unit5>
@ -87,25 +85,25 @@
<CursorPos X="22" Y="161"/>
<TopLine Value="160"/>
<EditorIndex Value="16"/>
<UsageCount Value="25"/>
<UsageCount Value="33"/>
<Loaded Value="True"/>
</Unit5>
<Unit6>
<Filename Value="..\user_service_intf_binder.pas"/>
<UnitName Value="user_service_intf_binder"/>
<CursorPos X="23" Y="291"/>
<TopLine Value="264"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<EditorIndex Value="4"/>
<UsageCount Value="11"/>
<UsageCount Value="19"/>
<Loaded Value="True"/>
</Unit6>
<Unit7>
<Filename Value="..\user_service_intf.pas"/>
<UnitName Value="user_service_intf"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="180"/>
<TopLine Value="1"/>
<EditorIndex Value="17"/>
<UsageCount Value="25"/>
<UsageCount Value="33"/>
<Loaded Value="True"/>
</Unit7>
<Unit8>
@ -113,8 +111,8 @@
<UnitName Value="metadata_repository"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<EditorIndex Value="22"/>
<UsageCount Value="28"/>
<EditorIndex Value="25"/>
<UsageCount Value="36"/>
<Loaded Value="True"/>
</Unit8>
<Unit9>
@ -122,8 +120,8 @@
<UnitName Value="semaphore"/>
<CursorPos X="2" Y="12"/>
<TopLine Value="1"/>
<EditorIndex Value="20"/>
<UsageCount Value="12"/>
<EditorIndex Value="21"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
</Unit9>
<Unit10>
@ -132,7 +130,7 @@
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<EditorIndex Value="15"/>
<UsageCount Value="27"/>
<UsageCount Value="35"/>
<Loaded Value="True"/>
</Unit10>
<Unit11>
@ -141,7 +139,7 @@
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<EditorIndex Value="12"/>
<UsageCount Value="27"/>
<UsageCount Value="35"/>
<Loaded Value="True"/>
</Unit11>
<Unit12>
@ -150,7 +148,7 @@
<CursorPos X="17" Y="28"/>
<TopLine Value="13"/>
<EditorIndex Value="14"/>
<UsageCount Value="27"/>
<UsageCount Value="35"/>
<Loaded Value="True"/>
</Unit12>
<Unit13>
@ -158,8 +156,8 @@
<UnitName Value="server_service_imputils"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<EditorIndex Value="18"/>
<UsageCount Value="26"/>
<EditorIndex Value="19"/>
<UsageCount Value="34"/>
<Loaded Value="True"/>
</Unit13>
<Unit14>
@ -167,26 +165,26 @@
<UnitName Value="IdCustomHTTPServer"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="8"/>
<UsageCount Value="7"/>
</Unit14>
<Unit15>
<Filename Value="..\..\..\..\..\..\lazarus23_213\fpc\2.1.3\source\rtl\i386\i386.inc"/>
<CursorPos X="49" Y="1252"/>
<TopLine Value="1231"/>
<UsageCount Value="8"/>
<UsageCount Value="7"/>
</Unit15>
<Unit16>
<Filename Value="..\..\wst.inc"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="7"/>
<UsageCount Value="6"/>
</Unit16>
<Unit17>
<Filename Value="..\..\xmlrpc_formatter.pas"/>
<UnitName Value="xmlrpc_formatter"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="28"/>
<UsageCount Value="8"/>
<UsageCount Value="7"/>
</Unit17>
<Unit18>
<Filename Value="..\..\server_service_xmlrpc.pas"/>
@ -194,7 +192,7 @@
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<EditorIndex Value="7"/>
<UsageCount Value="25"/>
<UsageCount Value="33"/>
<Loaded Value="True"/>
</Unit18>
<Unit19>
@ -203,7 +201,7 @@
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<EditorIndex Value="13"/>
<UsageCount Value="23"/>
<UsageCount Value="31"/>
<Loaded Value="True"/>
</Unit19>
<Unit20>
@ -212,7 +210,7 @@
<CursorPos X="18" Y="21"/>
<TopLine Value="1"/>
<EditorIndex Value="11"/>
<UsageCount Value="23"/>
<UsageCount Value="31"/>
<Loaded Value="True"/>
</Unit20>
<Unit21>
@ -220,107 +218,109 @@
<UnitName Value="IdSocketHandle"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="8"/>
<UsageCount Value="7"/>
</Unit21>
<Unit22>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\others_package\indy\indy-10.2.0.1\lazarus\IdAboutVCL.pas"/>
<UnitName Value="IdAboutVCL"/>
<CursorPos X="19" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="9"/>
<UsageCount Value="8"/>
</Unit22>
<Unit23>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\others_package\indy\indy-10.2.0.1\fpc\System\IdGlobal.pas"/>
<UnitName Value="IdGlobal"/>
<CursorPos X="59" Y="982"/>
<TopLine Value="981"/>
<UsageCount Value="9"/>
<UsageCount Value="8"/>
</Unit23>
<Unit24>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\rtl\inc\systemh.inc"/>
<CursorPos X="12" Y="852"/>
<TopLine Value="871"/>
<UsageCount Value="10"/>
<CursorPos X="21" Y="208"/>
<TopLine Value="193"/>
<EditorIndex Value="24"/>
<UsageCount Value="17"/>
<Loaded Value="True"/>
</Unit24>
<Unit25>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\rtl\inc\innr.inc"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="42"/>
<UsageCount Value="9"/>
<UsageCount Value="8"/>
</Unit25>
<Unit26>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\rtl\i386\fastmove.inc"/>
<CursorPos X="11" Y="835"/>
<TopLine Value="821"/>
<UsageCount Value="10"/>
<UsageCount Value="9"/>
</Unit26>
<Unit27>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\rtl\inc\system.inc"/>
<CursorPos X="11" Y="306"/>
<TopLine Value="285"/>
<EditorIndex Value="5"/>
<UsageCount Value="17"/>
<UsageCount Value="25"/>
<Loaded Value="True"/>
</Unit27>
<Unit28>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\rtl\inc\generic.inc"/>
<CursorPos X="5" Y="1289"/>
<TopLine Value="1"/>
<UsageCount Value="16"/>
<UsageCount Value="15"/>
</Unit28>
<Unit29>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\rtl\inc\system.fpd"/>
<CursorPos X="22" Y="17"/>
<TopLine Value="1"/>
<UsageCount Value="9"/>
<UsageCount Value="8"/>
</Unit29>
<Unit30>
<Filename Value="..\..\wst_fpc_xml.pas"/>
<UnitName Value="wst_fpc_xml"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<EditorIndex Value="2"/>
<UsageCount Value="16"/>
<EditorIndex Value="3"/>
<UsageCount Value="24"/>
<Loaded Value="True"/>
</Unit30>
<Unit31>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\rtl\objpas\sysutils\sysstrh.inc"/>
<CursorPos X="11" Y="66"/>
<TopLine Value="52"/>
<EditorIndex Value="1"/>
<UsageCount Value="16"/>
<EditorIndex Value="2"/>
<UsageCount Value="24"/>
<Loaded Value="True"/>
</Unit31>
<Unit32>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\rtl\objpas\sysutils\sysstr.inc"/>
<CursorPos X="6" Y="44"/>
<TopLine Value="30"/>
<UsageCount Value="9"/>
<UsageCount Value="8"/>
</Unit32>
<Unit33>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\rtl\win\sysosh.inc"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="51"/>
<UsageCount Value="9"/>
<UsageCount Value="8"/>
</Unit33>
<Unit34>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\rtl\inc\objpash.inc"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="322"/>
<UsageCount Value="9"/>
<UsageCount Value="8"/>
</Unit34>
<Unit35>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\rtl\inc\varianth.inc"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="9"/>
<UsageCount Value="8"/>
</Unit35>
<Unit36>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\rtl\inc\rtti.inc"/>
<CursorPos X="21" Y="77"/>
<TopLine Value="77"/>
<TopLine Value="5"/>
<EditorIndex Value="6"/>
<UsageCount Value="16"/>
<UsageCount Value="24"/>
<Loaded Value="True"/>
</Unit36>
<Unit37>
@ -329,7 +329,7 @@
<CursorPos X="26" Y="13"/>
<TopLine Value="1"/>
<EditorIndex Value="9"/>
<UsageCount Value="12"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
</Unit37>
<Unit38>
@ -338,18 +338,113 @@
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<EditorIndex Value="10"/>
<UsageCount Value="12"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
</Unit38>
<Unit39>
<Filename Value="..\user_service_intf.wst"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="10"/>
<UsageCount Value="9"/>
<SyntaxHighlighter Value="None"/>
</Unit39>
<Unit40>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\packages\fcl-xml\src\dom.pp"/>
<UnitName Value="DOM"/>
<CursorPos X="42" Y="228"/>
<TopLine Value="215"/>
<UsageCount Value="17"/>
</Unit40>
<Unit41>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\rtl\objpas\typinfo.pp"/>
<UnitName Value="typinfo"/>
<CursorPos X="46" Y="371"/>
<TopLine Value="366"/>
<EditorIndex Value="23"/>
<UsageCount Value="18"/>
<Loaded Value="True"/>
</Unit41>
<Unit42>
<Filename Value="..\user_service_intf_proxy.pas"/>
<UnitName Value="user_service_intf_proxy"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<EditorIndex Value="18"/>
<UsageCount Value="17"/>
<Loaded Value="True"/>
</Unit42>
<Unit43>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\others_package\indy\indy-10.2.0.1\fpc\Protocols\IdCustomHTTPServer.pas"/>
<UnitName Value="IdCustomHTTPServer"/>
<CursorPos X="14" Y="252"/>
<TopLine Value="239"/>
<UsageCount Value="11"/>
</Unit43>
<Unit44>
<Filename Value="..\..\type_lib_edtr\uabout.pas"/>
<ComponentName Value="fAbout"/>
<HasResources Value="True"/>
<ResourceFilename Value="..\..\type_lib_edtr\uabout.lrs"/>
<UnitName Value="uabout"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="11"/>
</Unit44>
<Unit45>
<Filename Value="..\..\type_lib_edtr\uwsttypelibraryedit.pas"/>
<ComponentName Value="fWstTypeLibraryEdit"/>
<HasResources Value="True"/>
<UnitName Value="uwsttypelibraryedit"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="10"/>
</Unit45>
<Unit46>
<Filename Value="..\..\ide\lazarus\wstimportdlg.pas"/>
<ComponentName Value="formImport"/>
<HasResources Value="True"/>
<ResourceFilename Value="..\..\ide\lazarus\wstimportdlg.lrs"/>
<UnitName Value="wstimportdlg"/>
<CursorPos X="27" Y="7"/>
<TopLine Value="1"/>
<UsageCount Value="11"/>
</Unit46>
<Unit47>
<Filename Value="..\..\indy_http_server.pas"/>
<UnitName Value="indy_http_server"/>
<CursorPos X="20" Y="20"/>
<TopLine Value="8"/>
<EditorIndex Value="1"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit47>
</Units>
<JumpHistory Count="0" HistoryIndex="-1"/>
<JumpHistory Count="6" HistoryIndex="5">
<Position1>
<Filename Value="..\..\indy_http_server.pas"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position1>
<Position2>
<Filename Value="..\..\indy_http_server.pas"/>
<Caret Line="160" Column="20" TopLine="147"/>
</Position2>
<Position3>
<Filename Value="..\..\indy_http_server.pas"/>
<Caret Line="1" Column="1" TopLine="28"/>
</Position3>
<Position4>
<Filename Value="..\..\indy_http_server.pas"/>
<Caret Line="102" Column="11" TopLine="84"/>
</Position4>
<Position5>
<Filename Value="..\..\indy_http_server.pas"/>
<Caret Line="359" Column="76" TopLine="346"/>
</Position5>
<Position6>
<Filename Value="..\..\indy_http_server.pas"/>
<Caret Line="20" Column="5" TopLine="1"/>
</Position6>
</JumpHistory>
</ProjectOptions>
<CompilerOptions>
<Version Value="5"/>
@ -372,6 +467,7 @@
<Generate Value="Faster"/>
</CodeGeneration>
<Other>
<CustomOptions Value="-dINDY_10"/>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>

View File

@ -7,7 +7,7 @@ uses
cthreads,
{$ENDIF}{$ENDIF}
Classes, SysUtils,
app_object, metadata_service, logger_extension;
indy_http_server, metadata_service, logger_extension;
var

View File

@ -10,15 +10,17 @@
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
}
{$INCLUDE wst_global.inc}
unit logger_extension;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, base_service_intf, server_service_intf;
{$INCLUDE wst.inc}
{$INCLUDE wst_delphi.inc}
type
{ TLoggerServiceExtension }

View File

@ -12,7 +12,7 @@
<MainUnit Value="0"/>
<IconPath Value=".\"/>
<TargetFileExt Value=".exe"/>
<ActiveEditorIndexAtStart Value="13"/>
<ActiveEditorIndexAtStart Value="2"/>
</General>
<VersionInfo>
<ProjectVersion Value=""/>
@ -35,7 +35,7 @@
<Filename Value="user_client_console.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="user_client_console"/>
<CursorPos X="64" Y="30"/>
<CursorPos X="15" Y="9"/>
<TopLine Value="1"/>
<EditorIndex Value="0"/>
<UsageCount Value="64"/>
@ -46,7 +46,7 @@
<UnitName Value="user_service_intf_proxy"/>
<CursorPos X="74" Y="12"/>
<TopLine Value="1"/>
<EditorIndex Value="7"/>
<EditorIndex Value="9"/>
<UsageCount Value="30"/>
<Loaded Value="True"/>
</Unit1>
@ -54,8 +54,8 @@
<Filename Value="..\..\synapse_tcp_protocol.pas"/>
<UnitName Value="synapse_tcp_protocol"/>
<CursorPos X="29" Y="132"/>
<TopLine Value="101"/>
<EditorIndex Value="13"/>
<TopLine Value="5"/>
<EditorIndex Value="15"/>
<UsageCount Value="32"/>
<Loaded Value="True"/>
</Unit2>
@ -71,7 +71,7 @@
<UnitName Value="user_service_intf"/>
<CursorPos X="53" Y="11"/>
<TopLine Value="1"/>
<EditorIndex Value="2"/>
<EditorIndex Value="4"/>
<UsageCount Value="29"/>
<Loaded Value="True"/>
</Unit4>
@ -87,7 +87,7 @@
<UnitName Value="base_service_intf"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<EditorIndex Value="4"/>
<EditorIndex Value="6"/>
<UsageCount Value="32"/>
<Loaded Value="True"/>
</Unit6>
@ -96,7 +96,7 @@
<UnitName Value="library_protocol"/>
<CursorPos X="1" Y="13"/>
<TopLine Value="1"/>
<EditorIndex Value="5"/>
<EditorIndex Value="7"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
</Unit7>
@ -140,9 +140,11 @@
<Unit14>
<Filename Value="..\..\synapse_http_protocol.pas"/>
<UnitName Value="synapse_http_protocol"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="22"/>
<CursorPos X="19" Y="16"/>
<TopLine Value="3"/>
<EditorIndex Value="2"/>
<UsageCount Value="14"/>
<Loaded Value="True"/>
</Unit14>
<Unit15>
<Filename Value="..\..\metadata_repository.pas"/>
@ -180,9 +182,11 @@
<Unit20>
<Filename Value="..\..\soap_formatter.pas"/>
<UnitName Value="soap_formatter"/>
<CursorPos X="21" Y="42"/>
<TopLine Value="46"/>
<CursorPos X="8" Y="96"/>
<TopLine Value="83"/>
<EditorIndex Value="1"/>
<UsageCount Value="17"/>
<Loaded Value="True"/>
</Unit20>
<Unit21>
<Filename Value="..\..\xmlrpc_formatter.pas"/>
@ -190,7 +194,7 @@
<UnitName Value="xmlrpc_formatter"/>
<CursorPos X="25" Y="72"/>
<TopLine Value="65"/>
<EditorIndex Value="6"/>
<EditorIndex Value="8"/>
<UsageCount Value="50"/>
<Loaded Value="True"/>
</Unit21>
@ -199,7 +203,7 @@
<UnitName Value="binary_formatter"/>
<CursorPos X="20" Y="21"/>
<TopLine Value="1"/>
<EditorIndex Value="9"/>
<EditorIndex Value="11"/>
<UsageCount Value="25"/>
<Loaded Value="True"/>
</Unit22>
@ -214,7 +218,7 @@
<UnitName Value="base_xmlrpc_formatter"/>
<CursorPos X="20" Y="1346"/>
<TopLine Value="1326"/>
<EditorIndex Value="8"/>
<EditorIndex Value="10"/>
<UsageCount Value="25"/>
<Loaded Value="True"/>
</Unit24>
@ -223,7 +227,7 @@
<UnitName Value="base_soap_formatter"/>
<CursorPos X="56" Y="334"/>
<TopLine Value="319"/>
<EditorIndex Value="3"/>
<EditorIndex Value="5"/>
<UsageCount Value="24"/>
<Loaded Value="True"/>
</Unit25>
@ -259,7 +263,7 @@
<UnitName Value="imp_utils"/>
<CursorPos X="26" Y="13"/>
<TopLine Value="1"/>
<EditorIndex Value="1"/>
<EditorIndex Value="3"/>
<UsageCount Value="15"/>
<Loaded Value="True"/>
</Unit30>
@ -268,7 +272,7 @@
<UnitName Value="wst_fpc_xml"/>
<CursorPos X="34" Y="67"/>
<TopLine Value="54"/>
<EditorIndex Value="11"/>
<EditorIndex Value="13"/>
<UsageCount Value="15"/>
<Loaded Value="True"/>
</Unit31>
@ -284,7 +288,7 @@
<UnitName Value="base_binary_formatter"/>
<CursorPos X="35" Y="1496"/>
<TopLine Value="1483"/>
<EditorIndex Value="10"/>
<EditorIndex Value="12"/>
<UsageCount Value="14"/>
<Loaded Value="True"/>
</Unit33>
@ -293,133 +297,12 @@
<UnitName Value="DOM"/>
<CursorPos X="14" Y="287"/>
<TopLine Value="274"/>
<EditorIndex Value="12"/>
<EditorIndex Value="14"/>
<UsageCount Value="11"/>
<Loaded Value="True"/>
</Unit34>
</Units>
<JumpHistory Count="30" HistoryIndex="29">
<Position1>
<Filename Value="..\..\wst_fpc_xml.pas"/>
<Caret Line="67" Column="34" TopLine="54"/>
</Position1>
<Position2>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\packages\fcl-xml\src\dom.pp"/>
<Caret Line="304" Column="36" TopLine="298"/>
</Position2>
<Position3>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\packages\fcl-xml\src\dom.pp"/>
<Caret Line="249" Column="54" TopLine="236"/>
</Position3>
<Position4>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\packages\fcl-xml\src\dom.pp"/>
<Caret Line="320" Column="63" TopLine="307"/>
</Position4>
<Position5>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\packages\fcl-xml\src\dom.pp"/>
<Caret Line="345" Column="58" TopLine="332"/>
</Position5>
<Position6>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\packages\fcl-xml\src\dom.pp"/>
<Caret Line="347" Column="60" TopLine="334"/>
</Position6>
<Position7>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\packages\fcl-xml\src\dom.pp"/>
<Caret Line="449" Column="66" TopLine="436"/>
</Position7>
<Position8>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\packages\fcl-xml\src\dom.pp"/>
<Caret Line="541" Column="58" TopLine="528"/>
</Position8>
<Position9>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\packages\fcl-xml\src\dom.pp"/>
<Caret Line="543" Column="62" TopLine="530"/>
</Position9>
<Position10>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\packages\fcl-xml\src\dom.pp"/>
<Caret Line="544" Column="62" TopLine="531"/>
</Position10>
<Position11>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\packages\fcl-xml\src\dom.pp"/>
<Caret Line="546" Column="66" TopLine="533"/>
</Position11>
<Position12>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\packages\fcl-xml\src\dom.pp"/>
<Caret Line="548" Column="58" TopLine="535"/>
</Position12>
<Position13>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\packages\fcl-xml\src\dom.pp"/>
<Caret Line="968" Column="3" TopLine="966"/>
</Position13>
<Position14>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\packages\fcl-xml\src\dom.pp"/>
<Caret Line="1357" Column="75" TopLine="1344"/>
</Position14>
<Position15>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\packages\fcl-xml\src\dom.pp"/>
<Caret Line="1360" Column="22" TopLine="1347"/>
</Position15>
<Position16>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\packages\fcl-xml\src\dom.pp"/>
<Caret Line="1465" Column="71" TopLine="1452"/>
</Position16>
<Position17>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\packages\fcl-xml\src\dom.pp"/>
<Caret Line="1532" Column="74" TopLine="1519"/>
</Position17>
<Position18>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\packages\fcl-xml\src\dom.pp"/>
<Caret Line="1862" Column="75" TopLine="1849"/>
</Position18>
<Position19>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\packages\fcl-xml\src\dom.pp"/>
<Caret Line="1864" Column="65" TopLine="1851"/>
</Position19>
<Position20>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\packages\fcl-xml\src\dom.pp"/>
<Caret Line="2038" Column="66" TopLine="2025"/>
</Position20>
<Position21>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\packages\fcl-xml\src\dom.pp"/>
<Caret Line="2045" Column="63" TopLine="2032"/>
</Position21>
<Position22>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\packages\fcl-xml\src\dom.pp"/>
<Caret Line="2074" Column="12" TopLine="2061"/>
</Position22>
<Position23>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\packages\fcl-xml\src\dom.pp"/>
<Caret Line="2104" Column="70" TopLine="2091"/>
</Position23>
<Position24>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\packages\fcl-xml\src\dom.pp"/>
<Caret Line="2107" Column="65" TopLine="2094"/>
</Position24>
<Position25>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\packages\fcl-xml\src\dom.pp"/>
<Caret Line="2148" Column="74" TopLine="2135"/>
</Position25>
<Position26>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\packages\fcl-xml\src\dom.pp"/>
<Caret Line="2150" Column="65" TopLine="2137"/>
</Position26>
<Position27>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\packages\fcl-xml\src\dom.pp"/>
<Caret Line="2159" Column="66" TopLine="2146"/>
</Position27>
<Position28>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\packages\fcl-xml\src\dom.pp"/>
<Caret Line="2171" Column="22" TopLine="2170"/>
</Position28>
<Position29>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\packages\fcl-xml\src\dom.pp"/>
<Caret Line="2172" Column="26" TopLine="2158"/>
</Position29>
<Position30>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\packages\fcl-xml\src\dom.pp"/>
<Caret Line="258" Column="23" TopLine="245"/>
</Position30>
</JumpHistory>
<JumpHistory Count="0" HistoryIndex="-1"/>
</ProjectOptions>
<CompilerOptions>
<Version Value="5"/>

View File

@ -0,0 +1,200 @@
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
<PathDelim Value="\"/>
<Version Value="5"/>
<General>
<Flags>
<MainUnitHasUsesSectionForAllUnits Value="False"/>
<MainUnitHasCreateFormStatements Value="False"/>
<MainUnitHasTitleStatement Value="False"/>
</Flags>
<MainUnit Value="0"/>
<IconPath Value="./"/>
<TargetFileExt Value=".exe"/>
<ActiveEditorIndexAtStart Value="0"/>
</General>
<VersionInfo>
<ProjectVersion Value=""/>
<Language Value=""/>
<CharSet Value=""/>
</VersionInfo>
<PublishOptions>
<Version Value="2"/>
<IgnoreBinaries Value="False"/>
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
</local>
</RunParams>
<Units Count="5">
<Unit0>
<Filename Value="readbuffer_sample.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="readbuffer_sample"/>
<CursorPos X="1" Y="27"/>
<TopLine Value="6"/>
<EditorIndex Value="0"/>
<UsageCount Value="25"/>
<Loaded Value="True"/>
</Unit0>
<Unit1>
<Filename Value="user_service_intf.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="user_service_intf"/>
<CursorPos X="1" Y="27"/>
<TopLine Value="23"/>
<EditorIndex Value="2"/>
<UsageCount Value="25"/>
<Loaded Value="True"/>
</Unit1>
<Unit2>
<Filename Value="user_service_intf_proxy.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="user_service_intf_proxy"/>
<CursorPos X="71" Y="12"/>
<TopLine Value="10"/>
<EditorIndex Value="4"/>
<UsageCount Value="25"/>
<Loaded Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\..\base_service_intf.pas"/>
<UnitName Value="base_service_intf"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<EditorIndex Value="3"/>
<UsageCount Value="12"/>
<Loaded Value="True"/>
</Unit3>
<Unit4>
<Filename Value="..\..\synapse_tcp_protocol.pas"/>
<UnitName Value="synapse_tcp_protocol"/>
<CursorPos X="12" Y="29"/>
<TopLine Value="16"/>
<EditorIndex Value="1"/>
<UsageCount Value="12"/>
<Loaded Value="True"/>
</Unit4>
</Units>
<JumpHistory Count="16" HistoryIndex="15">
<Position1>
<Filename Value="user_service_intf_proxy.pas"/>
<Caret Line="12" Column="71" TopLine="10"/>
</Position1>
<Position2>
<Filename Value="user_service_intf.pas"/>
<Caret Line="27" Column="25" TopLine="17"/>
</Position2>
<Position3>
<Filename Value="user_service_intf.pas"/>
<Caret Line="29" Column="21" TopLine="14"/>
</Position3>
<Position4>
<Filename Value="user_service_intf.pas"/>
<Caret Line="299" Column="8" TopLine="270"/>
</Position4>
<Position5>
<Filename Value="user_service_intf.pas"/>
<Caret Line="50" Column="38" TopLine="35"/>
</Position5>
<Position6>
<Filename Value="..\..\base_service_intf.pas"/>
<Caret Line="317" Column="40" TopLine="301"/>
</Position6>
<Position7>
<Filename Value="..\..\base_service_intf.pas"/>
<Caret Line="304" Column="40" TopLine="288"/>
</Position7>
<Position8>
<Filename Value="user_service_intf.pas"/>
<Caret Line="52" Column="3" TopLine="50"/>
</Position8>
<Position9>
<Filename Value="..\..\synapse_tcp_protocol.pas"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position9>
<Position10>
<Filename Value="..\..\synapse_tcp_protocol.pas"/>
<Caret Line="29" Column="12" TopLine="13"/>
</Position10>
<Position11>
<Filename Value="readbuffer_sample.pas"/>
<Caret Line="269" Column="1" TopLine="237"/>
</Position11>
<Position12>
<Filename Value="readbuffer_sample.pas"/>
<Caret Line="27" Column="44" TopLine="14"/>
</Position12>
<Position13>
<Filename Value="..\..\base_service_intf.pas"/>
<Caret Line="4431" Column="1" TopLine="4386"/>
</Position13>
<Position14>
<Filename Value="user_service_intf.pas"/>
<Caret Line="273" Column="1" TopLine="267"/>
</Position14>
<Position15>
<Filename Value="readbuffer_sample.pas"/>
<Caret Line="58" Column="18" TopLine="46"/>
</Position15>
<Position16>
<Filename Value="readbuffer_sample.pas"/>
<Caret Line="46" Column="11" TopLine="22"/>
</Position16>
</JumpHistory>
</ProjectOptions>
<CompilerOptions>
<Version Value="5"/>
<PathDelim Value="\"/>
<SearchPaths>
<OtherUnitFiles Value="..\;..\..\;$(LazarusDir)\others_package\synapse\"/>
</SearchPaths>
<CodeGeneration>
<Generate Value="Faster"/>
</CodeGeneration>
<Other>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>
<Debugging>
<BreakPoints Count="4">
<Item1>
<Source Value="D:\lazarusClean\fpcsrc\rtl\inc\getopts.pp"/>
<Line Value="230"/>
</Item1>
<Item2>
<Source Value="D:\lazarusClean\fpcsrc\rtl\inc\getopts.pp"/>
<Line Value="193"/>
</Item2>
<Item3>
<Source Value="D:\lazarusClean\fpcsrc\rtl\inc\getopts.pp"/>
<Line Value="198"/>
</Item3>
<Item4>
<Source Value="..\..\ws_helper\wsdl2pas_imp.pas"/>
<Line Value="606"/>
</Item4>
</BreakPoints>
<Watches Count="2">
<Item1>
<Expression Value="locStrFilter"/>
</Item1>
<Item2>
<Expression Value="i"/>
</Item2>
</Watches>
<Exceptions Count="2">
<Item1>
<Name Value="ECodetoolError"/>
</Item1>
<Item2>
<Name Value="EFOpenError"/>
</Item2>
</Exceptions>
</Debugging>
</CONFIG>

View File

@ -0,0 +1,269 @@
program readbuffer_sample;
{$mode objfpc}{$H+}
uses
Classes, SysUtils, TypInfo,
user_service_intf_proxy,
synapse_tcp_protocol, synapse_http_protocol, library_protocol,
soap_formatter, binary_formatter,
user_service_intf, xmlrpc_formatter;
type
TUser = TUser_Type;
TUserCategory = TUserCategory_Type;
var
UserServiceInst : UserService;
procedure ShowUser(AUser : TUser);
begin
if ( AUser <> nil ) then begin
WriteLn(' Name = ',AUser.UserName);
WriteLn(' Category = ',GetEnumName(TypeInfo(TUserCategory),Ord(AUser.Category)));
WriteLn(' e-Mail = ',AUser.eMail);
WriteLn(' Preferences = ',AUser.Preferences);
WriteLn(' Note = ',AUser.Note.Data);
{WriteLn(' Author = ',AUser.Note.Author);
WriteLn(' Date = ',AUser.Note.Date);}
end else begin
WriteLn('<Empty User>');
end;
end;
procedure ShowUserArray(AArray : TUserArray);
var
i, c : Integer;
usr : TUser;
begin
if ( AArray <> nil ) then begin
c := AArray.Length;
for i := 0 to Pred(c) do begin
usr := AArray[i];
WriteLn();
WriteLn(Format('User[%d] : ',[(i+1)]));
ShowUser(usr);
end;
end;
end;
procedure HandleShowAll();
var
userArray : TUserArray;
begin
userArray := UserServiceInst.GetList();
try
if ( userArray <> nil ) and ( userArray.Length > 0 ) then begin
ShowUserArray(userArray);
end else begin
WriteLn('Empty Array.');
end;
finally
FreeAndNil(userArray);
end;
end;
type TAddType = ( atAdd, atUpdate );
procedure HandleAdd(const AType :TAddType);
const CAPTIONS : array[TAddType] of string = ( 'Adding a user :', 'Updating a user :' );
function ReadItem(const APrompt : string; const ANonNull : Boolean):string ;
begin
Result := '';
Write(APrompt);
ReadLn(Result);
Result := Trim(Result);
if ANonNull and ( Length(Result) = 0 ) then
Raise Exception.Create('Invalid User Name!');
end;
var
usr : TUser;
buff : string;
begin
buff := '';
WriteLn(CAPTIONS[AType]);
try
usr := TUser.Create();
try
usr.UserName := ReadItem('Enter user name : ',True);
buff := UpperCase(ReadItem('Enter user Category( A : Admin; N : normal ) : ',True));
if ( buff[1] = 'A' ) then
usr.Category:= Admin
else
usr.Category:= Normal;
usr.eMail := ReadItem('Enter user e-mail : ',False);
usr.Preferences := ReadItem('Enter user Preferences : ',False);
buff := UpperCase(ReadItem('Do you want to add some notes : ',True));
if ( buff[1] = 'O' ) then begin
usr.Note.Data := ReadItem('Enter user Note : ',False);
{usr.Note.Author := ReadItem('Enter user Note.Author : ',False);
usr.Note.Date := ReadItem('Enter user Note.Date : ',False);}
end;
if ( AType = atUpdate ) then
UserServiceInst.Update(usr)
else
UserServiceInst.Add(usr);
finally
FreeAndNil(usr);
end;
except
on e : Exception do begin
WriteLn(e.Message);
end;
end;
end;
procedure HandleFindUser();
var
user : TUser;
buff : string;
begin
Write('Enter User Name : ');
ReadLn(buff);
user := UserServiceInst.Find(buff);
try
ShowUser(user);
finally
FreeAndNil(user);
end;
end;
procedure HandleDeleteUser();
var
buff : string;
begin
Write('Enter User Name : ');
ReadLn(buff);
UserServiceInst.Delete(buff);
end;
type
TTransportType = ( ttLibrary, ttTCP, ttHTTP );
TFormatType = ( ftBinary, ftSoap, ftXmlRPC );
var
TransportType : TTransportType;
FormatValue : TFormatType;
procedure CreateProxy();
const ADDRESS_MAP : array[TTransportType] of string = (
'LIB:FileName=..\library_server\lib_server.dll;target=UserService',
'TCP:Address=127.0.0.1;Port=1234;target=UserService',
//'http:Address=http://127.0.0.1:8080/wst/services/UserService/?format=soap'
'http:Address=http://127.0.0.1:8000/services/UserService'
);
FORMAT_MAP : array[TFormatType] of string =( 'binary', 'soap', 'xmlrpc' );
var
buff : string;
begin
if ( TransportType = ttHTTP ) then
buff := Format('%s/?format=%s',[ADDRESS_MAP[TransportType],FORMAT_MAP[FormatValue]])
else
buff := ADDRESS_MAP[TransportType];
if ( TransportType = ttLibrary ) then
buff := StringReplace(buff,'\',DirectorySeparator,[rfReplaceAll, rfIgnoreCase]);
UserServiceInst := TUserService_Proxy.Create(
'UserService',
FORMAT_MAP[FormatValue] + ':',
buff
);
end;
procedure ReadTransportType();
var
buff : string;
begin
WriteLn();
WriteLn('Select a transport protocol : ');
WriteLn(' L : Library, the lib_server project must have been built');
WriteLn(' T : TCP, the tcp_server must have been built');
WriteLn(' H : HTTP, the http_server must have been built');
WriteLn();
Write('Your selection : ');
while True do begin
ReadLn(buff);
buff := UpperCase(Trim(buff));
if ( Length(buff) > 0 ) and ( buff[1] in ['L','T', 'H'] ) then begin
case buff[1] of
'L' : TransportType := ttLibrary;
'T' : TransportType := ttTCP;
'H' : TransportType := ttHTTP;
end;
Break;
end;
end;
end;
procedure ReadFormatType();
var
buff : string;
begin
WriteLn();
WriteLn('Select a messaging format : ');
WriteLn(' B : binary ( binary_formatter.pas )');
WriteLn(' S : soap ( soap_formatter.pas )');
WriteLn(' X : XmlRpc ( xmlrpc_formatter.pas )');
WriteLn();
Write('Your selection : ');
while True do begin
ReadLn(buff);
buff := UpperCase(Trim(buff));
if ( Length(buff) > 0 ) and ( buff[1] in ['B','S', 'X'] ) then begin
case buff[1] of
'B' : FormatValue := ftBinary;
'S' : FormatValue := ftSoap;
'X' : FormatValue := ftXmlRPC;
end;
Break;
end;
end;
end;
var
strBuffer : string;
begin
SYNAPSE_RegisterTCP_Transport();
SYNAPSE_RegisterHTTP_Transport();
LIB_Register_Transport();
WriteLn('Sample Application using Web Services Toolkit');
ReadFormatType();
ReadTransportType();
CreateProxy();
WriteLn('Menu :');
WriteLn(' L : Show the user list');
WriteLn(' A : Add a new user');
WriteLn(' U : Update a user');
WriteLn(' D : Delete a user');
WriteLn(' F : Find a new');
WriteLn(' C : Change the communication protocol');
WriteLn(' Z : Change the messaging format');
WriteLn(' X : Exit');
WriteLn();
Write('Choose a item : ');
while True do begin
strBuffer := '';
ReadLn(strBuffer);
strBuffer := UpperCase(Trim(strBuffer));
if ( Length(strBuffer) > 0 ) then begin
case strBuffer[1] of
'L' : HandleShowAll();
'A' : HandleAdd(atAdd);
'U' : HandleAdd(atUpdate);
'D' : HandleDeleteUser();
'F' : HandleFindUser();
'C' :
begin
ReadTransportType();
CreateProxy();
end;
'Z' :
begin
ReadFormatType();
CreateProxy();
end;
'X' : Break;
end;
WriteLn();
Write('Choose a item : ');
end;
end;
end.

View File

@ -0,0 +1,271 @@
{
This unit has been produced by ws_helper.
Input unit name : "user_service_intf".
This unit name : "user_service_intf".
Date : "12/07/2007 11:50:48".
}
unit user_service_intf;
{$IFDEF FPC} {$mode objfpc}{$H+} {$ENDIF}
interface
uses SysUtils, Classes, TypInfo, base_service_intf, service_intf;
const
sNAME_SPACE = 'urn:UserService';
sUNIT_NAME = 'user_service_intf';
type
TUserArray = class;
TUser_Type = class;
TUserCategory_Type = (
Normal
,Admin
);
{ TUser_Type }
TUser_Type = class(TBaseComplexRemotable)
private
FCategory : TUserCategory_Type;
FUserName : string;
FeMail : string;
FPreferences : string;
FNote : TStringBufferRemotable;
public
constructor Create();override;
destructor Destroy();override;
published
property Category : TUserCategory_Type read FCategory write FCategory;
property UserName : string read FUserName write FUserName;
property eMail : string read FeMail write FeMail;
property Preferences : string read FPreferences write FPreferences;
property Note : TStringBufferRemotable read FNote write FNote;
end;
TUserArray = class(TBaseObjectArrayRemotable)
private
function GetItem(AIndex: Integer): TUser_Type;
public
class function GetItemClass():TBaseRemotableClass;override;
property Item[AIndex:Integer] : TUser_Type Read GetItem;Default;
end;
UserService = interface(IInvokable)
['{F49D8FA4-9BBC-4321-9869-5BA745070ABC}']
function GetList():TUserArray;
procedure Add(
const AUser : TUser_Type
);
procedure Update(
const AUser : TUser_Type
);
function Find(
const AName : string
):TUser_Type;
function Delete(
const AName : string
):boolean;
end;
procedure Register_user_service_intf_ServiceMetadata();
Implementation
uses metadata_repository;
{ TUserArray }
function TUserArray.GetItem(AIndex: Integer): TUser_Type;
begin
Result := Inherited GetItem(AIndex) As TUser_Type;
end;
class function TUserArray.GetItemClass(): TBaseRemotableClass;
begin
Result:= TUser_Type;
end;
procedure Register_user_service_intf_ServiceMetadata();
var
mm : IModuleMetadataMngr;
begin
mm := GetModuleMetadataMngr();
mm.SetRepositoryNameSpace(sUNIT_NAME, sNAME_SPACE);
mm.SetServiceCustomData(
sUNIT_NAME,
'UserService',
'TRANSPORT_Address',
'http://127.0.0.1:8000/services/UserService'
);
mm.SetServiceCustomData(
sUNIT_NAME,
'UserService',
'FORMAT_Style',
'rpc'
);
mm.SetOperationCustomData(
sUNIT_NAME,
'UserService',
'GetList',
'_E_N_',
'GetList'
);
mm.SetOperationCustomData(
sUNIT_NAME,
'UserService',
'GetList',
'TRANSPORT_soapAction',
'urn:UserService/UserServiceGetList'
);
mm.SetOperationCustomData(
sUNIT_NAME,
'UserService',
'GetList',
'FORMAT_Input_EncodingStyle',
'literal'
);
mm.SetOperationCustomData(
sUNIT_NAME,
'UserService',
'GetList',
'FORMAT_OutputEncodingStyle',
'literal'
);
mm.SetOperationCustomData(
sUNIT_NAME,
'UserService',
'Add',
'_E_N_',
'Add'
);
mm.SetOperationCustomData(
sUNIT_NAME,
'UserService',
'Add',
'TRANSPORT_soapAction',
'urn:UserService/UserServiceAdd'
);
mm.SetOperationCustomData(
sUNIT_NAME,
'UserService',
'Add',
'FORMAT_Input_EncodingStyle',
'literal'
);
mm.SetOperationCustomData(
sUNIT_NAME,
'UserService',
'Add',
'FORMAT_OutputEncodingStyle',
'literal'
);
mm.SetOperationCustomData(
sUNIT_NAME,
'UserService',
'Update',
'_E_N_',
'Update'
);
mm.SetOperationCustomData(
sUNIT_NAME,
'UserService',
'Update',
'TRANSPORT_soapAction',
'urn:UserService/UserServiceUpdate'
);
mm.SetOperationCustomData(
sUNIT_NAME,
'UserService',
'Update',
'FORMAT_Input_EncodingStyle',
'literal'
);
mm.SetOperationCustomData(
sUNIT_NAME,
'UserService',
'Update',
'FORMAT_OutputEncodingStyle',
'literal'
);
mm.SetOperationCustomData(
sUNIT_NAME,
'UserService',
'Find',
'_E_N_',
'Find'
);
mm.SetOperationCustomData(
sUNIT_NAME,
'UserService',
'Find',
'TRANSPORT_soapAction',
'urn:UserService/UserServiceFind'
);
mm.SetOperationCustomData(
sUNIT_NAME,
'UserService',
'Find',
'FORMAT_Input_EncodingStyle',
'literal'
);
mm.SetOperationCustomData(
sUNIT_NAME,
'UserService',
'Find',
'FORMAT_OutputEncodingStyle',
'literal'
);
mm.SetOperationCustomData(
sUNIT_NAME,
'UserService',
'Delete',
'_E_N_',
'Delete'
);
mm.SetOperationCustomData(
sUNIT_NAME,
'UserService',
'Delete',
'TRANSPORT_soapAction',
'urn:UserService/UserServiceDelete'
);
mm.SetOperationCustomData(
sUNIT_NAME,
'UserService',
'Delete',
'FORMAT_Input_EncodingStyle',
'literal'
);
mm.SetOperationCustomData(
sUNIT_NAME,
'UserService',
'Delete',
'FORMAT_OutputEncodingStyle',
'literal'
);
end;
{ TUser_Type }
constructor TUser_Type.Create( );
begin
inherited Create( );
FNote := TStringBufferRemotable.Create();
end;
destructor TUser_Type.Destroy( );
begin
FreeAndNil(FNote);
inherited Destroy( );
end;
initialization
GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(TUserCategory_Type),'TUserCategory');
GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(TUser_Type),'TUser');
GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(TUserArray),'TUserArray');
GetTypeRegistry().ItemByTypeInfo[TypeInfo(TUserArray)].RegisterExternalPropertyName(sARRAY_ITEM,'item');
End.

View File

@ -0,0 +1,89 @@
<?xml version="1.0"?>
<definitions name="urn:UserService" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="urn:UserService" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="urn:UserService">
<types>
<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:UserService">
<xsd:complexType name="TUserArray">
<xsd:sequence><xsd:element name="item" type="tns:TUser" maxOccurs="unbounded" minOccurs="0"/></xsd:sequence>
</xsd:complexType>
<xsd:complexType name="TUser">
<xsd:sequence>
<xsd:element name="Category" type="tns:TUserCategory" maxOccurs="1" minOccurs="1"/>
<xsd:element name="UserName" type="xsd:string" maxOccurs="1" minOccurs="1"/>
<xsd:element name="eMail" type="xsd:string" maxOccurs="1" minOccurs="1"/>
<xsd:element name="Preferences" type="xsd:string" maxOccurs="1" minOccurs="1"/>
<xsd:element name="Note" type="xsd:string" maxOccurs="1" minOccurs="1"/>
</xsd:sequence>
</xsd:complexType>
<xsd:simpleType name="TUserCategory">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="Normal"/>
<xsd:enumeration value="Admin"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>
</types>
<message name="GetList"/>
<message name="GetListResponse"><part name="result" type="tns:TUserArray"/></message>
<message name="Add"><part name="AUser" type="tns:TUser"/></message>
<message name="AddResponse"/>
<message name="Update"><part name="AUser" type="tns:TUser"/></message>
<message name="UpdateResponse"/>
<message name="Find"><part name="AName" type="xsd:string"/></message>
<message name="FindResponse"><part name="result" type="tns:TUser"/></message>
<message name="Delete"><part name="AName" type="xsd:string"/></message>
<message name="DeleteResponse"><part name="result" type="xsd:boolean"/></message>
<portType name="UserService">
<document><GUID value="{F49D8FA4-9BBC-4321-9869-5BA745070ABC}"/></document>
<operation name="GetList">
<input message="tns:GetList"/>
<output message="tns:GetListResponse"/>
</operation>
<operation name="Add">
<input message="tns:Add"/>
<output message="tns:AddResponse"/>
</operation>
<operation name="Update">
<input message="tns:Update"/>
<output message="tns:UpdateResponse"/>
</operation>
<operation name="Find">
<input message="tns:Find"/>
<output message="tns:FindResponse"/>
</operation>
<operation name="Delete">
<input message="tns:Delete"/>
<output message="tns:DeleteResponse"/>
</operation>
</portType>
<binding name="UserServiceBinding" type="tns:UserService">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="GetList">
<soap:operation soapAction="urn:UserService/UserServiceGetList"/>
<input><soap:body use="literal" namespace="urn:UserService"/></input>
<output><soap:body use="literal" namespace="urn:UserService"/></output>
</operation>
<operation name="Add">
<soap:operation soapAction="urn:UserService/UserServiceAdd"/>
<input><soap:body use="literal" namespace="urn:UserService"/></input>
<output><soap:body use="literal" namespace="urn:UserService"/></output>
</operation>
<operation name="Update">
<soap:operation soapAction="urn:UserService/UserServiceUpdate"/>
<input><soap:body use="literal" namespace="urn:UserService"/></input>
<output><soap:body use="literal" namespace="urn:UserService"/></output>
</operation>
<operation name="Find">
<soap:operation soapAction="urn:UserService/UserServiceFind"/>
<input><soap:body use="literal" namespace="urn:UserService"/></input>
<output><soap:body use="literal" namespace="urn:UserService"/></output>
</operation>
<operation name="Delete">
<soap:operation soapAction="urn:UserService/UserServiceDelete"/>
<input><soap:body use="literal" namespace="urn:UserService"/></input>
<output><soap:body use="literal" namespace="urn:UserService"/></output>
</operation>
</binding>
<service name="UserService">
<port name="UserServicePort" binding="tns:UserServiceBinding"><soap:address location="http://127.0.0.1:8000/services/UserService"/></port>
</service>
</definitions>

View File

@ -0,0 +1,9 @@
GetWSTResourceManager().AddResource('USER_SERVICE_INTF',
#0#0#0#20'WST_METADATA_0.2.2.0'#0#0#0#17'user_service_intf'#1#0#0#0#11'UserS'
+'ervice'#5#0#0#0#7'GetList'#1#0#0#0#6'result'#0#0#0#10'TUserArray'#0#0#0#0#0
+#0#0#3#0#0#0#3'Add'#1#0#0#0#5'AUser'#0#0#0#5'TUser'#0#0#0#0#0#0#0#1#0#0#0#6'U'
+'pdate'#1#0#0#0#5'AUser'#0#0#0#5'TUser'#0#0#0#0#0#0#0#1#0#0#0#4'Find'#2#0#0#0
+#5'AName'#0#0#0#6'string'#0#0#0#0#0#0#0#1#0#0#0#6'result'#0#0#0#5'TUser'#0#0
+#0#0#0#0#0#3#0#0#0#6'Delete'#2#0#0#0#5'AName'#0#0#0#6'string'#0#0#0#0#0#0#0#1
+#0#0#0#6'result'#0#0#0#7'boolean'#0#0#0#0#0#0#0#3''
);

View File

@ -0,0 +1,175 @@
{
This unit has been produced by ws_helper.
Input unit name : "user_service_intf".
This unit name : "user_service_intf_proxy".
Date : "12/07/2007 11:50:48".
}
Unit user_service_intf_proxy;
{$IFDEF FPC} {$mode objfpc}{$H+} {$ENDIF}
Interface
Uses SysUtils, Classes, TypInfo, base_service_intf, service_intf, user_service_intf;
Type
TUserService_Proxy=class(TBaseProxy,UserService)
Protected
class function GetServiceType() : PTypeInfo;override;
function GetList():TUserArray;
procedure Add(
const AUser : TUser_Type
);
procedure Update(
const AUser : TUser_Type
);
function Find(
const AName : string
):TUser_Type;
function Delete(
const AName : string
):boolean;
End;
Function wst_CreateInstance_UserService(const AFormat : string = 'SOAP:'; const ATransport : string = 'HTTP:'):UserService;
Implementation
uses wst_resources_imp, metadata_repository;
Function wst_CreateInstance_UserService(const AFormat : string; const ATransport : string):UserService;
Begin
Result := TUserService_Proxy.Create('UserService',AFormat+GetServiceDefaultFormatProperties(TypeInfo(UserService)),ATransport + 'address=' + GetServiceDefaultAddress(TypeInfo(UserService)));
End;
{ TUserService_Proxy implementation }
class function TUserService_Proxy.GetServiceType() : PTypeInfo;
begin
result := TypeInfo(UserService);
end;
function TUserService_Proxy.GetList():TUserArray;
Var
locSerializer : IFormatterClient;
strPrmName : string;
Begin
locSerializer := GetSerializer();
Try
locSerializer.BeginCall('GetList', GetTarget(),(Self as ICallContext));
locSerializer.EndCall();
MakeCall();
locSerializer.BeginCallRead((Self as ICallContext));
TObject(Result) := Nil;
strPrmName := 'result';
locSerializer.Get(TypeInfo(TUserArray), strPrmName, Result);
Finally
locSerializer.Clear();
End;
End;
procedure TUserService_Proxy.Add(
const AUser : TUser_Type
);
Var
locSerializer : IFormatterClient;
strPrmName : string;
Begin
locSerializer := GetSerializer();
Try
locSerializer.BeginCall('Add', GetTarget(),(Self as ICallContext));
locSerializer.Put('AUser', TypeInfo(TUser_Type), AUser);
locSerializer.EndCall();
MakeCall();
locSerializer.BeginCallRead((Self as ICallContext));
Finally
locSerializer.Clear();
End;
End;
procedure TUserService_Proxy.Update(
const AUser : TUser_Type
);
Var
locSerializer : IFormatterClient;
strPrmName : string;
Begin
locSerializer := GetSerializer();
Try
locSerializer.BeginCall('Update', GetTarget(),(Self as ICallContext));
locSerializer.Put('AUser', TypeInfo(TUser_Type), AUser);
locSerializer.EndCall();
MakeCall();
locSerializer.BeginCallRead((Self as ICallContext));
Finally
locSerializer.Clear();
End;
End;
function TUserService_Proxy.Find(
const AName : string
):TUser_Type;
Var
locSerializer : IFormatterClient;
strPrmName : string;
Begin
locSerializer := GetSerializer();
Try
locSerializer.BeginCall('Find', GetTarget(),(Self as ICallContext));
locSerializer.Put('AName', TypeInfo(string), AName);
locSerializer.EndCall();
MakeCall();
locSerializer.BeginCallRead((Self as ICallContext));
TObject(Result) := Nil;
strPrmName := 'result';
locSerializer.Get(TypeInfo(TUser_Type), strPrmName, Result);
Finally
locSerializer.Clear();
End;
End;
function TUserService_Proxy.Delete(
const AName : string
):boolean;
Var
locSerializer : IFormatterClient;
strPrmName : string;
Begin
locSerializer := GetSerializer();
Try
locSerializer.BeginCall('Delete', GetTarget(),(Self as ICallContext));
locSerializer.Put('AName', TypeInfo(string), AName);
locSerializer.EndCall();
MakeCall();
locSerializer.BeginCallRead((Self as ICallContext));
strPrmName := 'result';
locSerializer.Get(TypeInfo(boolean), strPrmName, Result);
Finally
locSerializer.Clear();
End;
End;
initialization
{$i user_service_intf.wst}
{$IF DECLARED(Register_user_service_intf_ServiceMetadata)}
Register_user_service_intf_ServiceMetadata();
{$IFEND}
End.

View File

@ -2,7 +2,7 @@
This unit has been produced by ws_helper.
Input unit name : "user_service_intf".
This unit name : "user_service_intf".
Date : "12/07/2007 10:55:02".
Date : "13/07/2007 21:34:10".
}
unit user_service_intf;
{$IFDEF FPC} {$mode objfpc}{$H+} {$ENDIF}
@ -130,6 +130,13 @@ begin
'FORMAT_Style',
'rpc'
);
mm.SetOperationCustomData(
sUNIT_NAME,
'UserService',
'GetList',
'_E_N_',
'GetList'
);
mm.SetOperationCustomData(
sUNIT_NAME,
'UserService',
@ -151,6 +158,13 @@ begin
'FORMAT_OutputEncodingStyle',
'literal'
);
mm.SetOperationCustomData(
sUNIT_NAME,
'UserService',
'Add',
'_E_N_',
'Add'
);
mm.SetOperationCustomData(
sUNIT_NAME,
'UserService',
@ -172,6 +186,13 @@ begin
'FORMAT_OutputEncodingStyle',
'literal'
);
mm.SetOperationCustomData(
sUNIT_NAME,
'UserService',
'Update',
'_E_N_',
'Update'
);
mm.SetOperationCustomData(
sUNIT_NAME,
'UserService',
@ -193,6 +214,13 @@ begin
'FORMAT_OutputEncodingStyle',
'literal'
);
mm.SetOperationCustomData(
sUNIT_NAME,
'UserService',
'Find',
'_E_N_',
'Find'
);
mm.SetOperationCustomData(
sUNIT_NAME,
'UserService',
@ -214,6 +242,13 @@ begin
'FORMAT_OutputEncodingStyle',
'literal'
);
mm.SetOperationCustomData(
sUNIT_NAME,
'UserService',
'Delete',
'_E_N_',
'Delete'
);
mm.SetOperationCustomData(
sUNIT_NAME,
'UserService',
@ -240,7 +275,6 @@ end;
initialization
GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(TUserCategory_Type),'TUserCategory');
GetTypeRegistry().ItemByTypeInfo[TypeInfo(TUserCategory_Type)].RegisterExternalPropertyName('Normal','result');
GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(TUser_Type),'TUser');
GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(TNote_Type),'TNote');
GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(TUserArray),'TUserArray');

View File

@ -2,7 +2,7 @@
This unit has been produced by ws_helper.
Input unit name : "user_service_intf".
This unit name : "user_service_intf_binder".
Date : "26/06/2007 23:46:28".
Date : "13/07/2007 21:34:10".
}
unit user_service_intf_binder;
{$IFDEF FPC} {$mode objfpc}{$H+} {$ENDIF}

View File

@ -2,7 +2,7 @@
This unit has been produced by ws_helper.
Input unit name : "user_service_intf".
This unit name : "user_service_intf_proxy".
Date : "26/06/2007 23:46:28".
Date : "13/07/2007 21:34:10".
}
Unit user_service_intf_proxy;

View File

@ -13,7 +13,7 @@
{$INCLUDE wst_global.inc}
unit synapse_http_protocol;
{$DEFINE WST_DBG}
//{$DEFINE WST_DBG}
interface

View File

@ -12,7 +12,7 @@
<MainUnit Value="0"/>
<IconPath Value="./"/>
<TargetFileExt Value=".exe"/>
<ActiveEditorIndexAtStart Value="0"/>
<ActiveEditorIndexAtStart Value="7"/>
</General>
<VersionInfo>
<ProjectVersion Value=""/>
@ -36,17 +36,17 @@
<Filename Value="test_prj.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="test_prj"/>
<CursorPos X="1" Y="69"/>
<TopLine Value="52"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<EditorIndex Value="0"/>
<UsageCount Value="25"/>
<UsageCount Value="26"/>
<Loaded Value="True"/>
</Unit0>
<Unit1>
<Filename Value="SDMTabularService.pas"/>
<UnitName Value="SDMTabularService"/>
<CursorPos X="3" Y="154"/>
<TopLine Value="145"/>
<TopLine Value="143"/>
<EditorIndex Value="10"/>
<UsageCount Value="12"/>
<Loaded Value="True"/>
@ -69,7 +69,7 @@
<Unit4>
<Filename Value="..\..\binary_streamer.pas"/>
<UnitName Value="binary_streamer"/>
<CursorPos X="95" Y="107"/>
<CursorPos X="21" Y="13"/>
<TopLine Value="6"/>
<EditorIndex Value="6"/>
<UsageCount Value="11"/>
@ -86,7 +86,7 @@
</Unit5>
<Unit6>
<Filename Value="..\..\wst_global.inc"/>
<CursorPos X="11" Y="4"/>
<CursorPos X="5" Y="4"/>
<TopLine Value="1"/>
<EditorIndex Value="7"/>
<UsageCount Value="12"/>
@ -104,8 +104,8 @@
<Unit8>
<Filename Value="..\..\soap_formatter.pas"/>
<UnitName Value="soap_formatter"/>
<CursorPos X="1" Y="94"/>
<TopLine Value="6"/>
<CursorPos X="19" Y="13"/>
<TopLine Value="1"/>
<EditorIndex Value="2"/>
<UsageCount Value="12"/>
<Loaded Value="True"/>
@ -113,8 +113,8 @@
<Unit9>
<Filename Value="..\..\synapse_http_protocol.pas"/>
<UnitName Value="synapse_http_protocol"/>
<CursorPos X="30" Y="176"/>
<TopLine Value="142"/>
<CursorPos X="18" Y="13"/>
<TopLine Value="13"/>
<EditorIndex Value="1"/>
<UsageCount Value="12"/>
<Loaded Value="True"/>
@ -172,7 +172,24 @@
<UsageCount Value="10"/>
</Unit16>
</Units>
<JumpHistory Count="0" HistoryIndex="-1"/>
<JumpHistory Count="4" HistoryIndex="3">
<Position1>
<Filename Value="..\..\synapse_http_protocol.pas"/>
<Caret Line="176" Column="30" TopLine="142"/>
</Position1>
<Position2>
<Filename Value="..\..\synapse_http_protocol.pas"/>
<Caret Line="26" Column="4" TopLine="11"/>
</Position2>
<Position3>
<Filename Value="..\..\synapse_http_protocol.pas"/>
<Caret Line="13" Column="18" TopLine="13"/>
</Position3>
<Position4>
<Filename Value="test_prj.pas"/>
<Caret Line="8" Column="13" TopLine="1"/>
</Position4>
</JumpHistory>
</ProjectOptions>
<CompilerOptions>
<Version Value="5"/>

View File

@ -25,8 +25,8 @@ object fAbout: TfAbout
Left = 93
Height = 14
Top = 56
Width = 113
Caption = 'Type Librarry Editor'
Width = 108
Caption = 'Type Library Editor'
Font.Style = [fsBold, fsItalic]
ParentColor = False
end

View File

@ -9,7 +9,7 @@ LazarusResources.Add('TfAbout','FORMDATA',[
+'Left'#2','#6'Height'#2#14#3'Top'#2#24#5'Width'#3#211#0#7'Caption'#6'$Web Se'
+'rvices Toolkit for FPC/Lazarus'#10'Font.Style'#11#6'fsBold'#0#11'ParentColo'
+'r'#8#0#0#6'TLabel'#6'Label2'#4'Left'#2']'#6'Height'#2#14#3'Top'#2'8'#5'Widt'
+'h'#2'q'#7'Caption'#6#20'Type Librarry Editor'#10'Font.Style'#11#6'fsBold'#8
+'h'#2'l'#7'Caption'#6#19'Type Library Editor'#10'Font.Style'#11#6'fsBold'#8
+'fsItalic'#0#11'ParentColor'#8#0#0#6'TLabel'#6'Label3'#4'Left'#2'1'#6'Height'
+#2#14#3'Top'#2'p'#5'Width'#3#200#0#7'Caption'#6'$Copyright (c) 2007 Inoussa '
+'OUEDRAOGO'#11'ParentColor'#8#0#0#7'TButton'#7'Button1'#4'Left'#2'p'#6'Heigh'

View File

@ -691,7 +691,7 @@ begin
s := Format('Register_%s_NameSpace',[SymbolTable.CurrentModule.Name]);
WriteLn(' {$IF DECLARED(%s)}',[s]);
WriteLn(' %s();',[s]);
WriteLn(' {$ENDIF}');
WriteLn(' {$IFEND}');
NewLine();
WriteLn(' {$i %s.%s}',[SymbolTable.CurrentModule.Name,sWST_EXTENSION]);
NewLine();
@ -977,7 +977,7 @@ Var
for k := 0 to Pred(mtds.Count) do begin
if TPasElement(mtds[k]).InheritsFrom(TPasProcedure) then begin
mtd := TPasProcedure(mtds[k]);
WriteLn('RegisterVerbHandler(%s,@%sHandler);',[QuotedStr(mtd.Name),mtd.Name]);
WriteLn('RegisterVerbHandler(%s,{$IFDEF FPC}@{$ENDIF}%sHandler);',[QuotedStr(mtd.Name),mtd.Name]);
end;
end;
EndAutoIndent();

View File

@ -77,15 +77,15 @@ procedure TMetadataGenerator.GenerateIntfMetadata(AIntf: TPasClassType);
procedure WriteParam(APrm : TPasArgument);
begin
FStream.WriteStr(FSymbolTable.GetExternalName(APrm));
FStream.WriteStr(FSymbolTable.GetExternalName(APrm.ArgType));
FStream.WriteStr(APrm.Name);
FStream.WriteStr(APrm.ArgType.Name);
FStream.WriteEnum(Ord(APrm.Access));
end;
procedure WriteResult(ARes : TPasResultElement);
begin
FStream.WriteStr(FSymbolTable.GetExternalName(ARes));
FStream.WriteStr(FSymbolTable.GetExternalName(ARes.ResultType));
FStream.WriteStr(ARes.Name);
FStream.WriteStr(ARes.ResultType.Name);
FStream.WriteEnum(Ord(argOut));
end;

View File

@ -58,8 +58,8 @@
<Filename Value="generator.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="generator"/>
<CursorPos X="30" Y="47"/>
<TopLine Value="35"/>
<CursorPos X="21" Y="694"/>
<TopLine Value="113"/>
<EditorIndex Value="7"/>
<UsageCount Value="200"/>
<Bookmarks Count="3">
@ -131,8 +131,8 @@
<Filename Value="metadata_generator.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="metadata_generator"/>
<CursorPos X="2" Y="19"/>
<TopLine Value="5"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<EditorIndex Value="1"/>
<UsageCount Value="200"/>
<Loaded Value="True"/>
@ -500,11 +500,31 @@
<UsageCount Value="11"/>
</Unit62>
</Units>
<JumpHistory Count="1" HistoryIndex="0">
<JumpHistory Count="6" HistoryIndex="5">
<Position1>
<Filename Value="metadata_generator.pas"/>
<Caret Line="122" Column="37" TopLine="114"/>
<Caret Line="117" Column="33" TopLine="96"/>
</Position1>
<Position2>
<Filename Value="metadata_generator.pas"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position2>
<Position3>
<Filename Value="metadata_generator.pas"/>
<Caret Line="81" Column="41" TopLine="67"/>
</Position3>
<Position4>
<Filename Value="metadata_generator.pas"/>
<Caret Line="88" Column="44" TopLine="74"/>
</Position4>
<Position5>
<Filename Value="metadata_generator.pas"/>
<Caret Line="99" Column="32" TopLine="85"/>
</Position5>
<Position6>
<Filename Value="metadata_generator.pas"/>
<Caret Line="117" Column="30" TopLine="104"/>
</Position6>
</JumpHistory>
</ProjectOptions>
<CompilerOptions>

View File

@ -6,4 +6,5 @@
PByteArray = ^ByteArray;
ByteArray = array[0..$effffff] of Byte;
PtrUInt = Cardinal;
SizeInt = Longint;
{$ENDIF}

View File

@ -0,0 +1,20 @@
unit wst_delphi_rtti_utils;
interface
uses SysUtils, TypInfo;
function GetEnumNameCount(AEnumTypeInfo: PTypeInfo): Integer;
implementation
function GetEnumNameCount(AEnumTypeInfo: PTypeInfo): Integer;
var
T: PTypeData;
begin
Result := 0;
T := GetTypeData(AEnumTypeInfo);
Result := ( T^.MaxValue - T^.MinValue ) + 1;
end;
end.

View File

@ -11,12 +11,14 @@ type
TDOMNode = IDOMNode;
TDOMNodeList = IDOMNodeList;
TDOMNamedNodeMap = IDOMNamedNodeMap;
TXMLDocument = IDOMDocument;
TDOMElement = IDOMElement;
function FindNode(ANode : TDOMNode; const ANodeName : string):TDOMNode;
function GetNodeItemsCount(const ANode : TDOMNode): Integer;
function GetNodeListCount(ANodeList : TDOMNodeList) : Integer ;
function GetNodeListCount(ANodeList : TDOMNodeList) : Integer ;overload;
function GetNodeListCount(ANodeList : TDOMNamedNodeMap) : Integer ;overload;
procedure ReleaseDomNode(ADomNode : IInterface);overload;
procedure ReleaseDomNode(var ADomNode : TXMLDocument);overload;
@ -65,7 +67,12 @@ begin
end;
end;
function GetNodeListCount(ANodeList : TDOMNodeList) : Integer ;
function GetNodeListCount(ANodeList : TDOMNodeList) : Integer ;overload;
begin
Result := ANodeList.length;
end;
function GetNodeListCount(ANodeList : TDOMNamedNodeMap) : Integer ;overload;
begin
Result := ANodeList.length;
end;

View File

@ -10,7 +10,8 @@ uses
{$INCLUDE wst_delphi.inc}
function GetNodeItemsCount(const ANode : TDOMNode): Integer;
function GetNodeListCount(ANodeList : TDOMNodeList) : Integer ;{$IFDEF USE_INLINE}inline;{$ENDIF}
function GetNodeListCount(ANodeList : TDOMNodeList) : Integer ;overload;{$IFDEF USE_INLINE}inline;{$ENDIF}
function GetNodeListCount(ANodeList : TDOMNamedNodeMap) : Integer ;overload;{$IFDEF USE_INLINE}inline;{$ENDIF}
procedure ReleaseDomNode(ADomNode : TDOMNode);overload;{$IFDEF USE_INLINE}inline;{$ENDIF}
procedure ReleaseDomNode(ADomNode : TDOMNodeList);overload;{$IFDEF USE_INLINE}inline;{$ENDIF}
function CreateDoc() : TXMLDocument ;{$IFDEF USE_INLINE}inline;{$ENDIF}
@ -37,11 +38,15 @@ begin
end;
end;
function GetNodeListCount(ANodeList : TDOMNodeList) : Integer ;{$IFDEF USE_INLINE}inline;{$ENDIF}
function GetNodeListCount(ANodeList : TDOMNodeList) : Integer ;overload;{$IFDEF USE_INLINE}inline;{$ENDIF}
begin
Result := ANodeList.Count;
end;
function GetNodeListCount(ANodeList : TDOMNamedNodeMap) : Integer ;overload;{$IFDEF USE_INLINE}inline;{$ENDIF}
begin
Result := ANodeList.Length;
end;
procedure ReleaseDomNode(ADomNode : TDOMNode);overload;{$IFDEF USE_INLINE}inline;{$ENDIF}
begin

View File

@ -1,7 +1,7 @@
{$IFDEF FPC}
{$mode objfpc}{$H+}
{$DEFINE HAS_QWORD}
{$DEFINE USE_INLINE}
//{$DEFINE USE_INLINE}
{$ELSE}
{$UNDEF HAS_QWORD}
{$UNDEF USE_INLINE}