diff --git a/wst/tags/0.4/COPYING.LGPL b/wst/tags/0.4/COPYING.LGPL new file mode 100644 index 000000000..92b8903ff --- /dev/null +++ b/wst/tags/0.4/COPYING.LGPL @@ -0,0 +1,481 @@ + GNU LIBRARY GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the library GPL. It is + numbered 2 because it goes with version 2 of the ordinary GPL.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Library General Public License, applies to some +specially designated Free Software Foundation software, and to any +other libraries whose authors decide to use it. You can use it for +your libraries, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if +you distribute copies of the library, or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link a program with the library, you must provide +complete object files to the recipients so that they can relink them +with the library, after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + Our method of protecting your rights has two steps: (1) copyright +the library, and (2) offer you this license which gives you legal +permission to copy, distribute and/or modify the library. + + Also, for each distributor's protection, we want to make certain +that everyone understands that there is no warranty for this free +library. If the library is modified by someone else and passed on, we +want its recipients to know that what they have is not the original +version, so that any problems introduced by others will not reflect on +the original authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that companies distributing free +software will individually obtain patent licenses, thus in effect +transforming the program into proprietary software. To prevent this, +we have made it clear that any patent must be licensed for everyone's +free use or not licensed at all. + + Most GNU software, including some libraries, is covered by the ordinary +GNU General Public License, which was designed for utility programs. This +license, the GNU Library General Public License, applies to certain +designated libraries. This license is quite different from the ordinary +one; be sure to read it in full, and don't assume that anything in it is +the same as in the ordinary license. + + The reason we have a separate public license for some libraries is that +they blur the distinction we usually make between modifying or adding to a +program and simply using it. Linking a program with a library, without +changing the library, is in some sense simply using the library, and is +analogous to running a utility program or application program. However, in +a textual and legal sense, the linked executable is a combined work, a +derivative of the original library, and the ordinary General Public License +treats it as such. + + Because of this blurred distinction, using the ordinary General +Public License for libraries did not effectively promote software +sharing, because most developers did not use the libraries. We +concluded that weaker conditions might promote sharing better. + + However, unrestricted linking of non-free programs would deprive the +users of those programs of all benefit from the free status of the +libraries themselves. This Library General Public License is intended to +permit developers of non-free programs to use free libraries, while +preserving your freedom as a user of such programs to change the free +libraries that are incorporated in them. (We have not seen how to achieve +this as regards changes in header files, but we have achieved it as regards +changes in the actual functions of the Library.) The hope is that this +will lead to faster development of free libraries. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, while the latter only +works together with the library. + + Note that it is possible for a library to be covered by the ordinary +General Public License rather than by this special one. + + GNU LIBRARY GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library which +contains a notice placed by the copyright holder or other authorized +party saying it may be distributed under the terms of this Library +General Public License (also called "this License"). Each licensee is +addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also compile or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + c) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + d) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the source code distributed need not include anything that is normally +distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Library General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! diff --git a/wst/tags/0.4/COPYING.modifiedLGPL b/wst/tags/0.4/COPYING.modifiedLGPL new file mode 100644 index 000000000..5f13ea54e --- /dev/null +++ b/wst/tags/0.4/COPYING.modifiedLGPL @@ -0,0 +1,26 @@ +This is the file COPYING.modifiedLGPL, it applies to several units in the +Lazarus sources distributed by members of the Lazarus Development Team. +All files contains headers showing the appropriate license. See there if this +modification can be applied. + +These files are distributed under the Library GNU General Public License +(see the file COPYING.LPGL) with the following modification: + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent modules, +and to copy and distribute the resulting executable under terms of your choice, +provided that you also meet, for each linked independent module, the terms +and conditions of the license of that module. An independent module is a +module which is not derived from or based on this library. If you modify this +library, you may extend this exception to your version of the library, but +you are not obligated to do so. If you do not wish to do so, delete this +exception statement from your version. + + +If you didn't receive a copy of the file COPYING.LGPL, contact: + Free Software Foundation, Inc., + 675 Mass Ave + Cambridge, MA 02139 + USA + diff --git a/wst/tags/0.4/base_binary_formatter.pas b/wst/tags/0.4/base_binary_formatter.pas new file mode 100644 index 000000000..27e0c4861 --- /dev/null +++ b/wst/tags/0.4/base_binary_formatter.pas @@ -0,0 +1,1592 @@ +{ This file is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This file is provide under modified LGPL licence + ( the files COPYING.modifiedLGPL and COPYING.LGPL). + + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +} +unit base_binary_formatter; + +interface + +uses + Classes, SysUtils, Contnrs, TypInfo, + base_service_intf, binary_streamer; + +{$INCLUDE wst.inc} +{$DEFINE wst_binary_header} + +const + sROOT = 'ROOT'; + sSCOPE_INNER_NAME = 'INNER_VAL'; +{$IFDEF wst_binary_header} + sHEADER = 'HEADER'; +{$ENDIF} + +type + EBinaryFormatterException = class(EServiceException) + End; + + TDataName = AnsiString; + TDataType = ( + dtInt8U, dtInt8S, + dtInt16U, dtInt16S, + dtInt32U, dtInt32S, + dtInt64U, dtInt64S, + dtBool, dtEnum, + dtSingle, dtDouble, dtExtended, dtCurrency, + dtString, + dtObject, dtArray + ); + + PStringBuffer = ^TStringBuffer; + PObjectBuffer = ^TObjectBuffer; + PArrayBuffer = ^TArrayBuffer; + PDataBuffer = ^TDataBuffer; + + TDataBuffer = Record + Name : TDataName; + Case DataType : TDataType of + dtInt8S : ( Int8S : TInt8S ); + dtInt8U : ( Int8U : TInt8U ); + dtInt16U : ( Int16U : TInt16U ); + dtInt16S : ( Int16S : TInt16S ); + dtInt32U : ( Int32U : TInt32U ); + dtInt32S : ( Int32S : TInt32S ); + dtInt64U : ( Int64U : TInt64U ); + dtInt64S : ( Int64S : TInt64S ); + dtBool : ( BoolData : TBoolData ); + dtEnum : ( EnumData : TEnumData ); + dtSingle : ( SingleData : TFloat_Single_4 ); + dtDouble : ( DoubleData : TFloat_Double_8 ); + dtExtended : ( ExtendedData : TFloat_Extended_10 ); + dtCurrency : ( CurrencyData : TFloat_Currency_8 ); + + dtString : ( StrData : PStringBuffer ); + dtObject : ( ObjectData : PObjectBuffer ); + dtArray : ( ArrayData : PArrayBuffer ); + End; + + TStringBuffer = Record + Data : String; + End; + + PObjectBufferItem = ^TObjectBufferItem; + TObjectBufferItem = Record + Data : PDataBuffer; + Next : PObjectBufferItem; + End; + + TObjectBuffer = Record + NilObject : TBoolData; + Count : Integer; + Head : PObjectBufferItem; + Last : PObjectBufferItem; + Attributes : PObjectBuffer; + InnerData : PDataBuffer; + End; + + PDataBufferList = ^TDataBufferList; + TDataBufferList = array[0..MAX_ARRAY_LENGTH] of PDataBuffer; + TArrayBuffer = Record + Count : Integer; + Items : PDataBufferList; + Attributes : PObjectBuffer; + End; + + { TStackItem } + + TStackItem = class + private + FScopeObject: PDataBuffer; + FScopeType: TScopeType; + Public + constructor Create(const AScopeObject : PDataBuffer;AScopeType : TScopeType); + function GetItemCount():Integer;virtual;abstract; + function Find(var AName : TDataName):PDataBuffer;virtual;abstract; + function GetByIndex(const AIndex : Integer):PDataBuffer;virtual;abstract; + function CreateBuffer( + Const AName : String; + const ADataType : TDataType + ):PDataBuffer;virtual;abstract; + function CreateInnerBuffer(const ADataType : TDataType):PDataBuffer;virtual;abstract; + function GetInnerBuffer():PDataBuffer;virtual;abstract; + procedure NilCurrentScope();virtual;abstract; + function IsCurrentScopeNil():Boolean;virtual;abstract; + property ScopeObject : PDataBuffer Read FScopeObject; + property ScopeType : TScopeType Read FScopeType; + End; + + { TObjectStackItem } + + TObjectStackItem = class(TStackItem) + Public + constructor Create(const AScopeObject : PDataBuffer); + function GetItemCount():Integer;override; + function Find(var AName : TDataName):PDataBuffer;override; + function GetByIndex(const AIndex : Integer):PDataBuffer;override; + function CreateBuffer( + Const AName : String; + const ADataType : TDataType + ):PDataBuffer;override; + function CreateInnerBuffer(const ADataType : TDataType):PDataBuffer;override; + function GetInnerBuffer():PDataBuffer;override; + procedure NilCurrentScope();override; + function IsCurrentScopeNil():Boolean;override; + End; + + { TArrayStackItem } + + TArrayStackItem = class(TStackItem) + Private + FIndex : Integer; + Public + constructor Create(const AScopeObject : PDataBuffer); + function GetItemCount():Integer;override; + function Find(var AName : TDataName):PDataBuffer;override; + function GetByIndex(const AIndex : Integer):PDataBuffer;override; + function CreateBuffer( + Const AName : String; + const ADataType : TDataType + ):PDataBuffer;override; + function CreateInnerBuffer(const ADataType : TDataType):PDataBuffer;override; + function GetInnerBuffer():PDataBuffer;overload;override; + procedure NilCurrentScope();override; + function IsCurrentScopeNil():Boolean;override; + End; + + { TBaseBinaryFormatter } + + TBaseBinaryFormatter = class(TSimpleFactoryItem,IFormatterBase) + private + FRootData : PDataBuffer; + FStack : TObjectStack; + FSerializationStyle : TSerializationStyle; + {$IFDEF wst_binary_header} + FHeaderEnterCount : Integer; + {$ENDIF} + protected + function GetCurrentScope: String; + function GetCurrentScopeObject():PDataBuffer; + procedure SetSerializationStyle(const ASerializationStyle : TSerializationStyle); + function GetSerializationStyle():TSerializationStyle; + protected + function HasScope():Boolean; + procedure CheckScope(); + procedure ClearStack(); + procedure PushStack(AScopeObject : PDataBuffer;Const AScopeType : TScopeType = stObject); + function StackTop():TStackItem; + function PopStack():TStackItem; + function GetRootData() : PDataBuffer; + protected + procedure PutFloat( + Const AName : String; + Const ATypeInfo : PTypeInfo; + Const AData : TFloat_Extended_10 + ); + procedure PutInt( + Const AName : String; + Const ATypeInfo : PTypeInfo; + Const AData : TInt64S + ); + procedure PutStr( + Const AName : String; + Const ATypeInfo : PTypeInfo; + Const AData : String + ); + procedure PutEnum( + Const AName : String; + Const ATypeInfo : PTypeInfo; + Const AData : TEnumData + ); + procedure PutBool( + Const AName : String; + Const ATypeInfo : PTypeInfo; + Const AData : Boolean + ); + procedure PutInt64( + Const AName : String; + Const ATypeInfo : PTypeInfo; + Const AData : Int64 + ); + procedure PutObj( + Const AName : String; + Const ATypeInfo : PTypeInfo; + Const AData : TObject + ); + + function GetDataBuffer(var AName : String):PDataBuffer; + procedure GetEnum( + Const ATypeInfo : PTypeInfo; + Var AName : String; + Var AData : TEnumData + ); + procedure GetBool( + Const ATypeInfo : PTypeInfo; + Var AName : String; + Var AData : Boolean + ); + procedure GetFloat( + Const ATypeInfo : PTypeInfo; + Var AName : String; + Var AData : TFloat_Extended_10 + ); + procedure GetInt( + Const ATypeInfo : PTypeInfo; + Var AName : String; + Var AData : TInt64S + ); + procedure GetInt64( + Const ATypeInfo : PTypeInfo; + Var AName : String; + Var AData : Int64 + ); + procedure GetStr( + Const ATypeInfo : PTypeInfo; + Var AName : String; + Var AData : String + ); + procedure GetObj( + Const ATypeInfo : PTypeInfo; + Var AName : String; + Var AData : TObject + ); + public + constructor Create();override; + destructor Destroy();override; + + procedure Clear(); + + procedure BeginObject( + Const AName : string; + Const ATypeInfo : PTypeInfo + ); + procedure BeginArray( + const AName : string; + const ATypeInfo : PTypeInfo; + const AItemTypeInfo : PTypeInfo; + const ABounds : Array Of Integer; + const AStyle : TArrayStyle + ); + procedure NilCurrentScope(); + function IsCurrentScopeNil():Boolean; + procedure EndScope(); + procedure AddScopeAttribute(Const AName,AValue : string); + function BeginObjectRead( + var AScopeName : string; + const ATypeInfo : PTypeInfo + ) : Integer; + function BeginArrayRead( + var AScopeName : string; + const ATypeInfo : PTypeInfo; + const AStyle : TArrayStyle; + const AItemName : string + ):Integer; + procedure EndScopeRead(); + + procedure BeginHeader(); + procedure EndHeader(); + + property CurrentScope : String Read GetCurrentScope; + + procedure Put( + Const AName : String; + Const ATypeInfo : PTypeInfo; + Const AData + ); + procedure PutScopeInnerValue( + const ATypeInfo : PTypeInfo; + const AData + ); + procedure Get( + Const ATypeInfo : PTypeInfo; + Var AName : String; + Var AData + ); + procedure GetScopeInnerValue( + const ATypeInfo : PTypeInfo; + var AData + ); + + procedure SaveToStream(AStream : TStream); + procedure LoadFromStream(AStream : TStream); + + procedure Error(Const AMsg:string);overload; + procedure Error(Const AMsg:string; Const AArgs : array of const);overload; + End; + + TDBGPinterProc = procedure(const AMsg:string); + + procedure ClearObj(const AOwner: PDataBuffer); + function LoadObjectFromStream(const AStoreRdr : IDataStoreReader):PDataBuffer; + procedure SaveObjectToStream(const ARoot: PDataBuffer; const ADest : IDataStore); + function CreateArrayBuffer( + const ALength : Integer; + const AName : TDataName; + const AOwner : PDataBuffer = nil + ):PDataBuffer; + function CreateObjBuffer( + const ADataType : TDataType; + const AName : TDataName; + const AOwner : PDataBuffer = nil + ):PDataBuffer; + + procedure PrintObj(const ARoot: PDataBuffer; const ALevel : Integer; const APrinterProc : TDBGPinterProc); + +implementation + +{$INCLUDE wst_rtl_imp.inc} + +procedure PrintObj(const ARoot: PDataBuffer; const ALevel : Integer; const APrinterProc : TDBGPinterProc); +Var + p : PObjectBufferItem; + s : string; + i ,j: Integer; +Begin + If Not Assigned(ARoot) Then + Exit; + s := StringOfChar(' ',ALevel); + Case ARoot^.DataType Of + dtInt8S : APrinterProc( s + ARoot^.Name + ' = ' + IntToStr(ARoot^.Int8S) ); + dtInt8U : APrinterProc( s + ARoot^.Name + ' = ' + IntToStr(ARoot^.Int8U) ); + dtInt32U : APrinterProc( s + ARoot^.Name + ' = ' + IntToStr(ARoot^.Int32U) ); + dtInt32S : APrinterProc( s + ARoot^.Name + ' = ' + IntToStr(ARoot^.Int32S) ); + dtInt64U : APrinterProc( s + ARoot^.Name + ' = ' + IntToStr(ARoot^.Int64U) ); + dtInt64S : APrinterProc( s + ARoot^.Name + ' = ' + IntToStr(ARoot^.Int64S) ); + + dtSingle : APrinterProc( s + ARoot^.Name + ' = ' + FloatToStr(ARoot^.SingleData) ); + dtDouble : APrinterProc( s + ARoot^.Name + ' = ' + FloatToStr(ARoot^.DoubleData) ); + dtExtended : APrinterProc( s + ARoot^.Name + ' = ' + FloatToStr(ARoot^.ExtendedData) ); + dtCurrency : APrinterProc( s + ARoot^.Name + ' = ' + FloatToStr(ARoot^.CurrencyData) ); + + dtString : APrinterProc( s + ARoot^.Name + ' = ' + ARoot^.StrData^.Data ); + dtObject : + Begin + APrinterProc( s + ARoot^.Name + ' = '); + If Not Assigned(ARoot^.ObjectData) Then Begin + APrinterProc(s + ' '); + End Else Begin + APrinterProc('( ' + IntToStr(ARoot^.ObjectData^.Count) + ' Objects )'); + p := ARoot^.ObjectData^.Head; + i := ALevel + 1; + While Assigned(p) Do Begin + PrintObj(p^.Data,i,APrinterProc); + p := p^.Next; + End; + End; + End; + dtArray : + Begin + APrinterProc( s + ARoot^.Name + ' = '); + If Not Assigned(ARoot^.ArrayData) Then Begin + APrinterProc(s + ' '); + End Else Begin + j := ARoot^.ArrayData^.Count; + APrinterProc('( Objects[ '+ IntToStr(j)+ '] )'); + i := ALevel + 1; + For j := 0 To Pred(j) Do Begin + PrintObj(ARoot^.ArrayData^.Items^[j],i,APrinterProc); + End; + End; + End; + End; +End; + +function FindObj(const AOwner: PDataBuffer; const AName : TDataName) : PDataBuffer; +Var + p : PObjectBufferItem; +Begin + Assert(AOwner^.DataType >= dtObject); + Result := Nil; + p:= AOwner^.ObjectData^.Head; + While Assigned(p) Do Begin + If AnsiSameText(AName,p^.Data^.Name) Then Begin + Result := p^.Data; + Exit; + End; + p := p^.Next; + End; +End; + +procedure AddObj( + const AOwner, AChildData: PDataBuffer; + const AIndex : Integer = -1 +); +Var + p : PObjectBufferItem; +Begin + If ( AOwner^.DataType = dtObject ) Then Begin + p := wst_GetMem(SizeOf(TObjectBufferItem)); + p^.Data := AChildData; + p^.Next := Nil; + If Assigned(AOwner^.ObjectData^.Head) Then Begin + AOwner^.ObjectData^.Last^.Next := p; + End Else Begin + AOwner^.ObjectData^.Head := p; + End; + AOwner^.ObjectData^.Last := p; + Inc(AOwner^.ObjectData^.Count); + End Else If ( AOwner^.DataType = dtArray ) Then Begin + If ( AIndex >= 0 ) And ( AIndex < AOwner^.ArrayData^.Count ) Then + AOwner^.ArrayData^.Items^[AIndex] := AChildData + Else + Raise EBinaryFormatterException.CreateFmt('Invalid array acces : %d',[AIndex]) + End Else Begin + Raise EBinaryFormatterException.CreateFmt('Invalid data type in this context : %d',[Ord(AOwner^.DataType)]) + End; +End; + +function CreateObjBuffer( + const ADataType : TDataType; + const AName : TDataName; + const AOwner : PDataBuffer = nil +):PDataBuffer; +var + resLen, i : Integer; +begin + resLen := SizeOf(TDataBuffer); + Result := wst_GetMem(resLen); + Try + FillChar(Result^,resLen,#0); + Result^.Name := AName; + Result^.DataType := ADataType; + Case Result^.DataType Of + dtString : + Begin + i := SizeOf(TStringBuffer); + Result^.StrData := wst_GetMem(i); + FillChar(Result^.StrData^,i,#0); + Result^.StrData^.Data := ''; + End; + dtObject : + Begin + Result^.ObjectData := wst_GetMem(SizeOf(TObjectBuffer)); + FillChar(Result^.ObjectData^,SizeOf(TObjectBuffer),#0); + End; + End; + If Assigned(AOwner) Then + AddObj(AOwner,Result); + Except + Freemem(Result,resLen); + Result := nil; + Raise; + End; +end; + +function CreateArrayBuffer( + const ALength : Integer; + const AName : TDataName; + const AOwner : PDataBuffer = nil +):PDataBuffer; +Var + i, resLen : Integer; +begin + Assert(ALength>=0); + resLen := SizeOf(TDataBuffer); + Result := wst_GetMem(resLen); + Try + FillChar(Result^,resLen,#0); + Result^.Name := AName; + Result^.DataType := dtArray; + Result^.ArrayData := wst_GetMem(SizeOf(TArrayBuffer)); + FillChar(Result^.ArrayData^,SizeOf(TArrayBuffer),#0); + Result^.ArrayData^.Count := ALength; + If ( ALength > 0 ) Then Begin + i := ALength*SizeOf(PDataBuffer); + Result^.ArrayData^.Items := wst_GetMem(i); + FillChar(Result^.ArrayData^.Items^[0],i,#0); + End Else Begin + Result^.ArrayData^.Items := Nil; + End; + If Assigned(AOwner) Then + AddObj(AOwner,Result); + Except + Freemem(Result,resLen); + Result := nil; + Raise; + End; +end; + +procedure SaveObjectToStream(const ARoot: PDataBuffer; const ADest : IDataStore); +Var + p : PObjectBufferItem; + i : TInt32S; +Begin + If Not Assigned(ARoot) Then + Exit; + i := Ord(ARoot^.DataType); + ADest.WriteInt32S(i); + ADest.WriteStr(ARoot^.Name); + Case ARoot^.DataType Of + dtInt8S : ADest.WriteInt8S(ARoot^.Int8S); + dtInt8U : ADest.WriteInt8U(ARoot^.Int8U); + dtInt16U : ADest.WriteInt16U(ARoot^.Int16U); + dtInt16S : ADest.WriteInt16S(ARoot^.Int16S); + dtInt32U : ADest.WriteInt32U(ARoot^.Int32U); + dtInt32S : ADest.WriteInt32S(ARoot^.Int32S); + dtInt64U : ADest.WriteInt64U(ARoot^.Int64U); + dtInt64S : ADest.WriteInt64S(ARoot^.Int64S); + + dtSingle : ADest.WriteSingle(ARoot^.SingleData); + dtDouble : ADest.WriteDouble(ARoot^.DoubleData); + dtExtended : ADest.WriteExtended(ARoot^.ExtendedData); + dtCurrency : ADest.WriteCurrency(ARoot^.CurrencyData); + + dtString : ADest.WriteStr(ARoot^.StrData^.Data); + dtBool : ADest.WriteBool(ARoot^.BoolData); + dtEnum : ADest.WriteEnum(ARoot^.EnumData); + dtObject : + Begin + ADest.WriteBool(ARoot^.ObjectData^.NilObject) ; + if not ARoot^.ObjectData^.NilObject then begin + i := ARoot^.ObjectData^.Count; + ADest.WriteInt32S(i); + + If ( i > 0 ) Then Begin + p := ARoot^.ObjectData^.Head; + For i := 1 To i Do Begin + SaveObjectToStream(p^.Data,ADest); + p := p^.Next; + End; + End; + ADest.WriteBool(Assigned(ARoot^.ObjectData^.InnerData)); + if Assigned(ARoot^.ObjectData^.InnerData) then + SaveObjectToStream(ARoot^.ObjectData^.InnerData,ADest); + end; + End; + dtArray : + Begin + i := ARoot^.ArrayData^.Count; + ADest.WriteInt32S(i); + + If ( i > 0 ) Then Begin + For i := 0 To Pred(i) Do Begin + SaveObjectToStream(ARoot^.ArrayData^.Items^[i],ADest); + End; + End; + End; + End; +End; + +function LoadObjectFromStream(const AStoreRdr : IDataStoreReader):PDataBuffer; +Var + i : TInt32S; + s : string; +Begin + Result := Nil; + If AStoreRdr.IsAtEof() Then + Exit; + i := AStoreRdr.ReadInt32S(); + s := AStoreRdr.ReadStr(); + If ( TDataType(i) < dtArray ) Then + Result := CreateObjBuffer(TDataType(i),s); + Case TDataType(i) Of + dtInt8S : Result^.Int8S := AStoreRdr.ReadInt8S(); + dtInt8U : Result^.Int8U := AStoreRdr.ReadInt8U(); + dtInt16U : Result^.Int16U := AStoreRdr.ReadInt16U(); + dtInt16S : Result^.Int16S := AStoreRdr.ReadInt16S(); + dtInt32U : Result^.Int32U := AStoreRdr.ReadInt32U(); + dtInt32S : Result^.Int32S := AStoreRdr.ReadInt32S(); + dtInt64U : Result^.Int64U := AStoreRdr.ReadInt64U(); + dtInt64S : Result^.Int64S := AStoreRdr.ReadInt64S(); + + dtSingle : Result^.SingleData := AStoreRdr.ReadSingle(); + dtDouble : Result^.DoubleData := AStoreRdr.ReadDouble(); + dtExtended : Result^.ExtendedData := AStoreRdr.ReadExtended(); + dtCurrency : Result^.CurrencyData := AStoreRdr.ReadCurrency(); + + dtString : Result^.StrData^.Data := AStoreRdr.ReadStr(); + dtBool : Result^.BoolData := AStoreRdr.ReadBool(); + dtEnum : Result^.EnumData := AStoreRdr.ReadEnum(); + dtObject : + Begin + Result^.ObjectData^.NilObject := AStoreRdr.ReadBool(); + if not Result^.ObjectData^.NilObject then begin + i := AStoreRdr.ReadInt32S(); + For i := 1 To i Do Begin + AddObj(Result,LoadObjectFromStream(AStoreRdr)); + End; + if AStoreRdr.ReadBool() then + Result^.ObjectData^.InnerData := LoadObjectFromStream(AStoreRdr); + end; + end; + dtArray : + Begin + i := AStoreRdr.ReadInt32S(); + Result := CreateArrayBuffer(i,s); + For i := 0 To Pred(i) Do Begin + AddObj(Result,LoadObjectFromStream(AStoreRdr),i); + End; + End; + End; +End; + +procedure ClearObjectBuffer(var ABuffer : PObjectBuffer); +var + p,q : PObjectBufferItem; +begin + if Assigned(ABuffer) then begin + if Assigned(ABuffer^.Attributes) then + ClearObjectBuffer(ABuffer^.Attributes); + p := ABuffer^.Head; + while Assigned(p) do begin + q := p; + p := p^.Next; + ClearObj(q^.Data); + Freemem(q^.Data); + q^.Data := Nil; + Freemem(q); + end; + if Assigned(ABuffer^.InnerData) then begin + ClearObj(ABuffer^.InnerData); + ABuffer^.InnerData := nil; + end; + //ABuffer^.Head := nil; + //ABuffer^.Last := nil; + Freemem(ABuffer); + ABuffer := nil; + end; +end; + +procedure ClearObj(const AOwner: PDataBuffer); +Var + i , j: Integer; + eltLen : Integer; +Begin + AOwner^.Name := ''; + Case AOwner^.DataType Of + dtString : + Begin + AOwner^.StrData^.Data := ''; + Freemem(AOwner^.StrData); + AOwner^.StrData := Nil; + End; + dtObject : + Begin + ClearObjectBuffer(AOwner^.ObjectData); + End; + dtArray : + Begin + eltLen := SizeOf(TDataBuffer); + For j := 0 to Pred(AOwner^.ArrayData^.Count) Do Begin + ClearObj(AOwner^.ArrayData^.Items^[j]); + Freemem(AOwner^.ArrayData^.Items^[j],eltLen); + AOwner^.ArrayData^.Items^[j] := Nil; + End; + i := AOwner^.ArrayData^.Count * SizeOf(PDataBuffer); + Freemem(AOwner^.ArrayData^.Items,i); + AOwner^.ArrayData^.Items := Nil; + ClearObjectBuffer(AOwner^.ArrayData^.Attributes); + i := SizeOf(TArrayBuffer); + Freemem(AOwner^.ArrayData,i); + AOwner^.ArrayData := Nil; + End; + End; +End; + + +{ TStackItem } + +constructor TStackItem.Create(const AScopeObject: PDataBuffer; AScopeType: TScopeType); +begin + Assert(Assigned(AScopeObject)); + FScopeObject := AScopeObject; + FScopeType := AScopeType; +end; + +{ TObjectStackItem } + +constructor TObjectStackItem.Create(const AScopeObject: PDataBuffer); +begin + Inherited Create(AScopeObject,stObject); +end; + +function TObjectStackItem.GetItemCount(): Integer; +begin + Result := ScopeObject^.ObjectData^.Count; +end; + +function TObjectStackItem.Find(var AName: TDataName): PDataBuffer; +begin + Result := FindObj(ScopeObject,AName); +end; + +function TObjectStackItem.GetByIndex(const AIndex: Integer): PDataBuffer; +Var + p : PObjectBufferItem; + i : Integer; +begin + If ( AIndex >=0 ) And ( AIndex < ScopeObject^.ObjectData^.Count) Then Begin + p := ScopeObject^.ObjectData^.Head; + For i := 1 To AIndex Do + p := p^.Next; + Result := p^.Data; + End Else + Raise EBinaryFormatterException.CreateFmt('Invalid index access : %d',[AIndex]); +end; + +function TObjectStackItem.CreateBuffer( + Const AName : String; + const ADataType : TDataType +):PDataBuffer; +begin + Result := CreateObjBuffer(ADataType,AName,ScopeObject); +end; + +function TObjectStackItem.CreateInnerBuffer(const ADataType: TDataType): PDataBuffer; +begin + Result := CreateObjBuffer(ADataType,sSCOPE_INNER_NAME,nil); + ScopeObject^.ObjectData^.InnerData := Result; +end; + +function TObjectStackItem.GetInnerBuffer(): PDataBuffer; +begin + Result := ScopeObject^.ObjectData^.InnerData; +end; + +procedure TObjectStackItem.NilCurrentScope(); +begin + Assert(ScopeObject^.ObjectData^.Count = 0); + ScopeObject^.ObjectData^.NilObject := True; +end; + +function TObjectStackItem.IsCurrentScopeNil(): Boolean; +begin + Result := ScopeObject^.ObjectData^.NilObject; +end; + +//---------------------------------------------------------------- +{ TBaseBinaryFormatter } + +procedure TBaseBinaryFormatter.ClearStack(); +Var + i, c : Integer; +begin + c := FStack.Count; + For I := 1 To c Do + FStack.Pop().Free(); +end; + +procedure TBaseBinaryFormatter.PushStack(AScopeObject: PDataBuffer;const AScopeType: TScopeType); +begin + If ( AScopeType = stObject ) Then + FStack.Push(TObjectStackItem.Create(AScopeObject)) + Else If ( AScopeType = stArray ) Then + FStack.Push(TArrayStackItem.Create(AScopeObject)) + Else + Assert(False); +end; + +function TBaseBinaryFormatter.StackTop(): TStackItem; +begin + Result := FStack.Peek() as TStackItem; +end; + +function TBaseBinaryFormatter.PopStack(): TStackItem; +begin + Result := FStack.Pop() as TStackItem; +end; + +function TBaseBinaryFormatter.GetRootData(): PDataBuffer; +begin + Result := FRootData; +end; + +procedure TBaseBinaryFormatter.PutFloat( + const AName : String; + const ATypeInfo : PTypeInfo; + const AData : TFloat_Extended_10 +); +begin + Case GetTypeData(ATypeInfo)^.FloatType Of + ftSingle : StackTop().CreateBuffer(AName,dtSingle)^.SingleData := AData; + ftDouble : StackTop().CreateBuffer(AName,dtDouble)^.DoubleData := AData; + ftExtended : StackTop().CreateBuffer(AName,dtExtended)^.ExtendedData := AData; + ftCurr : StackTop().CreateBuffer(AName,dtCurrency)^.CurrencyData := AData; + Else + StackTop().CreateBuffer(AName,dtExtended)^.ExtendedData := AData; + End; +end; + +function TBaseBinaryFormatter.GetCurrentScopeObject(): PDataBuffer; +begin + Result := StackTop().ScopeObject; +end; + +procedure TBaseBinaryFormatter.SetSerializationStyle( + const ASerializationStyle: TSerializationStyle +); +begin + FSerializationStyle := ASerializationStyle; +end; + +function TBaseBinaryFormatter.GetSerializationStyle(): TSerializationStyle; +begin + Result := FSerializationStyle; +end; + +function TBaseBinaryFormatter.HasScope(): Boolean; +begin + Result := ( FStack.Peek <> nil ); +end; + +procedure TBaseBinaryFormatter.CheckScope(); +begin + If Not HasScope() Then + Error('There is no scope.'); +end; + +function TBaseBinaryFormatter.GetCurrentScope: String; +begin + Result := GetCurrentScopeObject()^.Name; +end; + +procedure TBaseBinaryFormatter.PutInt( + const AName : String; + const ATypeInfo : PTypeInfo; + const AData : TInt64S +); +begin + Case GetTypeData(ATypeInfo)^.OrdType Of + otSByte : StackTop().CreateBuffer(AName,dtInt8S)^.Int8S := AData; + otUByte : StackTop().CreateBuffer(AName,dtInt8U)^.Int8U := AData; + otSWord : StackTop().CreateBuffer(AName,dtInt16S)^.Int16S := AData; + otUWord : StackTop().CreateBuffer(AName,dtInt16U)^.Int16U := AData; + otULong : StackTop().CreateBuffer(AName,dtInt32U)^.Int32U := AData; + otSLong : StackTop().CreateBuffer(AName,dtInt32S)^.Int32S := AData; + End; +end; + +procedure TBaseBinaryFormatter.PutStr( + const AName : String; + const ATypeInfo : PTypeInfo; + const AData : String +); +begin + StackTop().CreateBuffer(AName,dtString)^.StrData^.Data := AData; +end; + +procedure TBaseBinaryFormatter.PutEnum( + const AName: String; + const ATypeInfo: PTypeInfo; + const AData: TEnumData +); +begin + StackTop().CreateBuffer(AName,dtEnum)^.EnumData := AData; +end; + +procedure TBaseBinaryFormatter.PutBool( + const AName: String; + const ATypeInfo: PTypeInfo; + const AData: Boolean +); +begin + StackTop().CreateBuffer(AName,dtBool)^.BoolData := AData; +end; + +procedure TBaseBinaryFormatter.PutInt64( + const AName: String; + const ATypeInfo: PTypeInfo; + const AData: Int64 +); +begin + StackTop().CreateBuffer(AName,dtInt64S)^.Int64S := AData; +end; + +procedure TBaseBinaryFormatter.PutObj( + const AName: String; + const ATypeInfo: PTypeInfo; + const AData: TObject +); +begin + TBaseRemotableClass(GetTypeData(ATypeInfo)^.ClassType).Save(AData As TBaseRemotable, Self,AName,ATypeInfo); +end; + +function TBaseBinaryFormatter.GetDataBuffer(var AName: String): PDataBuffer; +begin + Result := StackTop().Find(AName); + If Not Assigned(Result) Then + Error('Param not found : "%s"',[AName]); +end; + +procedure TBaseBinaryFormatter.GetEnum( + const ATypeInfo: PTypeInfo; + var AName: String; + var AData: TEnumData +); +begin + AData := GetDataBuffer(AName)^.EnumData; +end; + +procedure TBaseBinaryFormatter.GetBool( + const ATypeInfo: PTypeInfo; + var AName: String; + var AData: Boolean +); +begin + AData := GetDataBuffer(AName)^.BoolData; +end; + +procedure TBaseBinaryFormatter.GetFloat( + const ATypeInfo : PTypeInfo; + var AName : String; + var AData : TFloat_Extended_10 +); +Var + t : PDataBuffer; +begin + t := GetDataBuffer(AName); + Case GetTypeData(ATypeInfo)^.FloatType Of + ftSingle : AData := t^.SingleData; + ftDouble : AData := t^.DoubleData; + ftExtended : AData := t^.ExtendedData; + ftCurr : AData := t^.CurrencyData; + Else + AData := t^.ExtendedData; + End; +end; + +procedure TBaseBinaryFormatter.GetInt( + const ATypeInfo: PTypeInfo; + var AName: String; + var AData: TInt64S +); +Var + t : PDataBuffer; +begin + t := GetDataBuffer(AName); + Case GetTypeData(ATypeInfo)^.OrdType Of + otSByte : AData := t^.Int8S; + otUByte : AData := t^.Int8U; + otSWord : AData := t^.Int16S; + otUWord : AData := t^.Int16U; + otSLong : AData := t^.Int32S; + otULong : AData := t^.Int32U; + Else + Assert(False); + End; +end; + +procedure TBaseBinaryFormatter.GetInt64( + const ATypeInfo: PTypeInfo; + var AName: String; + var AData: Int64 +); +begin + AData := GetDataBuffer(AName)^.Int64S; +end; + +procedure TBaseBinaryFormatter.GetStr( + const ATypeInfo: PTypeInfo; + var AName: String; + var AData: String +); +begin + AData := GetDataBuffer(AName)^.StrData^.Data; +end; + +procedure TBaseBinaryFormatter.GetObj( + const ATypeInfo: PTypeInfo; + var AName: String; + var AData: TObject +); +begin + TBaseRemotableClass(GetTypeData(ATypeInfo)^.ClassType).Load(AData, Self,AName,ATypeInfo); +end; + +procedure TBaseBinaryFormatter.Clear(); +begin + ClearStack(); + ClearObj(FRootData); + Freemem(FRootData); + FRootData := CreateObjBuffer(dtObject,sROOT); + PushStack(FRootData,stObject); +end; + +procedure TBaseBinaryFormatter.BeginArray( + const AName : string; + const ATypeInfo : PTypeInfo; + const AItemTypeInfo : PTypeInfo; + const ABounds : Array Of Integer; + const AStyle : TArrayStyle +); +var + i, j, k : Integer; +begin + If ( Length(ABounds) < 2 ) Then + Raise EBinaryFormatterException.Create('Invalid array bounds.'); + i := ABounds[0]; + j := ABounds[1]; + k := ( j - i + 1 ); + If ( k < 0 ) Then + Raise EBinaryFormatterException.Create('Invalid array bounds.'); + PushStack(CreateArrayBuffer(k,AName,StackTop().ScopeObject),stArray); +end; + +procedure TBaseBinaryFormatter.NilCurrentScope(); +begin + CheckScope(); + StackTop().NilCurrentScope(); +end; + +function TBaseBinaryFormatter.IsCurrentScopeNil(): Boolean; +begin + Result := StackTop().IsCurrentScopeNil(); +end; + +procedure TBaseBinaryFormatter.BeginObject(const AName: TDataName;const ATypeInfo: PTypeInfo); +begin + PushStack(StackTop().CreateBuffer(AName,dtObject)); +end; + +procedure TBaseBinaryFormatter.EndScope(); +begin + FStack.Pop().Free(); +end; + +procedure TBaseBinaryFormatter.AddScopeAttribute(const AName, AValue: string); +begin +end; + +function TBaseBinaryFormatter.BeginObjectRead( + var AScopeName : string; + const ATypeInfo : PTypeInfo +): Integer; +var + locNode : PDataBuffer; + stk : TStackItem; +begin + stk := StackTop(); + locNode := stk.Find(AScopeName); + if not Assigned(locNode) then begin + Error('Scope not found : "%s"',[AScopeName]); + end; + PushStack(locNode,stObject); + Result := StackTop().GetItemCount(); +end; + +function TBaseBinaryFormatter.BeginArrayRead( + var AScopeName : string; + const ATypeInfo : PTypeInfo; + const AStyle : TArrayStyle; + const AItemName : string +): Integer; +var + locNode : PDataBuffer; + stk : TStackItem; +begin + stk := StackTop(); + locNode := stk.Find(AScopeName); + if not Assigned(locNode) then begin + Error('Scope not found : "%s"',[AScopeName]); + end; + PushStack(locNode,stArray); + Result := StackTop().GetItemCount(); +end; + +procedure TBaseBinaryFormatter.EndScopeRead(); +begin + PopStack().Free(); +end; + +procedure TBaseBinaryFormatter.BeginHeader(); +begin +{$IFDEF wst_binary_header} + if ( FHeaderEnterCount <= 0 ) then begin + Inc(FHeaderEnterCount); + BeginObject(sHEADER,nil); + end; +{$ENDIF} +end; + +procedure TBaseBinaryFormatter.EndHeader(); +begin +{$IFDEF wst_binary_header} + if ( FHeaderEnterCount > 0 ) then begin + Dec(FHeaderEnterCount); + EndScope(); + end; +{$ENDIF} +end; + +procedure TBaseBinaryFormatter.Put(const AName: String; const ATypeInfo: PTypeInfo;const AData); +Var + int64Data : Int64; + strData : string; + objData : TObject; + boolData : Boolean; + enumData : TEnumData; + floatDt : TFloat_Extended_10; +begin + Case ATypeInfo^.Kind Of + tkLString{$IFDEF FPC},tkAString{$ENDIF} : + Begin + strData := String(AData); + PutStr(AName,ATypeInfo,strData); + End; + tkInt64{$IFDEF FPC},tkQWord{$ENDIF} : + Begin + int64Data := Int64(AData); + PutInt64(AName,ATypeInfo,int64Data); + End; + tkClass : + Begin + objData := TObject(AData); + PutObj(AName,ATypeInfo,objData); + End; + {$IFDEF FPC} + tkBool : + Begin + boolData := Boolean(AData); + PutBool(AName,ATypeInfo,boolData); + End; + {$ENDIF} + tkInteger, tkEnumeration : + begin + {$IFNDEF FPC} + if ( ATypeInfo^.Kind = tkEnumeration ) and + ( GetTypeData(ATypeInfo)^.BaseType^ = TypeInfo(Boolean) ) + then begin + boolData := Boolean(AData); + PutBool(AName,ATypeInfo,boolData); + end else begin + {$ENDIF} + enumData := 0; + Case GetTypeData(ATypeInfo)^.OrdType Of + otSByte : enumData := ShortInt(AData); + otUByte : enumData := Byte(AData); + otSWord : enumData := SmallInt(AData); + otUWord : enumData := Word(AData); + otSLong : enumData := LongInt(AData); + otULong : enumData := LongWord(AData); + End; + If ( ATypeInfo^.Kind = tkInteger ) Then + PutInt(AName,ATypeInfo,enumData) + Else + PutEnum(AName,ATypeInfo,enumData); + {$IFNDEF FPC} + end; + {$ENDIF} + end; + tkFloat : + Begin + floatDt := 0; + Case GetTypeData(ATypeInfo)^.FloatType Of + ftSingle : floatDt := Single(AData); + ftDouble : floatDt := Double(AData); + ftExtended : floatDt := Extended(AData); + ftCurr : floatDt := Currency(AData); + ftComp : floatDt := Comp(AData); + End; + PutFloat(AName,ATypeInfo,floatDt); + End; + End; +end; + +procedure TBaseBinaryFormatter.PutScopeInnerValue( + const ATypeInfo : PTypeInfo; + const AData +); +var + int64SData : Int64; + int64UData : QWord; + strData : string; + boolData : Boolean; + enumData : TEnumData; + floatDt : TFloat_Extended_10; +begin + CheckScope(); + case ATypeInfo^.Kind of + tkLString{$IFDEF FPC},tkAString{$ENDIF} : + begin + strData := string(AData); + StackTop().CreateInnerBuffer(dtString)^.StrData^.Data := strData; + end; + tkInt64 : + begin + int64SData := Int64(AData); + StackTop().CreateInnerBuffer(dtInt64S)^.Int64S := int64SData; + end; + {$IFDEF FPC} + tkQWord : + begin + int64UData := QWord(AData); + StackTop().CreateInnerBuffer(dtInt64U)^.Int64U := int64UData; + end; + {$ENDIF} + tkClass : + begin + raise EBinaryFormatterException.Create('Inner Scope value must be a "simple type" value.'); + end; + {$IFDEF FPC} + tkBool : + begin + boolData := Boolean(AData); + StackTop().CreateInnerBuffer(dtBool)^.BoolData := boolData; + end; + {$ENDIF} + tkInteger : + begin + enumData := 0; + case GetTypeData(ATypeInfo)^.OrdType of + otSByte : + begin + enumData := ShortInt(AData); + StackTop().CreateInnerBuffer(dtInt8S)^.Int8S := enumData; + end; + otUByte : + begin + enumData := Byte(AData); + StackTop().CreateInnerBuffer(dtInt8U)^.Int8U := enumData; + end; + otSWord : + begin + enumData := SmallInt(AData); + StackTop().CreateInnerBuffer(dtInt16S)^.Int16S := enumData; + end; + otUWord : + begin + enumData := Word(AData); + StackTop().CreateInnerBuffer(dtInt16U)^.Int16U := enumData; + end; + otSLong : + begin + enumData := LongInt(AData); + StackTop().CreateInnerBuffer(dtInt32S)^.Int32S := enumData; + end; + otULong : + begin + enumData := LongWord(AData); + StackTop().CreateInnerBuffer(dtInt32U)^.Int32U := enumData; + end; + end; + end; + tkEnumeration : + begin + {$IFNDEF FPC} + if ( ATypeInfo^.Kind = tkEnumeration ) and + ( GetTypeData(ATypeInfo)^.BaseType^ = TypeInfo(Boolean) ) + then begin + boolData := Boolean(AData); + StackTop().CreateInnerBuffer(dtBool)^.BoolData := boolData; + end else begin + {$ENDIF} + enumData := 0; + case GetTypeData(ATypeInfo)^.OrdType of + otSByte : enumData := ShortInt(AData); + otUByte : enumData := Byte(AData); + otSWord : enumData := SmallInt(AData); + otUWord : enumData := Word(AData); + otSLong : enumData := LongInt(AData); + otULong : enumData := LongWord(AData); + end; + StackTop().CreateInnerBuffer(dtEnum)^.EnumData := enumData; + {$IFNDEF FPC} + end; + {$ENDIF} + end; + tkFloat : + begin + floatDt := 0; + case GetTypeData(ATypeInfo)^.FloatType of + ftSingle : + begin + floatDt := Single(AData); + StackTop().CreateInnerBuffer(dtSingle)^.SingleData := floatDt; + end; + ftDouble : + begin + floatDt := Double(AData); + StackTop().CreateInnerBuffer(dtDouble)^.DoubleData := floatDt; + end; + ftExtended : + begin + floatDt := Extended(AData); + StackTop().CreateInnerBuffer(dtExtended)^.ExtendedData := floatDt; + end; + ftCurr : + begin + floatDt := Currency(AData); + StackTop().CreateInnerBuffer(dtExtended)^.ExtendedData := floatDt; + end; + ftComp : + begin + floatDt := Comp(AData); + StackTop().CreateInnerBuffer(dtCurrency)^.CurrencyData := floatDt; + end; + else + StackTop().CreateInnerBuffer(dtExtended)^.ExtendedData := floatDt; + end; + end; + end; +end; + +procedure TBaseBinaryFormatter.Get( + const ATypeInfo: PTypeInfo; + var AName: String; + var AData +); +Var + int64Data : Int64; + strData : string; + objData : TObject; + boolData : Boolean; + enumData : TEnumData; + floatDt : TFloat_Extended_10; +begin + Case ATypeInfo^.Kind Of + tkInt64{$IFDEF FPC},tkQWord{$ENDIF} : + Begin + int64Data := 0; + GetInt64(ATypeInfo,AName,int64Data); + Int64(AData) := int64Data; + End; + tkLString{$IFDEF FPC},tkAString{$ENDIF} : + Begin + strData := ''; + GetStr(ATypeInfo,AName,strData); + String(AData) := strData; + End; + tkClass : + Begin + objData := TObject(AData); + GetObj(ATypeInfo,AName,objData); + TObject(AData) := objData; + End; + {$IFDEF FPC} + tkBool : + Begin + boolData := False; + GetBool(ATypeInfo,AName,boolData); + Boolean(AData) := boolData; + End; + {$ENDIF} + tkInteger, tkEnumeration : + Begin + {$IFNDEF FPC} + if ( ATypeInfo^.Kind = tkEnumeration ) and + ( GetTypeData(ATypeInfo)^.BaseType^ = TypeInfo(Boolean) ) + then begin + boolData := False; + GetBool(ATypeInfo,AName,boolData); + Boolean(AData) := boolData; + end else begin + {$ENDIF} + enumData := 0; + If ( ATypeInfo^.Kind = tkInteger ) Then + GetInt(ATypeInfo,AName,enumData) + Else + GetEnum(ATypeInfo,AName,enumData); + Case GetTypeData(ATypeInfo)^.OrdType Of + otSByte : ShortInt(AData) := enumData; + otUByte : Byte(AData) := enumData; + otSWord : SmallInt(AData) := enumData; + otUWord : Word(AData) := enumData; + otSLong : LongInt(AData) := enumData; + otULong : LongWord(AData) := enumData; + End; + {$IFNDEF FPC} + end; + {$ENDIF} + End; + tkFloat : + Begin + floatDt := 0; + GetFloat(ATypeInfo,AName,floatDt); + Case GetTypeData(ATypeInfo)^.FloatType Of + ftSingle : Single(AData) := floatDt; + ftDouble : Double(AData) := floatDt; + ftExtended : Extended(AData) := floatDt; + ftCurr : Currency(AData) := floatDt; + ftComp : Comp(AData) := floatDt; + End; + End; + End; +end; + +procedure TBaseBinaryFormatter.GetScopeInnerValue( + const ATypeInfo : PTypeInfo; + var AData +); +Var + dataBuffer : PDataBuffer; +begin + CheckScope(); + dataBuffer := StackTop().GetInnerBuffer(); + Case ATypeInfo^.Kind Of + tkInt64 : Int64(AData) := dataBuffer^.Int64S; + {$IFDEF FPC} + tkQWord : QWord(AData) := dataBuffer^.Int64U; + {$ENDIF} + + tkLString + {$IFDEF FPC}, + tkAString + {$ENDIF} : string(AData) := dataBuffer^.StrData^.Data; + + tkClass : raise EBinaryFormatterException.Create('Inner Scope value must be a "simple type" value.'); + {$IFDEF FPC} + tkBool : Boolean(AData) := dataBuffer^.BoolData; + {$ENDIF} + tkInteger : + begin + case GetTypeData(ATypeInfo)^.OrdType Of + otSByte : ShortInt(AData) := dataBuffer^.Int8S; + otUByte : Byte(AData) := dataBuffer^.Int8U; + otSWord : SmallInt(AData) := dataBuffer^.Int16S; + otUWord : Word(AData) := dataBuffer^.Int16U; + otSLong : LongInt(AData) := dataBuffer^.Int32S; + otULong : LongWord(AData) := dataBuffer^.Int32U; + end; + end; + tkEnumeration : + begin + {$IFNDEF FPC} + if ( ATypeInfo^.Kind = tkEnumeration ) and + ( GetTypeData(ATypeInfo)^.BaseType^ = TypeInfo(Boolean) ) + then begin + Boolean(AData) := dataBuffer^.BoolData; + end else begin + {$ENDIF} + case GetTypeData(ATypeInfo)^.OrdType Of + otSByte : ShortInt(AData) := dataBuffer^.EnumData; + otUByte : Byte(AData) := dataBuffer^.EnumData; + otSWord : SmallInt(AData) := dataBuffer^.EnumData; + otUWord : Word(AData) := dataBuffer^.EnumData; + otSLong : LongInt(AData) := dataBuffer^.EnumData; + otULong : LongWord(AData) := dataBuffer^.EnumData; + end; + {$IFNDEF FPC} + end; + {$ENDIF} + end; + tkFloat : + begin + case GetTypeData(ATypeInfo)^.FloatType of + ftSingle : Single(AData) := dataBuffer^.SingleData; + ftDouble : Double(AData) := dataBuffer^.DoubleData; + ftExtended : Extended(AData) := dataBuffer^.ExtendedData; + ftCurr : Currency(AData) := dataBuffer^.CurrencyData; + else + Comp(AData) := dataBuffer^.ExtendedData; + end; + end; + end; +end; + +procedure TBaseBinaryFormatter.SaveToStream(AStream: TStream); +Var + locStore : IDataStore; +begin + locStore := CreateBinaryWriter(AStream); + SaveObjectToStream(FRootData,locStore); +end; + +procedure TBaseBinaryFormatter.LoadFromStream(AStream: TStream); +Var + locRdr : IDataStoreReader; + tmpRoot : PDataBuffer; +begin + locRdr := CreateBinaryReader(AStream); + tmpRoot := LoadObjectFromStream(locRdr); + + ClearStack(); + ClearObj(FRootData); + Freemem(FRootData); + FRootData := tmpRoot; + PushStack(FRootData,stObject); +end; + +procedure TBaseBinaryFormatter.Error(const AMsg: string); +begin + Raise EBinaryFormatterException.Create(AMsg); +end; + +procedure TBaseBinaryFormatter.Error(const AMsg: string;const AArgs: array of const); +begin + Raise EBinaryFormatterException.CreateFmt(AMsg,AArgs); +end; + +constructor TBaseBinaryFormatter.Create(); +begin + FRootData := CreateObjBuffer(dtObject,sROOT); + FStack := TObjectStack.Create(); + PushStack(FRootData,stObject); +end; + +destructor TBaseBinaryFormatter.Destroy(); +begin + ClearStack(); + FreeAndNil(FStack); + ClearObj(FRootData); + Freemem(FRootData); + inherited Destroy(); +end; + +{ TArrayStackItem } + +constructor TArrayStackItem.Create(const AScopeObject: PDataBuffer); +begin + Inherited Create(AScopeObject,stArray); + FIndex := 0; +end; + +function TArrayStackItem.GetItemCount(): Integer; +begin + Result := ScopeObject^.ArrayData^.Count; +end; + +function TArrayStackItem.Find(var AName: TDataName): PDataBuffer; +begin + If ( FIndex >= 0 ) And ( FIndex < ScopeObject^.ArrayData^.Count ) Then + Result := ScopeObject^.ArrayData^.Items^[FIndex] + Else + Raise EBinaryFormatterException.CreateFmt('Invalid array index : %d',[FIndex]); + Inc(FIndex); +end; + +function TArrayStackItem.GetByIndex(const AIndex: Integer): PDataBuffer; +begin + If ( AIndex >= 0 ) And ( AIndex < ScopeObject^.ArrayData^.Count ) Then + Result := ScopeObject^.ArrayData^.Items^[AIndex] + Else + Raise EBinaryFormatterException.CreateFmt('Invalid array index : %d',[AIndex]); +end; + +function TArrayStackItem.CreateBuffer( + const AName : String; + const ADataType : TDataType +): PDataBuffer; +begin + If ( FIndex >= 0 ) And ( FIndex < ScopeObject^.ArrayData^.Count ) Then + Result := CreateObjBuffer(ADataType,AName,Nil) + Else + Raise EBinaryFormatterException.CreateFmt('Invalid array index : %d',[FIndex]); + ScopeObject^.ArrayData^.Items^[FIndex] := Result; + Inc(FIndex); +end; + +function TArrayStackItem.CreateInnerBuffer(const ADataType: TDataType): PDataBuffer; +begin + raise EBinaryFormatterException.Create('Array do not support "inner value" feature.'); +end; + +function TArrayStackItem.GetInnerBuffer(): PDataBuffer; +begin + raise EBinaryFormatterException.Create('Array do not support "inner value" feature.'); +end; + +procedure TArrayStackItem.NilCurrentScope(); +begin +end; + +function TArrayStackItem.IsCurrentScopeNil(): Boolean; +begin + Result := False; +end; + +end. diff --git a/wst/tags/0.4/base_service_intf.pas b/wst/tags/0.4/base_service_intf.pas new file mode 100644 index 000000000..367b272e3 --- /dev/null +++ b/wst/tags/0.4/base_service_intf.pas @@ -0,0 +1,4148 @@ +{ + This file is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This file is provide under modified LGPL licence + ( the files COPYING.modifiedLGPL and COPYING.LGPL). + + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +} +unit base_service_intf; + +interface + +uses + Classes, SysUtils, TypInfo, Contnrs; + +{$INCLUDE wst.inc} +{$INCLUDE wst_delphi.inc} + +const + stBase = 0; + stObject = stBase + 1; + stArray = stBase + 2; + + sARRAY_ITEM = 'item'; + sARRAY_STYLE = 'style'; + + // array style string + sScoped = 'scoped'; + sEmbedded = 'embedded'; + +type + + { standart data types defines } + anyURI = type string; + token = type string; + nonNegativeInteger = type LongWord; + positiveInteger = type nonNegativeInteger; + float = Single; + + TScopeType = Integer; + TArrayStyle = ( asScoped, asEmbeded, asNone ); + THeaderDirection = ( hdOut, hdIn ); + THeaderDirections = set of THeaderDirection; +const + AllHeaderDirection = [Low(THeaderDirection)..High(THeaderDirection)]; + +type + + EServiceException = class(Exception) + End; + + EBaseRemoteException = class(EServiceException) + private + FFaultCode: string; + FFaultString: string; + Published + property FaultCode : string Read FFaultCode Write FFaultCode; + property FaultString : string Read FFaultString Write FFaultString; + End; + + ETypeRegistryException = class(EServiceException) + End; + + IItemFactory = Interface; + IFormatterBase = Interface; + IFormatterRegistry = Interface; + + TBaseRemotable = class; + THeaderBlock = class; + + //Utility interface used to configure its parent. + IPropertyManager = Interface + ['{A3A6B8F4-E50D-4956-B416-C642C72E4672}'] + procedure SetProperty(Const AName,AValue:string); + procedure SetProperties(Const APropsStr:string); + function GetProperty(Const AName:String):string; + function GetPropertyNames(ADest : TStrings):Integer; + procedure Clear(); + procedure Copy(ASource:IPropertyManager; Const AClearBefore : Boolean); + End; + + IItemFactory = interface + ['{38258BC0-CBE6-437B-B104-9A62475E53AC}'] + function CreateInstance():IInterface; + end; + + IItemFactoryEx = interface(IItemFactory) + ['{66B77926-7E45-4780-8FFB-FB78625EDC1D}'] + function GetPropertyManager( + const APropertyGroup : string; + const ACreateIfNotExists : Boolean + ):IPropertyManager; + end; + + IFormatterRegistry = Interface + ['{E4D69D2A-F0A5-43E1-8C56-B47E7AB5D1AF}'] + function Find(const AFormatterName : string):IFormatterBase; + procedure Register( + const AFormatterName : string; + AFactory : IItemFactory + ); + End; + + ICallContext = Interface + ['{855EB8E2-0700-45B1-B852-2101023200E0}'] + procedure AddObjectToFree(const AObject : TObject); + procedure Clear(); + function AddHeader( + const AHeader : THeaderBlock; + const AKeepOwnership : Boolean + ):Integer; + function GetHeaderCount(const ADirections : THeaderDirections):Integer; + function GetHeader(const AIndex : Integer) : THeaderBlock; + procedure ClearHeaders(const ADirection : THeaderDirection); + End; + + TSerializationStyle = ( ssNodeSerialization, ssAttibuteSerialization ); + + IFormatterBase = Interface + ['{2AB3BF54-B7D6-4C46-8245-133C8775E9C1}'] + procedure SetSerializationStyle(const ASerializationStyle : TSerializationStyle); + function GetSerializationStyle():TSerializationStyle; + function GetCurrentScope():string; + procedure Clear(); + + procedure BeginObject( + Const AName : string; + Const ATypeInfo : PTypeInfo + ); + procedure BeginArray( + const AName : string; + const ATypeInfo : PTypeInfo; + const AItemTypeInfo : PTypeInfo; + const ABounds : Array Of Integer; + const AStyle : TArrayStyle + ); + procedure NilCurrentScope(); + function IsCurrentScopeNil():Boolean; + procedure EndScope(); + procedure AddScopeAttribute(Const AName,AValue : string); + function BeginObjectRead( + var AScopeName : string; + const ATypeInfo : PTypeInfo + ) : Integer; + function BeginArrayRead( + var AScopeName : string; + const ATypeInfo : PTypeInfo; + const AStyle : TArrayStyle; + const AItemName : string + ):Integer; + procedure EndScopeRead(); + property CurrentScope : String Read GetCurrentScope; + + procedure BeginHeader(); + procedure EndHeader(); + + procedure Put( + Const AName : String; + Const ATypeInfo : PTypeInfo; + Const AData + ); + procedure PutScopeInnerValue( + const ATypeInfo : PTypeInfo; + const AData + ); + procedure Get( + Const ATypeInfo : PTypeInfo; + Var AName : String; + Var AData + ); + procedure GetScopeInnerValue( + const ATypeInfo : PTypeInfo; + var AData + ); + + procedure SaveToStream(AStream : TStream); + procedure LoadFromStream(AStream : TStream); + + // This procedures will raise exceptions!!! + procedure Error(Const AMsg:string);overload; + procedure Error(Const AMsg:string; Const AArgs : array of const);overload; + End; + + { TSimpleCallContext } + + TSimpleCallContext = class(TInterfacedObject,ICallContext) + private + FHeaderList : TObjectList; + FFreeObjectList : TObjectList; + protected + procedure AddObjectToFree(const AObject : TObject); + procedure Clear(); + function AddHeader( + const AHeader : THeaderBlock; + const AKeepOwnership : Boolean + ):Integer; + function GetHeaderCount(const ADirections : THeaderDirections):Integer; + function GetHeader(const AIndex : Integer) : THeaderBlock; + procedure ClearHeaders(const ADirection : THeaderDirection); + procedure FreeHeader(AHeader : THeaderBlock); + Public + constructor Create(); + destructor Destroy();override; + End; + + { TBaseRemotable } + TBaseRemotableClass = class of TBaseRemotable; + TBaseRemotable = class(TPersistent) + Public + constructor Create();virtual; + class procedure Save( + AObject : TBaseRemotable; + AStore : IFormatterBase; + Const AName : String; + Const ATypeInfo : PTypeInfo + );virtual;abstract; + class procedure Load( + Var AObject : TObject; + AStore : IFormatterBase; + var AName : String; + const ATypeInfo : PTypeInfo + );virtual;abstract; + End; + + TAbstractSimpleRemotableClass = class of TAbstractSimpleRemotable; + TAbstractSimpleRemotable = class(TBaseRemotable) + end; + + { TBaseDateRemotable } + + TBaseDateRemotable = class(TAbstractSimpleRemotable) + private + FDate : TDateTime; + FYear : Integer; + FMonth : Integer; + FDay : Integer; + protected + procedure SetDate(const AValue: TDateTime);virtual; + public + class procedure Save( + AObject : TBaseRemotable; + AStore : IFormatterBase; + const AName : string; + const ATypeInfo : PTypeInfo + );override; + class procedure Load( + var AObject : TObject; + AStore : IFormatterBase; + var AName : string; + const ATypeInfo : PTypeInfo + );override; + class function FormatDate(const ADate : TDateTime):string;virtual;abstract; + class function ParseDate(const ABuffer : string):TDateTime;virtual;abstract; + + procedure Assign(Source: TPersistent); override; + + property AsDate : TDateTime read FDate write SetDate; + property Year : Integer read FYear; + property Month : Integer read FMonth; + property Day : Integer read FDay; + end; + + { TDateRemotable } + + TDateRemotable = class(TBaseDateRemotable) + private + FHour: Integer; + FMinute: Integer; + FSecond: Integer; + protected + procedure SetDate(const AValue: TDateTime);override; + public + class function FormatDate(const ADate : TDateTime):string;override; + class function ParseDate(const ABuffer : string):TDateTime;override; + property Hour : Integer read FHour; + property Minute : Integer read FMinute; + property Second : Integer read FSecond; + end; + + TDurationRemotable = class(TBaseDateRemotable) + protected + //class function FormatDate(const ADate : TDateTime):string;override; + //class function ParseDate(const ABuffer : string):TDateTime;override; + end; + + TTimeRemotable = class(TBaseDateRemotable) + protected + //class function FormatDate(const ADate : TDateTime):string;override; + //class function ParseDate(const ABuffer : string):TDateTime;override; + end; + + TAbstractComplexRemotableClass = class of TAbstractComplexRemotable; + + { TAbstractComplexRemotable } + + TAbstractComplexRemotable = class(TBaseRemotable) + public + class procedure RegisterAttributeProperty(const AProperty : shortstring);virtual; + class procedure RegisterAttributeProperties(const APropertList : array of shortstring);virtual; + class function IsAttributeProperty(const AProperty : shortstring):Boolean; + + procedure Assign(Source: TPersistent); override; + end; + + TBaseComplexRemotableClass = class of TBaseComplexRemotable; + + { TBaseComplexRemotable } + + TBaseComplexRemotable = class(TAbstractComplexRemotable) + public + class procedure Save( + AObject : TBaseRemotable; + AStore : IFormatterBase; + const AName : string; + const ATypeInfo : PTypeInfo + );override; + class procedure Load( + var AObject : TObject; + AStore : IFormatterBase; + var AName : string; + const ATypeInfo : PTypeInfo + );override; + end; + + { TBaseComplexSimpleContentRemotable } + + TBaseComplexSimpleContentRemotable = class(TAbstractComplexRemotable) + protected + class procedure SaveValue(AObject : TBaseRemotable; AStore : IFormatterBase);virtual;abstract; + class procedure LoadValue(var AObject : TObject; AStore : IFormatterBase);virtual;abstract; + public + class procedure Save( + AObject : TBaseRemotable; + AStore : IFormatterBase; + const AName : string; + const ATypeInfo : PTypeInfo + );override; + class procedure Load( + var AObject : TObject; + AStore : IFormatterBase; + var AName : string; + const ATypeInfo : PTypeInfo + );override; + end; + + { TComplexInt8UContentRemotable } + + TComplexInt8UContentRemotable = class(TBaseComplexSimpleContentRemotable) + private + FValue: Byte; + protected + class procedure SaveValue(AObject : TBaseRemotable; AStore : IFormatterBase);override; + class procedure LoadValue(var AObject : TObject; AStore : IFormatterBase);override; + public + property Value : Byte read FValue write FValue; + end; + + { TComplexInt8SContentRemotable } + + TComplexInt8SContentRemotable = class(TBaseComplexSimpleContentRemotable) + private + FValue: ShortInt; + protected + class procedure SaveValue(AObject : TBaseRemotable; AStore : IFormatterBase);override; + class procedure LoadValue(var AObject : TObject; AStore : IFormatterBase);override; + public + property Value : ShortInt read FValue write FValue; + end; + + { TComplexInt16SContentRemotable } + + TComplexInt16SContentRemotable = class(TBaseComplexSimpleContentRemotable) + private + FValue: SmallInt; + protected + class procedure SaveValue(AObject : TBaseRemotable; AStore : IFormatterBase);override; + class procedure LoadValue(var AObject : TObject; AStore : IFormatterBase);override; + public + property Value : SmallInt read FValue write FValue; + end; + + TComplexInt16UContentRemotable = class(TBaseComplexSimpleContentRemotable) + private + FValue: Word; + protected + class procedure SaveValue(AObject : TBaseRemotable; AStore : IFormatterBase);override; + class procedure LoadValue(var AObject : TObject; AStore : IFormatterBase);override; + public + property Value : Word read FValue write FValue; + end; + + { TComplexInt32SContentRemotable } + + TComplexInt32SContentRemotable = class(TBaseComplexSimpleContentRemotable) + private + FValue: LongInt; + protected + class procedure SaveValue(AObject : TBaseRemotable; AStore : IFormatterBase);override; + class procedure LoadValue(var AObject : TObject; AStore : IFormatterBase);override; + public + property Value : LongInt read FValue write FValue; + end; + + { TComplexInt32UContentRemotable } + + TComplexInt32UContentRemotable = class(TBaseComplexSimpleContentRemotable) + private + FValue: LongWord; + protected + class procedure SaveValue(AObject : TBaseRemotable; AStore : IFormatterBase);override; + class procedure LoadValue(var AObject : TObject; AStore : IFormatterBase);override; + public + property Value : LongWord read FValue write FValue; + end; + + { TComplexInt64SContentRemotable } + + TComplexInt64SContentRemotable = class(TBaseComplexSimpleContentRemotable) + private + FValue: Int64; + protected + class procedure SaveValue(AObject : TBaseRemotable; AStore : IFormatterBase);override; + class procedure LoadValue(var AObject : TObject; AStore : IFormatterBase);override; + public + property Value : Int64 read FValue write FValue; + end; + + { TComplexInt64UContentRemotable } + + TComplexInt64UContentRemotable = class(TBaseComplexSimpleContentRemotable) + private + FValue: QWord; + protected + class procedure SaveValue(AObject : TBaseRemotable; AStore : IFormatterBase);override; + class procedure LoadValue(var AObject : TObject; AStore : IFormatterBase);override; + public + property Value : QWord read FValue write FValue; + end; + + { TComplexFloatExtendedContentRemotable } + + TComplexFloatExtendedContentRemotable = class(TBaseComplexSimpleContentRemotable) + private + FValue: Extended; + protected + class procedure SaveValue(AObject : TBaseRemotable; AStore : IFormatterBase);override; + class procedure LoadValue(var AObject : TObject; AStore : IFormatterBase);override; + public + property Value : Extended read FValue write FValue; + end; + + { TComplexFloatDoubleContentRemotable } + + TComplexFloatDoubleContentRemotable = class(TBaseComplexSimpleContentRemotable) + private + FValue: Double; + protected + class procedure SaveValue(AObject : TBaseRemotable; AStore : IFormatterBase);override; + class procedure LoadValue(var AObject : TObject; AStore : IFormatterBase);override; + public + property Value : Double read FValue write FValue; + end; + + { TComplexFloatSingleContentRemotable } + + TComplexFloatSingleContentRemotable = class(TBaseComplexSimpleContentRemotable) + private + FValue: Single; + protected + class procedure SaveValue(AObject : TBaseRemotable; AStore : IFormatterBase);override; + class procedure LoadValue(var AObject : TObject; AStore : IFormatterBase);override; + public + property Value : Single read FValue write FValue; + end; + + { TComplexStringContentRemotable } + + TComplexStringContentRemotable = class(TBaseComplexSimpleContentRemotable) + private + FValue: string; + protected + class procedure SaveValue(AObject : TBaseRemotable; AStore : IFormatterBase);override; + class procedure LoadValue(var AObject : TObject; AStore : IFormatterBase);override; + public + property Value : string read FValue write FValue; + end; + + { TComplexBooleanContentRemotable } + + TComplexBooleanContentRemotable = class(TBaseComplexSimpleContentRemotable) + private + FValue: Boolean; + protected + class procedure SaveValue(AObject : TBaseRemotable; AStore : IFormatterBase);override; + class procedure LoadValue(var AObject : TObject; AStore : IFormatterBase);override; + public + property Value : Boolean read FValue write FValue; + end; + + THeaderBlockClass = class of THeaderBlock; + + { THeaderBlock } + + THeaderBlock = class(TBaseComplexRemotable) + private + FDirection: THeaderDirection; + FmustUnderstand: Integer; + FUnderstood: Boolean; + function HasmustUnderstand: boolean; + procedure SetmustUnderstand(const AValue: Integer); + public + property Direction : THeaderDirection read FDirection write FDirection; + property Understood : Boolean read FUnderstood write FUnderstood; + published + property mustUnderstand : Integer read FmustUnderstand write SetmustUnderstand stored HasmustUnderstand; + end; + + TBaseArrayRemotableClass = class of TBaseArrayRemotable; + + { TBaseArrayRemotable } + + TBaseArrayRemotable = class(TAbstractComplexRemotable) + protected + class function GetItemName():string;virtual; + class function GetStyle():TArrayStyle;virtual; + procedure CheckIndex(const AIndex : Integer); + function GetLength():Integer;virtual;abstract; + public + class function GetItemTypeInfo():PTypeInfo;virtual;abstract; + destructor Destroy();override; + + procedure SetLength(const ANewSize : Integer);virtual;abstract; + property Length : Integer Read GetLength; + end; + + { TBaseObjectArrayRemotable + An implementation for array handling. The array items are "owned" by + this class instance, so one has not to free them. + } + TBaseObjectArrayRemotable = class(TBaseArrayRemotable) + Private + FArray : Array Of TBaseRemotable; + Protected + function GetItem(AIndex: Integer): TBaseRemotable; + function GetLength():Integer;override; + Public + class procedure Save( + AObject : TBaseRemotable; + AStore : IFormatterBase; + Const AName : String; + Const ATypeInfo : PTypeInfo + );override; + class procedure Load( + Var AObject : TObject; + AStore : IFormatterBase; + var AName : String; + const ATypeInfo : PTypeInfo + );override; + + class function GetItemClass():TBaseRemotableClass;virtual;abstract; + class function GetItemTypeInfo():PTypeInfo;override; + + constructor Create();override; + procedure Assign(Source: TPersistent); override; + + procedure SetLength(Const ANewSize : Integer);override; + Property Item[AIndex:Integer] : TBaseRemotable Read GetItem;Default; + End; + + TBaseObjectArrayRemotableClass = class of TBaseObjectArrayRemotable; + + { TBaseSimpleTypeArrayRemotable } + + TBaseSimpleTypeArrayRemotable = class(TBaseArrayRemotable) + protected + procedure SaveItem( + AStore : IFormatterBase; + const AName : String; + const AIndex : Integer + );virtual;abstract; + procedure LoadItem( + AStore : IFormatterBase; + const AIndex : Integer + );virtual;abstract; + public + class procedure Save( + AObject : TBaseRemotable; + AStore : IFormatterBase; + const AName : string; + const ATypeInfo : PTypeInfo + );override; + class procedure Load( + var AObject : TObject; + AStore : IFormatterBase; + var AName : string; + const ATypeInfo : PTypeInfo + );override; + end; + + { TArrayOfStringRemotable } + // --------- AnsiString !!!! ---------- + TArrayOfStringRemotable = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of ansistring; + function GetItem(AIndex: Integer): ansistring; + procedure SetItem(AIndex: Integer; const AValue: ansistring); + protected + function GetLength():Integer;override; + procedure SaveItem( + AStore : IFormatterBase; + const AName : String; + const AIndex : Integer + );override; + procedure LoadItem( + AStore : IFormatterBase; + const AIndex : Integer + );override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : ansistring read GetItem write SetItem; default; + end; + + { TArrayOfBooleanRemotable } + + TArrayOfBooleanRemotable = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of Boolean; + function GetItem(AIndex: Integer): Boolean; + procedure SetItem(AIndex: Integer; const AValue: Boolean); + protected + function GetLength():Integer;override; + procedure SaveItem( + AStore : IFormatterBase; + const AName : String; + const AIndex : Integer + );override; + procedure LoadItem( + AStore : IFormatterBase; + const AIndex : Integer + );override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : Boolean read GetItem write SetItem; default; + end; + + { TArrayOfInt8URemotable } + + TArrayOfInt8URemotable = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of Byte; + function GetItem(AIndex: Integer): Byte; + procedure SetItem(AIndex: Integer; const AValue: Byte); + protected + function GetLength():Integer;override; + procedure SaveItem( + AStore : IFormatterBase; + const AName : String; + const AIndex : Integer + );override; + procedure LoadItem( + AStore : IFormatterBase; + const AIndex : Integer + );override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : Byte read GetItem write SetItem; default; + end; + + { TArrayOfInt8SRemotable } + + TArrayOfInt8SRemotable = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of ShortInt; + function GetItem(AIndex: Integer): ShortInt; + procedure SetItem(AIndex: Integer; const AValue: ShortInt); + protected + function GetLength():Integer;override; + procedure SaveItem( + AStore : IFormatterBase; + const AName : String; + const AIndex : Integer + );override; + procedure LoadItem( + AStore : IFormatterBase; + const AIndex : Integer + );override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : ShortInt read GetItem write SetItem; default; + end; + + { TArrayOfInt16SRemotable } + + TArrayOfInt16SRemotable = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of SmallInt; + function GetItem(AIndex: Integer): SmallInt; + procedure SetItem(AIndex: Integer; const AValue: SmallInt); + protected + function GetLength():Integer;override; + procedure SaveItem( + AStore : IFormatterBase; + const AName : String; + const AIndex : Integer + );override; + procedure LoadItem( + AStore : IFormatterBase; + const AIndex : Integer + );override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : SmallInt read GetItem write SetItem; default; + end; + + { TArrayOfInt16URemotable } + + TArrayOfInt16URemotable = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of Word; + function GetItem(AIndex: Integer): Word; + procedure SetItem(AIndex: Integer; const AValue: Word); + protected + function GetLength():Integer;override; + procedure SaveItem( + AStore : IFormatterBase; + const AName : String; + const AIndex : Integer + );override; + procedure LoadItem( + AStore : IFormatterBase; + const AIndex : Integer + );override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : Word read GetItem write SetItem; default; + end; + + { TArrayOfInt32URemotable } + + TArrayOfInt32URemotable = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of LongWord; + function GetItem(AIndex: Integer): LongWord; + procedure SetItem(AIndex: Integer; const AValue: LongWord); + protected + function GetLength():Integer;override; + procedure SaveItem( + AStore : IFormatterBase; + const AName : String; + const AIndex : Integer + );override; + procedure LoadItem( + AStore : IFormatterBase; + const AIndex : Integer + );override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : LongWord read GetItem write SetItem; default; + end; + + { TArrayOfInt32SRemotable } + + TArrayOfInt32SRemotable = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of LongInt; + function GetItem(AIndex: Integer): LongInt; + procedure SetItem(AIndex: Integer; const AValue: LongInt); + protected + function GetLength():Integer;override; + procedure SaveItem( + AStore : IFormatterBase; + const AName : String; + const AIndex : Integer + );override; + procedure LoadItem( + AStore : IFormatterBase; + const AIndex : Integer + );override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : LongInt read GetItem write SetItem; default; + end; + + { TArrayOfInt64SRemotable } + + TArrayOfInt64SRemotable = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of Int64; + function GetItem(AIndex: Integer): Int64; + procedure SetItem(AIndex: Integer; const AValue: Int64); + protected + function GetLength():Integer;override; + procedure SaveItem( + AStore : IFormatterBase; + const AName : String; + const AIndex : Integer + );override; + procedure LoadItem( + AStore : IFormatterBase; + const AIndex : Integer + );override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : Int64 read GetItem write SetItem; default; + end; + + { TArrayOfInt64URemotable } + + TArrayOfInt64URemotable = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of QWord; + function GetItem(AIndex: Integer): QWord; + procedure SetItem(AIndex: Integer; const AValue: QWord); + protected + function GetLength():Integer;override; + procedure SaveItem( + AStore : IFormatterBase; + const AName : String; + const AIndex : Integer + );override; + procedure LoadItem( + AStore : IFormatterBase; + const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : QWord read GetItem write SetItem; default; + end; + + { TArrayOfFloatSingleRemotable } + + TArrayOfFloatSingleRemotable = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of Single; + function GetItem(AIndex: Integer): Single; + procedure SetItem(AIndex: Integer; const AValue: Single); + protected + function GetLength():Integer;override; + procedure SaveItem( + AStore : IFormatterBase; + const AName : String; + const AIndex : Integer + );override; + procedure LoadItem( + AStore : IFormatterBase; + const AIndex : Integer + );override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : Single read GetItem write SetItem; default; + end; + + { TArrayOfFloatDoubleRemotable } + + TArrayOfFloatDoubleRemotable = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of Double; + function GetItem(AIndex: Integer): Double; + procedure SetItem(AIndex: Integer; const AValue: Double); + protected + function GetLength():Integer;override; + procedure SaveItem( + AStore : IFormatterBase; + const AName : String; + const AIndex : Integer + );override; + procedure LoadItem( + AStore : IFormatterBase; + const AIndex : Integer + );override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : Double read GetItem write SetItem; default; + end; + + { TArrayOfFloatExtendedRemotable } + + TArrayOfFloatExtendedRemotable = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of Extended; + function GetItem(AIndex: Integer): Extended; + procedure SetItem(AIndex: Integer; const AValue: Extended); + protected + function GetLength():Integer;override; + procedure SaveItem( + AStore : IFormatterBase; + const AName : String; + const AIndex : Integer + );override; + procedure LoadItem( + AStore : IFormatterBase; + const AIndex : Integer + );override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : Extended read GetItem write SetItem; default; + end; + + { TArrayOfFloatCurrencyRemotable } + + TArrayOfFloatCurrencyRemotable = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of Currency; + function GetItem(AIndex: Integer): Currency; + procedure SetItem(AIndex: Integer; const AValue: Currency); + protected + function GetLength():Integer;override; + procedure SaveItem( + AStore : IFormatterBase; + const AName : String; + const AIndex : Integer + );override; + procedure LoadItem( + AStore : IFormatterBase; + const AIndex : Integer + );override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : Currency read GetItem write SetItem; default; + end; + + { TBaseFactoryRegistryItem } + // Implementation helpers + TBaseFactoryRegistryItem = class + private + FFactory: IItemFactory; + FName: string; + public + constructor Create( + const AName : string; + const AFactory : IItemFactory + ); + destructor Destroy();override; + property Name : string Read FName; + property Factory : IItemFactory Read FFactory; + End; + + { TBaseFactoryRegistry } + TBaseFactoryRegistry = class(TInterfacedObject,IInterface) + private + FList : TObjectList; + function GetCount: Integer; + function GetItem(Index: Integer): TBaseFactoryRegistryItem; + protected + function FindFactory(const AName: string): IItemFactory; + procedure Register( + const AName : string; + AFactory : IItemFactory + ); + protected + property Count : Integer read GetCount; + property Item[Index:Integer] : TBaseFactoryRegistryItem read GetItem; + public + constructor Create(); + destructor Destroy();override; + End; + + { TSimpleFactoryItem } + + TSimpleFactoryItem = class(TInterfacedObject) + public + constructor Create();virtual; + End; + + TSimpleFactoryItemClass = class of TSimpleFactoryItem; + + { TSimpleItemFactory } + + TSimpleItemFactory = class(TInterfacedPersistent,IInterface,IItemFactory) + private + FItemClass : TSimpleFactoryItemClass; + protected + function CreateInstance():IInterface; + public + constructor Create(AItemClass : TSimpleFactoryItemClass); + End; + + { TSimpleItemFactoryEx } + + TSimpleItemFactoryEx = class(TSimpleItemFactory,IInterface,IItemFactory,IItemFactoryEx) + private + FPropertyNames : TStringList; + FProperties : IInterfaceList; + protected + function GetPropertyManager( + const APropertyGroup : string; + const ACreateIfNotExists : Boolean + ):IPropertyManager; + public + constructor Create(AItemClass : TSimpleFactoryItemClass); + destructor Destroy();override; + End; + + TTypeRegistryItemOption = ( trioNonVisibleToMetadataService ); + TTypeRegistryItemOptions = set of TTypeRegistryItemOption; + + { TTypeRegistryItem } + + TTypeRegistryItem = class + private + FDataType: PTypeInfo; + FNameSpace: string; + FDeclaredName : string; + FOptions: TTypeRegistryItemOptions; + FSynonymTable : TStrings; + FExternalNames : TStrings; + FInternalNames : TStrings; + public + constructor Create( + ANameSpace : string; + ADataType : PTypeInfo; + Const ADeclaredName : string = '' + ); + destructor Destroy();override; + function AddPascalSynonym(const ASynonym : string):TTypeRegistryItem;//inline; + function IsSynonym(const APascalTypeName : string):Boolean;//inline; + + procedure RegisterExternalPropertyName(const APropName, AExtPropName : string); + function GetExternalPropertyName(const APropName : string) : string; + function GetInternalPropertyName(const AExtPropName : string) : string; + + property DataType : PTypeInfo read FDataType; + property NameSpace : string read FNameSpace; + property DeclaredName : string read FDeclaredName; + property Options : TTypeRegistryItemOptions read FOptions write FOptions; + end; + + { TTypeRegistry } + + TTypeRegistry = class + Private + FList : TObjectList; + function GetCount: Integer; + function GetItemByIndex(Index: Integer): TTypeRegistryItem; + function GetItemByTypeInfo(Index: PTypeInfo): TTypeRegistryItem; + Public + constructor Create(); + destructor Destroy();override; + function IndexOf(Const ATypeInfo : PTypeInfo):Integer; + function Add(AItem:TTypeRegistryItem):Integer; + function Register( + Const ANameSpace : String; + Const ADataType : PTypeInfo; + Const ADeclaredName : String = '' + ):TTypeRegistryItem; + function Find(ATypeInfo : PTypeInfo; Const AExact : Boolean):TTypeRegistryItem;overload; + function Find(const APascalTypeName : string):TTypeRegistryItem;overload; + function FindByDeclaredName(const ATypeName,ANameSpace : string):TTypeRegistryItem; + Property Count : Integer Read GetCount; + Property Item[Index:Integer] : TTypeRegistryItem Read GetItemByIndex;default; + Property ItemByTypeInfo[Index:PTypeInfo] : TTypeRegistryItem Read GetItemByTypeInfo; + End; + + TPropStoreType = ( pstNever, pstOptional, pstAlways ); + + EPropertyException = class(Exception) + end; + + { TStoredPropertyManager } + + TStoredPropertyManager = class(TInterfacedObject,IPropertyManager) + private + FData : TStringList; + procedure Error(Const AMsg:string);overload; + procedure Error(Const AMsg:string; Const AArgs : array of const);overload; + protected + procedure SetProperty(Const AName,AValue:string); + procedure SetProperties(Const APropsStr:string); + function GetProperty(Const AName:String):string; + function GetPropertyNames(ADest : TStrings):Integer; + procedure Clear(); + procedure Copy(ASource:IPropertyManager; Const AClearBefore : Boolean); + public + constructor Create(); + destructor Destroy();override; + end; + +const + sXSD_NS = 'http://www.w3.org/2001/XMLSchema'; + sXSD = 'xsd'; + sSOAP_ENV = 'http://schemas.xmlsoap.org/soap/envelope/'; + sSOAP_ENV_ABR = 'SOAP-ENV'; + sWST_BASE_NS = 'urn:wst_base'; + + PROP_LIST_DELIMITER = ';'; + + function GetTypeRegistry():TTypeRegistry; + procedure RegisterStdTypes(); + + function IsStoredPropClass(AClass : TClass;PropInfo : PPropInfo) : TPropStoreType; + +implementation + +Var + TypeRegistryInstance : TTypeRegistry = Nil; + +function GetTypeRegistry():TTypeRegistry; +begin + If Not Assigned(TypeRegistryInstance) Then + TypeRegistryInstance := TTypeRegistry.Create(); + Result := TypeRegistryInstance; +end; + +procedure RegisterStdTypes(); +Var + r : TTypeRegistry; + ri : TTypeRegistryItem; +begin + r := GetTypeRegistry(); + r.Register(sXSD_NS,TypeInfo(Integer),'int').AddPascalSynonym('Integer'); + r.Register(sXSD_NS,TypeInfo(LongWord),'unsignedInt'); + r.Register(sXSD_NS,TypeInfo(positiveInteger),'positiveInteger'); + r.Register(sXSD_NS,TypeInfo(nonNegativeInteger),'nonNegativeInteger'); + + + r.Register(sXSD_NS,TypeInfo(string),'string').AddPascalSynonym('string'); + r.Register(sXSD_NS,TypeInfo(AnsiString),'ansistring').AddPascalSynonym('ansistring'); + r.Register(sXSD_NS,TypeInfo(anyURI),'anyURI').AddPascalSynonym('anyURI'); + + r.Register(sXSD_NS,TypeInfo(boolean),'boolean').AddPascalSynonym('boolean'); + + r.Register(sXSD_NS,TypeInfo(Byte),'unsignedByte').AddPascalSynonym('Byte'); + r.Register(sXSD_NS,TypeInfo(ShortInt),'byte').AddPascalSynonym('ShortInt'); + r.Register(sXSD_NS,TypeInfo(Word),'unsignedShort').AddPascalSynonym('Word'); + r.Register(sXSD_NS,TypeInfo(SmallInt),'short').AddPascalSynonym('SmallInt'); + r.Register(sXSD_NS,TypeInfo(Int64),'long').AddPascalSynonym('Int64'); + r.Register(sXSD_NS,TypeInfo(QWord),'unsignedLong').AddPascalSynonym('QWord'); + + r.Register(sXSD_NS,TypeInfo(Single),'float').AddPascalSynonym('Single'); + r.Register(sXSD_NS,TypeInfo(Currency),'float').AddPascalSynonym('Currency'); + r.Register(sXSD_NS,TypeInfo(Comp),'float').AddPascalSynonym('Comp'); + r.Register(sXSD_NS,TypeInfo(Double),'double').AddPascalSynonym('Double'); + r.Register(sXSD_NS,TypeInfo(Extended),'decimal').AddPascalSynonym('Extended'); + + r.Register(sXSD_NS,TypeInfo(TDateRemotable),'dateTime').AddPascalSynonym('TDateRemotable'); + r.Register(sXSD_NS,TypeInfo(TDurationRemotable),'duration').AddPascalSynonym('TDurationRemotable'); + r.Register(sXSD_NS,TypeInfo(TTimeRemotable),'time').AddPascalSynonym('TTimeRemotable'); + + ri := r.Register(sWST_BASE_NS,TypeInfo(TBaseArrayRemotable),'TBaseArrayRemotable'); + ri.Options := ri.Options + [trioNonVisibleToMetadataService]; + + THeaderBlock.RegisterAttributeProperty('mustUnderstand'); + ri := r.Register(sSOAP_ENV,TypeInfo(THeaderBlock),'THeaderBlock'); + ri.Options := ri.Options + [trioNonVisibleToMetadataService]; + + + r.Register(sWST_BASE_NS,TypeInfo(TArrayOfStringRemotable),'TArrayOfStringRemotable').AddPascalSynonym('TArrayOfStringRemotable'); + r.Register(sWST_BASE_NS,TypeInfo(TArrayOfBooleanRemotable),'TArrayOfBooleanRemotable').AddPascalSynonym('TArrayOfBooleanRemotable'); + + r.Register(sWST_BASE_NS,TypeInfo(TArrayOfInt8URemotable),'TArrayOfInt8URemotable').AddPascalSynonym('TArrayOfInt8URemotable'); + r.Register(sWST_BASE_NS,TypeInfo(TArrayOfInt8SRemotable),'TArrayOfInt8SRemotable').AddPascalSynonym('TArrayOfInt8SRemotable'); + + r.Register(sWST_BASE_NS,TypeInfo(TArrayOfInt16URemotable),'TArrayOfInt16URemotable').AddPascalSynonym('TArrayOfInt16URemotable'); + r.Register(sWST_BASE_NS,TypeInfo(TArrayOfInt16SRemotable),'TArrayOfInt16SRemotable').AddPascalSynonym('TArrayOfInt16SRemotable'); + + r.Register(sWST_BASE_NS,TypeInfo(TArrayOfInt32URemotable),'TArrayOfInt32URemotable').AddPascalSynonym('TArrayOfInt32URemotable'); + r.Register(sWST_BASE_NS,TypeInfo(TArrayOfInt32SRemotable),'TArrayOfInt32SRemotable').AddPascalSynonym('TArrayOfInt32SRemotable'); + + r.Register(sWST_BASE_NS,TypeInfo(TArrayOfInt64URemotable),'TArrayOfInt64URemotable').AddPascalSynonym('TArrayOfInt64URemotable'); + r.Register(sWST_BASE_NS,TypeInfo(TArrayOfInt64SRemotable),'TArrayOfInt64SRemotable').AddPascalSynonym('TArrayOfInt64SRemotable'); + + r.Register(sWST_BASE_NS,TypeInfo(TArrayOfFloatSingleRemotable),'TArrayOfFloatSingleRemotable').AddPascalSynonym('TArrayOfFloatSingleRemotable'); + r.Register(sWST_BASE_NS,TypeInfo(TArrayOfFloatDoubleRemotable),'TArrayOfFloatDoubleRemotable').AddPascalSynonym('TArrayOfFloatDoubleRemotable'); + r.Register(sWST_BASE_NS,TypeInfo(TArrayOfFloatExtendedRemotable),'TArrayOfFloatExtendedRemotable').AddPascalSynonym('TArrayOfFloatExtendedRemotable'); + r.Register(sWST_BASE_NS,TypeInfo(TArrayOfFloatCurrencyRemotable),'TArrayOfFloatCurrencyRemotable').AddPascalSynonym('TArrayOfFloatCurrencyRemotable'); + + r.Register(sXSD_NS,TypeInfo(TComplexInt64SContentRemotable),'long').AddPascalSynonym('TComplexInt64SContentRemotable'); + r.Register(sXSD_NS,TypeInfo(TComplexInt64UContentRemotable),'unsignedLong').AddPascalSynonym('TComplexInt64UContentRemotable'); + + r.Register(sXSD_NS,TypeInfo(TComplexInt32SContentRemotable),'int').AddPascalSynonym('TComplexInt32SContentRemotable'); + r.Register(sXSD_NS,TypeInfo(TComplexInt32UContentRemotable),'unsignedInt').AddPascalSynonym('TComplexInt32UContentRemotable'); + + r.Register(sXSD_NS,TypeInfo(TComplexInt16SContentRemotable),'short').AddPascalSynonym('TComplexInt16SContentRemotable'); + r.Register(sXSD_NS,TypeInfo(TComplexInt16UContentRemotable),'unsignedShort').AddPascalSynonym('TComplexInt16UContentRemotable'); + + r.Register(sXSD_NS,TypeInfo(TComplexInt8SContentRemotable),'byte').AddPascalSynonym('TComplexInt8SContentRemotable'); + r.Register(sXSD_NS,TypeInfo(TComplexInt8UContentRemotable),'unsignedByte').AddPascalSynonym('TComplexInt8UContentRemotable'); + + r.Register(sXSD_NS,TypeInfo(TComplexFloatExtendedContentRemotable),'decimal').AddPascalSynonym('TComplexFloatExtendedContentRemotable'); + r.Register(sXSD_NS,TypeInfo(TComplexFloatDoubleContentRemotable),'double').AddPascalSynonym('TComplexFloatDoubleContentRemotable'); + r.Register(sXSD_NS,TypeInfo(TComplexFloatSingleContentRemotable),'Single').AddPascalSynonym('TComplexFloatSingleContentRemotable'); + + r.Register(sXSD_NS,TypeInfo(TComplexStringContentRemotable),'string').AddPascalSynonym('TComplexStringContentRemotable'); + r.Register(sXSD_NS,TypeInfo(TComplexBooleanContentRemotable),'boolean').AddPascalSynonym('TComplexBooleanContentRemotable'); +end; + +{$IFDEF FPC} +function IsStoredPropClass(AClass : TClass;PropInfo : PPropInfo) : TPropStoreType; +begin + case (PropInfo^.PropProcs shr 4) and 3 of + ptfield: + Result := pstOptional; + ptconst: + begin + if LongBool(PropInfo^.StoredProc) then + Result := pstAlways + else + Result := pstNever; + end; + ptstatic, + ptvirtual: + Result := pstOptional; + end; +end; +{$ELSE} +function IsStoredPropClass(AClass : TClass;PropInfo : PPropInfo) : TPropStoreType; +{var + b : PByte; +begin + if ( ( PropInfo^.StoredProc and $0FFFFFF00 ) = 0 ) then begin + if LongBool(PropInfo^.StoredProc) then // constante + Result := pstAlways + else + Result := pstNever; + end else begin + b := PByte(PropInfo^.StoredProc); + Inc(b,3); + if ( b^ < $FE ) then begin //StaticMethod + Result := pstOptional; + end else ( b^ > $FE ) begin Field + end else begin // virtual method + end; + end; +end;} +begin + if ( ( Cardinal(PropInfo^.StoredProc) and $0FFFFFF00 ) = 0 ) then begin + if LongBool(PropInfo^.StoredProc) then begin + Result := pstAlways + end else begin + Result := pstNever; + end; + end else begin + Result := pstOptional; + end; +end; +{$ENDIF} + +{ TBaseRemotable } + +constructor TBaseRemotable.Create(); +begin +end; + +{ TBaseComplexRemotable } +Type + TEnumBuffer = Record + Case TOrdType Of + otSByte : (ShortIntData : ShortInt); + otUByte : (ByteData : Byte); + otSWord : (SmallIntData : SmallInt); + otUWord : (WordData : Word); + otSLong : (SLongIntData : LongInt); + otULong : (ULongIntData : LongWord); + End; + TFloatBuffer = Record + Case TFloatType Of + ftSingle : (SingleData : Single); + ftDouble : (DoubleData : Double); + ftExtended : (ExtendedData : Extended); + ftCurr : (CurrencyData : Currency); + ftComp : (CompData : Comp); + End; + + { TSerializeOptions } + + TSerializeOptions = class + private + FAttributeFieldList : TStringList; + private + FElementClass: TAbstractComplexRemotableClass; + procedure AddAttributeField(const AAttributeField : string); + function GetAttributeCount: Integer; + function GetAttributeField(AIndex : Integer): string; + public + constructor Create(const AElementClass : TAbstractComplexRemotableClass); + destructor Destroy();override; + function IsAttributeField(const AField : string):Boolean; + property ElementClass : TAbstractComplexRemotableClass read FElementClass; + property AttributeFieldCount : Integer read GetAttributeCount; + property AttributeField[AIndex : Integer] : string read GetAttributeField; + end; + + { TSerializeOptionsRegistry } + + TSerializeOptionsRegistry = class + private + FList : TObjectList; + private + function GetCount: Integer; + function GetItem(AIndex : Integer): TSerializeOptions; + function IndexOf(const AElementClass : TAbstractComplexRemotableClass):Integer; + public + constructor Create(); + destructor Destroy();override; + function RegisterClass(const AElementClass : TAbstractComplexRemotableClass):TSerializeOptions; + function Find(const AElementClass : TAbstractComplexRemotableClass):TSerializeOptions; + property Count : Integer read GetCount; + property Item[AIndex : Integer] : TSerializeOptions read GetItem; + end; + +var + SerializeOptionsRegistryInstance : TSerializeOptionsRegistry = nil; + +function GetSerializeOptionsRegistry():TSerializeOptionsRegistry; +begin + if not Assigned(SerializeOptionsRegistryInstance) then + SerializeOptionsRegistryInstance := TSerializeOptionsRegistry.Create(); + Result := SerializeOptionsRegistryInstance; +end; + +{ TSerializeOptionsRegistry } + +function TSerializeOptionsRegistry.GetCount: Integer; +begin + Result := FList.Count; +end; + +function TSerializeOptionsRegistry.GetItem(AIndex : Integer): TSerializeOptions; +begin + Result := FList[AIndex] as TSerializeOptions; +end; + +function TSerializeOptionsRegistry.IndexOf( + const AElementClass: TAbstractComplexRemotableClass +): Integer; +begin + for Result := 0 to Pred(Count) do begin + if ( Item[Result].ElementClass = AElementClass ) then + Exit; + end; + Result := -1; +end; + +constructor TSerializeOptionsRegistry.Create(); +begin + FList := TObjectList.Create(True); +end; + +destructor TSerializeOptionsRegistry.Destroy(); +begin + FreeAndNil(FList); + inherited Destroy(); +end; + +function TSerializeOptionsRegistry.RegisterClass( + const AElementClass: TAbstractComplexRemotableClass +): TSerializeOptions; +var + i, j, k, c : Integer; + ri : TSerializeOptions; +begin + i := IndexOf(AElementClass); + if ( i < 0 ) then begin + c := FList.Count; + i := FList.Add(TSerializeOptions.Create(AElementClass)); + Result := FList[i] as TSerializeOptions; + for j := 0 to Pred(c) do begin + ri := FList[j] as TSerializeOptions; + for k := 0 to Pred(ri.AttributeFieldCount) do begin + Result.FAttributeFieldList.Add(ri.FAttributeFieldList[k]); + end; + end; + end; + Result := FList[i] as TSerializeOptions; +end; + +function TSerializeOptionsRegistry.Find(const AElementClass: TAbstractComplexRemotableClass): TSerializeOptions; +var + i : Integer; +begin + i := IndexOf(AElementClass); + if ( i >= 0 ) then + Result := FList[i] as TSerializeOptions + else + Result := nil; +end; + +{ TSerializeOptions } + +procedure TSerializeOptions.AddAttributeField(const AAttributeField: string); +begin + if ( FAttributeFieldList.IndexOf(AAttributeField) < 0 ) then + FAttributeFieldList.Add(AAttributeField); +end; + +function TSerializeOptions.GetAttributeCount: Integer; +begin + Result := FAttributeFieldList.Count; +end; + +function TSerializeOptions.GetAttributeField(AIndex : Integer): string; +begin + Result := FAttributeFieldList[AIndex]; +end; + +constructor TSerializeOptions.Create(const AElementClass: TAbstractComplexRemotableClass); +begin + FElementClass := AElementClass; + FAttributeFieldList := TStringList.Create(); + FAttributeFieldList.Duplicates := dupIgnore; +end; + +destructor TSerializeOptions.Destroy(); +begin + FreeAndNil(FAttributeFieldList); + inherited Destroy(); +end; + +function TSerializeOptions.IsAttributeField(const AField: string): Boolean; +begin + Result := ( FAttributeFieldList.IndexOf(AField) >= 0 ); +end; + +class procedure TBaseComplexRemotable.Save( + AObject : TBaseRemotable; + AStore : IFormatterBase; + const AName : String; + const ATypeInfo : PTypeInfo +); +Var + propList : PPropList; + i, propCount, propListLen : Integer; + pt : PTypeInfo; + int64Data : Int64; + strData : String; + objData : TObject; + boolData : Boolean; + enumData : TEnumBuffer; + floatDt : TFloatBuffer; + p : PPropInfo; + oldSS,ss : TSerializationStyle; + typRegItem : TTypeRegistryItem; + prpName : string; +begin + oldSS := AStore.GetSerializationStyle(); + AStore.BeginObject(AName,ATypeInfo); + try + if not Assigned(AObject) then begin + AStore.NilCurrentScope(); + Exit; + end; + propCount := GetTypeData(ATypeInfo)^.PropCount; + if ( propCount > 0 ) then begin + propListLen := GetPropList(ATypeInfo,propList); + try + ss := AStore.GetSerializationStyle(); + typRegItem := GetTypeRegistry().ItemByTypeInfo[ATypeInfo]; + for i := 0 to Pred(propCount) do begin + p := propList^[i]; + pt := p^.PropType{$IFNDEF FPC}^{$ENDIF}; + if IsStoredProp(AObject,p) then begin + if IsAttributeProperty(p^.Name) then begin + if ( ss <> ssAttibuteSerialization ) then + ss := ssAttibuteSerialization; + end else begin + if ( ss <> ssNodeSerialization ) then + ss := ssNodeSerialization; + end; + if ( ss <> AStore.GetSerializationStyle() ) then + AStore.SetSerializationStyle(ss); + prpName := typRegItem.GetExternalPropertyName(p^.Name); + case pt^.Kind of + tkInt64{$IFDEF FPC},tkQWord{$ENDIF} : + begin + int64Data := GetOrdProp(AObject,p^.Name); + AStore.Put(prpName,pt,int64Data); + end; + tkLString{$IFDEF FPC},tkAString{$ENDIF} : + begin + strData := GetStrProp(AObject,p^.Name); + AStore.Put(prpName,pt,strData); + end; + tkClass : + begin + objData := GetObjectProp(AObject,p^.Name); + AStore.Put(prpName,pt,objData); + end; + {$IFDEF FPC} + tkBool : + begin + boolData := Boolean(GetOrdProp(AObject,p^.Name)); + AStore.Put(prpName,pt,boolData); + end; + {$ENDIF} + tkEnumeration,tkInteger : + begin + {$IFNDEF FPC} + if ( pt^.Kind = tkEnumeration ) and + ( GetTypeData(pt)^.BaseType^ = TypeInfo(Boolean) ) + then begin + boolData := Boolean(GetOrdProp(AObject,p^.Name)); + AStore.Put(prpName,pt,boolData); + end else begin + {$ENDIF} + FillChar(enumData,SizeOf(enumData),#0); + case GetTypeData(pt)^.OrdType of + otSByte : + begin + enumData.ShortIntData := ShortInt(GetOrdProp(AObject,p^.Name)); + AStore.Put(prpName,pt,enumData.ShortIntData); + end; + otUByte : + begin + enumData.ByteData := Byte(GetOrdProp(AObject,p^.Name)); + AStore.Put(prpName,pt,enumData.ByteData); + end; + otSWord : + begin + enumData.SmallIntData := SmallInt(GetOrdProp(AObject,p^.Name)); + AStore.Put(prpName,pt,enumData.SmallIntData); + end; + otUWord : + begin + enumData.WordData := Word(GetOrdProp(AObject,p^.Name)); + AStore.Put(prpName,pt,enumData.WordData); + end; + otSLong : + begin + enumData.SLongIntData := LongInt(GetOrdProp(AObject,p^.Name)); + AStore.Put(prpName,pt,enumData.SLongIntData); + end; + otULong : + begin + enumData.ULongIntData := LongWord(GetOrdProp(AObject,p^.Name)); + AStore.Put(prpName,pt,enumData.ULongIntData); + end; + end; + {$IFNDEF FPC} + end; + {$ENDIF} + end; + tkFloat : + begin + FillChar(floatDt,SizeOf(floatDt),#0); + case GetTypeData(pt)^.FloatType of + ftSingle : + begin + floatDt.SingleData := GetFloatProp(AObject,p^.Name); + AStore.Put(prpName,pt,floatDt.SingleData); + end; + ftDouble : + begin + floatDt.DoubleData := GetFloatProp(AObject,p^.Name); + AStore.Put(prpName,pt,floatDt.DoubleData); + end; + ftExtended : + begin + floatDt.ExtendedData := Extended(GetFloatProp(AObject,p^.Name)); + AStore.Put(prpName,pt,floatDt.ExtendedData); + end; + ftCurr : + begin + floatDt.CurrencyData := GetFloatProp(AObject,p^.Name); + AStore.Put(prpName,pt,floatDt.CurrencyData); + end; + ftComp : + begin + floatDt.CompData := GetFloatProp(AObject,p^.Name); + AStore.Put(prpName,pt,floatDt.CompData); + end; + end; + end; + end; + end; + end; + finally + Freemem(propList,propListLen*SizeOf(Pointer)); + end; + end; + finally + AStore.EndScope(); + AStore.SetSerializationStyle(oldSS); + end; +end; + +Type + TFloatExtendedType = Extended; +class procedure TBaseComplexRemotable.Load( + Var AObject : TObject; + AStore : IFormatterBase; + var AName : String; + const ATypeInfo : PTypeInfo +); +Var + propList : PPropList; + i, propCount, propListLen : Integer; + pt : PTypeInfo; + propName : String; + int64Data : Int64; + strData : String; + objData : TObject; + objDataCreateHere : Boolean; + boolData : Boolean; + p : PPropInfo; + enumData : TEnumBuffer; + floatDt : TFloatExtendedType; + floatBuffer : TFloatBuffer; + persistType : TPropStoreType; + objTypeData : PTypeData; + oldSS,ss : TSerializationStyle; + typRegItem : TTypeRegistryItem; +begin + oldSS := AStore.GetSerializationStyle(); + if ( AStore.BeginObjectRead(AName,ATypeInfo) >= 0 ) then begin + try + if AStore.IsCurrentScopeNil() then + Exit; // ???? FreeAndNil(AObject); + If Not Assigned(AObject) Then + AObject := Create(); + objTypeData := GetTypeData(ATypeInfo); + propCount := objTypeData^.PropCount; + If ( propCount > 0 ) Then Begin + propListLen := GetPropList(ATypeInfo,propList); + Try + typRegItem := GetTypeRegistry().ItemByTypeInfo[ATypeInfo]; + For i := 0 To Pred(propCount) Do Begin + p := propList^[i]; + persistType := IsStoredPropClass(objTypeData^.ClassType,p); + If ( persistType in [pstOptional,pstAlways] ) Then Begin + pt := p^.PropType{$IFNDEF FPC}^{$ENDIF}; + propName := typRegItem.GetExternalPropertyName(p^.Name); + if IsAttributeProperty(p^.Name) then begin + ss := ssAttibuteSerialization; + end else begin + ss := ssNodeSerialization; + end; + if ( ss <> AStore.GetSerializationStyle() ) then + AStore.SetSerializationStyle(ss); + try + Case pt^.Kind Of + tkInt64{$IFDEF FPC},tkQWord{$ENDIF} : + Begin + AStore.Get(pt,propName,int64Data); + SetOrdProp(AObject,p^.Name,int64Data); + End; + tkLString{$IFDEF FPC}, tkAString{$ENDIF} : + Begin + AStore.Get(pt,propName,strData); + SetStrProp(AObject,p^.Name,strData); + End; + {$IFDEF FPC} + tkBool : + Begin + AStore.Get(pt,propName,boolData); + SetOrdProp(AObject,p^.Name,Ord(boolData)); + End; + {$ENDIF} + tkClass : + Begin + objData := GetObjectProp(AObject,p^.Name); + objDataCreateHere := not Assigned(objData); + try + AStore.Get(pt,propName,objData); + if objDataCreateHere then + SetObjectProp(AObject,p^.Name,objData); + finally + if objDataCreateHere and ( objData <> GetObjectProp(AObject,p^.Name) ) then + FreeAndNil(objData); + end; + End; + tkEnumeration,tkInteger : + Begin + {$IFNDEF FPC} + if ( pt^.Kind = tkEnumeration ) and + ( GetTypeData(pt)^.BaseType^ = TypeInfo(Boolean) ) + then begin + boolData := Boolean(GetOrdProp(AObject,p^.Name)); + AStore.Put(propName,pt,boolData); + end else begin + {$ENDIF} + FillChar(enumData,SizeOf(enumData),#0); + Case GetTypeData(pt)^.OrdType Of + otSByte : + Begin + AStore.Get(pt,propName,enumData.ShortIntData); + int64Data := enumData.ShortIntData; + End; + otUByte : + Begin + AStore.Get(pt,propName,enumData.ByteData); + int64Data := enumData.ByteData; + End; + otSWord : + Begin + AStore.Get(pt,propName,enumData.SmallIntData); + int64Data := enumData.SmallIntData; + End; + otUWord : + Begin + AStore.Get(pt,propName,enumData.WordData); + int64Data := enumData.WordData; + End; + otSLong: + Begin + AStore.Get(pt,propName,enumData.SLongIntData); + int64Data := enumData.SLongIntData; + End; + otULong : + Begin + AStore.Get(pt,propName,enumData.ULongIntData); + int64Data := enumData.ULongIntData; + End; + End; + {$IFNDEF FPC} + end; + {$ENDIF} + SetOrdProp(AObject,p^.Name,int64Data); + End; + tkFloat : + Begin + FillChar(floatDt,SizeOf(floatBuffer),#0); + Case GetTypeData(pt)^.FloatType Of + ftSingle : + Begin + AStore.Get(pt,propName,floatBuffer.SingleData); + floatDt := floatBuffer.SingleData; + End; + ftDouble : + Begin + AStore.Get(pt,propName,floatBuffer.DoubleData); + floatDt := floatBuffer.DoubleData; + End; + ftExtended : + Begin + AStore.Get(pt,propName,floatBuffer.ExtendedData); + floatDt := floatBuffer.ExtendedData; + End; + ftCurr : + Begin + AStore.Get(pt,propName,floatBuffer.CurrencyData); + floatDt := floatBuffer.CurrencyData; + End; + ftComp : + Begin + AStore.Get(pt,propName,floatBuffer.CompData); + floatDt := floatBuffer.CompData; + End; + End; + SetFloatProp(AObject,p^.Name,floatDt); + End; + End; + except + on E : EServiceException do begin + if ( persistType = pstAlways ) then + raise; + end; + end; + End; + End; + Finally + Freemem(propList,propListLen*SizeOf(Pointer)); + End; + End; + finally + AStore.EndScopeRead(); + AStore.SetSerializationStyle(oldSS); + end; + end; +end; + +{ TBaseObjectArrayRemotable } + +function TBaseObjectArrayRemotable.GetItem(AIndex: Integer): TBaseRemotable; +begin + CheckIndex(AIndex); + Result := FArray[AIndex]; +end; + +function TBaseObjectArrayRemotable.GetLength(): Integer; +begin + Result := System.Length(FArray); +end; + +class procedure TBaseObjectArrayRemotable.Save( + AObject : TBaseRemotable; + AStore : IFormatterBase; + const AName : String; + const ATypeInfo : PTypeInfo +); +Var + itmTypInfo : PTypeInfo; + i,j : Integer; + nativObj : TBaseObjectArrayRemotable; + itm : TObject; + itmName : string; + styl : TArrayStyle; +begin + if Assigned(AObject) then begin + Assert(AObject.InheritsFrom(TBaseObjectArrayRemotable)); + nativObj := AObject as TBaseObjectArrayRemotable; + j := nativObj.Length; + end else begin + j := 0; + end; + itmTypInfo := PTypeInfo(GetItemClass().ClassInfo); + styl := GetStyle(); + AStore.BeginArray(AName,PTypeInfo(Self.ClassInfo),itmTypInfo,[0,Pred(j)],styl); + try + if ( styl = asScoped ) then begin + itmName := GetItemName(); + end else begin + itmName := AName; + end; + for i := 0 to Pred(j) do begin + itm := nativObj.Item[i]; + AStore.Put(itmName,itmTypInfo,itm); + end; + finally + AStore.EndScope(); + end; +end; + +class procedure TBaseObjectArrayRemotable.Load( + var AObject : TObject; + AStore : IFormatterBase; + var AName : String; + const ATypeInfo : PTypeInfo +); +Var + i, len : Integer; + nativObj : TBaseObjectArrayRemotable; + s : string; + itmTypInfo : PTypeInfo; + itm : TBaseRemotable; + itmName : string; + styl : TArrayStyle; +begin + styl := GetStyle(); + if ( styl = asScoped ) then begin + itmName := GetItemName(); + end else begin + itmName := AName; + end; + len := AStore.BeginArrayRead(AName,ATypeInfo,styl,itmName); + if ( len >= 0 ) then begin + Try + If Not Assigned(AObject) Then + AObject := Create(); + itmTypInfo := PTypeInfo(GetItemClass().ClassInfo); + nativObj := AObject as TBaseObjectArrayRemotable; + If ( len > 0 ) Then Begin + s := ''; + nativObj.SetLength(len); + For i := 0 To Pred(len) Do Begin + itm := nativObj[i]; + AStore.Get(itmTypInfo,s,itm); + End; + End; + Finally + AStore.EndScopeRead(); + End; + end; +end; + +class function TBaseObjectArrayRemotable.GetItemTypeInfo(): PTypeInfo; +begin + Result:= GetItemClass().ClassInfo; +end; + +constructor TBaseObjectArrayRemotable.Create(); +begin + FArray := Nil; +end; + +procedure TBaseObjectArrayRemotable.Assign(Source: TPersistent); +var + src : TBaseObjectArrayRemotable; + i, c : PtrInt; +begin + if Assigned(Source) then begin + if Source.InheritsFrom(TBaseObjectArrayRemotable) then begin + src := TBaseObjectArrayRemotable(Source); + c := src.Length; + SetLength(c); + for i := 0 to Pred(c) do begin + Item[i].Assign(src.Item[i]); + end; + end else begin + inherited Assign(Source); + end; + end else begin + SetLength(0); + end; +end; + +procedure TBaseObjectArrayRemotable.SetLength(const ANewSize: Integer); +var + i,oldLen : Integer; + itmClss : TBaseRemotableClass; +begin + oldLen := GetLength; + if ( oldLen = ANewSize ) then + Exit; + + if ( ANewSize < 0 ) then + raise EBaseRemoteException.CreateFmt('Invalid array length : %d',[ANewSize]); + + if ( oldLen > ANewSize ) then begin + for i := ANewSize to Pred(oldLen) do + FreeAndNil(FArray[i]); + System.SetLength(FArray,ANewSize); + end else begin + System.SetLength(FArray,ANewSize); + itmClss := GetItemClass(); + for i := oldLen to Pred(ANewSize) do + FArray[i] := itmClss.Create(); + end; +end; + +{ TBaseFactoryRegistryItem } + +constructor TBaseFactoryRegistryItem.Create( + const AName : string; + const AFactory : IItemFactory +); +begin + Assert(Assigned(AFactory)); + FName := AName; + FFactory := AFactory; +end; + +destructor TBaseFactoryRegistryItem.Destroy(); +begin + FName := ''; + FFactory := nil; + inherited Destroy(); +end; + +function TBaseFactoryRegistry.GetCount: Integer; +begin + Result := FList.Count; +end; + +function TBaseFactoryRegistry.GetItem(Index: Integer): TBaseFactoryRegistryItem; +begin + Result := FList[Index] as TBaseFactoryRegistryItem; +end; + +{ TBaseFactoryRegistry } +function TBaseFactoryRegistry.FindFactory(const AName: string): IItemFactory; +Var + i , c : Integer; + s : string; +begin + s := LowerCase(Trim(AName)); + c := Pred(FList.Count); + For i := 0 To c Do Begin + If AnsiSameText(TBaseFactoryRegistryItem(FList[i]).Name,s) Then Begin + Result := TBaseFactoryRegistryItem(FList[i]).Factory; + Exit; + End; + End; + Result := Nil; +end; + +procedure TBaseFactoryRegistry.Register( + const AName : string; + AFactory : IItemFactory +); +begin + Assert(Assigned(AFactory)); + If Not Assigned(FindFactory(AName)) Then + FList.Add(TBaseFactoryRegistryItem.Create(AName,AFactory)); +end; + +constructor TBaseFactoryRegistry.Create(); +begin + FList := TObjectList.Create(True); + inherited Create(); +end; + +destructor TBaseFactoryRegistry.Destroy(); +begin + FList.Free(); + inherited Destroy(); +end; + +{ TSimpleItemFactory } + +function TSimpleItemFactory.CreateInstance(): IInterface; +begin + Result := FItemClass.Create() as IInterface; +end; + +constructor TSimpleItemFactory.Create(AItemClass: TSimpleFactoryItemClass); +begin + Assert(Assigned(AItemClass)); + FItemClass := AItemClass; +end; + +{ TSimpleItemFactoryEx } + +function TSimpleItemFactoryEx.GetPropertyManager( + const APropertyGroup : string; + const ACreateIfNotExists : Boolean +):IPropertyManager; +var + i : Integer; + s : string; +begin + Result := nil; + s := Trim(APropertyGroup); + i := FPropertyNames.IndexOf(s); + if ( i < 0 ) then begin + if not ACreateIfNotExists then + Exit; + i := FPropertyNames.Add(s); + FProperties.Add(TStoredPropertyManager.Create() as IInterface); + end; + Result := FProperties.Get(i) as IPropertyManager; +end; + +constructor TSimpleItemFactoryEx.Create(AItemClass: TSimpleFactoryItemClass); +begin + inherited Create(AItemClass); + FPropertyNames := TStringList.Create(); + FProperties := TInterfaceList.Create(); +end; + +destructor TSimpleItemFactoryEx.Destroy(); +begin + FreeAndNil(FPropertyNames); + FProperties := nil; + inherited Destroy(); +end; + +{ TSimpleFactoryItem } + +constructor TSimpleFactoryItem.Create(); +begin +end; + + +{ TSimpleCallContext } + +procedure TSimpleCallContext.Clear(); +begin + FHeaderList.Clear(); + FFreeObjectList.Clear();; +end; + +procedure TSimpleCallContext.AddObjectToFree(const AObject: TObject); +begin + if ( FFreeObjectList.IndexOf(AObject) < 0 ) then + FFreeObjectList.Add(AObject); +end; + +function TSimpleCallContext.AddHeader( + const AHeader: THeaderBlock; + const AKeepOwnership: Boolean +): Integer; +begin + Result := FHeaderList.IndexOf(AHeader); + if ( Result = -1 ) then + Result := FHeaderList.Add(AHeader); + if AKeepOwnership then + AddObjectToFree(AHeader); +end; + +function TSimpleCallContext.GetHeaderCount(const ADirections : THeaderDirections):Integer; +var + i : Integer; +begin + if ( ADirections = [Low(THeaderDirection)..High(THeaderDirection)] ) then + Result := FHeaderList.Count + else begin + Result := 0; + for i := 0 to Pred(FHeaderList.Count) do begin + if ( THeaderBlock(FHeaderList[i]).Direction in ADirections ) then + Inc(Result); + end; + end; +end; + +function TSimpleCallContext.GetHeader(const AIndex: Integer): THeaderBlock; +begin + Result := FHeaderList[AIndex] as THeaderBlock; +end; + +procedure TSimpleCallContext.ClearHeaders(const ADirection: THeaderDirection); +var + i, c : Integer; + h : THeaderBlock; + fl : TObjectList; +begin + c := FHeaderList.Count; + if ( c > 0 ) then begin + fl := TObjectList.Create(False); + try + for i := 0 to Pred(c) do begin + h := FHeaderList[i] as THeaderBlock; + if ( h.Direction = ADirection ) then + fl.Add(h); + end; + for i := 0 to Pred(fl.Count) do + FreeHeader(fl[i] as THeaderBlock); + finally + fl.Free(); + end; + end; +end; + +procedure TSimpleCallContext.FreeHeader(AHeader: THeaderBlock); +begin + if Assigned(AHeader) then begin + if ( FHeaderList.IndexOf(AHeader) >= 0 ) then + FHeaderList.Remove(AHeader); + if ( FFreeObjectList.IndexOf(AHeader) >= 0 ) then + FHeaderList.Remove(AHeader) + else + AHeader.Free(); + end; +end; + +constructor TSimpleCallContext.Create(); +begin + FHeaderList := TObjectList.Create(False); + FFreeObjectList := TObjectList.Create(True); +end; + +destructor TSimpleCallContext.Destroy(); +begin + FreeAndNil(FHeaderList); + FreeAndNil(FFreeObjectList); + inherited Destroy(); +end; + +{ TTypeRegistryItem } + +constructor TTypeRegistryItem.Create( + ANameSpace : String; + ADataType : PTypeInfo; + Const ADeclaredName : String +); +begin + FNameSpace := ANameSpace; + FDataType := ADataType; + FDeclaredName := Trim(ADeclaredName); + If ( Length(FDeclaredName) = 0 ) Then + FDeclaredName := FDataType^.Name; +end; + +destructor TTypeRegistryItem.Destroy(); +begin + FreeAndNil(FInternalNames); + FreeAndNil(FExternalNames); + FreeAndNil(FSynonymTable); + inherited Destroy(); +end; + +function TTypeRegistryItem.AddPascalSynonym(const ASynonym: string):TTypeRegistryItem; //inline; +begin + Result := Self; + if AnsiSameText(ASynonym,DataType^.Name) then + Exit; + if not Assigned(FSynonymTable) then begin + FSynonymTable := TStringList.Create(); + FSynonymTable.Add(FDataType^.Name); + end; + if ( FSynonymTable.IndexOf(ASynonym) = -1 ) then + FSynonymTable.Add(AnsiLowerCase(ASynonym)); +end; + +function TTypeRegistryItem.IsSynonym(const APascalTypeName: string): Boolean;//inline; +begin + Result := AnsiSameText(APascalTypeName,DataType^.Name); + if ( not Result ) and Assigned(FSynonymTable) then + Result := ( FSynonymTable.IndexOf(APascalTypeName) >= 0 ) ; +end; + +procedure TTypeRegistryItem.RegisterExternalPropertyName(const APropName,AExtPropName: string); +begin + if not Assigned(FExternalNames) then begin + FExternalNames := TStringList.Create(); + FInternalNames := TStringList.Create(); + end; + FExternalNames.Values[APropName] := AExtPropName; + FInternalNames.Values[AExtPropName] := APropName; +end; + +function TTypeRegistryItem.GetExternalPropertyName(const APropName: string): string; +begin + if Assigned(FExternalNames) and ( FExternalNames.IndexOfName(APropName) <> -1 ) then begin + Result := FExternalNames.Values[APropName]; + end else begin + Result := APropName; + end; +end; + +function TTypeRegistryItem.GetInternalPropertyName(const AExtPropName: string): string; +begin + if Assigned(FInternalNames) and ( FInternalNames.IndexOfName(AExtPropName) <> -1 ) then + Result := FInternalNames.Values[AExtPropName] + else + Result := AExtPropName; +end; + +{ TTypeRegistry } + +function TTypeRegistry.GetCount: Integer; +begin + Result := FList.Count; +end; + +function TTypeRegistry.GetItemByIndex(Index: Integer): TTypeRegistryItem; +begin + Result := FList[Index] as TTypeRegistryItem; +end; + +function TTypeRegistry.GetItemByTypeInfo(Index: PTypeInfo): TTypeRegistryItem; +Var + i : Integer; +begin + Assert(Assigned(Index)); + i := IndexOf(Index); + If ( i > -1 ) Then + Result := FList[i] as TTypeRegistryItem + Else + Raise ETypeRegistryException.CreateFmt('Type not registered : %s',[Index^.Name]) +end; + +constructor TTypeRegistry.Create(); +begin + Inherited Create(); + FList := TObjectList.Create(True); +end; + +destructor TTypeRegistry.Destroy(); +begin + FreeAndNil(FList); + inherited Destroy(); +end; + +function TTypeRegistry.IndexOf(Const ATypeInfo: PTypeInfo): Integer; +begin + For Result := 0 To Pred(Count) Do Begin + If ( ATypeInfo^.Kind = Item[Result].DataType^.Kind ) And + AnsiSameText(ATypeInfo^.Name,Item[Result].DataType^.Name) + Then + Exit; + End; + Result := -1; +end; + +function TTypeRegistry.Add(AItem: TTypeRegistryItem): Integer; +begin + Result := IndexOf(AItem.DataType); + If ( Result = -1 ) Then + Result := FList.Add(AItem) + Else + Raise ETypeRegistryException.CreateFmt('Type already registered : "%s"',[AItem.DataType^.Name]); +end; + +function TTypeRegistry.Register( + Const ANameSpace : String; + Const ADataType : PTypeInfo; + Const ADeclaredName : String = '' +): TTypeRegistryItem; +var + i : Integer; +begin + i := IndexOf(ADataType); + if ( i = -1 ) then + i := Add(TTypeRegistryItem.Create(ANameSpace,ADataType,ADeclaredName)); + Result := Item[i]; +end; + +function TTypeRegistry.Find(ATypeInfo : PTypeInfo; Const AExact : Boolean):TTypeRegistryItem; +Var + i : Integer; + searchClass : TClass; +begin + Result := Nil; + i := IndexOf(ATypeInfo); + If ( i > -1 ) Then + Result := Item[i] + Else If ( Not AExact ) And + Assigned(ATypeInfo) And + ( ATypeInfo^.Kind = tkClass ) + Then Begin + searchClass := GetTypeData(ATypeInfo)^.ClassType; + For i := 0 To Pred(Count) Do Begin + Result := Item[i]; + If ( Result.DataType^.Kind = tkClass ) And + searchClass.InheritsFrom(GetTypeData(Result.DataType)^.ClassType) + Then + Exit; + End; + Result := Nil; + End; +end; + +function TTypeRegistry.Find(const APascalTypeName: string): TTypeRegistryItem; +var + i,c : Integer; +begin + c := Count; + for i := 0 to Pred(c) do begin + Result := Item[i]; + if Result.IsSynonym(APascalTypeName) then + Exit; + end; + Result := nil; +end; + +function TTypeRegistry.FindByDeclaredName( + const ATypeName, + ANameSpace : string +): TTypeRegistryItem; +var + i, c : Integer; +begin + c := Count; + for i := 0 to Pred(c) do begin + Result := Item[i]; + if AnsiSameText(ANameSpace,Result.NameSpace) and + AnsiSameText(ATypeName,Result.DeclaredName) + then + Exit; + end; + Result := nil; +end; + + +{ TBaseSimpleTypeArrayRemotable } + + +class procedure TBaseSimpleTypeArrayRemotable.Save( + AObject : TBaseRemotable; + AStore : IFormatterBase; + const AName : string; + const ATypeInfo : PTypeInfo +); +var + i,j : Integer; + nativObj : TBaseSimpleTypeArrayRemotable; + itmName : string; + styl : TArrayStyle; +begin + if Assigned(AObject) then begin + Assert(AObject.InheritsFrom(TBaseSimpleTypeArrayRemotable)); + nativObj := AObject as TBaseSimpleTypeArrayRemotable; + j := nativObj.Length; + end else begin + j := 0; + end; + styl := GetStyle(); + AStore.BeginArray(AName,PTypeInfo(Self.ClassInfo),GetItemTypeInfo(),[0,Pred(j)],styl); + try + if ( styl = asScoped ) then begin + itmName := GetItemName(); + end else begin + itmName := AName; + end; + for i := 0 to Pred(j) do begin + nativObj.SaveItem(AStore,itmName,i); + end; + finally + AStore.EndScope(); + end; +end; + +class procedure TBaseSimpleTypeArrayRemotable.Load( + var AObject : TObject; + AStore : IFormatterBase; + var AName : String; + const ATypeInfo : PTypeInfo +); +Var + i, len : Integer; + nativObj : TBaseSimpleTypeArrayRemotable; + itmName : string; + styl : TArrayStyle; +begin + styl := GetStyle(); + if ( styl = asScoped ) then begin + itmName := GetItemName(); + end else begin + itmName := AName; + end; + len := AStore.BeginArrayRead(AName,ATypeInfo, GetStyle(),itmName); + if ( len >= 0 ) then begin + try + if not Assigned(AObject) then + AObject := Create(); + nativObj := nil; + nativObj := AObject as TBaseSimpleTypeArrayRemotable; + if ( len >= 0 ) then begin + nativObj.SetLength(len); + for i := 0 to Pred(len) do begin + nativObj.LoadItem(AStore,i); + end; + end; + finally + AStore.EndScopeRead(); + end; + end; +end; + +{ TArrayOfStringRemotable } + +function TArrayOfStringRemotable.GetItem(AIndex: Integer): ansistring; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure TArrayOfStringRemotable.SetItem(AIndex: Integer;const AValue: ansistring); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function TArrayOfStringRemotable.GetLength(): Integer; +begin + Result := System.Length(FData) +end; + +procedure TArrayOfStringRemotable.SaveItem( + AStore : IFormatterBase; + const AName : String; + const AIndex : Integer +); +begin + AStore.Put(AName,TypeInfo(ansistring),FData[AIndex]); +end; + +procedure TArrayOfStringRemotable.LoadItem( + AStore : IFormatterBase; + const AIndex : Integer +); +var + sName : string; +begin + sName := GetItemName(); + AStore.Get(TypeInfo(ansistring),sName,FData[AIndex]); +end; + +class function TArrayOfStringRemotable.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(ansistring); +end; + +procedure TArrayOfStringRemotable.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ TBaseArrayRemotable } + +class function TBaseArrayRemotable.GetItemName(): string; +var + tri : TTypeRegistryItem; +begin + tri := GetTypeRegistry().Find(PTypeInfo(Self.ClassInfo),False); + if Assigned(tri) then + Result := Trim(tri.GetExternalPropertyName(sARRAY_ITEM)); + if ( System.Length(Result) = 0 ) then + Result := sARRAY_ITEM; +end; + +class function TBaseArrayRemotable.GetStyle(): TArrayStyle; +var + tri : TTypeRegistryItem; +begin + tri := GetTypeRegistry().Find(PTypeInfo(Self.ClassInfo),False); + if Assigned(tri) and AnsiSameText(sEmbedded,Trim(tri.GetExternalPropertyName(sARRAY_STYLE))) then begin + Result := asEmbeded; + end else begin + Result := asScoped; + end; +end; + +procedure TBaseArrayRemotable.CheckIndex(const AIndex : Integer); +begin + if ( AIndex < 0 ) or ( AIndex >= Length ) then + raise EServiceException.CreateFmt('Index out of bound : %d',[AIndex]); +end; + +destructor TBaseArrayRemotable.Destroy(); +begin + SetLength(0); + inherited Destroy(); +end; + +{ TArrayOfBooleanRemotable } + +function TArrayOfBooleanRemotable.GetItem(AIndex: Integer): Boolean; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure TArrayOfBooleanRemotable.SetItem(AIndex: Integer;const AValue: Boolean); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function TArrayOfBooleanRemotable.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure TArrayOfBooleanRemotable.SaveItem(AStore: IFormatterBase; + const AName: String; const AIndex: Integer); +begin + AStore.Put(AName,TypeInfo(Boolean),FData[AIndex]); +end; + +procedure TArrayOfBooleanRemotable.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := GetItemName(); + AStore.Get(TypeInfo(Boolean),sName,FData[AIndex]); +end; + +class function TArrayOfBooleanRemotable.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(Boolean); +end; + +procedure TArrayOfBooleanRemotable.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ TArrayOfInt8URemotable } + +function TArrayOfInt8URemotable.GetItem(AIndex: Integer): Byte; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure TArrayOfInt8URemotable.SetItem(AIndex: Integer; const AValue: Byte); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function TArrayOfInt8URemotable.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure TArrayOfInt8URemotable.SaveItem(AStore: IFormatterBase; + const AName: String; const AIndex: Integer); +begin + AStore.Put(AName,TypeInfo(Byte),FData[AIndex]); +end; + +procedure TArrayOfInt8URemotable.LoadItem(AStore: IFormatterBase; const AIndex: Integer); +var + sName : string; +begin + sName := GetItemName(); + AStore.Get(TypeInfo(Byte),sName,FData[AIndex]); +end; + +class function TArrayOfInt8URemotable.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(Byte); +end; + +procedure TArrayOfInt8URemotable.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ TArrayOfInt8SRemotable } + +function TArrayOfInt8SRemotable.GetItem(AIndex: Integer): ShortInt; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure TArrayOfInt8SRemotable.SetItem(AIndex: Integer; const AValue: ShortInt); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function TArrayOfInt8SRemotable.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure TArrayOfInt8SRemotable.SaveItem(AStore: IFormatterBase; + const AName: String; const AIndex: Integer); +begin + AStore.Put(AName,TypeInfo(ShortInt),FData[AIndex]); +end; + +procedure TArrayOfInt8SRemotable.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := GetItemName(); + AStore.Get(TypeInfo(ShortInt),sName,FData[AIndex]); +end; + +class function TArrayOfInt8SRemotable.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(ShortInt); +end; + +procedure TArrayOfInt8SRemotable.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ TArrayOfInt16SRemotable } + +function TArrayOfInt16SRemotable.GetItem(AIndex: Integer): SmallInt; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure TArrayOfInt16SRemotable.SetItem(AIndex: Integer;const AValue: SmallInt); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function TArrayOfInt16SRemotable.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure TArrayOfInt16SRemotable.SaveItem(AStore: IFormatterBase; + const AName: String; const AIndex: Integer); +begin + AStore.Put(AName,TypeInfo(SmallInt),FData[AIndex]); +end; + +procedure TArrayOfInt16SRemotable.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := GetItemName(); + AStore.Get(TypeInfo(SmallInt),sName,FData[AIndex]); +end; + +class function TArrayOfInt16SRemotable.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(SmallInt); +end; + +procedure TArrayOfInt16SRemotable.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ TArrayOfInt16URemotable } + +function TArrayOfInt16URemotable.GetItem(AIndex: Integer): Word; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure TArrayOfInt16URemotable.SetItem(AIndex: Integer; const AValue: Word); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function TArrayOfInt16URemotable.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure TArrayOfInt16URemotable.SaveItem(AStore: IFormatterBase; + const AName: String; const AIndex: Integer); +begin + AStore.Put(AName,TypeInfo(Word),FData[AIndex]); +end; + +procedure TArrayOfInt16URemotable.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := GetItemName(); + AStore.Get(TypeInfo(Word),sName,FData[AIndex]); +end; + +class function TArrayOfInt16URemotable.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(Word); +end; + +procedure TArrayOfInt16URemotable.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ TArrayOfInt32URemotable } + +function TArrayOfInt32URemotable.GetItem(AIndex: Integer): LongWord; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure TArrayOfInt32URemotable.SetItem(AIndex: Integer;const AValue: LongWord); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function TArrayOfInt32URemotable.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure TArrayOfInt32URemotable.SaveItem(AStore: IFormatterBase; + const AName: String; const AIndex: Integer); +begin + AStore.Put(AName,TypeInfo(LongWord),FData[AIndex]); +end; + +procedure TArrayOfInt32URemotable.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := GetItemName(); + AStore.Get(TypeInfo(LongWord),sName,FData[AIndex]); +end; + +class function TArrayOfInt32URemotable.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(LongWord); +end; + +procedure TArrayOfInt32URemotable.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ TArrayOfInt32SRemotable } + +function TArrayOfInt32SRemotable.GetItem(AIndex: Integer): LongInt; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure TArrayOfInt32SRemotable.SetItem(AIndex: Integer; const AValue: LongInt); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function TArrayOfInt32SRemotable.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure TArrayOfInt32SRemotable.SaveItem(AStore: IFormatterBase; + const AName: String; const AIndex: Integer); +begin + AStore.Put(AName,TypeInfo(LongInt),FData[AIndex]); +end; + +procedure TArrayOfInt32SRemotable.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := GetItemName(); + AStore.Get(TypeInfo(LongInt),sName,FData[AIndex]); +end; + +class function TArrayOfInt32SRemotable.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(LongInt); +end; + +procedure TArrayOfInt32SRemotable.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ TArrayOfInt64SRemotable } + +function TArrayOfInt64SRemotable.GetItem(AIndex: Integer): Int64; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure TArrayOfInt64SRemotable.SetItem(AIndex: Integer; const AValue: Int64); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function TArrayOfInt64SRemotable.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure TArrayOfInt64SRemotable.SaveItem(AStore: IFormatterBase; + const AName: String; const AIndex: Integer); +begin + AStore.Put(AName,TypeInfo(Int64),FData[AIndex]); +end; + +procedure TArrayOfInt64SRemotable.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := GetItemName(); + AStore.Get(TypeInfo(Int64),sName,FData[AIndex]); +end; + +class function TArrayOfInt64SRemotable.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(Int64); +end; + +procedure TArrayOfInt64SRemotable.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ TArrayOfInt64URemotable } + +function TArrayOfInt64URemotable.GetItem(AIndex: Integer): QWord; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure TArrayOfInt64URemotable.SetItem(AIndex: Integer; const AValue: QWord); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function TArrayOfInt64URemotable.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure TArrayOfInt64URemotable.SaveItem(AStore: IFormatterBase; + const AName: String; const AIndex: Integer); +begin + AStore.Put(AName,TypeInfo(QWord),FData[AIndex]); +end; + +procedure TArrayOfInt64URemotable.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := GetItemName(); + AStore.Get(TypeInfo(QWord),sName,FData[AIndex]); +end; + +class function TArrayOfInt64URemotable.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(QWord); +end; + +procedure TArrayOfInt64URemotable.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ TArrayOfFloatSingleRemotable } + +function TArrayOfFloatSingleRemotable.GetItem(AIndex: Integer): Single; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure TArrayOfFloatSingleRemotable.SetItem(AIndex: Integer;const AValue: Single); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function TArrayOfFloatSingleRemotable.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure TArrayOfFloatSingleRemotable.SaveItem(AStore: IFormatterBase; + const AName: String; const AIndex: Integer); +begin + AStore.Put(AName,TypeInfo(Single),FData[AIndex]); +end; + +procedure TArrayOfFloatSingleRemotable.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := GetItemName(); + AStore.Get(TypeInfo(Single),sName,FData[AIndex]); +end; + +class function TArrayOfFloatSingleRemotable.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(Single); +end; + +procedure TArrayOfFloatSingleRemotable.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ TArrayOfFloatDoubleRemotable } + +function TArrayOfFloatDoubleRemotable.GetItem(AIndex: Integer): Double; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure TArrayOfFloatDoubleRemotable.SetItem(AIndex: Integer;const AValue: Double); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function TArrayOfFloatDoubleRemotable.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure TArrayOfFloatDoubleRemotable.SaveItem(AStore: IFormatterBase; + const AName: String; const AIndex: Integer); +begin + AStore.Put(AName,TypeInfo(Double),FData[AIndex]); +end; + +procedure TArrayOfFloatDoubleRemotable.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := GetItemName(); + AStore.Get(TypeInfo(Double),sName,FData[AIndex]); +end; + +class function TArrayOfFloatDoubleRemotable.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(Double); +end; + +procedure TArrayOfFloatDoubleRemotable.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ TArrayOfFloatExtendedRemotable } + +function TArrayOfFloatExtendedRemotable.GetItem(AIndex: Integer): Extended; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure TArrayOfFloatExtendedRemotable.SetItem(AIndex: Integer;const AValue: Extended); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function TArrayOfFloatExtendedRemotable.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure TArrayOfFloatExtendedRemotable.SaveItem(AStore: IFormatterBase; + const AName: String; const AIndex: Integer); +begin + AStore.Put(AName,TypeInfo(Extended),FData[AIndex]); +end; + +procedure TArrayOfFloatExtendedRemotable.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := GetItemName(); + AStore.Get(TypeInfo(Extended),sName,FData[AIndex]); +end; + +class function TArrayOfFloatExtendedRemotable.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(Extended); +end; + +procedure TArrayOfFloatExtendedRemotable.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ TArrayOfFloatCurrencyRemotable } + +function TArrayOfFloatCurrencyRemotable.GetItem(AIndex: Integer): Currency; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure TArrayOfFloatCurrencyRemotable.SetItem(AIndex: Integer;const AValue: Currency); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function TArrayOfFloatCurrencyRemotable.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure TArrayOfFloatCurrencyRemotable.SaveItem(AStore: IFormatterBase; + const AName: String; const AIndex: Integer); +begin + AStore.Put(AName,TypeInfo(Currency),FData[AIndex]); +end; + +procedure TArrayOfFloatCurrencyRemotable.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := GetItemName(); + AStore.Get(TypeInfo(Currency),sName,FData[AIndex]); +end; + +class function TArrayOfFloatCurrencyRemotable.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(Currency); +end; + +procedure TArrayOfFloatCurrencyRemotable.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + + +{ THeaderBlock } + +function THeaderBlock.HasmustUnderstand: boolean; +begin + Result := ( FmustUnderstand <> 0 ); +end; + +procedure THeaderBlock.SetmustUnderstand(const AValue: Integer); +begin + if ( AValue <> 0 ) then + FmustUnderstand := 1 + else + FmustUnderstand := 0; +end; + +{ TStoredPropertyManager } + +procedure TStoredPropertyManager.Error(Const AMsg: string); +begin + raise EPropertyException.Create(AMsg); +end; + +procedure TStoredPropertyManager.Error( + Const AMsg: string; + Const AArgs: array of const +); +begin + raise EPropertyException.CreateFmt(AMsg,AArgs); +end; + +procedure TStoredPropertyManager.SetProperty(Const AName, AValue: string); +begin + FData.Values[AName] := AValue; +end; + +procedure TStoredPropertyManager.SetProperties(Const APropsStr: string); +var + lst : TStringList; + i : Integer; +begin + if ( Length(Trim(APropsStr)) = 0 ) then + Exit; + lst := TStringList.Create(); + try + lst.QuoteChar := #0; + lst.Delimiter := PROP_LIST_DELIMITER; + lst.DelimitedText := APropsStr; + for i := 0 to Pred(lst.Count) do + SetProperty(lst.Names[i],lst.ValueFromIndex[i]); + finally + lst.Free(); + end; +end; + +function TStoredPropertyManager.GetProperty(Const AName: String): string; +begin + Result := FData.Values[AName]; +end; + +function TStoredPropertyManager.GetPropertyNames(ADest: TStrings): Integer; +var + i : Integer; +begin + ADest.Clear(); + Result := FData.Count; + for i := 0 to Pred(Result) do + ADest.Add(FData.Names[i]); +end; + +procedure TStoredPropertyManager.Clear(); +begin + FData.Clear(); +end; + +procedure TStoredPropertyManager.Copy( + ASource : IPropertyManager; + Const AClearBefore : Boolean +); +var + lst : TStringList; + i : Integer; + s : string; +begin + if AClearBefore then + Clear(); + if Assigned(ASource) then begin + lst := TStringList.Create(); + try + ASource.GetPropertyNames(lst); + for i := 0 to Pred(lst.Count) do begin + s := lst[i]; + SetProperty(s,ASource.GetProperty(s)); + end; + finally + lst.Free(); + end; + end; +end; + +constructor TStoredPropertyManager.Create(); +begin + FData := TStringList.Create(); +end; + +destructor TStoredPropertyManager.Destroy(); +begin + FreeAndNil(FData); + inherited Destroy(); +end; + + +{ TAbstractComplexRemotable } + +class procedure TAbstractComplexRemotable.RegisterAttributeProperty(const AProperty: shortstring); +var + ri : TSerializeOptions; +begin + ri := GetSerializeOptionsRegistry().Find(Self); + if not Assigned(ri) then + ri := GetSerializeOptionsRegistry().RegisterClass(Self); + ri.AddAttributeField(AProperty); +end; + +class procedure TAbstractComplexRemotable.RegisterAttributeProperties(const APropertList: array of shortstring); +var + i : Integer; +begin + for i := Low(APropertList) to High(APropertList) do + RegisterAttributeProperty(APropertList[i]); +end; + +class function TAbstractComplexRemotable.IsAttributeProperty(const AProperty: shortstring): Boolean; +var + ri : TSerializeOptions; + pc : TClass; +begin + Result := False; + if ( Self = TBaseComplexRemotable ) then + Exit; + pc := Self; + while Assigned(pc) and pc.InheritsFrom(TBaseComplexRemotable) do begin + ri := GetSerializeOptionsRegistry().Find(TBaseComplexRemotableClass(pc)); + if Assigned(ri) then begin + Result := ri.IsAttributeField(AProperty); + Exit; + end; + pc := pc.ClassParent; + end; +end; + +procedure TAbstractComplexRemotable.Assign(Source: TPersistent); +var + propList : PPropList; + i, propCount, propListLen : Integer; + p, sp : PPropInfo; + selfTypeInfo : PTypeInfo; + srcObj, dstObj : TObject; +begin + if not Assigned(Source) then + Exit; + selfTypeInfo := Self.ClassInfo; + propCount := GetTypeData(selfTypeInfo)^.PropCount; + if ( propCount > 0 ) then begin + propListLen := GetPropList(selfTypeInfo,propList); + try + for i := 0 to Pred(propCount) do begin + p := propList^[i]; + sp := GetPropInfo(Source,p^.Name); + if Assigned(sp) and Assigned(sp^.GetProc) and + Assigned(p^.SetProc) + then begin + case p^.PropType^.Kind of + tkInt64{$IFDEF FPC},tkQWord, tkBool{$ENDIF}, tkEnumeration,tkInteger : + SetOrdProp(Self,p,GetOrdProp(Source,p^.Name)); + tkLString{$IFDEF FPC}, tkAString{$ENDIF} : + SetStrProp(Self,p,GetStrProp(Source,p^.Name)); + tkClass : + begin + srcObj := GetObjectProp(Source,p^.Name); + dstObj := GetObjectProp(Self,p^.Name); + if ( not Assigned(dstObj) ) and + ( Assigned(srcObj) and srcObj.InheritsFrom(TAbstractComplexRemotable) ) + then begin + dstObj := TAbstractComplexRemotableClass(srcObj.ClassType).Create(); + SetObjectProp(Self,p,dstObj); + end; + if Assigned(dstObj) then begin + if ( srcObj = nil ) then begin + FreeAndNil(dstObj); + SetObjectProp(Self,p,dstObj); + end else begin + if dstObj.InheritsFrom(TPersistent) and srcObj.InheritsFrom(TPersistent) then + TPersistent(dstObj).Assign(TPersistent(srcObj)); + end; + end; + end; + tkFloat : + SetFloatProp(Self,p,GetFloatProp(Source,p^.Name)); + end; + end; + end; + finally + Freemem(propList,propListLen*SizeOf(Pointer)); + end; + end; +end; + +{ TBaseComplexSimpleContentRemotable } + +class procedure TBaseComplexSimpleContentRemotable.Save( + AObject: TBaseRemotable; + AStore: IFormatterBase; + const AName: string; + const ATypeInfo: PTypeInfo +); +Var + propList : PPropList; + i, propCount, propListLen : Integer; + pt : PTypeInfo; + int64Data : Int64; + strData : String; + objData : TObject; + boolData : Boolean; + enumData : TEnumBuffer; + floatDt : TFloatBuffer; + p : PPropInfo; + oldSS : TSerializationStyle; + tr : TTypeRegistry; + propName : string; +begin + oldSS := AStore.GetSerializationStyle(); + AStore.BeginObject(AName,ATypeInfo); + try + if not Assigned(AObject) then begin + AStore.NilCurrentScope(); + Exit; + end; + SaveValue(AObject,AStore); + propCount := GetTypeData(ATypeInfo)^.PropCount; + if ( propCount > 0 ) then begin + propListLen := GetPropList(ATypeInfo,propList); + try + tr := GetTypeRegistry(); + AStore.SetSerializationStyle(ssAttibuteSerialization); + for i := 0 to Pred(propCount) do begin + p := propList^[i]; + pt := p^.PropType{$IFNDEF FPC}^{$ENDIF}; + propName := tr.ItemByTypeInfo[pt].GetExternalPropertyName(p^.Name); + if IsStoredProp(AObject,p) then begin + case pt^.Kind of + tkInt64{$IFDEF FPC},tkQWord{$ENDIF} : + begin + int64Data := GetOrdProp(AObject,p^.Name); + AStore.Put(propName,pt,int64Data); + end; + tkLString{$IFDEF FPC},tkAString{$ENDIF} : + begin + strData := GetStrProp(AObject,p^.Name); + AStore.Put(propName,pt,strData); + end; + tkClass : + begin + objData := GetObjectProp(AObject,p^.Name); + AStore.Put(propName,pt,objData); + end; + {$IFDEF FPC} + tkBool : + begin + boolData := Boolean(GetOrdProp(AObject,p^.Name)); + AStore.Put(propName,pt,boolData); + end; + {$ENDIF} + tkEnumeration,tkInteger : + begin + {$IFNDEF FPC} + if ( pt^.Kind = tkEnumeration ) and + ( GetTypeData(pt)^.BaseType^ = TypeInfo(Boolean) ) + then begin + boolData := Boolean(GetOrdProp(AObject,p^.Name)); + AStore.Put(propName,pt,boolData); + end else begin + {$ENDIF} + FillChar(enumData,SizeOf(enumData),#0); + case GetTypeData(pt)^.OrdType of + otSByte : + begin + enumData.ShortIntData := ShortInt(GetOrdProp(AObject,p^.Name)); + AStore.Put(propName,pt,enumData.ShortIntData); + end; + otUByte : + begin + enumData.ByteData := Byte(GetOrdProp(AObject,p^.Name)); + AStore.Put(propName,pt,enumData.ByteData); + end; + otSWord : + begin + enumData.SmallIntData := SmallInt(GetOrdProp(AObject,p^.Name)); + AStore.Put(propName,pt,enumData.SmallIntData); + end; + otUWord : + begin + enumData.WordData := Word(GetOrdProp(AObject,p^.Name)); + AStore.Put(propName,pt,enumData.WordData); + end; + otSLong : + begin + enumData.SLongIntData := LongInt(GetOrdProp(AObject,p^.Name)); + AStore.Put(propName,pt,enumData.SLongIntData); + end; + otULong : + begin + enumData.ULongIntData := LongWord(GetOrdProp(AObject,p^.Name)); + AStore.Put(propName,pt,enumData.ULongIntData); + end; + end; + {$IFNDEF FPC} + end; + {$ENDIF} + end; + tkFloat : + begin + FillChar(floatDt,SizeOf(floatDt),#0); + case GetTypeData(pt)^.FloatType of + ftSingle : + begin + floatDt.SingleData := GetFloatProp(AObject,p^.Name); + AStore.Put(propName,pt,floatDt.SingleData); + end; + ftDouble : + begin + floatDt.DoubleData := GetFloatProp(AObject,p^.Name); + AStore.Put(propName,pt,floatDt.DoubleData); + end; + ftExtended : + begin + floatDt.ExtendedData := Extended(GetFloatProp(AObject,p^.Name)); + AStore.Put(propName,pt,floatDt.ExtendedData); + end; + ftCurr : + begin + floatDt.CurrencyData := GetFloatProp(AObject,p^.Name); + AStore.Put(propName,pt,floatDt.CurrencyData); + end; + ftComp : + begin + floatDt.CompData := GetFloatProp(AObject,p^.Name); + AStore.Put(propName,pt,floatDt.CompData); + end; + end; + end; + end; + end; + end; + finally + Freemem(propList,propListLen*SizeOf(Pointer)); + end; + end; + finally + AStore.EndScope(); + AStore.SetSerializationStyle(oldSS); + end; +end; + +class procedure TBaseComplexSimpleContentRemotable.Load( + var AObject: TObject; + AStore: IFormatterBase; + var AName: string; + const ATypeInfo: PTypeInfo +); +Var + propList : PPropList; + i, propCount, propListLen : Integer; + pt : PTypeInfo; + propName : String; + int64Data : Int64; + strData : String; + objData : TObject; + objDataCreateHere : Boolean; + boolData : Boolean; + p : PPropInfo; + enumData : TEnumBuffer; + floatDt : TFloatExtendedType; + floatBuffer : TFloatBuffer; + persistType : TPropStoreType; + objTypeData : PTypeData; + oldSS : TSerializationStyle; + tr : TTypeRegistry; +begin + oldSS := AStore.GetSerializationStyle(); + if ( AStore.BeginObjectRead(AName,ATypeInfo) >= 0 ) then begin + try + if AStore.IsCurrentScopeNil() then + Exit; // ???? FreeAndNil(AObject); + If Not Assigned(AObject) Then + AObject := Create(); + LoadValue(AObject,AStore); + objTypeData := GetTypeData(ATypeInfo); + propCount := objTypeData^.PropCount; + If ( propCount > 0 ) Then Begin + propListLen := GetPropList(ATypeInfo,propList); + Try + tr := GetTypeRegistry(); + AStore.SetSerializationStyle(ssAttibuteSerialization); + For i := 0 To Pred(propCount) Do Begin + p := propList^[i]; + persistType := IsStoredPropClass(objTypeData^.ClassType,p); + If ( persistType in [pstOptional,pstAlways] ) Then Begin + pt := p^.PropType{$IFNDEF FPC}^{$ENDIF}; + propName := tr.ItemByTypeInfo[pt].GetExternalPropertyName(p^.Name); + try + Case pt^.Kind Of + tkInt64{$IFDEF FPC},tkQWord{$ENDIF} : + Begin + AStore.Get(pt,propName,int64Data); + SetOrdProp(AObject,p^.Name,int64Data); + End; + tkLString{$IFDEF FPC},tkAString{$ENDIF} : + Begin + AStore.Get(pt,propName,strData); + SetStrProp(AObject,p^.Name,strData); + End; + {$IFDEF FPC} + tkBool : + Begin + AStore.Get(pt,propName,boolData); + SetOrdProp(AObject,p^.Name,Ord(boolData)); + End; + {$ENDIF} + tkClass : + Begin + objData := GetObjectProp(AObject,p^.Name); + objDataCreateHere := not Assigned(objData); + try + AStore.Get(pt,propName,objData); + if objDataCreateHere then + SetObjectProp(AObject,p^.Name,objData); + finally + if objDataCreateHere then + FreeAndNil(objData); + end; + End; + tkEnumeration,tkInteger : + Begin + FillChar(enumData,SizeOf(enumData),#0); + Case GetTypeData(pt)^.OrdType Of + otSByte : + Begin + AStore.Get(pt,propName,enumData.ShortIntData); + int64Data := enumData.ShortIntData; + End; + otUByte : + Begin + AStore.Get(pt,propName,enumData.ByteData); + int64Data := enumData.ByteData; + End; + otSWord : + Begin + AStore.Get(pt,propName,enumData.SmallIntData); + int64Data := enumData.SmallIntData; + End; + otUWord : + Begin + AStore.Get(pt,propName,enumData.WordData); + int64Data := enumData.WordData; + End; + otSLong: + Begin + AStore.Get(pt,propName,enumData.SLongIntData); + int64Data := enumData.SLongIntData; + End; + otULong : + Begin + AStore.Get(pt,propName,enumData.ULongIntData); + int64Data := enumData.ULongIntData; + End; + End; + SetOrdProp(AObject,p^.Name,int64Data); + End; + tkFloat : + Begin + FillChar(floatDt,SizeOf(floatBuffer),#0); + Case GetTypeData(pt)^.FloatType Of + ftSingle : + Begin + AStore.Get(pt,propName,floatBuffer.SingleData); + floatDt := floatBuffer.SingleData; + End; + ftDouble : + Begin + AStore.Get(pt,propName,floatBuffer.DoubleData); + floatDt := floatBuffer.DoubleData; + End; + ftExtended : + Begin + AStore.Get(pt,propName,floatBuffer.ExtendedData); + floatDt := floatBuffer.ExtendedData; + End; + ftCurr : + Begin + AStore.Get(pt,propName,floatBuffer.CurrencyData); + floatDt := floatBuffer.CurrencyData; + End; + ftComp : + Begin + AStore.Get(pt,propName,floatBuffer.CompData); + floatDt := floatBuffer.CompData; + End; + End; + SetFloatProp(AObject,p^.Name,floatDt); + End; + End; + except + on E : EServiceException do begin + if ( persistType = pstAlways ) then + raise; + end; + end; + End; + End; + Finally + Freemem(propList,propListLen*SizeOf(Pointer)); + End; + End; + finally + AStore.EndScopeRead(); + AStore.SetSerializationStyle(oldSS); + end; + end; +end; + +{ TComplexInt32SContentRemotable } + +class procedure TComplexInt32SContentRemotable.SaveValue( + AObject : TBaseRemotable; + AStore : IFormatterBase +); +begin + AStore.PutScopeInnerValue(TypeInfo(LongInt),(AObject as TComplexInt32SContentRemotable).Value); +end; + +class procedure TComplexInt32SContentRemotable.LoadValue( + var AObject : TObject; + AStore : IFormatterBase +); +var + i : LongInt; +begin + i := 0; + AStore.GetScopeInnerValue(TypeInfo(LongInt),i); + (AObject as TComplexInt32SContentRemotable).Value := i; +end; + +{ TComplexInt32UContentRemotable } + +class procedure TComplexInt32UContentRemotable.SaveValue( + AObject : TBaseRemotable; + AStore : IFormatterBase +); +begin + AStore.PutScopeInnerValue(TypeInfo(LongWord),(AObject as TComplexInt32UContentRemotable).Value); +end; + +class procedure TComplexInt32UContentRemotable.LoadValue( + var AObject : TObject; + AStore : IFormatterBase +); +var + i : LongWord; +begin + i := 0; + AStore.GetScopeInnerValue(TypeInfo(LongWord),i); + (AObject as TComplexInt32UContentRemotable).Value := i; +end; + +{ TComplexInt16SContentRemotable } + +class procedure TComplexInt16SContentRemotable.SaveValue( + AObject : TBaseRemotable; + AStore : IFormatterBase +); +begin + AStore.PutScopeInnerValue(TypeInfo(SmallInt),(AObject as TComplexInt16SContentRemotable).Value); +end; + +class procedure TComplexInt16SContentRemotable.LoadValue( + var AObject : TObject; + AStore : IFormatterBase +); +var + i : SmallInt; +begin + i := 0; + AStore.GetScopeInnerValue(TypeInfo(SmallInt),i); + (AObject as TComplexInt16SContentRemotable).Value := i; +end; + +{ TComplexInt16UContentRemotable } + +class procedure TComplexInt16UContentRemotable.SaveValue( + AObject : TBaseRemotable; + AStore : IFormatterBase +); +begin + AStore.PutScopeInnerValue(TypeInfo(Word),(AObject as TComplexInt16UContentRemotable).Value); +end; + +class procedure TComplexInt16UContentRemotable.LoadValue( + var AObject : TObject; + AStore : IFormatterBase +); +var + i : Word; +begin + i := 0; + AStore.GetScopeInnerValue(TypeInfo(Word),i); + (AObject as TComplexInt16UContentRemotable).Value := i; +end; + +{ TComplexFloatExtendedContentRemotable } + +class procedure TComplexFloatExtendedContentRemotable.SaveValue( + AObject : TBaseRemotable; + AStore : IFormatterBase +); +begin + AStore.PutScopeInnerValue(TypeInfo(Extended),(AObject as TComplexFloatExtendedContentRemotable).Value); +end; + +class procedure TComplexFloatExtendedContentRemotable.LoadValue( + var AObject : TObject; + AStore : IFormatterBase +); +var + i : Extended; +begin + i := 0; + AStore.GetScopeInnerValue(TypeInfo(Extended),i); + (AObject as TComplexFloatExtendedContentRemotable).Value := i; +end; + +{ TComplexFloatDoubleContentRemotable } + +class procedure TComplexFloatDoubleContentRemotable.SaveValue( + AObject : TBaseRemotable; + AStore : IFormatterBase +); +begin + AStore.PutScopeInnerValue(TypeInfo(Double),(AObject as TComplexFloatDoubleContentRemotable).Value); +end; + +class procedure TComplexFloatDoubleContentRemotable.LoadValue( + var AObject : TObject; + AStore : IFormatterBase +); +var + i : Double; +begin + i := 0; + AStore.GetScopeInnerValue(TypeInfo(Double),i); + (AObject as TComplexFloatDoubleContentRemotable).Value := i; +end; + +{ TComplexStringContentRemotable } + +class procedure TComplexStringContentRemotable.SaveValue( + AObject : TBaseRemotable; + AStore : IFormatterBase +); +begin + AStore.PutScopeInnerValue(TypeInfo(string),(AObject as TComplexStringContentRemotable).Value); +end; + +class procedure TComplexStringContentRemotable.LoadValue( + var AObject : TObject; + AStore : IFormatterBase +); +var + i : string; +begin + i := ''; + AStore.GetScopeInnerValue(TypeInfo(string),i); + (AObject as TComplexStringContentRemotable).Value := i; +end; + +{ TDateRemotable } + +procedure TDateRemotable.SetDate(const AValue: TDateTime); +var + hh, mn, ss, ssss : Word; +begin + inherited SetDate(AValue); + DecodeTime(AsDate,hh,mn,ss,ssss); + FHour := hh; + FMinute := mn; + FSecond := ss; +end; + +class function TDateRemotable.FormatDate(const ADate: TDateTime): string; +var + s, buffer : string; + d, m, y : Word; + hh, mn, ss, ssss : Word; +begin + //'-'? yyyy '-' mm '-' dd 'T' hh ':' mm ':' ss ('.' s+)? (zzzzzz)? + + DecodeDate(ADate,y,m,d); + s := IntToStr(y); + buffer := IntToStr(m); + if ( m < 10 ) then + buffer := '0' + buffer; + s := Format('%s-%s',[s,buffer]); + + buffer := IntToStr(d); + if ( d < 10 ) then + buffer := '0' + buffer; + s := Format('%s-%s',[s,buffer]); + + DecodeTime(ADate,hh,mn,ss,ssss); + buffer := IntToStr(hh); + if ( hh < 10 ) then + buffer := '0' + buffer; + s := Format('%sT%s',[s,buffer]); + + buffer := IntToStr(mn); + if ( mn < 10 ) then + buffer := '0' + buffer; + s := Format('%s:%s',[s,buffer]); + + buffer := IntToStr(ss); + if ( ss < 10 ) then + buffer := '0' + buffer; + s := Format('%s:%s',[s,buffer]); + + Result := s; +end; + +class function TDateRemotable.ParseDate(const ABuffer: string): TDateTime; +var + buffer : string; + bufferPos, bufferLen : Integer; + + function ReadInt() : Integer; + var + neg : Boolean; + s : shortstring; + begin + neg := False; + Result := 0; + + while ( bufferPos <= bufferLen ) and ( buffer[bufferPos] < #33 ) do begin + Inc(bufferPos); + end; + + if ( bufferPos <= bufferLen ) then begin + if ( ABuffer[bufferPos] = '-' ) then begin + neg := True; + Inc(bufferPos); + end; + end; + s := ''; + while ( bufferPos <= bufferLen ) and ( buffer[bufferPos] in ['0'..'9'] ) do begin + s := s + buffer[bufferPos]; + Inc(bufferPos); + end; + if ( Length(s) = 0 ) then + raise EServiceException.Create('Invalid INTEGER BUFFER'); + Result := StrToInt(s); + if neg then begin + Result := -Result; + end; + end; + +var + d, m, y : Word; + hh, mn, ss : Word; +begin + //'-'? yyyy '-' mm '-' dd 'T' hh ':' mm ':' ss ('.' s+)? (zzzzzz)? + + buffer := Trim(ABuffer); + bufferPos := 0; + bufferLen := Length(buffer); + + y := ReadInt(); + Inc(bufferPos); + + m := ReadInt(); + Inc(bufferPos); + + d := ReadInt(); + Inc(bufferPos); + + hh := ReadInt(); + Inc(bufferPos); + + mn := ReadInt(); + Inc(bufferPos); + + ss := ReadInt(); + + Result := EncodeDate(y,m,d) + EncodeTime(hh,mn,ss,0); +end; + +{ TBaseDateRemotable } + +procedure TBaseDateRemotable.SetDate(const AValue: TDateTime); +var + y, m, d : Word; +begin + DecodeDate(AValue,y,m,d); + FDate := AValue; + FYear := y; + FMonth := m; + FDay := d; +end; + +class procedure TBaseDateRemotable.Save( + AObject : TBaseRemotable; + AStore : IFormatterBase; + const AName : string; + const ATypeInfo : PTypeInfo +); +var + buffer : string; +begin + buffer := FormatDate(TDateRemotable(AObject).AsDate); + AStore.BeginObject(AName,ATypeInfo); + try + AStore.PutScopeInnerValue(TypeInfo(string),buffer); + finally + AStore.EndScope(); + end; +end; + +class procedure TBaseDateRemotable.Load( + var AObject : TObject; + AStore : IFormatterBase; + var AName : string; + const ATypeInfo : PTypeInfo +); +var + strBuffer : string; +begin + if ( AStore.BeginObjectRead(AName,ATypeInfo) >= 0 ) then begin + try + strBuffer := ''; + AStore.GetScopeInnerValue(TypeInfo(string),strBuffer); + (AObject as TDateRemotable).AsDate := ParseDate(strBuffer); + finally + AStore.EndScopeRead(); + end; + end; +end; + +procedure TBaseDateRemotable.Assign(Source: TPersistent); +begin + if Source.InheritsFrom(TDateRemotable) then begin + FDate := TDateRemotable(Source).AsDate; + end else begin + inherited Assign(Source); + end; +end; + +{ TComplexInt8SContentRemotable } + +class procedure TComplexInt8SContentRemotable.SaveValue( + AObject : TBaseRemotable; + AStore : IFormatterBase +); +begin + AStore.PutScopeInnerValue(TypeInfo(ShortInt),(AObject as TComplexInt8SContentRemotable).Value); +end; + +class procedure TComplexInt8SContentRemotable.LoadValue( + var AObject : TObject; + AStore : IFormatterBase +); +var + i : ShortInt; +begin + i := 0; + AStore.GetScopeInnerValue(TypeInfo(ShortInt),i); + (AObject as TComplexInt8SContentRemotable).Value := i; +end; + +{ TComplexInt8UContentRemotable } + +class procedure TComplexInt8UContentRemotable.SaveValue( + AObject : TBaseRemotable; + AStore : IFormatterBase +); +begin + AStore.PutScopeInnerValue(TypeInfo(Byte),(AObject as TComplexInt8UContentRemotable).Value); +end; + +class procedure TComplexInt8UContentRemotable.LoadValue( + var AObject : TObject; + AStore : IFormatterBase +); +var + i : Byte; +begin + i := 0; + AStore.GetScopeInnerValue(TypeInfo(Byte),i); + (AObject as TComplexInt8UContentRemotable).Value := i; +end; + +{ TComplexFloatSingleContentRemotable } + +class procedure TComplexFloatSingleContentRemotable.SaveValue( + AObject : TBaseRemotable; + AStore : IFormatterBase +); +begin + AStore.PutScopeInnerValue(TypeInfo(Single),(AObject as TComplexFloatSingleContentRemotable).Value); +end; + +class procedure TComplexFloatSingleContentRemotable.LoadValue( + var AObject : TObject; + AStore : IFormatterBase +); +var + i : Single; +begin + i := 0; + AStore.GetScopeInnerValue(TypeInfo(Single),i); + (AObject as TComplexFloatSingleContentRemotable).Value := i; +end; + +{ TComplexInt64SContentRemotable } + +class procedure TComplexInt64SContentRemotable.SaveValue( + AObject : TBaseRemotable; + AStore : IFormatterBase +); +begin + AStore.PutScopeInnerValue(TypeInfo(Int64),(AObject as TComplexInt64SContentRemotable).Value); +end; + +class procedure TComplexInt64SContentRemotable.LoadValue( + var AObject : TObject; + AStore : IFormatterBase +); +var + i : Int64; +begin + i := 0; + AStore.GetScopeInnerValue(TypeInfo(Int64),i); + (AObject as TComplexInt64SContentRemotable).Value := i; +end; + +{ TComplexInt64UContentRemotable } + +class procedure TComplexInt64UContentRemotable.SaveValue( + AObject : TBaseRemotable; + AStore : IFormatterBase +); +begin + AStore.PutScopeInnerValue(TypeInfo(QWord),(AObject as TComplexInt64UContentRemotable).Value); +end; + +class procedure TComplexInt64UContentRemotable.LoadValue( + var AObject : TObject; + AStore : IFormatterBase +); +var + i : QWord; +begin + i := 0; + AStore.GetScopeInnerValue(TypeInfo(QWord),i); + (AObject as TComplexInt64UContentRemotable).Value := i; +end; + +{ TComplexBooleanContentRemotable } + +class procedure TComplexBooleanContentRemotable.SaveValue( + AObject : TBaseRemotable; + AStore : IFormatterBase +); +begin + AStore.PutScopeInnerValue(TypeInfo(Boolean),(AObject as TComplexBooleanContentRemotable).Value); +end; + +class procedure TComplexBooleanContentRemotable.LoadValue( + var AObject : TObject; + AStore : IFormatterBase +); +var + i : Boolean; +begin + i := False; + AStore.GetScopeInnerValue(TypeInfo(Boolean),i); + (AObject as TComplexBooleanContentRemotable).Value := i; +end; + +initialization + TypeRegistryInstance := TTypeRegistry.Create(); + SerializeOptionsRegistryInstance := TSerializeOptionsRegistry.Create(); + +finalization + FreeAndNil(SerializeOptionsRegistryInstance); + FreeAndNil(TypeRegistryInstance); +end. diff --git a/wst/tags/0.4/base_soap_formatter.pas b/wst/tags/0.4/base_soap_formatter.pas new file mode 100644 index 000000000..2d63709c7 --- /dev/null +++ b/wst/tags/0.4/base_soap_formatter.pas @@ -0,0 +1,1685 @@ +{ + This file is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This file is provide under modified LGPL licence + ( the files COPYING.modifiedLGPL and COPYING.LGPL). + + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +} +unit base_soap_formatter; + +{$mode objfpc}{$H+} +{$IF (FPC_VERSION = 2) and (FPC_RELEASE > 0)} + {$define FPC_211} +{$ENDIF} + +interface + +uses + Classes, SysUtils, TypInfo, Contnrs, + DOM, + base_service_intf; + +Const + sPROTOCOL_NAME = 'SOAP'; + + sXML_NS = 'xmlns'; + sXSI_NS = 'http://www.w3.org/1999/XMLSchema-instance'; + sTYPE = 'type'; + sNIL = 'nil'; + + sSOAP_ENC = 'http://schemas.xmlsoap.org/soap/encoding/'; + sSOAP_ENC_ABR = 'SOAP-ENC'; + + sARRAY_TYPE = 'arrayType'; + + sCONTENT_TYPE = 'contenttype'; + sSOAP_CONTENT_TYPE = 'text/xml'; + + sHEADER = 'Header'; + sENVELOPE = 'Envelope'; + +Type + + TEnumIntType = Int64; + + { ESOAPException } + + ESOAPException = class(EBaseRemoteException) + End; + + { TStackItem } + + TStackItem = class + private + FEmbeddedScopeCount: Integer; + FNameSpace: string; + FScopeObject: TDOMNode; + FScopeType: TScopeType; + protected + function GetItemsCount() : Integer;virtual; + Public + constructor Create(AScopeObject : TDOMNode;AScopeType : TScopeType); + function FindNode(var ANodeName : string):TDOMNode;virtual;abstract; + procedure SetNameSpace(const ANameSpace : string); + property ScopeObject : TDOMNode Read FScopeObject; + property ScopeType : TScopeType Read FScopeType; + property NameSpace : string Read FNameSpace; + property ItemsCount : Integer read GetItemsCount; + + property EmbeddedScopeCount : Integer read FEmbeddedScopeCount; + function BeginEmbeddedScope() : Integer; + function EndEmbeddedScope() : Integer; + End; + + { TObjectStackItem } + + TObjectStackItem = class(TStackItem) + Public + function FindNode(var ANodeName : string):TDOMNode;override; + End; + + { TAbstractArrayStackItem } + + TAbstractArrayStackItem = class(TStackItem) + private + FItemList : TDOMNodeList; + FIndex : Integer; + FItemName : string; + protected + procedure EnsureListCreated(); + function GetItemsCount() : Integer;override; + function CreateList(const ANodeName : string):TDOMNodeList;virtual;abstract; + public + constructor Create( + AScopeObject : TDOMNode; + const AScopeType : TScopeType; + const AItemName : string + ); + destructor Destroy();override; + function FindNode(var ANodeName : string):TDOMNode;override; + end; + + { TScopedArrayStackItem } + + TScopedArrayStackItem = class(TAbstractArrayStackItem) + protected + function CreateList(const ANodeName : string):TDOMNodeList;override; + end; + + { TEmbeddedArrayStackItem } + + TEmbeddedArrayStackItem = class(TAbstractArrayStackItem) + protected + function CreateList(const ANodeName : string):TDOMNodeList;override; + end; + + TSOAPEncodingStyle = ( Literal, Encoded ); + TSOAPDocumentStyle = ( RPC, Document ); + +{$M+} + + { TSOAPBaseFormatter } + + TSOAPBaseFormatter = class(TSimpleFactoryItem,IFormatterBase) + private + FContentType: string; + FEncodingStyle: TSOAPEncodingStyle; + FStyle: TSOAPDocumentStyle; + FHeaderEnterCount : Integer; + + FNameSpaceCounter : Integer; + FDoc : TXMLDocument; + FStack : TObjectStack; + + FKeepedStyle : TSOAPDocumentStyle; + FKeepedEncoding : TSOAPEncodingStyle; + FSerializationStyle : TSerializationStyle; + + procedure InternalClear(const ACreateDoc : Boolean); + + function NextNameSpaceCounter():Integer;//inline; + function HasScope():Boolean;//inline; + + procedure CheckScope();//inline; + function InternalPutData( + Const AName : String; + Const ATypeInfo : PTypeInfo; + Const AData : string + ):TDOMNode; + function PutEnum( + Const AName : String; + Const ATypeInfo : PTypeInfo; + Const AData : TEnumIntType + ):TDOMNode; + function PutBool( + Const AName : String; + Const ATypeInfo : PTypeInfo; + Const AData : Boolean + ):TDOMNode; + function PutInt64( + Const AName : String; + Const ATypeInfo : PTypeInfo; + Const AData : Int64 + ):TDOMNode; + function PutStr( + Const AName : String; + Const ATypeInfo : PTypeInfo; + Const AData : String + ):TDOMNode; + function PutFloat( + Const AName : String; + Const ATypeInfo : PTypeInfo; + Const AData : Extended + ):TDOMNode; + procedure PutObj( + Const AName : String; + Const ATypeInfo : PTypeInfo; + Const AData : TObject + ); + + function GetNodeValue(var AName : String):DOMString; + procedure GetEnum( + Const ATypeInfo : PTypeInfo; + Var AName : String; + Var AData : TEnumIntType + ); + procedure GetBool( + Const ATypeInfo : PTypeInfo; + Var AName : String; + Var AData : Boolean + ); + procedure GetInt( + Const ATypeInfo : PTypeInfo; + Var AName : String; + Var AData : Integer + ); + procedure GetInt64( + Const ATypeInfo : PTypeInfo; + Var AName : String; + Var AData : Int64 + ); + procedure GetFloat( + Const ATypeInfo : PTypeInfo; + Var AName : String; + Var AData : Extended + ); + procedure GetStr( + Const ATypeInfo : PTypeInfo; + Var AName : String; + Var AData : String + ); + procedure GetObj( + Const ATypeInfo : PTypeInfo; + Var AName : String; + Var AData : TObject + ); + protected + function GetXmlDoc():TXMLDocument; + function PushStack(AScopeObject : TDOMNode):TStackItem;overload; + function PushStack( + AScopeObject : TDOMNode; + const AStyle : TArrayStyle; + const AItemName : string + ):TStackItem;overload; + function FindAttributeByValueInNode( + Const AAttValue : String; + Const ANode : TDOMNode; + Out AResAtt : string + ):boolean; + function FindAttributeByNameInNode( + Const AAttName : String; + Const ANode : TDOMNode; + Out AResAttValue : string + ):boolean; + function FindAttributeByValueInScope(Const AAttValue : String):String; + function FindAttributeByNameInScope(Const AAttName : String):String; + function GetNameSpaceShortName( + const ANameSpace : string; + const ACreateIfNotFound : Boolean + ):shortstring; + protected + function GetCurrentScope():String; + function GetCurrentScopeObject():TDOMElement; + function StackTop():TStackItem; + function PopStack():TStackItem; + procedure ClearStack(); + procedure BeginScope( + Const AScopeName,ANameSpace : string; + Const ANameSpaceShortName : string ; + Const AScopeType : TScopeType; + const AStyle : TArrayStyle + ); + function InternalBeginScopeRead( + var AScopeName : string; + const ATypeInfo : PTypeInfo; + const AScopeType : TScopeType; + const AStyle : TArrayStyle; + const AItemName : string + ):Integer; + + procedure SetSerializationStyle(const ASerializationStyle : TSerializationStyle); + function GetSerializationStyle():TSerializationStyle; + procedure SetStyleAndEncoding( + const AStyle : TSOAPDocumentStyle; + const AEncoding : TSOAPEncodingStyle + ); + procedure RestoreStyleAndEncoding(); + procedure Prepare(); + function ReadHeaders(ACallContext : ICallContext):Integer; + function WriteHeaders(ACallContext : ICallContext):Integer; + public + constructor Create();override; + destructor Destroy();override; + procedure Clear(); + + procedure BeginObject( + Const AName : string; + Const ATypeInfo : PTypeInfo + ); + procedure BeginArray( + const AName : string; + const ATypeInfo : PTypeInfo; + const AItemTypeInfo : PTypeInfo; + const ABounds : Array Of Integer; + const AStyle : TArrayStyle + ); + + procedure NilCurrentScope(); + function IsCurrentScopeNil():Boolean; + procedure EndScope(); + procedure AddScopeAttribute(Const AName,AValue : string); + function BeginObjectRead( + var AScopeName : string; + const ATypeInfo : PTypeInfo + ) : Integer; + function BeginArrayRead( + var AScopeName : string; + const ATypeInfo : PTypeInfo; + const AStyle : TArrayStyle; + const AItemName : string + ):Integer; + procedure EndScopeRead(); + + procedure BeginHeader(); + procedure EndHeader(); + + procedure Put( + Const AName : String; + Const ATypeInfo : PTypeInfo; + Const AData + ); + procedure PutScopeInnerValue( + const ATypeInfo : PTypeInfo; + const AData + ); + procedure Get( + Const ATypeInfo : PTypeInfo; + Var AName : String; + Var AData + ); + procedure GetScopeInnerValue( + const ATypeInfo : PTypeInfo; + var AData + ); + + procedure SaveToStream(AStream : TStream); + procedure LoadFromStream(AStream : TStream); + + procedure Error(Const AMsg:string); + procedure Error(Const AMsg:string; Const AArgs : array of const); + Published + property EncodingStyle : TSOAPEncodingStyle Read FEncodingStyle Write FEncodingStyle; + property ContentType : string Read FContentType Write FContentType; + property Style : TSOAPDocumentStyle Read FStyle Write FStyle; + End; +{$M-} + +implementation +Uses XMLWrite, XMLRead, StrUtils, + imp_utils; + +function GetNodeItemsCount(const ANode : TDOMNode): Integer; +var + chdLst : TDOMNodeList; +begin + if ANode.HasChildNodes then begin + chdLst := ANode.ChildNodes; + try + Result := chdLst.Count + finally + chdLst.Release(); + end; + end else begin + Result := 0; + end; +end; + +{ TStackItem } + +function TStackItem.GetItemsCount: Integer; +begin + Result := GetNodeItemsCount(ScopeObject); +end; + +constructor TStackItem.Create(AScopeObject: TDOMNode; AScopeType: TScopeType); +begin + FScopeObject := AScopeObject; + FScopeType := AScopeType; +end; + +procedure TStackItem.SetNameSpace(const ANameSpace: string); +begin + FNameSpace := ANameSpace; +end; + +function TStackItem.BeginEmbeddedScope(): Integer; +begin + Inc(FEmbeddedScopeCount); + Result := FEmbeddedScopeCount; +end; + +function TStackItem.EndEmbeddedScope(): Integer; +begin + if ( FEmbeddedScopeCount < 1 ) then begin + raise Exception.Create('Invalid opération on scope, their are no embedded scope.'); + end; + Dec(FEmbeddedScopeCount); + Result := FEmbeddedScopeCount; +end; + +{ TObjectStackItem } + +function TObjectStackItem.FindNode(var ANodeName: string): TDOMNode; +begin + Result:= ScopeObject.FindNode(ANodeName); +end; + +{ TAbstractArrayStackItem } + +procedure TAbstractArrayStackItem.EnsureListCreated(); +begin + if ( FItemList = nil ) then begin + FItemList := CreateList(FItemName); + end; +end; + +function TAbstractArrayStackItem.GetItemsCount(): Integer; +begin + EnsureListCreated(); + if Assigned(FItemList) then begin + Result := FItemList.Count; + end else begin + Result := 0; + end; +end; + +constructor TAbstractArrayStackItem.Create( + AScopeObject : TDOMNode; + const AScopeType : TScopeType; + const AItemName : string +); +begin + inherited Create(AScopeObject,AScopeType); + FItemName := AItemName; +end; + +destructor TAbstractArrayStackItem.Destroy(); +begin + if Assigned(FItemList) then + FItemList.Release(); + inherited Destroy(); +end; + +function TAbstractArrayStackItem.FindNode(var ANodeName: string): TDOMNode; +begin + EnsureListCreated(); + if ( FIndex >= FItemList.Count ) then + raise ESOAPException.CreateFmt('Index out of bound : %d; Node Name = "%s"; Parent Node = "%s"',[FIndex,ANodeName,ScopeObject.NodeName]); + Result:= FItemList.Item[FIndex]; + Inc(FIndex); + ANodeName := Result.NodeName; +end; + +{ TSOAPBaseFormatter } + +procedure TSOAPBaseFormatter.ClearStack(); +Var + i, c : Integer; +begin + c := FStack.Count; + For I := 1 To c Do + FStack.Pop().Free(); +end; + +function TSOAPBaseFormatter.PushStack(AScopeObject : TDOMNode) : TStackItem; +begin + Result := FStack.Push(TObjectStackItem.Create(AScopeObject,stObject)) as TStackItem; +end; + +function TSOAPBaseFormatter.PushStack( + AScopeObject : TDOMNode; + const AStyle : TArrayStyle; + const AItemName : string +): TStackItem; +begin + case AStyle of + asScoped : Result := FStack.Push(TScopedArrayStackItem.Create(AScopeObject,stArray,AItemName)) as TStackItem; + asEmbeded : Result := FStack.Push(TEmbeddedArrayStackItem.Create(AScopeObject,stArray,AItemName)) as TStackItem; + else + Assert(False); + end; +end; + +function TSOAPBaseFormatter.BeginObjectRead( + var AScopeName : string; + const ATypeInfo : PTypeInfo +): Integer; +begin + Result := InternalBeginScopeRead(AScopeName,ATypeInfo,stObject,asNone,''); +end; + +function TSOAPBaseFormatter.BeginArrayRead( + var AScopeName : string; + const ATypeInfo : PTypeInfo; + const AStyle : TArrayStyle; + const AItemName : string +): Integer; +begin + Result := InternalBeginScopeRead(AScopeName,ATypeInfo,stArray,AStyle,AItemName); +end; + +procedure TSOAPBaseFormatter.EndScopeRead(); +begin + PopStack().Free(); +end; + +procedure TSOAPBaseFormatter.BeginHeader(); +begin + if ( FHeaderEnterCount <= 0 ) then begin + Inc(FHeaderEnterCount); + Prepare(); + BeginScope(sHEADER,sSOAP_ENV,sSOAP_ENV_ABR,stObject,asNone); + SetStyleAndEncoding(Document,Literal); + end; +end; + +procedure TSOAPBaseFormatter.EndHeader(); +begin + if ( FHeaderEnterCount > 0 ) then begin + Dec(FHeaderEnterCount); + RestoreStyleAndEncoding(); + EndScope(); + end; +end; + +procedure TSOAPBaseFormatter.InternalClear(const ACreateDoc: Boolean); +begin + ClearStack(); + FreeAndNil(FDoc); + if ACreateDoc then + FDoc := TXMLDocument.Create(); +end; + +function TSOAPBaseFormatter.NextNameSpaceCounter(): Integer; +begin + Inc(FNameSpaceCounter); + Result := FNameSpaceCounter; +end; + +function TSOAPBaseFormatter.HasScope(): Boolean; +begin + Result := Assigned(FStack.Peek); +end; + +function TSOAPBaseFormatter.FindAttributeByValueInNode( + Const AAttValue : String; + Const ANode : TDOMNode; + Out AResAtt : string +):boolean; +Var + i,c : Integer; +begin + AResAtt := ''; + If Assigned(ANode) And Assigned(ANode.Attributes) Then Begin + c := Pred(ANode.Attributes.Length); + For i := 0 To c Do Begin + If AnsiSameText(AAttValue,ANode.Attributes.Item[i].NodeValue) Then Begin + AResAtt := ANode.Attributes.Item[i].NodeName; + Result := True; + Exit; + End; + End; + End; + Result := False; +end; + +function TSOAPBaseFormatter.FindAttributeByNameInNode( + const AAttName: String; + const ANode: TDOMNode; + Out AResAttValue: string +): boolean; +var + i,c : Integer; +begin + AResAttValue := ''; + If Assigned(ANode) And Assigned(ANode.Attributes) Then Begin + c := Pred(ANode.Attributes.Length); + For i := 0 To c Do Begin + If AnsiSameText(AAttName,ANode.Attributes.Item[i].NodeName) Then Begin + AResAttValue := ANode.Attributes.Item[i].NodeValue; + Result := True; + Exit; + End; + End; + End; + Result := False; +end; + +function TSOAPBaseFormatter.FindAttributeByValueInScope(const AAttValue: String): String; +Var + tmpNode : TDOMNode; +begin + If HasScope() Then Begin + tmpNode := GetCurrentScopeObject(); + While Assigned(tmpNode) Do Begin + If FindAttributeByValueInNode(AAttValue,tmpNode,Result) Then + Exit; + tmpNode := tmpNode.ParentNode; + End; + End; + Result := ''; +end; + +function TSOAPBaseFormatter.FindAttributeByNameInScope(const AAttName: String): String; +var + tmpNode : TDOMNode; +begin + if HasScope() then begin + tmpNode := GetCurrentScopeObject(); + while Assigned(tmpNode) do begin + if FindAttributeByNameInNode(AAttName,tmpNode,Result) then + Exit; + tmpNode := tmpNode.ParentNode; + end; + end; + Result := ''; +end; + +function TSOAPBaseFormatter.GetNameSpaceShortName( + const ANameSpace : string; + const ACreateIfNotFound : Boolean +): shortstring; +begin + Result := FindAttributeByValueInScope(ANameSpace); + if IsStrEmpty(Result) then begin + if ACreateIfNotFound then begin + Result := 'ns' + IntToStr(NextNameSpaceCounter()); + AddScopeAttribute('xmlns:'+Result, ANameSpace); + end; + end else begin + Result := Copy(Result,Length('xmlns:')+1,MaxInt); + end; +end; + +procedure TSOAPBaseFormatter.CheckScope(); +begin + If Not HasScope() Then + Error('There is no scope.'); +end; + +function ExtractNameSpaceShortName(const ANameSpaceDeclaration : string):string; +var + i : integer; +begin + i := AnsiPos(sXML_NS,ANameSpaceDeclaration); + if ( i > 0 ) then begin + Result := Copy(ANameSpaceDeclaration, (i + Length(sXML_NS) + 1 ), MaxInt ); + end else begin + Result := ''; + end; +end; + +function TSOAPBaseFormatter.InternalPutData( + const AName : String; + const ATypeInfo : PTypeInfo; + const AData : string +): TDOMNode; +Var + namespaceLongName, namespaceShortName, strName, strNodeName, s : string; + regItem : TTypeRegistryItem; +begin + strNodeName := AName; + if ( Style = Document ) then begin + namespaceShortName := Copy(FindAttributeByValueInScope(StackTop().NameSpace),AnsiPos(':',namespaceShortName) + 1,MaxInt); + if not IsStrEmpty(namespaceShortName) then begin + s := ExtractNameSpaceShortName(namespaceShortName); + if not IsStrEmpty(s) then + strNodeName := s + ':' + strNodeName; + end; + end; + + if ( FSerializationStyle = ssNodeSerialization ) then begin + Result := FDoc.CreateElement(strNodeName); + Result.AppendChild(FDoc.CreateTextNode(AData)); + GetCurrentScopeObject().AppendChild(Result); + If ( EncodingStyle = Encoded ) Then Begin + regItem := GetTypeRegistry().ItemByTypeInfo[ATypeInfo]; + strName := regItem.DeclaredName; + namespaceLongName := regItem.NameSpace; + If Not IsStrEmpty(namespaceLongName) Then Begin + namespaceShortName := FindAttributeByValueInScope(namespaceLongName); + If IsStrEmpty(namespaceShortName) Then Begin + namespaceShortName := Format('ns%d',[NextNameSpaceCounter()]); + AddScopeAttribute(sXML_NS + ':'+namespaceShortName,namespaceLongName); + End Else Begin + namespaceShortName := ExtractNameSpaceShortName(namespaceShortName);//Copy(namespaceShortName,AnsiPos(':',namespaceShortName) + 1,MaxInt); + End; + strName := Format('%s:%s',[namespaceShortName,strName]) + End; + namespaceShortName := GetNameSpaceShortName(sXSI_NS,True); + if not IsStrEmpty(namespaceShortName) then + namespaceShortName := namespaceShortName + ':'; + (Result As TDOMElement).SetAttribute(namespaceShortName + sTYPE,strName); + End; + end else begin + Result := GetCurrentScopeObject(); + (Result as TDOMElement).SetAttribute(strNodeName,AData); + end; +end; + +function TSOAPBaseFormatter.PutEnum( + const AName: String; + const ATypeInfo: PTypeInfo; + const AData: TEnumIntType +): TDOMNode; +begin + Result := InternalPutData( + AName, + ATypeInfo, + GetTypeRegistry().ItemByTypeInfo[ATypeInfo].GetExternalPropertyName(GetEnumName(ATypeInfo,AData)) + ); +end; + +function TSOAPBaseFormatter.PutBool( + const AName : String; + const ATypeInfo : PTypeInfo; + const AData : Boolean +): TDOMNode; +begin + Result := InternalPutData(AName,ATypeInfo,LowerCase(BoolToStr(AData))); +end; + +function TSOAPBaseFormatter.PutInt64( + const AName : String; + const ATypeInfo : PTypeInfo; + const AData : Int64 +): TDOMNode; +begin + Result := InternalPutData(AName,ATypeInfo,IntToStr(AData)); +end; + +function TSOAPBaseFormatter.PutStr( + const AName: String; + const ATypeInfo: PTypeInfo; + const AData: String +):TDOMNode; +begin + Result := InternalPutData(AName,ATypeInfo,AData); +end; + +procedure TSOAPBaseFormatter.PutObj( + const AName : String; + const ATypeInfo : PTypeInfo; + const AData : TObject +); +begin + TBaseRemotableClass(GetTypeData(ATypeInfo)^.ClassType).Save(AData As TBaseRemotable, Self,AName,ATypeInfo); +end; + +function TSOAPBaseFormatter.PutFloat( + const AName : String; + const ATypeInfo : PTypeInfo; + const AData : Extended +):TDOMNode; +Var + s, frmt : string; + prcsn,i : Integer; +begin + Case GetTypeData(ATypeInfo)^.FloatType Of + ftSingle, + ftCurr, + ftComp : prcsn := 7; + ftDouble, + ftExtended : prcsn := 15; + End; + frmt := '#.' + StringOfChar('#',prcsn) + 'E-0'; + s := FormatFloat(frmt,AData); + i := Pos(',',s); + If ( i > 0 ) Then + s[i] := '.'; + Result := InternalPutData(AName,ATypeInfo,s); +end; + +function TSOAPBaseFormatter.GetNodeValue(var AName: String): DOMString; +Var + locElt : TDOMNode; + namespaceShortName, strNodeName, s : string; +begin + strNodeName := AName; + if ( Style = Document ) then begin + namespaceShortName := Copy(FindAttributeByValueInScope(StackTop().NameSpace),AnsiPos(':',namespaceShortName) + 1,MaxInt); + if not IsStrEmpty(namespaceShortName) then begin + s := ExtractNameSpaceShortName(namespaceShortName); + if not IsStrEmpty(s) then + strNodeName := s + ':' + strNodeName; + end; + end; + + if ( FSerializationStyle = ssNodeSerialization ) then begin + locElt := StackTop().FindNode(strNodeName) As TDOMElement; + end else begin + locElt := GetCurrentScopeObject().GetAttributeNode(strNodeName); + end; + + if Assigned(locElt) then begin + if locElt.HasChildNodes then + Result := locElt.FirstChild.NodeValue + else + Result := locElt.NodeValue; + end else begin + Error('Param or Attribute not found : "%s"',[AName]); + end; +end; + +procedure TSOAPBaseFormatter.GetEnum( + const ATypeInfo: PTypeInfo; + var AName: String; + var AData: TEnumIntType +); +Var + locBuffer : String; +begin + locBuffer := Trim(GetNodeValue(AName)); + If IsStrEmpty(locBuffer) Then + AData := 0 + Else + AData := GetEnumValue(ATypeInfo,locBuffer) +End; + +procedure TSOAPBaseFormatter.GetBool( + const ATypeInfo : PTypeInfo; + var AName : String; + var AData : Boolean +); +Var + locBuffer : String; +begin + locBuffer := LowerCase(Trim(GetNodeValue(AName))); + If IsStrEmpty(locBuffer) Then + AData := False + Else + AData := StrToBool(locBuffer); +end; + +procedure TSOAPBaseFormatter.GetInt( + const ATypeInfo: PTypeInfo; + var AName: String; + var AData: Integer +); +begin + AData := StrToIntDef(Trim(GetNodeValue(AName)),0); +end; + +procedure TSOAPBaseFormatter.GetInt64( + const ATypeInfo : PTypeInfo; + var AName : String; + var AData : Int64 +); +begin + AData := StrToInt64Def(Trim(GetNodeValue(AName)),0); +end; + +procedure TSOAPBaseFormatter.GetFloat( + const ATypeInfo : PTypeInfo; + var AName : String; + var AData : Extended +); +begin + AData := StrToFloatDef(Trim(GetNodeValue(AName)),0); +end; + +procedure TSOAPBaseFormatter.GetStr( + const ATypeInfo : PTypeInfo; + var AName : String; + var AData : String +); +begin + AData := GetNodeValue(AName); +end; + +procedure TSOAPBaseFormatter.GetObj( + const ATypeInfo : PTypeInfo; + var AName : String; + var AData : TObject +); +begin + TBaseRemotableClass(GetTypeData(ATypeInfo)^.ClassType).Load(AData, Self,AName,ATypeInfo); +end; + +function TSOAPBaseFormatter.GetXmlDoc(): TXMLDocument; +begin + Result := FDoc; +end; + +function TSOAPBaseFormatter.GetCurrentScope(): String; +begin + CheckScope(); + Result:= GetCurrentScopeObject().NodeName; +end; + +function TSOAPBaseFormatter.GetCurrentScopeObject(): TDOMElement; +begin + Result := StackTop().ScopeObject As TDOMElement; +end; + +function TSOAPBaseFormatter.StackTop(): TStackItem; +begin + CheckScope(); + Result := FStack.Peek() as TStackItem; +end; + +function TSOAPBaseFormatter.PopStack(): TStackItem; +begin + CheckScope(); + Result := FStack.Pop() as TStackItem; +end; + +constructor TSOAPBaseFormatter.Create(); +begin + Inherited Create(); + FContentType := sSOAP_CONTENT_TYPE; + FStack := TObjectStack.Create(); + FDoc := TXMLDocument.Create(); + FDoc.Encoding := 'UTF-8'; +end; + +destructor TSOAPBaseFormatter.Destroy(); +begin + FDoc.Free(); + ClearStack(); + FStack.Free(); + inherited Destroy(); +end; + +procedure TSOAPBaseFormatter.Clear(); +begin + InternalClear(True); +end; + +procedure TSOAPBaseFormatter.BeginObject( + const AName : string; + const ATypeInfo : PTypeInfo +); +Var + typData : TTypeRegistryItem; + nmspc,nmspcSH, xsiNmspcSH : string; + mustAddAtt : Boolean; + strNodeName : string; +begin + typData := GetTypeRegistry().Find(ATypeInfo,False); + If Not Assigned(typData) Then + Error('Object type not registered : %s',[IfThen(Assigned(ATypeInfo),ATypeInfo^.Name,'')]); + mustAddAtt := False; + nmspc := typData.NameSpace; + If IsStrEmpty(nmspc) Then + nmspcSH := 'tns' + Else Begin + nmspcSH := FindAttributeByValueInScope(nmspc); + If IsStrEmpty(nmspcSH) Then Begin + nmspcSH := 'ns' + IntToStr(NextNameSpaceCounter()); + If HasScope() Then + AddScopeAttribute('xmlns:'+nmspcSH, nmspc) + Else Begin + mustAddAtt := True; + End; + End Else Begin + nmspcSH := Copy(nmspcSH,Length('xmlns:')+1,MaxInt); + End; + End; + + if ( Style = Document ) then begin + strNodeName := nmspcSH + ':' + AName; + end else begin + strNodeName := AName; + end; + + BeginScope(strNodeName,'','',stObject,asNone); + If mustAddAtt Then + AddScopeAttribute('xmlns:'+nmspcSH, nmspc); + if ( EncodingStyle = Encoded ) then begin + xsiNmspcSH := GetNameSpaceShortName(sXSI_NS,True); + if not IsStrEmpty(xsiNmspcSH) then + xsiNmspcSH := xsiNmspcSH + ':'; + AddScopeAttribute(xsiNmspcSH + sTYPE,Format('%s:%s',[nmspcSH,typData.DeclaredName])); + end; + StackTop().SetNameSpace(nmspc); +end; + +procedure TSOAPBaseFormatter.BeginArray( + const AName : string; + const ATypeInfo : PTypeInfo; + const AItemTypeInfo : PTypeInfo; + const ABounds : Array Of Integer; + const AStyle : TArrayStyle +); +Var + typData : TTypeRegistryItem; + nmspc,nmspcSH : string; + i,j, k : Integer; + strNodeName : string; + xsiNmspcSH : string; +begin + if ( Length(ABounds) < 2 ) then begin + Error('Invalid array bounds.'); + end; + i := ABounds[0]; + j := ABounds[1]; + k := j - i + 1; + if ( k < 0 ) then begin + Error('Invalid array bounds.'); + end; + typData := GetTypeRegistry().Find(ATypeInfo,False); + if not Assigned(typData) then begin + Error('Array type not registered.'); + end; + nmspc := typData.NameSpace; + if IsStrEmpty(nmspc) then begin + nmspcSH := 'tns' + end else begin + nmspcSH := FindAttributeByValueInScope(nmspc); + if IsStrEmpty(nmspcSH) then begin + nmspcSH := 'ns' + IntToStr(NextNameSpaceCounter()); + AddScopeAttribute('xmlns:'+nmspcSH, nmspc); + end else begin + nmspcSH := Copy(nmspcSH,Length('xmlns:')+1,MaxInt); + end; + end; + + if ( Style = Document ) then begin + strNodeName := nmspcSH + ':' + AName; + end else begin + strNodeName := AName; + end; + + //if ( AStyle = asScoped ) then begin + BeginScope(strNodeName,'','',stArray,AStyle); + //end; + + if ( EncodingStyle = Encoded ) then begin + //AddScopeAttribute(sXSI_TYPE,nmspc); + //SOAP-ENC:arrayType="xsd:int[2]" + {AddScopeAttribute( + Format('%s:%s',[sSOAP_ENC_ABR,sARRAY_TYPE]) , + Format('%s:%s[%d]',[nmspcSH,typData.DeclaredName,k]) + );} + xsiNmspcSH := GetNameSpaceShortName(sXSI_NS,True); + if not IsStrEmpty(xsiNmspcSH) then + xsiNmspcSH := xsiNmspcSH + ':'; + AddScopeAttribute(xsiNmspcSH + sTYPE,Format('%s:%s',[nmspcSH,typData.DeclaredName])); + end; + StackTop().SetNameSpace(nmspc); +end; + +procedure TSOAPBaseFormatter.NilCurrentScope(); +var + nmspcSH : shortstring; +begin + CheckScope(); + nmspcSH := FindAttributeByValueInScope(sXSI_NS); + if IsStrEmpty(nmspcSH) then begin + nmspcSH := 'ns' + IntToStr(NextNameSpaceCounter()); + AddScopeAttribute('xmlns:'+nmspcSH, sXSI_NS); + end else begin + nmspcSH := Copy(nmspcSH,Length('xmlns:')+1,MaxInt); + end; + GetCurrentScopeObject().SetAttribute(nmspcSH + ':' + sNIL,'true'); +end; + +function TSOAPBaseFormatter.IsCurrentScopeNil(): Boolean; +Var + s,nsShortName,nilName : shortstring; +begin + CheckScope(); + nsShortName := FindAttributeByValueInScope(sXSI_NS); + Result := False; + if IsStrEmpty(nsShortName) then begin + nilName := 'nil'; + end else begin + nsShortName := Copy(nsShortName,1 + Pos(':',nsShortName),MaxInt); + if not IsStrEmpty(nsShortName) Then + nsShortName := nsShortName + ':'; + nilName := nsShortName + 'nil'; + end; + s := Trim(GetCurrentScopeObject().GetAttribute(nilName)); + if ( Length(s) > 0 ) and ( AnsiSameText(s,'true') or AnsiSameText(s,'"true"') ) then begin + Result := True; + end; +end; + +procedure TSOAPBaseFormatter.BeginScope( + Const AScopeName,ANameSpace : string; + Const ANameSpaceShortName : string; + Const AScopeType : TScopeType; + const AStyle : TArrayStyle +); +Var + nsStr, scpStr : String; + e : TDOMElement; + hasNmspc, addAtt : Boolean; +begin + if ( AScopeType = stObject ) or + ( ( AScopeType = stArray ) and ( AStyle = asScoped ) ) + then begin + scpStr := AScopeName; + hasNmspc := Not IsStrEmpty(ANameSpace); + If hasNmspc Then Begin + nsStr := FindAttributeByValueInScope(ANameSpace); + addAtt := IsStrEmpty(nsStr); + If addAtt Then Begin + If IsStrEmpty(ANameSpaceShortName) Then + nsStr := 'ns' + IntToStr(NextNameSpaceCounter()) + Else + nsStr := Trim(ANameSpaceShortName); + End Else Begin + nsStr := Copy(nsStr,Succ(AnsiPos(':',nsStr)),MaxInt); + End; + scpStr := nsStr + ':' + scpStr; + End; + + e := FDoc.CreateElement(scpStr); + If HasScope() Then + GetCurrentScopeObject().AppendChild(e) + Else + FDoc.AppendChild(e); + if ( AScopeType = stObject ) then begin + PushStack(e); + end else begin + PushStack(e,AStyle,''); + end; + if hasNmspc and addAtt then begin + e.SetAttribute('xmlns:'+nsStr,ANameSpace); + StackTop().SetNameSpace(ANameSpace); + end; + end else if ( ( AScopeType = stArray ) and ( AStyle = asEmbeded ) ) then begin + StackTop().BeginEmbeddedScope(); + end; +end; + +function TSOAPBaseFormatter.InternalBeginScopeRead( + var AScopeName : string; + const ATypeInfo : PTypeInfo; + const AScopeType : TScopeType; + const AStyle : TArrayStyle; + const AItemName : string +): Integer; +var + locNode : TDOMNode; + stk : TStackItem; + typData : TTypeRegistryItem; + nmspc,nmspcSH : string; + strNodeName : string; +begin + if ( Style = Document ) then begin + typData := GetTypeRegistry().Find(ATypeInfo,False); + if not Assigned(typData) then begin + Error('Object type not registered : %s',[IfThen(Assigned(ATypeInfo),ATypeInfo^.Name,'')]); + end; + nmspc := typData.NameSpace; + if IsStrEmpty(nmspc) then begin + nmspcSH := '' + end else begin + nmspcSH := FindAttributeByValueInScope(nmspc); + if not IsStrEmpty(nmspcSH) then begin + nmspcSH := Copy(nmspcSH,Length('xmlns:')+1,MaxInt); + end; + end; + if IsStrEmpty(nmspcSH) then begin + strNodeName := AScopeName + end else begin + if ( Pos(':',AScopeName) < 1 ) then begin + strNodeName := nmspcSH + ':' + AScopeName + end else begin + strNodeName := AScopeName; + end; + end; + end else begin + nmspcSH := ''; + strNodeName := AScopeName; + end; + + stk := StackTop(); + if ( AScopeType = stObject ) or + ( ( AScopeType = stArray ) and ( AStyle = asScoped ) ) + then begin + locNode := stk.FindNode(strNodeName); + end else begin + locNode := stk.ScopeObject; + end; + + if ( locNode = nil ) then begin + Result := -1; + end else begin + if ( AScopeType = stObject ) then begin + PushStack(locNode); + end else begin + PushStack(locNode,AStyle,AItemName); + end; + if ( Style = Document ) then begin + StackTop().SetNameSpace(nmspc); + end; + Result := StackTop().GetItemsCount(); + end; +end; + +procedure TSOAPBaseFormatter.SetSerializationStyle(const ASerializationStyle: TSerializationStyle); +begin + FSerializationStyle := ASerializationStyle; +end; + +function TSOAPBaseFormatter.GetSerializationStyle(): TSerializationStyle; +begin + Result := FSerializationStyle; +end; + +procedure TSOAPBaseFormatter.SetStyleAndEncoding( + const AStyle: TSOAPDocumentStyle; + const AEncoding: TSOAPEncodingStyle +); +begin + FKeepedStyle := Style; + FKeepedEncoding := EncodingStyle; + Style := AStyle; + EncodingStyle := AEncoding; +end; + +procedure TSOAPBaseFormatter.RestoreStyleAndEncoding(); +begin + EncodingStyle := FKeepedEncoding; + Style := FKeepedStyle; +end; + +procedure TSOAPBaseFormatter.Prepare(); +var + locDoc : TDOMDocument; +begin + locDoc := GetXmlDoc(); + if Assigned(locDoc.DocumentElement) and + AnsiSameText(locDoc.DocumentElement.NodeName,( sSOAP_ENV_ABR + ':' + sENVELOPE )) + then begin + ClearStack(); + PushStack(locDoc.DocumentElement); + end else begin + BeginScope(sENVELOPE,sSOAP_ENV,sSOAP_ENV_ABR,stObject,asNone); + AddScopeAttribute('xmlns:xsi',sXSI_NS); + AddScopeAttribute('xmlns:'+sXSD, sXSD_NS); + AddScopeAttribute('xmlns:'+sSOAP_ENC_ABR, sSOAP_ENC); + end; +end; + +function TSOAPBaseFormatter.ReadHeaders(ACallContext: ICallContext): Integer; + + function ExtractTypeInfo(ANode : TDOMElement) : TTypeRegistryItem; + var + j : Integer; + ndName, nsSN, nsLN, s : string; + begin + ndName := ANode.NodeName; + j := Pos(':',ndName); + if ( j > 0 ) then + nsSN := Copy(ndName,1,Pred(j)) + else + nsSN := ''; + if IsStrEmpty(nsSN) then + s := sXML_NS + else + s := sXML_NS + ':' + nsSN; + nsLN := FindAttributeByNameInScope(s); + Result := GetTypeRegistry().FindByDeclaredName(Copy(ndName,Succ(j),MaxInt),nsLN); + end; + +var + i : Integer; + nd : TDOMElement; + typItm : TTypeRegistryItem; + tmpObj : THeaderBlock; + locName : string; + chdLst : TDOMNodeList; +begin + SetStyleAndEncoding(Document,Literal); + try + Result := StackTop().ItemsCount; + if ( Result > 0 ) then begin + chdLst := StackTop().ScopeObject.ChildNodes; + try + for i := 0 to Pred(Result) do begin + nd := chdLst.Item[i] as TDOMElement; + typItm := ExtractTypeInfo(nd); + if Assigned(typItm) then begin + if ( typItm.DataType^.Kind = tkClass ) then begin + tmpObj := nil; + locName := nd.NodeName; + Get(typItm.DataType,locName,tmpObj); + if Assigned(tmpObj) then begin + tmpObj.Direction := hdIn; + ACallContext.AddHeader(tmpObj,True); + end; + end; + end; + end; + finally + chdLst.Release(); + end; + end; + finally + RestoreStyleAndEncoding(); + end; +end; + +function TSOAPBaseFormatter.WriteHeaders(ACallContext : ICallContext): Integer; +var + ptyp : PTypeInfo; + h : THeaderBlock; + i, c : Integer; +begin + Result := ACallContext.GetHeaderCount([hdOut]); + if ( Result > 0 ) then begin + BeginHeader(); + try + c := ACallContext.GetHeaderCount(AllHeaderDirection); + for i := 0 to Pred(c) do begin + h := ACallContext.GetHeader(i); + if ( h.Direction = hdOut ) then begin + ptyp := PTypeInfo(h.ClassInfo); + Put(GetTypeRegistry().ItemByTypeInfo[ptyp].DeclaredName,ptyp,h); + end; + end; + finally + EndHeader(); + end; + end; +end; + +procedure TSOAPBaseFormatter.EndScope(); +begin + CheckScope(); + if ( StackTop().EmbeddedScopeCount = 0 ) then begin + FStack.Pop().Free(); + end else begin + StackTop().EndEmbeddedScope(); + end; +end; + +procedure TSOAPBaseFormatter.AddScopeAttribute(const AName, AValue: string); +begin + CheckScope(); + GetCurrentScopeObject().SetAttribute(AName,AValue); +end; + +procedure TSOAPBaseFormatter.Put( + const AName: String; + const ATypeInfo: PTypeInfo; + const AData +); +Var + int64Data : Int64; + strData : string; + objData : TObject; + boolData : Boolean; + enumData : TEnumIntType; + floatDt : Extended; +begin + Case ATypeInfo^.Kind Of + tkInt64, tkQWord : + Begin + int64Data := Int64(AData); + PutInt64(AName,ATypeInfo,int64Data); + End; + tkLString, tkAString : + Begin + strData := String(AData); + PutStr(AName,ATypeInfo,strData); + End; + tkClass : + Begin + objData := TObject(AData); + PutObj(AName,ATypeInfo,objData); + End; + tkBool : + Begin + boolData := Boolean(AData); + PutBool(AName,ATypeInfo,boolData); + End; + tkInteger, tkEnumeration : + Begin + enumData := 0; + Case GetTypeData(ATypeInfo)^.OrdType Of + otSByte : enumData := ShortInt(AData); + otUByte : enumData := Byte(AData); + otSWord : enumData := SmallInt(AData); + otUWord : enumData := Word(AData); + otSLong, + otULong : enumData := LongInt(AData); + End; + If ( ATypeInfo^.Kind = tkInteger ) Then + PutInt64(AName,ATypeInfo,enumData) + Else + PutEnum(AName,ATypeInfo,enumData); + End; + tkFloat : + Begin + floatDt := 0; + Case GetTypeData(ATypeInfo)^.FloatType Of + ftSingle : floatDt := Single(AData); + ftDouble : floatDt := Double(AData); + ftExtended : floatDt := Extended(AData); + ftCurr : floatDt := Currency(AData); + ftComp : floatDt := Comp(AData); + End; + PutFloat(AName,ATypeInfo,floatDt); + End; + End; +end; + +procedure TSOAPBaseFormatter.PutScopeInnerValue( + const ATypeInfo : PTypeInfo; + const AData +); +Var + int64SData : Int64; + int64UData : QWord; + strData : string; + objData : TObject; + boolData : Boolean; + enumData : TEnumIntType; + floatDt : Extended; + dataBuffer : string; + frmt : string; + prcsn,i : Integer; +begin + CheckScope(); + Case ATypeInfo^.Kind Of + tkInt64 : + begin + int64SData := Int64(AData); + dataBuffer := IntToStr(int64SData); + end; + tkQWord : + begin + int64UData := QWord(AData); + dataBuffer := IntToStr(int64UData); + end; + tkLString, tkAString : + begin + strData := string(AData); + dataBuffer := strData; + end; + tkClass : + begin + raise ESOAPException.Create('Inner Scope value must be a "simple type" value.'); + end; + tkBool : + begin + boolData := Boolean(AData); + dataBuffer := BoolToStr(boolData); + end; + tkInteger : + begin + case GetTypeData(ATypeInfo)^.OrdType of + otSByte : enumData := ShortInt(AData); + otUByte : enumData := Byte(AData); + otSWord : enumData := SmallInt(AData); + otUWord : enumData := Word(AData); + otSLong, + otULong : enumData := LongInt(AData); + end; + dataBuffer := IntToStr(enumData); + end; + tkEnumeration : + begin + enumData := 0; + case GetTypeData(ATypeInfo)^.OrdType of + otSByte : enumData := ShortInt(AData); + otUByte : enumData := Byte(AData); + otSWord : enumData := SmallInt(AData); + otUWord : enumData := Word(AData); + otSLong, + otULong : enumData := LongInt(AData); + end; + dataBuffer := GetTypeRegistry().ItemByTypeInfo[ATypeInfo].GetExternalPropertyName(GetEnumName(ATypeInfo,enumData)) + end; + tkFloat : + begin + floatDt := 0; + case GetTypeData(ATypeInfo)^.FloatType of + ftSingle : + begin + floatDt := Single(AData); + prcsn := 7; + end; + ftDouble : + begin + floatDt := Double(AData); + prcsn := 15; + end; + ftExtended : + begin + floatDt := Extended(AData); + prcsn := 15; + end; + ftCurr : + begin + floatDt := Currency(AData); + prcsn := 7; + end; + ftComp : + begin + floatDt := Comp(AData); + prcsn := 7; + end; + end; + frmt := '#.' + StringOfChar('#',prcsn) + 'E-0'; + dataBuffer := FormatFloat(frmt,floatDt); + i := Pos(',',dataBuffer); + if ( i > 0 ) then + dataBuffer[i] := '.'; + end; + end; + StackTop().ScopeObject.AppendChild(FDoc.CreateTextNode(dataBuffer)); +end; + +procedure TSOAPBaseFormatter.Get( + const ATypeInfo : PTypeInfo; + var AName : String; + var AData +); +Var + int64Data : Int64; + strData : string; + objData : TObject; + boolData : Boolean; + enumData : TEnumIntType; + floatDt : Extended; +begin + Case ATypeInfo^.Kind Of + tkInt64,tkQWord : + Begin + int64Data := 0; + GetInt64(ATypeInfo,AName,int64Data); + Int64(AData) := int64Data; + End; + tkLString, tkAString : + Begin + strData := ''; + GetStr(ATypeInfo,AName,strData); + String(AData) := strData; + End; + tkClass : + Begin + objData := TObject(AData); + GetObj(ATypeInfo,AName,objData); + TObject(AData) := objData; + End; + tkBool : + Begin + boolData := False; + GetBool(ATypeInfo,AName,boolData); + Boolean(AData) := boolData; + End; + tkInteger, tkEnumeration : + Begin + enumData := 0; + If ( ATypeInfo^.Kind = tkInteger ) Then + GetInt64(ATypeInfo,AName,enumData) + Else + GetEnum(ATypeInfo,AName,enumData); + Case GetTypeData(ATypeInfo)^.OrdType Of + otSByte : ShortInt(AData) := enumData; + otUByte : Byte(AData) := enumData; + otSWord : SmallInt(AData) := enumData; + otUWord : Word(AData) := enumData; + otSLong, + otULong : LongInt(AData) := enumData; + End; + End; + tkFloat : + Begin + floatDt := 0; + GetFloat(ATypeInfo,AName,floatDt); + Case GetTypeData(ATypeInfo)^.FloatType Of + ftSingle : Single(AData) := floatDt; + ftDouble : Double(AData) := floatDt; + ftExtended : Extended(AData) := floatDt; + ftCurr : Currency(AData) := floatDt; + ftComp : Comp(AData) := floatDt; + End; + End; + End; +end; + +procedure TSOAPBaseFormatter.GetScopeInnerValue( + const ATypeInfo : PTypeInfo; + var AData +); +Var + enumData : TEnumIntType; + floatDt : Extended; + dataBuffer : string; + nd : TDOMNode; +begin + CheckScope(); + nd := StackTop().ScopeObject; + if nd.HasChildNodes() then + dataBuffer := nd.FirstChild.NodeValue + else + dataBuffer := StackTop().ScopeObject.NodeValue; + Case ATypeInfo^.Kind Of + tkInt64 : Int64(AData) := StrToInt64Def(Trim(dataBuffer),0); + tkQWord : QWord(AData) := StrToInt64Def(Trim(dataBuffer),0); + tkLString, + tkAString : string(AData) := dataBuffer; + tkClass : + begin + raise ESOAPException.Create('Inner Scope value must be a "simple type" value.'); + end; + tkBool : + begin + dataBuffer := LowerCase(Trim(dataBuffer)); + if IsStrEmpty(dataBuffer) then + Boolean(AData) := False + else + Boolean(AData) := StrToBool(dataBuffer); + end; + tkInteger, tkEnumeration : + begin + if ( ATypeInfo^.Kind = tkInteger ) then + enumData := StrToIntDef(Trim(dataBuffer),0) + else + enumData := GetEnumValue(ATypeInfo,GetTypeRegistry().ItemByTypeInfo[ATypeInfo].GetInternalPropertyName(dataBuffer)); + case GetTypeData(ATypeInfo)^.OrdType of + otSByte : ShortInt(AData) := enumData; + otUByte : Byte(AData) := enumData; + otSWord : SmallInt(AData) := enumData; + otUWord : Word(AData) := enumData; + otSLong, + otULong : LongInt(AData) := enumData; + end; + end; + tkFloat : + begin + floatDt := StrToFloatDef(Trim(dataBuffer),0); + case GetTypeData(ATypeInfo)^.FloatType of + ftSingle : Single(AData) := floatDt; + ftDouble : Double(AData) := floatDt; + ftExtended : Extended(AData) := floatDt; + ftCurr : Currency(AData) := floatDt; + ftComp : Comp(AData) := floatDt; + end; + end; + end; +end; + +procedure TSOAPBaseFormatter.SaveToStream(AStream: TStream); +begin + WriteXMLFile(FDoc,AStream); +end; + +procedure TSOAPBaseFormatter.LoadFromStream(AStream: TStream); +Var + nd : TDOMNode; +begin + InternalClear(False); + ReadXMLFile(FDoc,AStream); + nd := GetXmlDoc().DocumentElement; + If Assigned(nd) Then + PushStack(nd); +end; + +procedure TSOAPBaseFormatter.Error(const AMsg: string); +begin + Raise ESOAPException.Create(AMsg); +end; + +procedure TSOAPBaseFormatter.Error(const AMsg: string;const AArgs: array of const); +begin + Raise ESOAPException.CreateFmt(AMsg,AArgs); +end; + +{ TScopedArrayStackItem } + +function TScopedArrayStackItem.CreateList(const ANodeName : string): TDOMNodeList; +begin + if ScopeObject.HasChildNodes() then begin + Result := ScopeObject.GetChildNodes(); + end else begin + Result := nil; + end; +end; + +{ TEmbeddedArrayStackItem } + +function TEmbeddedArrayStackItem.CreateList(const ANodeName: string): TDOMNodeList; +begin + if ScopeObject.HasChildNodes() then begin + Result := {$IFNDEF FPC_211}TDOMNodeList{$ELSE}TDOMElementList{$ENDIF}.Create(ScopeObject,ANodeName); + end else begin + Result := nil; + end; +end; + + +end. diff --git a/wst/tags/0.4/binary_formatter.pas b/wst/tags/0.4/binary_formatter.pas new file mode 100644 index 000000000..c05787067 --- /dev/null +++ b/wst/tags/0.4/binary_formatter.pas @@ -0,0 +1,203 @@ +{ + This file is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This file is provide under modified LGPL licence + ( the files COPYING.modifiedLGPL and COPYING.LGPL). + + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +} +unit binary_formatter; + +interface + +uses + Classes, SysUtils, TypInfo, + base_service_intf, service_intf, imp_utils, + base_binary_formatter; + +{$INCLUDE wst.inc} + +Const + sCONTENT_TYPE = 'contenttype'; + sBINARY_CONTENT = 'binary'; + sPROTOCOL_NAME = sBINARY_CONTENT; + + sTARGET = 'target'; + +Type + +{$M+} + TBinaryFormatter = class(TBaseBinaryFormatter,IFormatterClient) + private + FPropMngr : IPropertyManager; + FCallProcedureName : string; + FCallTarget : String; + protected + public + function GetPropertyManager():IPropertyManager; + + procedure BeginCall( + const AProcName, + ATarget : string; + ACallContext : ICallContext + ); + procedure EndCall(); + procedure BeginCallRead(ACallContext : ICallContext); + + function GetCallProcedureName():String; + function GetCallTarget():String; + End; + + + { TBinaryCallMaker } + + TBinaryCallMaker = class(TSimpleFactoryItem,ICallMaker) + Private + FPropMngr : IPropertyManager; + Public + constructor Create();override; + destructor Destroy();override; + function GetPropertyManager():IPropertyManager; + procedure MakeCall( + ASerializer : IFormatterClient; + ATransport : ITransport + ); + End; + +implementation + +function TBinaryFormatter.GetPropertyManager(): IPropertyManager; +begin + If Not Assigned(FPropMngr) Then + FPropMngr := TPublishedPropertyManager.Create(Self); + Result := FPropMngr; +end; + +procedure TBinaryFormatter.BeginCall( + const AProcName, + ATarget : string; + ACallContext : ICallContext +); +begin + FCallProcedureName := AProcName; + FCallTarget := ATarget; + + BeginObject('Body',Nil); + BeginObject(FCallTarget,Nil); + BeginObject(FCallProcedureName,Nil); +end; + +procedure TBinaryFormatter.EndCall(); +begin + EndScope(); + EndScope(); + EndScope(); +end; + +procedure TBinaryFormatter.BeginCallRead(ACallContext : ICallContext); +Var + s,nme : string; + e : EBaseRemoteException; +begin + ClearStack(); + PushStack(GetRootData(),stObject); + s := 'Body'; + BeginObjectRead(s,nil); + s := StackTop().GetByIndex(0)^.Name; + If AnsiSameText(s,'Fault') Then Begin + BeginObjectRead(s,nil); + e := EBaseRemoteException.Create(''); + Try + nme := 'faultcode'; + Get(TypeInfo(string),nme,s); + e.FaultCode := s; + nme := 'faultstring'; + Get(TypeInfo(string),nme,s); + e.FaultString := s; + e.Message := Format('%s : "%s"',[e.FaultCode,e.FaultString]); + Except + FreeAndNil(e); + Raise; + End; + Raise e; + End; + FCallTarget := s; + BeginObjectRead(FCallTarget,nil); + FCallProcedureName := StackTop().GetByIndex(0)^.Name; + BeginObjectRead(FCallProcedureName,nil); +end; + +function TBinaryFormatter.GetCallProcedureName(): String; +begin + Result := FCallProcedureName; +end; + +function TBinaryFormatter.GetCallTarget(): String; +begin + Result := FCallTarget; +end; + +{ TBinaryCallMaker } + +constructor TBinaryCallMaker.Create(); +begin + FPropMngr := TPublishedPropertyManager.Create(Self); +end; + +destructor TBinaryCallMaker.Destroy(); +begin + FPropMngr := Nil; + inherited Destroy(); +end; + +function TBinaryCallMaker.GetPropertyManager(): IPropertyManager; +begin + Result:= FPropMngr; +end; + +procedure TBinaryCallMaker.MakeCall( + ASerializer : IFormatterClient; + ATransport : ITransport +); +Var + rqt, rsps : TMemoryStream; +begin + Assert(Assigned(ASerializer)); + Assert(Assigned(ATransport)); + ATransport.GetPropertyManager().SetProperty( + sCONTENT_TYPE, + sBINARY_CONTENT + ); + rsps := Nil; + rqt := TMemoryStream.Create(); + Try + rsps := TMemoryStream.Create(); + ASerializer.SaveToStream(rqt); + rqt.Position := 0; + ATransport.SendAndReceive(rqt,rsps); + rqt.Clear(); + rsps.Position := 0; + ASerializer.Clear(); + ASerializer.LoadFromStream(rsps); + Finally + rsps.Free(); + rqt.Free(); + End; +end; + +procedure RegisterBinaryProtocol(); +begin + GetFormaterRegistry().Register( + sPROTOCOL_NAME, + TSimpleItemFactory.Create(TBinaryFormatter) as IItemFactory, + TSimpleItemFactory.Create(TBinaryCallMaker) as IItemFactory + ); +end; + +Initialization + RegisterBinaryProtocol(); +end. diff --git a/wst/tags/0.4/binary_streamer.pas b/wst/tags/0.4/binary_streamer.pas new file mode 100644 index 000000000..7f16b3737 --- /dev/null +++ b/wst/tags/0.4/binary_streamer.pas @@ -0,0 +1,521 @@ +{ + This file is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This file is provide under modified LGPL licence + ( the files COPYING.modifiedLGPL and COPYING.LGPL). + + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +} +unit binary_streamer; + +interface + +uses + Classes, SysUtils, Types; + +{$INCLUDE wst.inc} +{$INCLUDE wst_delphi.inc} + +Const + MAX_ARRAY_LENGTH = 1024*1024; + +Type + + TInt8U = Byte; TInt8S = ShortInt; + TInt16U = Word; TInt16S = SmallInt; + TInt32U = LongWord; TInt32S = LongInt; + TInt64S = Int64;TInt64U = QWord; + TBoolData = Boolean; + TEnumData = Int64; + TStringData = AnsiString; + + TFloat_Single_4 = Single; + TFloat_Double_8 = Double; + TFloat_Extended_10 = Extended; + TFloat_Currency_8 = Currency; + + IDataStore = Interface + ['{CA767A0E-7660-4765-9959-6960A69B1660}'] + procedure WriteInt8U(Const AData : TInt8U); + procedure WriteInt8S(Const AData : TInt8S); + + procedure WriteInt16U(Const AData : TInt16U); + procedure WriteInt16S(Const AData : TInt16S); + + procedure WriteInt32U(Const AData : TInt32U); + procedure WriteInt32S(Const AData : TInt32S); + + procedure WriteInt64U(Const AData : TInt64U); + procedure WriteInt64S(Const AData : TInt64S); + + procedure WriteBool(Const AData : TBoolData); + procedure WriteEnum(Const AData : TEnumData); + procedure WriteStr(Const AData : TStringData); + + procedure WriteSingle(Const AData : TFloat_Single_4); + procedure WriteDouble(Const AData : TFloat_Double_8); + procedure WriteExtended(Const AData : TFloat_Extended_10); + procedure WriteCurrency(Const AData : TFloat_Currency_8); + End; + + IDataStoreReader = Interface + ['{AF50317E-6DD6-40C5-A2F6-3ED5F478564F}'] + function IsAtEof():Boolean; + function ReadInt8U():TInt8U; + function ReadInt8S():TInt8S; + + function ReadInt16U():TInt16U; + function ReadInt16S():TInt16S; + + function ReadInt32U():TInt32U; + function ReadInt32S():TInt32S; + + function ReadInt64U():TInt64U; + function ReadInt64S():TInt64S; + + function ReadBool():TBoolData; + function ReadEnum():TEnumData; + function ReadStr():TStringData; + + function ReadSingle():TFloat_Single_4; + function ReadDouble():TFloat_Double_8; + function ReadExtended():TFloat_Extended_10; + function ReadCurrency():TFloat_Currency_8; + End; + + function CreateBinaryReader(AStream : TStream):IDataStoreReader; + function CreateBinaryWriter(AStream : TStream):IDataStore; + + procedure ReverseBytes(var AData; const ALength : Integer);{$IFDEF ENDIAN_BIG}inline;{$ENDIF} + function Reverse_16(AValue:Word):Word;{$IFDEF USE_INLINE}inline;{$ENDIF} + function Reverse_32(AValue:DWord):DWord;{$IFDEF USE_INLINE}inline;{$ENDIF} + function Reverse_64(AValue:QWord):QWord;{$IFDEF USE_INLINE}inline;{$ENDIF} + + function Reverse_Single(AValue:Single):Single;{$IFDEF USE_INLINE}inline;{$ENDIF} + function Reverse_Double(AValue:Double):Double;{$IFDEF USE_INLINE}inline;{$ENDIF} + function Reverse_Extended(AValue:Extended):Extended;{$IFDEF USE_INLINE}inline;{$ENDIF} + function Reverse_Currency(AValue:Currency):Currency;{$IFDEF USE_INLINE}inline;{$ENDIF} + +implementation + +{$IFDEF ENDIAN_BIG} +procedure ReverseBytes(var AData; const ALength : Integer);{$IFDEF USE_INLINE}inline;{$ENDIF} +begin +end; +{$ELSE} // assume ENDIAN_LITTLE +procedure ReverseBytes(var AData; const ALength : Integer); +Var + i,j : PtrInt; + c : Byte; + pDt : {$IFDEF FPC}^Byte{$ELSE}PByteArray{$ENDIF}; +begin + pDt := @AData; + j := ALength div 2; + For i := 0 To Pred(j) Do Begin + c := pDt{$IFNDEF FPC}^{$ENDIF}[i]; + pDt[i] := pDt[(ALength - 1 ) - i]; + pDt[(ALength - 1 ) - i] := c; + End; +end; +{$ENDIF} + +function Reverse_16(AValue:Word):Word;{$IFDEF USE_INLINE}inline;{$ENDIF} +begin + Result := AValue; + ReverseBytes(Result,2) +end; + +function Reverse_32(AValue:DWord):DWord;{$IFDEF USE_INLINE}inline;{$ENDIF} +begin + Result := AValue; + ReverseBytes(Result,4) +end; + +function Reverse_64(AValue:QWord):QWord;{$IFDEF USE_INLINE}inline;{$ENDIF} +begin + Result := AValue; + ReverseBytes(Result,8) +end; + +function Reverse_Single(AValue:Single):Single;{$IFDEF USE_INLINE}inline;{$ENDIF} +begin + Result := AValue; + ReverseBytes(Result,4) +end; + +function Reverse_Double(AValue:Double):Double;{$IFDEF USE_INLINE}inline;{$ENDIF} +begin + Result := AValue; + ReverseBytes(Result,8) +end; + +function Reverse_Extended(AValue:Extended):Extended;{$IFDEF USE_INLINE}inline;{$ENDIF} +begin + Result := AValue; + ReverseBytes(Result,10); +end; + +function Reverse_Currency(AValue:Currency):Currency;{$IFDEF USE_INLINE}inline;{$ENDIF} +begin + Result := AValue; + ReverseBytes(Result,8); +end; + +Type + { TDataStore } + + TDataStore = class(TInterfacedObject,IDataStore) + Private + FStream : TStream; + Protected + procedure WriteInt8U(Const AData : TInt8U); + procedure WriteInt8S(Const AData : TInt8S); + + procedure WriteInt16U(Const AData : TInt16U); + procedure WriteInt16S(Const AData : TInt16S); + + procedure WriteInt32U(Const AData : TInt32U); + procedure WriteInt32S(Const AData : TInt32S); + + procedure WriteInt64U(Const AData : TInt64U); + procedure WriteInt64S(Const AData : TInt64S); + + procedure WriteBool(Const AData : TBoolData); + procedure WriteEnum(Const AData : TEnumData); + procedure WriteStr(Const AData : TStringData); + + procedure WriteSingle(Const AData : TFloat_Single_4); + procedure WriteDouble(Const AData : TFloat_Double_8); + procedure WriteExtended(Const AData : TFloat_Extended_10); + procedure WriteCurrency(Const AData : TFloat_Currency_8); + Public + constructor Create(AStream : TStream); + End; + + { TDataStoreReader } + + TDataStoreReader = class(TInterfacedObject,IDataStoreReader) + Private + FStream : TStream; + Protected + function IsAtEof():Boolean; + function ReadInt8U():TInt8U; + function ReadInt8S():TInt8S; + + function ReadInt16U():TInt16U; + function ReadInt16S():TInt16S; + + function ReadInt32U():TInt32U; + function ReadInt32S():TInt32S; + + function ReadInt64U():TInt64U; + function ReadInt64S():TInt64S; + + function ReadBool():TBoolData; + function ReadEnum():TEnumData; + function ReadStr():TStringData; + + function ReadSingle():TFloat_Single_4; + function ReadDouble():TFloat_Double_8; + function ReadExtended():TFloat_Extended_10; + function ReadCurrency():TFloat_Currency_8; + Public + constructor Create(AStream : TStream); + End; + +function CreateBinaryWriter(AStream : TStream):IDataStore; +begin + Result := TDataStore.Create(AStream) As IDataStore; +end; + +function CreateBinaryReader(AStream : TStream):IDataStoreReader; +begin + Result := TDataStoreReader.Create(AStream) As IDataStoreReader; +end; + +{ TDataStore } + +procedure TDataStore.WriteInt8U(const AData: TInt8U); +begin + FStream.Write(AData,SizeOf(AData)); +end; + +procedure TDataStore.WriteInt8S(const AData: TInt8S); +begin + FStream.Write(AData,SizeOf(AData)); +end; + +{$IFDEF FPC} +procedure TDataStore.WriteInt16U(const AData: TInt16U); +begin + FStream.Write(Reverse_16(AData),SizeOf(AData)); +end; + +procedure TDataStore.WriteInt16S(const AData: TInt16S); +begin + FStream.Write(Reverse_16(AData),SizeOf(AData)); +end; + +procedure TDataStore.WriteInt32U(const AData: TInt32U); +begin + FStream.Write(Reverse_32(AData),SizeOf(AData)); +end; + +procedure TDataStore.WriteInt32S(const AData: TInt32S); +begin + FStream.Write(Reverse_32(AData),SizeOf(AData)); +end; + +procedure TDataStore.WriteInt64U(const AData: TInt64U); +begin + FStream.Write(Reverse_64(AData),SizeOf(AData)); +end; + +procedure TDataStore.WriteInt64S(const AData: TInt64S); +begin + FStream.Write(Reverse_64(AData),SizeOf(AData)); +end; +{$ELSE} +procedure TDataStore.WriteInt16U(const AData: TInt16U); +var + bffr : TInt16U; +begin + bffr := Reverse_16(AData); + FStream.Write(bffr,SizeOf(AData)); +end; + +procedure TDataStore.WriteInt16S(const AData: TInt16S); +var + bffr : TInt16U; +begin + bffr := Reverse_16(AData); + FStream.Write(bffr,SizeOf(AData)); +end; + +procedure TDataStore.WriteInt32U(const AData: TInt32U); +var + bffr : TInt32U; +begin + bffr := Reverse_32(AData); + FStream.Write(bffr,SizeOf(AData)); +end; + +procedure TDataStore.WriteInt32S(const AData: TInt32S); +var + bffr : TInt32U; +begin + bffr := Reverse_32(AData); + FStream.Write(bffr,SizeOf(AData)); +end; + +procedure TDataStore.WriteInt64U(const AData: TInt64U); +var + bffr : TInt64U; +begin + bffr := Reverse_64(AData); + FStream.Write(bffr,SizeOf(AData)); +end; + +procedure TDataStore.WriteInt64S(const AData: TInt64S); +var + bffr : TInt64U; +begin + bffr := Reverse_64(AData); + FStream.Write(bffr,SizeOf(AData)); +end; +{$ENDIF} + +procedure TDataStore.WriteBool(const AData: TBoolData); +Var + i : TInt8U; +begin + If AData Then + i := 1 + Else + i := 0; + WriteInt8U(i); +end; + +procedure TDataStore.WriteEnum(const AData: TEnumData); +begin + WriteInt64S(AData); +end; + +procedure TDataStore.WriteStr(const AData: TStringData); +Var + i : TInt32S; +begin + i := Length(AData); + WriteInt32S(i); + If ( i > 0 ) Then + FStream.Write(AData[1],i); +end; + +{$IFDEF FPC} +procedure TDataStore.WriteSingle(const AData: TFloat_Single_4); +begin + FStream.Write(Reverse_Single(AData),SizeOf(AData)); +end; + +procedure TDataStore.WriteDouble(const AData: TFloat_Double_8); +begin + FStream.Write(Reverse_Double(AData),SizeOf(AData)); +end; + +procedure TDataStore.WriteExtended(const AData: TFloat_Extended_10); +begin + FStream.Write(Reverse_Extended(AData),SizeOf(AData)); +end; + +procedure TDataStore.WriteCurrency(const AData: TFloat_Currency_8); +begin + FStream.Write(Reverse_Currency(AData),SizeOf(AData)); +end; +{$ELSE} +procedure TDataStore.WriteSingle(const AData: TFloat_Single_4); +var + bffr : TFloat_Single_4; +begin + bffr := Reverse_Single(AData); + FStream.Write(bffr,SizeOf(AData)); +end; + +procedure TDataStore.WriteDouble(const AData: TFloat_Double_8); +var + bffr : TFloat_Double_8; +begin + bffr := Reverse_Double(AData); + FStream.Write(bffr,SizeOf(AData)); +end; + +procedure TDataStore.WriteExtended(const AData: TFloat_Extended_10); +var + bffr : TFloat_Extended_10; +begin + bffr := Reverse_Extended(AData); + FStream.Write(bffr,SizeOf(AData)); +end; + +procedure TDataStore.WriteCurrency(const AData: TFloat_Currency_8); +var + bffr : TFloat_Currency_8; +begin + bffr := Reverse_Currency(AData); + FStream.Write(bffr,SizeOf(AData)); +end; +{$ENDIF} + +constructor TDataStore.Create(AStream: TStream); +begin + Assert(Assigned(AStream)); + FStream := AStream; +end; + +{ TDataStoreReader } + +function TDataStoreReader.IsAtEof(): Boolean; +begin + Result := ( FStream.Position >= FStream.Size ); +end; + +function TDataStoreReader.ReadInt8U(): TInt8U; +begin + FStream.Read(Result,SizeOf(Result)); +end; + +function TDataStoreReader.ReadInt8S(): TInt8S; +begin + FStream.Read(Result,SizeOf(Result)); +end; + +function TDataStoreReader.ReadInt16U(): TInt16U; +begin + FStream.Read(Result,SizeOf(Result)); + Result := Reverse_16(Result); +end; + +function TDataStoreReader.ReadInt16S(): TInt16S; +begin + FStream.Read(Result,SizeOf(Result)); + Result := Reverse_16(Result); +end; + +function TDataStoreReader.ReadInt32U(): TInt32U; +begin + FStream.Read(Result,SizeOf(Result)); + Result := Reverse_32(Result); +end; + +function TDataStoreReader.ReadInt32S(): TInt32S; +begin + FStream.Read(Result,SizeOf(Result)); + Result := Reverse_32(Result); +end; + +function TDataStoreReader.ReadInt64U(): TInt64U; +begin + FStream.Read(Result,SizeOf(Result)); + Result := Reverse_64(Result); +end; + +function TDataStoreReader.ReadInt64S(): TInt64S; +begin + FStream.Read(Result,SizeOf(Result)); + Result := Reverse_64(Result); +end; + +function TDataStoreReader.ReadBool(): TBoolData; +begin + Result := ( ReadInt8U() > 0 ); +end; + +function TDataStoreReader.ReadEnum(): TEnumData; +begin + Result := ReadInt64S(); +end; + +function TDataStoreReader.ReadStr(): TStringData; +Var + i : TInt32S; +begin + i := ReadInt32S(); + SetLength(Result,i); + If ( i > 0 ) Then + FStream.ReadBuffer(Result[1],i); +end; + +function TDataStoreReader.ReadSingle(): TFloat_Single_4; +begin + FStream.Read(Result,SizeOf(Result)); + Result := Reverse_Single(Result); +end; + +function TDataStoreReader.ReadDouble(): TFloat_Double_8; +begin + FStream.Read(Result,SizeOf(Result)); + Result := Reverse_Double(Result); +end; + +function TDataStoreReader.ReadExtended(): TFloat_Extended_10; +begin + FStream.Read(Result,SizeOf(Result)); + Result := Reverse_Extended(Result); +end; + +function TDataStoreReader.ReadCurrency(): TFloat_Currency_8; +begin + FStream.Read(Result,SizeOf(Result)); + Result := Reverse_Currency(Result); +end; + +constructor TDataStoreReader.Create(AStream: TStream); +begin + Assert(Assigned(AStream)); + FStream := AStream; +end; + +end. diff --git a/wst/tags/0.4/doc/WebServiceToolKit.odt b/wst/tags/0.4/doc/WebServiceToolKit.odt new file mode 100644 index 000000000..3cc7df86a Binary files /dev/null and b/wst/tags/0.4/doc/WebServiceToolKit.odt differ diff --git a/wst/tags/0.4/doc/WebServiceToolKit.rtf b/wst/tags/0.4/doc/WebServiceToolKit.rtf new file mode 100644 index 000000000..c9cb11fa3 --- /dev/null +++ b/wst/tags/0.4/doc/WebServiceToolKit.rtf @@ -0,0 +1,1585 @@ +{\rtf1\ansi\deff1\adeflang1025 +{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset0 Nimbus Roman No9 L{\*\falt Times New Roman};}{\f2\fswiss\fprq2\fcharset0 Nimbus Sans L{\*\falt Arial};}{\f3\fnil\fprq1\fcharset0 Courier 10 Pitch;}{\f4\fmodern\fprq1\fcharset0 Courier New;}{\f5\fnil\fprq0\fcharset2 StarSymbol{\*\falt Arial Unicode MS};}{\f6\fmodern\fprq1\fcharset128 Courier New;}{\f7\fswiss\fprq2\fcharset128 Alba{\*\falt Arial};}{\f8\fnil\fprq2\fcharset0 Nimbus Sans L{\*\falt Arial};}{\f9\fnil\fprq2\fcharset0 HG Mincho Light J{\*\falt msmincho};}} +{\colortbl;\red0\green0\blue0;\red0\green0\blue128;\red128\green0\blue0;\red204\green204\blue204;\red192\green192\blue192;\red128\green128\blue128;} +{\stylesheet{\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033\snext1 Normal;} +{\s2\sa120\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033\sbasedon1\snext2 Body Text;} +{\s3\sb240\sa120\keepn\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\afs28\lang255\ltrch\dbch\af9\langfe255\hich\f2\fs28\lang1033\loch\f2\fs28\lang1033\sbasedon1\snext2 Heading;} +{\s4\sb240\sa120\keepn\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\afs32\lang255\ab\ltrch\dbch\af9\langfe255\hich\f2\fs32\lang1033\b\loch\f2\fs32\lang1033\b\sbasedon3\snext2{\*\soutlvl0} heading 1;} +{\s5\sb240\sa120\keepn\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\afs28\lang255\ai\ab\ltrch\dbch\af9\langfe255\hich\f2\fs28\lang1033\i\b\loch\f2\fs28\lang1033\i\b\sbasedon3\snext2{\*\soutlvl1} heading 2;} +{\s6\sb240\sa120\keepn\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\afs28\lang255\ab\ltrch\dbch\af9\langfe255\hich\f2\fs28\lang1033\b\loch\f2\fs28\lang1033\b\sbasedon3\snext2{\*\soutlvl2} heading 3;} +{\s7\sb240\sa120\keepn\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\afs23\lang255\ai\ab\ltrch\dbch\af9\langfe255\hich\f2\fs23\lang1033\i\b\loch\f2\fs23\lang1033\i\b\sbasedon3\snext2{\*\soutlvl3} heading 4;} +{\s8\sb240\sa120\keepn\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\afs23\lang255\ab\ltrch\dbch\af9\langfe255\hich\f2\fs23\lang1033\b\loch\f2\fs23\lang1033\b\sbasedon3\snext2{\*\soutlvl4} heading 5;} +{\s9\sb240\sa120\keepn\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\afs21\lang255\ab\ltrch\dbch\af9\langfe255\hich\f2\fs21\lang1033\b\loch\f2\fs21\lang1033\b\sbasedon3\snext2{\*\soutlvl5} heading 6;} +{\s10\cf0\tqc\tx4818\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033\sbasedon1\snext10 header;} +{\s11\li283\ri0\lin283\rin0\fi-283\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs20\lang1033\loch\f1\fs20\lang1033\sbasedon1\snext11 footnote text;} +{\s12\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033\sbasedon1\snext12 Index;} +{\s13\sb240\sa120\keepn\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\afs32\lang255\ab\ltrch\dbch\af9\langfe255\hich\f2\fs32\lang1033\b\loch\f2\fs32\lang1033\b\sbasedon3\snext13 Contents Heading;} +{\s14\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033\sbasedon12\snext14 toc 1;} +{\s15\li283\ri0\lin283\rin0\fi0\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033\sbasedon12\snext15 toc 2;} +{\s16\li566\ri0\lin566\rin0\fi0\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033\sbasedon12\snext16 toc 3;} +{\s17\li849\ri0\lin849\rin0\fi0\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033\sbasedon12\snext17 toc 4;} +{\s18\li1132\ri0\lin1132\rin0\fi0\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033\sbasedon12\snext18 toc 5;} +{\s19\li1415\ri0\lin1415\rin0\fi0\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033\sbasedon12\snext19 toc 6;} +{\s20\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af4\afs20\lang255\ltrch\dbch\af4\langfe255\hich\f4\fs20\lang1033\loch\f4\fs20\lang1033\sbasedon1\snext20 Preformatted Text;} +{\*\cs22\cf0\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 Footnote Symbol;} +{\*\cs23\cf0\rtlch\af5\afs18\lang255\ltrch\dbch\af5\langfe255\hich\f5\fs18\lang1033\loch\f5\fs18\lang1033 Bullet Symbols;} +{\*\cs24\cf2\ul\ulc0\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 Internet link;} +{\*\cs25\cf3\ul\ulc0\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 Visited Internet Link;} +{\*\cs26\cf0\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 Endnote Symbol;} +{\*\cs27\cf0{\*\updnprop5801}\up10\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 Footnote anchor;} +{\*\cs28\cf0{\*\updnprop5801}\up10\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 Endnote anchor;} +{\*\cs29\cf0\rtlch\af8\afs24\lang255\ab\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\b\loch\f1\fs24\lang1033\b Strong Emphasis;} +}{\*\listtable{\list\listtemplateid1 +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li720} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li1080} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li1440} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li1800} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li2160} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li2520} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li2880} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li3240} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li3600} +{\*\soutlvl{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li3960}}\listid1} +{\list\listtemplateid2 +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10004 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li720} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10146 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li1080} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10004 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li1440} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10004 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li1800} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10004 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li2160} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10004 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li2520} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10004 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li2880} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10004 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li3240} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10004 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li3600} +{\*\soutlvl{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10004 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li3960}}\listid2} +{\list\listtemplateid3 +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li720} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li1080} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li1440} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li1800} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li2160} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li2520} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li2880} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li3240} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li3600} +{\*\soutlvl{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li3960}}\listid3} +{\list\listtemplateid4 +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li720} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li1080} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li1440} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li1800} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li2160} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li2520} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li2880} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li3240} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li3600} +{\*\soutlvl{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li3960}}\listid4} +{\list\listtemplateid5 +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li720} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li1080} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li1440} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li1800} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li2160} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li2520} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li2880} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li3240} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li3600} +{\*\soutlvl{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li3960}}\listid5} +{\list\listtemplateid6 +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li720} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li1080} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li1440} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li1800} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li2160} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li2520} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li2880} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li3240} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li3600} +{\*\soutlvl{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li3960}}\listid6} +{\list\listtemplateid7 +{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'00.;}{\levelnumbers\'01;}\fi-360\li720} +{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'01.;}{\levelnumbers\'01;}\fi-360\li1080} +{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'02.;}{\levelnumbers\'01;}\fi-360\li1440} +{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'03.;}{\levelnumbers\'01;}\fi-360\li1800} +{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'04.;}{\levelnumbers\'01;}\fi-360\li2160} +{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'05.;}{\levelnumbers\'01;}\fi-360\li2520} +{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'06.;}{\levelnumbers\'01;}\fi-360\li2880} +{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'07.;}{\levelnumbers\'01;}\fi-360\li3240} +{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'08.;}{\levelnumbers\'01;}\fi-360\li3600} +{\*\soutlvl{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'09.;}{\levelnumbers\'01;}\fi-360\li3960}}\listid7} +{\list\listtemplateid8 +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10004 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li720} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10004 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li1080} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10004 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li1440} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10004 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li1800} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10004 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li2160} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10004 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li2520} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10004 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li2880} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10004 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li3240} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10004 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li3600} +{\*\soutlvl{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10004 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li3960}}\listid8} +{\list\listtemplateid9 +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10004 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li720} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10004 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li1080} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10004 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li1440} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10004 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li1800} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10004 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li2160} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10004 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li2520} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10004 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li2880} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10004 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li3240} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10004 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li3600} +{\*\soutlvl{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10004 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li3960}}\listid9} +{\list\listtemplateid10 +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8226 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li720} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8226 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li1080} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8226 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li1440} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8226 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li1800} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8226 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li2160} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8226 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li2520} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8226 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li2880} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8226 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li3240} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8226 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li3600} +{\*\soutlvl{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8226 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li3960}}\listid10} +{\list\listtemplateid11 +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10132 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li720} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10132 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li1080} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10132 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li1440} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10132 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li1800} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10132 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li2160} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10132 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li2520} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10132 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li2880} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10132 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li3240} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10132 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li3600} +{\*\soutlvl{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10132 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li3960}}\listid11} +{\list\listtemplateid12 +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li720} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li1080} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li1440} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li1800} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li2160} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li2520} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li2880} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li3240} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li3600} +{\*\soutlvl{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li3960}}\listid12} +{\list\listtemplateid13 +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10004 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li720} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10004 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li1080} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10004 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li1440} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10004 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li1800} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10004 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li2160} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10004 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li2520} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10004 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li2880} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10004 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li3240} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10004 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li3600} +{\*\soutlvl{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10004 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li3960}}\listid13} +{\list\listtemplateid14 +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u10004 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-283\li707} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8226 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-283\li1414} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8226 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-283\li2121} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8226 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-283\li2828} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8226 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-283\li3535} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8226 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-283\li4242} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8226 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-283\li4949} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8226 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-283\li5656} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8226 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-283\li6363} +{\*\soutlvl{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u8226 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-283\li7070}}\listid14} +{\list\listtemplateid15 +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li720} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li1080} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li1440} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li1800} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li2160} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li2520} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li2880} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li3240} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li3600} +{\*\soutlvl{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li3960}}\listid15} +{\list\listtemplateid16 +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li720} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li1080} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li1440} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li1800} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li2160} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li2520} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li2880} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li3240} +{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li3600} +{\*\soutlvl{\listlevel\levelnfc23\leveljc0\levelstartat1\levelfollow0{\leveltext \'01\u57354 ?;}{\levelnumbers;}\f5\fs18\f5\fs18\f5\fs18\f5\fi-360\li3960}}\listid16} +{\list\listtemplateid17 +{\listlevel\levelnfc4\leveljc0\levelstartat1\levelfollow0{\leveltext \'03(\'00);}{\levelnumbers\'02;}\fi-360\li720} +{\listlevel\levelnfc4\leveljc0\levelstartat1\levelfollow0{\leveltext \'03(\'01);}{\levelnumbers\'02;}\fi-360\li1080} +{\listlevel\levelnfc4\leveljc0\levelstartat1\levelfollow0{\leveltext \'03(\'02);}{\levelnumbers\'02;}\fi-360\li1440} +{\listlevel\levelnfc4\leveljc0\levelstartat1\levelfollow0{\leveltext \'03(\'03);}{\levelnumbers\'02;}\fi-360\li1800} +{\listlevel\levelnfc4\leveljc0\levelstartat1\levelfollow0{\leveltext \'03(\'04);}{\levelnumbers\'02;}\fi-360\li2160} +{\listlevel\levelnfc4\leveljc0\levelstartat1\levelfollow0{\leveltext \'03(\'05);}{\levelnumbers\'02;}\fi-360\li2520} +{\listlevel\levelnfc4\leveljc0\levelstartat1\levelfollow0{\leveltext \'03(\'06);}{\levelnumbers\'02;}\fi-360\li2880} +{\listlevel\levelnfc4\leveljc0\levelstartat1\levelfollow0{\leveltext \'03(\'07);}{\levelnumbers\'02;}\fi-360\li3240} +{\listlevel\levelnfc4\leveljc0\levelstartat1\levelfollow0{\leveltext \'03(\'08);}{\levelnumbers\'02;}\fi-360\li3600} +{\*\soutlvl{\listlevel\levelnfc4\leveljc0\levelstartat1\levelfollow0{\leveltext \'03(\'09);}{\levelnumbers\'02;}\fi-360\li3960}}\listid17} +}{\listoverridetable{\listoverride\listid1\listoverridecount0\ls0}{\listoverride\listid2\listoverridecount0\ls1}{\listoverride\listid3\listoverridecount0\ls2}{\listoverride\listid4\listoverridecount0\ls3}{\listoverride\listid5\listoverridecount0\ls4}{\listoverride\listid6\listoverridecount0\ls5}{\listoverride\listid7\listoverridecount0\ls6}{\listoverride\listid8\listoverridecount0\ls7}{\listoverride\listid9\listoverridecount0\ls8}{\listoverride\listid10\listoverridecount0\ls9}{\listoverride\listid11\listoverridecount0\ls10}{\listoverride\listid12\listoverridecount0\ls11}{\listoverride\listid13\listoverridecount0\ls12}{\listoverride\listid14\listoverridecount0\ls13}{\listoverride\listid15\listoverridecount0\ls14}{\listoverride\listid16\listoverridecount0\ls15}{\listoverride\listid17\listoverridecount0\ls16}} + +{\info{\title Web Service Toolkit for FPC & Lazarus}{\keywords Web Service FPC, Lazarus}{\creatim\yr2006\mo4\dy20\hr13\min39}{\author Inoussa OUEDRAOGO}{\revtim\yr2007\mo5\dy5\hr19\min40}{\printim\yr1601\mo1\dy1\hr0\min0}{\comment StarWriter}{\vern6800}}\deftab709 +{\*\pgdsctbl +{\pgdsc0\pgdscuse195\pgwsxn11905\pghsxn16837\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\headery0{\*\headeryb283\headerxl0\headerxr0\headeryh0}{\header \pard\plain \s10\cf0\ul\ulc0\qr\tqc\tx4818\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ab\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\b\loch\f1\fs24\lang1033\b {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b Web Service Toolkit for FPC & Lazarus} +\par } +\pgdscnxt0 Standard;} +{\pgdsc1\pgdscuse195\pgwsxn11905\pghsxn16837\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\pgdscnxt1 Footnote;} +{\pgdsc2\pgdscuse195\pgwsxn11905\pghsxn16837\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\pgdscnxt2 Endnote;}} +\paperh16837\paperw11905\margl1134\margr1134\margt1134\margb1134\sectd\sbknone\pgwsxn11905\pghsxn16837\marglsxn1134\margrsxn1134\margtsxn1693\margbsxn1134\headery1134{\header \pard\plain \s10\cf0\ul\ulc0\qr\tqc\tx4818\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ab\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\b\loch\f1\fs24\lang1033\b {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b Web Service Toolkit for FPC & Lazarus} +\par } +\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc +\pard\plain \sb240\sa120\keepn\f2\fs32\b\f9\fs32\b\fs32\b\qr \ltrpar\s4\cf0\qr{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\rtlch\afs32\lang255\ab\ltrch\dbch\af9\langfe255\hich\f2\fs32\lang1033\b\loch\f2\fs32\lang1033\b +\par \pard\plain \sb240\sa120\keepn\f2\fs32\b\f9\fs32\b\fs32\b \ltrpar\s4\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs32\lang255\ab\ltrch\dbch\af9\langfe255\hich\f2\fs32\lang1033\b\loch\f2\fs32\lang1033\b +\par \pard\plain \sb240\sa120\keepn\f2\fs32\b\f9\fs32\b\fs32\b \ltrpar\s4\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs32\lang255\ab\ltrch\dbch\af9\langfe255\hich\f2\fs32\lang1033\b\loch\f2\fs32\lang1033\b +\par \pard\plain \sb240\sa120\keepn\f2\fs32\b\f9\fs32\b\fs32\b \ltrpar\s4\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs32\lang255\ab\ltrch\dbch\af9\langfe255\hich\f2\fs32\lang1033\b\loch\f2\fs32\lang1033\b +\par \pard\plain \sb240\sa120\keepn\f2\fs32\b\f9\fs32\b\fs32\b \ltrpar\s4\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs32\lang255\ab\ltrch\dbch\af9\langfe255\hich\f2\fs32\lang1033\b\loch\f2\fs32\lang1033\b +\par \pard\plain \sb240\sa120\keepn\f2\fs32\b\f9\fs32\b\fs32\b \ltrpar\s4\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs32\lang255\ab\ltrch\dbch\af9\langfe255\hich\f2\fs32\lang1033\b\loch\f2\fs32\lang1033\b +\par \pard\plain \ltrpar\s1\cf0\ul\ulc0\qc{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs96\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs96\lang1033\loch\f1\fs96\lang1033 {\rtlch \ltrch\loch\f1\fs96\lang1033\i0\b0 Web Service Toolkit for FPC & Lazarus} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs96\lang1033\i0\b0 0.4} +\par \pard\plain \ltrpar\s1\cf0\qc{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs96\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs96\lang1033\loch\f1\fs96\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs40\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs40\lang1033\loch\f1\fs40\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0\ul\ulc0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs40\lang255\ab\ltrch\dbch\af8\langfe255\hich\f1\fs40\lang1033\b\loch\f1\fs40\lang1033\b {\rtlch \ltrch\loch\f1\fs40\lang1033\i0\b Inoussa OUEDRAOGO} +\par \page\sect\sbknone\cols1\ltrsect +\pard\plain \ltrpar\s13\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs32\lang255\ab\ltrch\dbch\af9\langfe255\hich\f2\fs32\lang1033\b\loch\f2\fs32\lang1033\b {\rtlch \ltrch\loch\f2\fs32\lang1033\i0\b Table des mati\'e8res} +\par \pard\plain \ltrpar\s14\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Web Service Toolkit for FPC & Lazarus\tab 4} +\par \pard\plain \ltrpar\s15\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li283\ri0\lin283\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Client Side ( service consumption )\tab 5} +\par \pard\plain \ltrpar\s16\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li566\ri0\lin566\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 overview\tab 5} +\par \pard\plain \ltrpar\s16\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li566\ri0\lin566\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Example\tab 5} +\par \pard\plain \ltrpar\s16\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li566\ri0\lin566\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Connection Parameters \tab 11} +\par \pard\plain \ltrpar\s17\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li849\ri0\lin849\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 HTTP connection Parameters \tab 12} +\par \pard\plain \ltrpar\s17\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li849\ri0\lin849\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 TCP connection Parameters \tab 12} +\par \pard\plain \ltrpar\s17\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li849\ri0\lin849\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 LIBRARY ( LIB ) connection Parameters \tab 12} +\par \pard\plain \ltrpar\s17\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li849\ri0\lin849\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Multi-Address service ( Address per operation )\tab 13} +\par \pard\plain \ltrpar\s15\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li283\ri0\lin283\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Server Side ( service creation )\tab 14} +\par \pard\plain \ltrpar\s16\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li566\ri0\lin566\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Overview.\tab 14} +\par \pard\plain \ltrpar\s16\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li566\ri0\lin566\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Example\tab 14} +\par \pard\plain \ltrpar\s17\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li849\ri0\lin849\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Defining the service Interface\tab 14} +\par \pard\plain \ltrpar\s17\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li849\ri0\lin849\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Providing an implementation for the service\tab 16} +\par \pard\plain \ltrpar\s17\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li849\ri0\lin849\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Providing a binder for the service.\tab 18} +\par \pard\plain \ltrpar\s17\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li849\ri0\lin849\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Host the service into an application server.\tab 19} +\par \pard\plain \ltrpar\s16\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li566\ri0\lin566\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 WSDL generation.\tab 23} +\par \pard\plain \ltrpar\s17\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li849\ri0\lin849\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The Meta data Service.\tab 23} +\par \pard\plain \ltrpar\s17\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li849\ri0\lin849\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 WSDL generation API.\tab 23} +\par \pard\plain \ltrpar\s18\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li1132\ri0\lin1132\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 WSDL Customization.\tab 23} +\par \pard\plain \ltrpar\s17\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li849\ri0\lin849\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Sample\tab 24} +\par \pard\plain \ltrpar\s16\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li566\ri0\lin566\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Services Extensions \'96 Server side\tab 24} +\par \pard\plain \ltrpar\s15\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li283\ri0\lin283\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Services meta data.\tab 25} +\par \pard\plain \ltrpar\s16\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li566\ri0\lin566\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Extended Meta data.\tab 25} +\par \pard\plain \ltrpar\s15\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li283\ri0\lin283\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Headers support.\tab 27} +\par \pard\plain \ltrpar\s16\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li566\ri0\lin566\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The THeaderBlock class \tab 27} +\par \pard\plain \ltrpar\s16\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li566\ri0\lin566\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Defining header class.\tab 27} +\par \pard\plain \ltrpar\s16\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li566\ri0\lin566\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The ICallContext interface.\tab 27} +\par \pard\plain \ltrpar\s16\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li566\ri0\lin566\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Client side headers.\tab 28} +\par \pard\plain \ltrpar\s16\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li566\ri0\lin566\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Server side headers.\tab 28} +\par \pard\plain \ltrpar\s17\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li849\ri0\lin849\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The ICallControl interface.\tab 28} +\par \pard\plain \ltrpar\s15\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li283\ri0\lin283\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 SOAP Specific.\tab 30} +\par \pard\plain \ltrpar\s16\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li566\ri0\lin566\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Binding style.\tab 30} +\par \pard\plain \ltrpar\s17\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li849\ri0\lin849\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Client side.\tab 30} +\par \pard\plain \ltrpar\s17\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li849\ri0\lin849\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Server side.\tab 30} +\par \pard\plain \ltrpar\s16\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li566\ri0\lin566\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Encoding style.\tab 30} +\par \pard\plain \ltrpar\s17\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li849\ri0\lin849\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Client side.\tab 30} +\par \pard\plain \ltrpar\s17\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li849\ri0\lin849\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Server side.\tab 30} +\par \pard\plain \ltrpar\s15\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li283\ri0\lin283\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Provided examples\tab 31} +\par \pard\plain \ltrpar\s16\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li566\ri0\lin566\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Client side examples\tab 31} +\par \pard\plain \ltrpar\s16\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li566\ri0\lin566\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Server side examples\tab 31} +\par \pard\plain \ltrpar\s15\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li283\ri0\lin283\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Status\tab 31} +\par \pard\plain \ltrpar\s16\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li566\ri0\lin566\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Serialization\tab 31} +\par \pard\plain \ltrpar\s17\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li849\ri0\lin849\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 SOAP serializer\tab 31} +\par \pard\plain \ltrpar\s17\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li849\ri0\lin849\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Binary serializer\tab 32} +\par \pard\plain \ltrpar\s17\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li849\ri0\lin849\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Class type serialization. \tab 33} +\par \pard\plain \ltrpar\s18\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li1132\ri0\lin1132\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The root \'93TBaseRemotable\'94 class.\tab 33} +\par \pard\plain \ltrpar\s18\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li1132\ri0\lin1132\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The \'93TBaseComplexRemotable\'94 serialization.\tab 33} +\par \pard\plain \ltrpar\s19\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li1415\ri0\lin1415\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Attribute properties.\tab 34} +\par \pard\plain \ltrpar\s18\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li1132\ri0\lin1132\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Provided array implementations.\tab 36} +\par \pard\plain \ltrpar\s17\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li849\ri0\lin849\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Test cases\tab 38} +\par \pard\plain \ltrpar\s15\cf0\tldot\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\li283\ri0\lin283\rin0\fi0\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Author\tab 38} +\par \sect\sectd\sbknone\pgwsxn11905\pghsxn16837\marglsxn1134\margrsxn1134\margtsxn1693\margbsxn1134\headery1134{\header \pard\plain \s10\cf0\ul\ulc0\qr\tqc\tx4818\tqr\tx9637{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ab\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\b\loch\f1\fs24\lang1033\b {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b Web Service Toolkit for FPC & Lazarus} +\par } + +\pard\plain \sb240\sa120\keepn\f2\fs32\b\f9\fs32\b\fs32\b \ltrpar\s4\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs32\lang255\ab\ltrch\dbch\af9\langfe255\hich\f2\fs32\lang1033\b\loch\f2\fs32\lang1033\b +\par \page\pard\plain \sb240\sa120\keepn\f2\fs32\b\f9\fs32\b\fs32\b \ltrpar\s4\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs32\lang255\ab\ltrch\dbch\af9\langfe255\hich\f2\fs32\lang1033\b\loch\f2\fs32\lang1033\b {\rtlch \ltrch\loch\f2\fs32\lang1033\i0\b Web Service Toolkit f{\rtlch\ltrch\dbch\hich\fs28\loch\fs28 or FPC & Lazarus}} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs28\lang255\ai\ltrch\dbch\af8\langfe255\hich\f1\fs28\lang1033\i\loch\f1\fs28\lang1033\i {\rtlch \ltrch\loch \'93}{\rtlch \ltrch\loch\f1\fs28\lang1033\i\b0 Web Service Toolkit\'94 is a web services package for FPC and Lazarus; \'93Web Service Toolkit\'94 is meant to ease web services {\rtlch\ltrch\dbch\hich\b\loch\b consumption and creation} by FPC and Lazarus users.} +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \sb240\sa120\keepn\f2\fs28\i\b\f9\fs28\i\b\fs28\i\b \ltrpar\s5\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs28\lang255\ai\ab\ltrch\dbch\af9\langfe255\hich\f2\fs28\lang1033\i\b\loch\f2\fs28\lang1033\i\b +\par \page\pard\plain \sb240\sa120\keepn\f2\fs28\i\b\f9\fs28\i\b\fs28\i\b \ltrpar\s5\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs28\lang255\ai\ab\ltrch\dbch\af9\langfe255\hich\f2\fs28\lang1033\i\b\loch\f2\fs28\lang1033\i\b {\rtlch \ltrch\loch\f2\fs28\lang1033\i\b Client Side ( service consumption )} +\par \pard\plain \sb240\sa120\keepn\f2\fs28\b\f9\fs28\b\fs28\b \ltrpar\s6\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs28\lang255\ab\ltrch\dbch\af9\langfe255\hich\f2\fs28\lang1033\b\loch\f2\fs28\lang1033\b {\rtlch \ltrch\loch\f2\fs28\lang1033\i0\b overview} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch \'93}{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Web Service Toolkit\'94 is made of two parts, a command line tool {\rtlch\ltrch\dbch\hich\i\b\loch\i\b \'93ws_helper\'94} and a collection of support units. Given an interface definition file( a WSDL file or a pascal file describing \'e0 web service ), {\rtlch\ltrch\dbch\hich\i\b\loch\i\b \'93ws_helper\'94} will create a FPC unit containing a pr +oxy implementing that interface. At runtime when a call targeting the web service is issued, the proxy's role is to :} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj (a)\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls16\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 marshall the call parameters, } +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj (b)\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls16\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 make the call to the target web service, } +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj (c)\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls16\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 receive the call return and unmarshall output parameters to the caller.} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj \tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Behind the scene, the proxy will take care of the SOAP plumbing details.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \sb240\sa120\keepn\f2\fs28\b\f9\fs28\b\fs28\b \ltrpar\s6\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs28\lang255\ab\ltrch\dbch\af9\langfe255\hich\f2\fs28\lang1033\b\loch\f2\fs28\lang1033\b {\rtlch \ltrch\loch\f2\fs28\lang1033\i0\b Example} +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 We will use the {\rtlch\ltrch\dbch\hich\i\b\loch\i\b \'93Amazon E-Commerce Service\'94}, freely available ( you will need to create a account, it's free) for personal use at this address \'93http://www.amazon.com/gp/browse.html?node=3435361\'94.In order to use this service, we have to download its exposed + WSDL(Web Services Description Language) interface and translate it to Pascal language. The {\rtlch\ltrch\dbch\hich\i\b\loch\i\b ws_helper} program will handle this for us. In order to present his capabilities, below are printed the command line arguments it supports.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ab\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\b\loch\f3\fs20\lang1033\b {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b [Listing ws_helper usage]} +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\loch\f3\fs20\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ws_helper [-uMODE] [-p] [-b] [-i] [-oPATH] inputFilename} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 -u MODE Generate the pascal translation of the WSDL input file} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 MODE value may be U for used types or A for all types} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 -p Generate service proxy} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 -b Generate service binder} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 -i Generate service minimal implementation} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 -o PATH Relative output directory} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 -a PATH Absolute output directory} +\par \pard\plain \ltrpar\s1\cf0\chcbpat4\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs20\lang255\ab\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\b\loch\f3\fs20\lang1033\b {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b [/Listing]} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 To translate the WDSL file from the {\rtlch\ltrch\dbch\hich\i\b\loch\i\b \'93Amazon E-Commerce Service\'94} execute the following command at the prompt:} +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ab\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\b\loch\f3\fs20\lang1033\b {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b [Listing WSDL parsing]} +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\loch\f3\fs20\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ..\\..\\ws_helper\\ws_helper.exe -uA -p -o. AWSECommerceService.wsdl} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ws_helper, Web Service Toolkit 0.4 Copyright (c) 2006, 2007 by Inoussa OUEDRAOGO} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Parsing the file : AWSECommerceService.wsdl} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Interface file generation...} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Proxy file generation...} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Metadata file generation...} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 File "AWSECommerceService.wsdl" parsed succesfully.} +\par \pard\plain \ltrpar\s1\cf0\chcbpat4\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs20\lang255\ab\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\b\loch\f3\fs20\lang1033\b {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b [/Listing]} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 It will produce two (2) files : } +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u57354\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls15\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0{\ltrch\hich\f4\loch\f4 AWSECommerceService.pas,}}{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 the service definition file} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u57354\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls15\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0{\ltrch\hich\f4\loch\f4 AWSECommerceService_proxy.pas,}}{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 this file contains a proxy which implements the service interface defined in the first file.} +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 below is printed an extract of both files :} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ab\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\b\loch\f3\fs20\lang1033\b {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b [code File = {\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\loch\f3\fs20 AWSECommerceService}]} +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\loch\f3\fs20\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 unit AWSECommerceService;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 \{$IFDEF FPC\} \{$mode objfpc\}\{$H+\} \{$ENDIF\}} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 interface} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 uses SysUtils, Classes, TypInfo, base_service_intf, service_intf;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 const} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 sNAME_SPACE = 'http://webservices.amazon.com/AWSECommerceService/2007-04-04';} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 sUNIT_NAME = 'AWSECommerceService';} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 type} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 HelpRequest = class;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Help_RequestArray = class;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 (...)} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 AWSECommerceServicePortType = interface(IInvokable)} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ['\{305A7E48-DD92-4C20-B699-4F2B47C93342\}']} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 function Help(} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Const HelpParam : Help_Type} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ):HelpResponse_Type;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 function ItemSearch(} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Const ItemSearchParam : ItemSearch_Type} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ):ItemSearchResponse_Type;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 function ItemLookup(} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Const ItemLookupParam : ItemLookup_Type} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ):ItemLookupResponse_Type;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 (...)} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 end;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 procedure Register_AWSECommerceService_ServiceMetadata();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ab\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\b\loch\f3\fs20\lang1033\b {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b [/code]} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b [code File = {\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\loch\f3\fs20 AWSECommerceService_proxy}]} +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\loch\f3\fs20\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Unit AWSECommerceService_proxy;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 \{$IFDEF FPC\} \{$mode objfpc\}\{$H+\} \{$ENDIF\}} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Interface} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Uses SysUtils, Classes, TypInfo, base_service_intf, service_intf, AWSECommerceService;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Type} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 TAWSECommerceServicePortType_Proxy=class(TBaseProxy,AWSECommerceServicePortType)} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Protected} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 class function GetServiceType() : PTypeInfo;override;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 function Help(} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Const HelpParam : Help_Type} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ):HelpResponse_Type;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 function ItemSearch(} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Const ItemSearchParam : ItemSearch_Type} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ):ItemSearchResponse_Type;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 function ItemLookup(} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Const ItemLookupParam : ItemLookup_Type} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ):ItemLookupResponse_Type; } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 (...)} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 End;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Function wst_CreateInstance_AWSECommerceServicePortType(const AFormat : string = 'SOAP:'; const ATransport : string = 'HTTP:'):AWSECommerceServicePortType;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Implementation} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 uses wst_resources_imp, metadata_repository;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Function wst_CreateInstance_AWSECommerceServicePortType(const AFormat : string; const ATransport : string):AWSECommerceServicePortType;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Begin} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Result := TAWSECommerceServicePortType_Proxy.Create('AWSECommerceServicePortType',AFormat+GetServiceDefaultFormatProperties(TypeInfo(AWSECommerceServicePortType)),ATransport + 'address=' + GetServiceDefaultAddress(TypeInfo(AWSECommerceServicePortType))); +} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 End;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 function TAWSECommerceServicePortType_Proxy.ItemSearch(} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Const ItemSearchParam : ItemSearch_Type} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ):ItemSearchResponse_Type;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Var} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 locSerializer : IFormatterClient;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 strPrmName : string;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Begin} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 locSerializer := GetSerializer();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Try} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 locSerializer.BeginCall('ItemSearch', GetTarget(),(Self as ICallContext));} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 locSerializer.Put('ItemSearch', TypeInfo(ItemSearch_Type), ItemSearchParam);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 locSerializer.EndCall();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 MakeCall();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 locSerializer.BeginCallRead((Self as ICallContext));} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 TObject(Result) := Nil;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 strPrmName := 'ItemSearchResponse';} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 locSerializer.Get(TypeInfo(ItemSearchResponse_Type), strPrmName, Result);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Finally} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 locSerializer.Clear();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 End;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 End;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 (...)} +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ab\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\b\loch\f3\fs20\lang1033\b {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b [/code]} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 We are now able to build a simple program for the service. The {\rtlch\ltrch\dbch\hich\i\b\loch\i\b Synapse Library} is required to compile the program as it is used for the HTTP communication. This library can be downloaded free of charge at this {\field{\*\fldinst HYPERLINK "http://synapse.ararat.cz/" }{\fldrslt \*\cs24\cf2\ul\ulc0\rtlch\ltrch\dbch\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\field{\*\fldinst HYPERLINK "http://synapse.ararat.cz/" }{\fldrslt \*\cs24\cf2\ul\ulc0\rtlch\ltrch\dbch\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\field{\*\fldinst HYPERLINK "http://synapse.ararat.cz/" }{\fldrslt \*\cs24\cf2\ul\ulc0\rtlch\ltrch\dbch\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 location.}}}}}} The {\field{\*\fldinst HYPERLINK "http://www.indyproject.org/Sockets/fpc/index.en.html" }{\fldrslt \*\cs24\cf2\ul\ulc0\rtlch\ltrch\dbch\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\field{\*\fldinst HYPERLINK "http://www.indyproject.org/Sockets/fpc/index.en.html" }{\fldrslt \*\cs24\cf2\ul\ulc0\rtlch\ltrch\dbch\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\field{\*\fldinst HYPERLINK "http://www.indyproject.org/Sockets/fpc/index.en.html" }{\fldrslt \*\cs24\cf2\ul\ulc0\rtlch\ltrch\dbch\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 Indy}}}}}} Library or {\field{\*\fldinst HYPERLINK "http://www.overbyte.be/frame_index.html" }{\fldrslt \*\cs24\cf2\ul\ulc0\rtlch\ltrch\dbch\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\field{\*\fldinst HYPERLINK "http://www.overbyte.be/frame_index.html" }{\fldrslt \*\cs24\cf2\ul\ulc0\rtlch\ltrch\dbch\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\field{\*\fldinst HYPERLINK "http://www.overbyte.be/frame_index.html" }{\fldrslt \*\cs24\cf2\ul\ulc0\rtlch\ltrch\dbch\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 ICS}}}}}} library can +also be used.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ab\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\b\loch\f3\fs20\lang1033\b {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b [code]} +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\loch\f3\fs20\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 program amazon_sample;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 \{$mode objfpc\}\{$H+\}} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 uses} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Classes, SysUtils,{\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\loch\f3\fs20 soap_formatter, synapse_http_protocol,}} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 metadata_repository,{\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\loch\f3\fs20 AWSECommerceService, AWSECommerceService_proxy;}} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 const sACCES_ID = ;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 function ReadEntry(const APromp : string):string ;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 begin} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Result := '';} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Write(APromp);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 while True do begin} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ReadLn(Result);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Result := Trim(Result);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 if ( Length(Result) > 0 ) then} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Break;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 end;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 end;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 var} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 locService : AWSECommerceServicePortType;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 rqst : ItemSearch_Type;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 rsps : ItemSearchResponse_Type;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 rspsItem : Items_Type;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 i, j, k : Integer;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 itm : Item_Type;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 begin} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 SYNAPSE_RegisterHTTP_Transport();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 WriteLn('Web Services Toolkit Amazon sample');} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 WriteLn('This sample demonstrates the "ItemSearch" method of the Amazon web service');} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 WriteLn();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 rqst := ItemSearch_Type.Create();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 try} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 locService := wst_CreateInstance_AWSECommerceServicePortType();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 rqst.AWSAccessKeyId := sACCES_ID;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 while True do begin} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 rqst.Request.SetLength(1);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 rqst.Request[0].SearchIndex := ReadEntry('Enter the Search Index : ');} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 rqst.Request[0].Availability := Available;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 rqst.Request[0].Count := 10;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 rqst.Request[0].MerchantId := 'Amazon';} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 rqst.Request[0].ItemPage := 1;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 rqst.Request[0].Keywords := ReadEntry('Enter the Keywords : ');} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 rsps := locService.ItemSearch(rqst);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 if ( rsps.OperationRequest.Errors.Length > 0 ) then begin} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 WriteLn(Format('Errors ( %d ) : ',[rsps.OperationRequest.Errors.Length]));} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 for i := 0 to Pred(rsps.OperationRequest.Errors.Length) do begin} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 WriteLn(Format(' Error[%d] :',[i]));} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 WriteLn(' ' + rsps.OperationRequest.Errors[i].Code);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 WriteLn(' ' + rsps.OperationRequest.Errors[i].Message);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 end;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 end else begin} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 WriteLn(Format('Response ( %d ) : ',[rsps.Items.Length]));} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 if Assigned(rsps) then begin} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 for i := 0 to Pred(rsps.Items.Length) do begin} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 rspsItem := rsps.Items[i];} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 WriteLn(' TotalPages :' + IntToStr(rspsItem.TotalPages));} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 WriteLn(' TotalResults :' + IntToStr(rspsItem.TotalResults));} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 WriteLn(' Items :' + IntToStr(rspsItem._Item.Length));} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 WriteLn('');} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 for j := 0 to Pred(rspsItem._Item.Length) do begin} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 itm := rspsItem._Item[j];;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 WriteLn(' ASIN :' + itm.ASIN);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 WriteLn(' DetailPageURL :' + itm.DetailPageURL);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 if Assigned(itm.ItemAttributes) then begin} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 WriteLn(' Title :' + itm.ItemAttributes.Title);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 for k := 0 to Pred(itm.ItemAttributes.Author.Length) do begin} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 WriteLn(' Author[ ' + IntToStr(k) + ' ] ' + itm.ItemAttributes.Author.Item[k]);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 end;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 WriteLn(' Manufacturer :' + itm.ItemAttributes.Manufacturer);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 WriteLn(' ProductGroup :' + itm.ItemAttributes.ProductGroup);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 end;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 WriteLn('');} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 end;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 end;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 end else begin} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 WriteLn('Unexpected service response : Invalid response');} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 end;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 end;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 WriteLn();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 WriteLn();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 if ( UpperCase(ReadEntry('Continue ( Y/N ) :'))[1] <> 'Y' ) then} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Break;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 end;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 finally} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 FreeAndNil(rqst);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 FreeAndNil(rsps);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 end;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ReadLn;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 end.} +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ab\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\b\loch\f3\fs20\lang1033\b {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b [/code]} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The units {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b base_service_intf}{\ltrch\hich\f4\loch\f4 , }{\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b service_intf, soap_formatter, synapse_http_protocol, wst_resources_imp }{\ltrch\hich\f4\loch\f4 and}{\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b metadata_repository} are provided with the toolkit; Below is the result of a execution session searching for \'93Freepascal\'94 in the \'93All\'94 search index ( t +he service is case-sensitive!) .} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0\chcbpat4\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs20\lang255\ab\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\b\loch\f3\fs20\lang1033\b {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b [Listing]} +\par \pard\plain \ltrpar\s1\cf0\chcbpat4\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs20\lang255\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\loch\f3\fs20\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Web Services Toolkit Amazon sample} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 This sample demonstrates the "ItemSearch" method of the Amazon web service} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Enter the Search Index : All} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Enter the Keywords : Freepascal} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Response ( 1 ) :} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 TotalPages :1} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 TotalResults :9} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Items :9} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ASIN :0470088702} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 DetailPageURL :http://www.amazon.com/gp/redirect.html%3FASIN=0470088702%} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 26tag=ws%26lcode=sp1%26cID=2025%26ccmID=165953%26location=/o/ASIN/0470088702%253} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 FSubscriptionId=0W3H25JMMGBNBXSTQN82} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Title :Beginning Programming For Dummies (Beginning Programming f} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 or Dummies)} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Author[ 0 ] Wallace Wang} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Manufacturer :For Dummies} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ProductGroup :Book} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ASIN :0471375233} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 DetailPageURL :http://www.amazon.com/gp/redirect.html%3FASIN=0471375233%} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 26tag=ws%26lcode=sp1%26cID=2025%26ccmID=165953%26location=/o/ASIN/0471375233%253} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 FSubscriptionId=0W3H25JMMGBNBXSTQN82} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Title :Assembly Language Step-by-step: Programming with DOS and L} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 inux (with CD-ROM)} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Author[ 0 ] Jeff Duntemann} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Manufacturer :Wiley} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ProductGroup :Book} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 (...)} +\par \pard\plain \ltrpar\s1\cf0\chcbpat4\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs20\lang255\ab\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\b\loch\f3\fs20\lang1033\b {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b [/Listing]} +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 It finds one (1) page containing nine (9) items!} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The {\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\loch\f3\fs20 wst_CreateInstance_AWSECommerceServicePortType()} function, located in the {\ltrch\hich\f4\loch\f4 AWSECommerceService.pas file }create a proxy instance based on the service's informations contained in the WSDL file.} +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ab\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\b\loch\f3\fs20\lang1033\b {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b [code]} +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\loch\f3\fs20\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Function wst_CreateInstance_AWSECommerceServicePortType(const AFormat : string; const ATransport : string):AWSECommerceServicePortType;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Begin} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Result := TAWSECommerceServicePortType_Proxy.Create(} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 'AWSECommerceServicePortType',} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Aformat+GetServiceDefaultFormatProperties(TypeInfo(AWSECommerceServicePortType)),} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ATransport + 'address=' + GetServiceDefaultAddress(TypeInfo(AWSECommerceServicePortType)));} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 End;} +\par \pard\plain \ltrpar\s1\cf0\chcbpat4\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs20\lang255\ab\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\b\loch\f3\fs20\lang1033\b {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b [/code]} +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The complete source code of this example is shipped with the toolkit.} +\par \pard\plain \sb240\sa120\keepn\f2\fs28\b\f9\fs28\b\fs28\b\qj \ltrpar\s6\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\rtlch\afs28\lang255\ab\ltrch\dbch\af9\langfe255\hich\f2\fs28\lang1033\b\loch\f2\fs28\lang1033\b {\rtlch \ltrch\loch\f2\fs28\lang1033\i0\b Connection Parameters } +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The connection string general format is: } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch {\chcbpat4 }}{\chcbpat4{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 protocol:paramName=paramValue(;paramName=paramValue)*}} +\par \pard\plain \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sa120\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sa120\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 where :} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\sa120\f5\fs18\f5\fs18\f5\fs18 \u57354\'3f\tab}\ilvl0 \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls14\aspalpha\li720\ri0\lin720\rin0\fi-360\sa120\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0{\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b protocol}}{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 is the protocol being used,} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\sa120\f5\fs18\f5\fs18\f5\fs18 \u57354\'3f\tab}\ilvl0 \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls14\aspalpha\li720\ri0\lin720\rin0\fi-360\sa120\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0{\rtlch\ltrch\dbch\hich\f4\fs20\b\loch\f4\fs20\b paramName=paramValue}}{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0{\rtlch\ltrch\dbch\hich\f3\fs20\loch\f3\fs20 enable parameters passing to the protocol.}} +\par \pard\plain \sb240\sa120\keepn\f2\fs23\i\b\f9\fs23\i\b\fs23\i\b \ltrpar\s7\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs23\lang255\ai\ab\ltrch\dbch\af9\langfe255\hich\f2\fs23\lang1033\i\b\loch\f2\fs23\lang1033\i\b {\rtlch \ltrch\loch\f2\fs23\lang1033\i\b HTTP connection Parameters } +\par \pard\plain \ltrpar\s2\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sa120\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 HTTP supported parameters are: } +\par \pard\plain {\listtext\pard\plain \li707\ri0\lin707\rin0\fi-283\f5\fs18\f5\fs18\f5\fs18 \u10004\'3f\tab}\ilvl0 \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls13\aspalpha\li707\ri0\lin707\rin0\fi-283\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0{\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b address}}{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 {( required for a service supporting a unique address ) }} +\par \pard\plain {\listtext\pard\plain \li707\ri0\lin707\rin0\fi-283\f5\fs18\f5\fs18\f5\fs18 \u10004\'3f\tab}\ilvl0 \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls13\aspalpha\li707\ri0\lin707\rin0\fi-283\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0{\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b ProxyServer}}{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 } +\par \pard\plain {\listtext\pard\plain \li707\ri0\lin707\rin0\fi-283\f5\fs18\f5\fs18\f5\fs18 \u10004\'3f\tab}\ilvl0 \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls13\aspalpha\li707\ri0\lin707\rin0\fi-283\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0{\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b ProxyPort}}{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 } +\par \pard\plain {\listtext\pard\plain \li707\ri0\lin707\rin0\fi-283\f5\fs18\f5\fs18\f5\fs18 \u10004\'3f\tab}\ilvl0 \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls13\aspalpha\li707\ri0\lin707\rin0\fi-283\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0{\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b ProxyUsername}}{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 } +\par \pard\plain {\listtext\pard\plain \li707\ri0\lin707\rin0\fi-283\f4\b\b\b\f5\fs18\f5\fs18\f5\fs18 \u10004\'3f\tab}\ilvl0 \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls13\aspalpha\li707\ri0\lin707\rin0\fi-283\ql\rtlch\af8\afs24\lang255\ab\ltrch\dbch\af8\langfe255\hich\f4\fs24\lang1033\b\loch\f4\fs24\lang1033\b {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b ProxyPassword} +\par \pard\plain \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sa120\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sa120\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 HTTP Connection through proxy are supported using the {\rtlch\ltrch\dbch\hich\i\loch\i proxy*} parametters. Below is an example address string. } +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\loch\f3\fs20\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Const} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 sADDRESS = 'http:address=http://webservices.amazon.com/AWSECommerceService/2007-04-04'+} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ';ProxyServer=197.150.10.10;ProxyPort=9881'+} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ';ProxyUsername=inoussa;ProxyPassword=wst';} +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The toolkit has three HTTP implementations based on ICS ( {\ltrch\hich\f4\loch\f4 ics_http_protocol.pas} ), Indy ( {\ltrch\hich\f4\loch\f4 indy_http_protocol.pas} ) and SYNAPSE ( {\ltrch\hich\f4\loch\f4 synapse_http_protocol.pas} ). } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \sb240\sa120\keepn\f2\fs23\i\b\f9\fs23\i\b\fs23\i\b \ltrpar\s7\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs23\lang255\ai\ab\ltrch\dbch\af9\langfe255\hich\f2\fs23\lang1033\i\b\loch\f2\fs23\lang1033\i\b {\rtlch \ltrch\loch\f2\fs23\lang1033\i\b TCP connection Parameters } +\par \pard\plain \ltrpar\s2\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sa120\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 TCP supported parameters are: } +\par \pard\plain {\listtext\pard\plain \li707\ri0\lin707\rin0\fi-283\f5\fs18\f5\fs18\f5\fs18 \u10004\'3f\tab}\ilvl0 \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls13\aspalpha\li707\ri0\lin707\rin0\fi-283\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0{\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b address}}{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 {( required for a service supporting a unique address ) }} +\par \pard\plain {\listtext\pard\plain \li707\ri0\lin707\rin0\fi-283\f4\b\b\b\f5\fs18\f5\fs18\f5\fs18 \u10004\'3f\tab}\ilvl0 \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls13\aspalpha\li707\ri0\lin707\rin0\fi-283\ql\rtlch\af8\afs24\lang255\ab\ltrch\dbch\af8\langfe255\hich\f4\fs24\lang1033\b\loch\f4\fs24\lang1033\b {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b Port} +\par \pard\plain {\listtext\pard\plain \li707\ri0\lin707\rin0\fi-283\f4\b\b\b\f5\fs18\f5\fs18\f5\fs18 \u10004\'3f\tab}\ilvl0 \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls13\aspalpha\li707\ri0\lin707\rin0\fi-283\ql\rtlch\af8\afs24\lang255\ab\ltrch\dbch\af8\langfe255\hich\f4\fs24\lang1033\b\loch\f4\fs24\lang1033\b {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b target{( the target service ) }} +\par \pard\plain \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sa120\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sa120\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Below is an example address string. } +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\loch\f3\fs20\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Const} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 sADDRESS = 'TCP:Address=10.0.0.3;Port=1234;target=UserService';} +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The toolkit has two TCP implementations based on Synapse ( ics_tcp_protocol.pas ) and ICS ( {\ltrch\hich\f4\loch\f4 ics_tcp_protocol.pas} ). } +\par \pard\plain \ltrpar\s2\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sa120\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch } +\par \pard\plain \sb240\sa120\keepn\f2\fs23\i\b\f9\fs23\i\b\fs23\i\b \ltrpar\s7\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql {\rtlch \ltrch\loch\f2\fs23\lang1033\i\b LIBRARY ( LIB ) connection Parameters } +\par \pard\plain \ltrpar\s2\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sa120\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The idea behind this protocol is to be able to host services in dynamic libraries ( DLL/DSO ). It can be viewed as a plug-in framework where plug-ins ( services ) are provided by dynamic libraries. } +\par \pard\plain \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sa120\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 LIB supported parameters are: } +\par \pard\plain {\listtext\pard\plain \li707\ri0\lin707\rin0\fi-283\f5\fs18\f5\fs18\f5\fs18 \u10004\'3f\tab}\ilvl0 \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls13\aspalpha\li707\ri0\lin707\rin0\fi-283\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0{\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b FileName}}{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 {( the DLL/SO filename ) }} +\par \pard\plain {\listtext\pard\plain \li707\ri0\lin707\rin0\fi-283\f4\b\b\b\f5\fs18\f5\fs18\f5\fs18 \u10004\'3f\tab}\ilvl0 \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls13\aspalpha\li707\ri0\lin707\rin0\fi-283\ql\rtlch\af8\afs24\lang255\ab\ltrch\dbch\af8\langfe255\hich\f4\fs24\lang1033\b\loch\f4\fs24\lang1033\b {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b target{( the target service ) }} +\par \pard\plain \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sa120\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sa120\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Below is an example address string. } +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\loch\f3\fs20\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Const} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 sADDRESS = 'LIB:FileName=..\\library_server\\lib_server.dll;target=UserService';} +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The toolkit has one LIB implementation ( {\ltrch\hich\f4\loch\f4 library_protocol.pas} ). } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs28\lang255\ai\ltrch\dbch\af8\langfe255\hich\f1\fs28\lang1033\i\loch\f1\fs28\lang1033\i {\rtlch \ltrch\loch\f1\fs28\lang1033\i\b0 The samples folder contains 3 projects user_client_console, tcp_server and library_server which demonstrate the TCP and LIBRARY protocols.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \sb240\sa120\keepn\f2\fs23\i\b\f9\fs23\i\b\fs23\i\b \ltrpar\s7\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs23\lang255\ai\ab\ltrch\dbch\af9\langfe255\hich\f2\fs23\lang1033\i\b\loch\f2\fs23\lang1033\i\b {\rtlch \ltrch\loch\f2\fs23\lang1033\i\b Multi-Address service ( Address per operation )} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Certain services ( like the eBay SOAP services ) use a address per operation. The toolkit uses extended meta data ( see the services meta data chapter below ) to set operation's addresses. The \'93ebay\'94 SOAP sample located under the {\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\b\loch\f3\fs20\b tests\\ebay} folder demonst +rates the operation's address setting.} +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \page\pard\plain \sb240\sa120\keepn\f2\fs28\i\b\f9\fs28\i\b\fs28\i\b\qj \ltrpar\s5\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\rtlch\afs28\lang255\ai\ab\ltrch\dbch\af9\langfe255\hich\f2\fs28\lang1033\i\b\loch\f2\fs28\lang1033\i\b {\rtlch \ltrch\loch\f2\fs28\lang1033\i\b Server Side ( service creation )} +\par \pard\plain \sb240\sa120\keepn\f2\fs28\b\f9\fs28\b\fs28\b \ltrpar\s6\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs28\lang255\ab\ltrch\dbch\af9\langfe255\hich\f2\fs28\lang1033\b\loch\f2\fs28\lang1033\b {\rtlch \ltrch\loch\f2\fs28\lang1033\i0\b Overview.} +\par \pard\plain \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sa120\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Web Service Toolkit contains a server side framework for service creation. Key features are:} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\sa120\f5\fs18\f5\fs18\f5\fs18 \u10004\'3f\tab}\ilvl0 \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls12\aspalpha\li720\ri0\lin720\rin0\fi-360\sa120\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Service definition( interface ) is separated from implementation,} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\sa120\f5\fs18\f5\fs18\f5\fs18 \u10004\'3f\tab}\ilvl0 \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls12\aspalpha\li720\ri0\lin720\rin0\fi-360\sa120\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Interface and implementations are not bound to message protocol,} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\sa120\f5\fs18\f5\fs18\f5\fs18 \u10004\'3f\tab}\ilvl0 \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls12\aspalpha\li720\ri0\lin720\rin0\fi-360\sa120\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 WSDL generation} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\sa120\f5\fs18\f5\fs18\f5\fs18 \u10004\'3f\tab}\ilvl0 \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls12\aspalpha\li720\ri0\lin720\rin0\fi-360\sa120\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Support for SOAP 1.1 and a binary protocol,} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\sa120\f5\fs18\f5\fs18\f5\fs18 \u10004\'3f\tab}\ilvl0 \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls12\aspalpha\li720\ri0\lin720\rin0\fi-360\sa120\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The framework is not bound to a transport protocol.} +\par \pard\plain \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sa120\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \sb240\sa120\keepn\f2\fs28\b\f9\fs28\b\fs28\b \ltrpar\s6\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs28\lang255\ab\ltrch\dbch\af9\langfe255\hich\f2\fs28\lang1033\b\loch\f2\fs28\lang1033\b {\rtlch \ltrch\loch\f2\fs28\lang1033\i0\b Example} +\par \pard\plain \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sa120\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 In order to create a service, we have to :} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\sa120\f5\fs18\f5\fs18\f5\fs18 \u57354\'3f\tab}\ilvl0 \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls11\aspalpha\li720\ri0\lin720\rin0\fi-360\sa120\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 define its interface, } +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\sa120\f5\fs18\f5\fs18\f5\fs18 \u57354\'3f\tab}\ilvl0 \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls11\aspalpha\li720\ri0\lin720\rin0\fi-360\sa120\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 provide an implementation and register that one for the service, } +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\sa120\f5\fs18\f5\fs18\f5\fs18 \u57354\'3f\tab}\ilvl0 \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls11\aspalpha\li720\ri0\lin720\rin0\fi-360\sa120\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 provide a binder that will route calls targeting the service to the implementation and register that one,} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\sa120\f5\fs18\f5\fs18\f5\fs18 \u57354\'3f\tab}\ilvl0 \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls11\aspalpha\li720\ri0\lin720\rin0\fi-360\sa120\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 host the service into an application server( TCP server, HTTP Server, Library server,... ).} +\par \pard\plain \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sa120\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \sb240\sa120\keepn\f2\fs23\i\b\f9\fs23\i\b\fs23\i\b \ltrpar\s7\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs23\lang255\ai\ab\ltrch\dbch\af9\langfe255\hich\f2\fs23\lang1033\i\b\loch\f2\fs23\lang1033\i\b {\rtlch \ltrch\loch\f2\fs23\lang1033\i\b Defining the service Interface} +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 We will use the interface defined below for our sample. The complete projects of the example is located in the folder \'93samples\'94. } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\loch\f3\fs20\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 [{\rtlch\ltrch\dbch\hich\b\loch\b Code]}} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 unit user_service_intf;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 \{$IFDEF FPC\} \{$mode objfpc\}\{$H+\} \{$ENDIF\}} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 interface} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 uses SysUtils, Classes, TypInfo, base_service_intf, service_intf;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 const} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 sNAME_SPACE = 'urn:UserService';} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 sUNIT_NAME = 'user_service_intf';} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 type} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 TUser = class;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 TUserArray = class;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 TUserCategory = ( } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Normal} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ,Admin} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 );} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 TUser = class(TBaseComplexRemotable)} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 private} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 FCategory : TUserCategory;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 FUserName : string;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 FeMail : string;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 FPreferences : string;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 published} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 property Category : TUserCategory read FCategory write FCategory;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 property UserName : string read FUserName write FUserName;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 property eMail : string read FeMail write FeMail;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 property Preferences : string read FPreferences write FPreferences;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 end;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 TUserArray = class(TBaseObjectArrayRemotable)} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 private} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 function GetItem(AIndex: Integer): TUser;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 public} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 class function GetItemClass():TBaseRemotableClass;override;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 property Item[AIndex:Integer] : TUser Read GetItem;Default;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 end;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 UserService = interface(IInvokable)} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ['\{CA6F6192-C3DE-4D9C-B3DF-E616376A0DC9\}']} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 function GetList():TUserArray;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 procedure Add(} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Const AUser : TUser} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 );} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 procedure Update(} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Const AUser : TUser} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 );} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 function Find(} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Const AName : string} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ):TUser;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 function Delete(} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Const AName : string} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ):boolean;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 end;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 (...)} +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ab\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\b\loch\f3\fs20\lang1033\b {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b [/code]} +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \sb240\sa120\keepn\f2\fs23\i\b\f9\fs23\i\b\fs23\i\b \ltrpar\s7\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs23\lang255\ai\ab\ltrch\dbch\af9\langfe255\hich\f2\fs23\lang1033\i\b\loch\f2\fs23\lang1033\i\b {\rtlch \ltrch\loch\f2\fs23\lang1033\i\b Providing an implementation for the service} +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch \'93}{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0{\rtlch\ltrch\dbch\hich\i\b\loch\i\b ws_helper}}{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 \'94 has options to generate proxy file, basic implementation skeleton file and a binder file ( see the listing above). } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ab\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\b\loch\f3\fs20\lang1033\b {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b [Listing ws_helper usage]} +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\loch\f3\fs20\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ws_helper, Web Service Toolkit 0.4 Copyright (c) 2006, 2007 by Inoussa OUEDRAOGO} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ws_helper [-uMODE] [-p] [-b] [-i] [-oPATH] inputFilename} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 -u MODE Generate the pascal translation of the WSDL input file} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 MODE value may be U for used types or A for all types} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 -p Generate service proxy} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 -b Generate service binder} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 -i Generate service minimal implementation} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 -o PATH Relative output directory} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 -a PATH Absolute output directory} +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ab\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\b\loch\f3\fs20\lang1033\b {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b [/Listing]} +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Executing \'93{\rtlch\ltrch\dbch\hich\i\b\loch\i\b ws_helper}\'94 with the {\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\loch\f3\fs20 -i} and {\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\loch\f3\fs20 -b} options as above will produce two files : {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b user_service_intf_imp.pas} and {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b user_service_intf_binder.pas}} +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ab\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\b\loch\f3\fs20\lang1033\b {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b [Listing ws_helper execution session]} +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\loch\f3\fs20\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ws_helper\\ws_helper.exe -i -b -o. user_service_intf.pas} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ws_helper, Web Service Toolkit 0.4 Copyright (c) 2006, 2007 by Inoussa OUEDRAOGO} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Parsing the file : {\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\loch\f3\fs20 user_service_intf.pas}} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Proxy file generation...} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Binder file generation...} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Implementation file generation...} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Metadata file generation...} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 File "{\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\loch\f3\fs20 user_service_intf.pas}" parsed succesfully..} +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ab\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\b\loch\f3\fs20\lang1033\b {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b [/Listing]} +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The {\chcbpat4\rtlch\ltrch\dbch\hich\f4\fs20\b\loch\f4\fs20\b user_service_intf_imp.pas} unit contains a skeleton implementation class for the interface. It defines a procedure named {\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\loch\f3\fs20 RegisterUserServiceImplementationFactory}. The procedure registers the class as the service implementation provider in the implement +ation registry.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ab\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\b\loch\f3\fs20\lang1033\b {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b [code]} +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\loch\f3\fs20\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Unit user_service_intf_imp;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 \{$IFDEF FPC\} \{$mode objfpc\}\{$H+\} \{$ENDIF\}} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Interface} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Uses SysUtils, Classes, } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 base_service_intf, server_service_intf, server_service_imputils,} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 user_service_intf, cursor_intf;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Type} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 \{ TUserService_ServiceImp \}} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 TUserService_ServiceImp=class(TBaseServiceImplementation,UserService)} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Protected} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 function GetList():TUserArray;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 procedure Add(} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Const AUser : TUser} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 );} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 procedure Update(} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Const AUser : TUser} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 );} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 function Find(} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Const AName : string} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ):TUser;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 function Delete(} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Const AName : string} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ):boolean;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 End;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 procedure RegisterUserServiceImplementationFactory();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Implementation} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 (...)} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 procedure TUserService_ServiceImp.Add(Const AUser : TUser);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 var} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 locObj : TUser;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Begin} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 locObj := Find(AUser.UserName);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 if ( locObj <> nil ) then} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 raise Exception.CreateFmt('Duplicated user : "%s"',[AUser.UserName]);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 locObj := TUser.Create();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 locObj.Assign(AUser);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 FUserList.Add(locObj);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 End; } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 procedure RegisterUserServiceImplementationFactory();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Begin} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 GetServiceImplementationRegistry().Register(} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 'UserService',} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 TImplementationFactory.Create(TUserService_ServiceImp) as IServiceImplementationFactory);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 End;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 (...) } +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ab\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\b\loch\f3\fs20\lang1033\b {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b [/code]} +\par \pard\plain \sb240\sa120\keepn\f2\fs23\i\b\f9\fs23\i\b\fs23\i\b\qj \ltrpar\s7\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\rtlch\afs23\lang255\ai\ab\ltrch\dbch\af9\langfe255\hich\f2\fs23\lang1033\i\b\loch\f2\fs23\lang1033\i\b +\par \pard\plain \sb240\sa120\keepn\f2\fs23\i\b\f9\fs23\i\b\fs23\i\b\qj \ltrpar\s7\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs23\lang255\ai\ab\ltrch\dbch\af9\langfe255\hich\f2\fs23\lang1033\i\b\loch\f2\fs23\lang1033\i\b {\rtlch \ltrch\loch\f2\fs23\lang1033\i\b Providing a binder for the service.} +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The binder's role is to:} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10132\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls10\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 unpack the incoming message,} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10132\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls10\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 set up the call stack,} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10132\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls10\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 make the call against the registered implementation,} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10132\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls10\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 serialize the execution stack to create the return message.} +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The {\ltrch\hich\f6\loch\f6 user_service_intf_binder.pas} unit generated by {\rtlch\ltrch\dbch\hich\i\b\loch\i\b ws_helper}, contains :} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \'95\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls9\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0{\ltrch\hich\f4\loch\f4 TUserService_ServiceBinder}}{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 : the actual binder class,} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \'95\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls9\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0{\ltrch\hich\f6\loch\f6 TUserService_ServiceBinderFactory}}{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 a factory class for the binder and} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \'95\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls9\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0{\ltrch\hich\f6\loch\f6 Server_service_RegisterUserServiceService}}{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 : the binder factory registration procedure.} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \'95\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The following code extract shows the unit interface part and a method handler of the binder.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ab\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\b\loch\f3\fs20\lang1033\b {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b [Code part of {\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\b\loch\f3\fs20\b user_service_intf_binder}.pas]} +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\loch\f3\fs20\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 unit user_service_intf_binder;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 \{$IFDEF FPC\} \{$mode objfpc\}\{$H+\} \{$ENDIF\}} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 interface} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 uses SysUtils, Classes, base_service_intf, server_service_intf, user_service_intf;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 type} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 TUserService_ServiceBinder=class(TBaseServiceBinder)} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Protected} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 procedure GetListHandler(AFormatter:IFormatterResponse);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 procedure AddHandler(AFormatter:IFormatterResponse);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 procedure UpdateHandler(AFormatter:IFormatterResponse);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 procedure FindHandler(AFormatter:IFormatterResponse);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 procedure DeleteHandler(AFormatter:IFormatterResponse);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Public} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 constructor Create();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 End;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 TUserService_ServiceBinderFactory = class(TInterfacedObject,IItemFactory)} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 protected} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 function CreateInstance():IInterface;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 End;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 procedure Server_service_RegisterUserServiceService();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 (...)} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 procedure TUserService_ServiceBinder.AddHandler(AFormatter:IFormatterResponse);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Var} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 cllCntrl : ICallControl;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 tmpObj : UserService;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 callCtx : ICallContext;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 strPrmName : string;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 procName,trgName : string;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 AUser : TUser;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Begin} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 callCtx := GetCallContext();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 TObject(AUser) := Nil;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 strPrmName := 'AUser'; AFormatter.Get(TypeInfo(TUser),strPrmName,AUser);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 If Assigned(Pointer(AUser)) Then} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 callCtx.AddObjectToFree(TObject(AUser));} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 tmpObj := Self.GetFactory().CreateInstance() as UserService;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 if Supports(tmpObj,ICallControl,cllCntrl) then} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 cllCntrl.SetCallContext(GetCallContext());} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 tmpObj.Add(AUser);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 procName := AFormatter.GetCallProcedureName();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 trgName := AFormatter.GetCallTarget();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 AFormatter.Clear();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 AFormatter.BeginCallResponse(procName,trgName);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 AFormatter.EndCallResponse();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 callCtx := Nil;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 End;} +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ab\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\b\loch\f3\fs20\lang1033\b {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b [/Code]} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \sb240\sa120\keepn\f2\fs23\i\b\f9\fs23\i\b\fs23\i\b \ltrpar\s7\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs23\lang255\ai\ab\ltrch\dbch\af9\langfe255\hich\f2\fs23\lang1033\i\b\loch\f2\fs23\lang1033\i\b {\rtlch \ltrch\loch\f2\fs23\lang1033\i\b Host the service into an application server.} +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The application server's role is to route incoming service requests to the Web Service Toolkit runtime. For the runtime to process service requests :} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10004\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls8\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The services and their implementations have to be registered ,} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10004\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls8\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The message protocol (SOAP, binary,...) have to be registered. } +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10004\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The runtime interface is defined in the {\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\b\loch\f3\fs20\b server_service_intf} unit. This unit contains :} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10004\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls7\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0{\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b GetServerServiceRegistry}}{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 , which returns the service registry,} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10004\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls7\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0{\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b GetServiceImplementationRegistry}}{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 which returns the service implementation registry,} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10004\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls7\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0{\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b GetFormatterRegistry}}{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 which returns the message format registry and} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10004\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls7\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0{\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b HandleServiceRequest}}{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 which is the unique entry point for request processing.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The toolkit is provided with a simple TCP server ( using {\rtlch\ltrch\dbch\hich\b\loch\b Synapse} components ) hosting the sample {\rtlch\ltrch\dbch\hich\i\b\loch\i\b UserService} service defined early in this document and located in the {\rtlch\ltrch\dbch\hich\f6\i\loch\f6\i \\samples\\tcp_server} folder. The complete source files of the sample is in that directory + and the client application in the {\rtlch\ltrch\dbch\hich\f6\i\loch\f6\i \\samples\\user_client_console} sub folder. The registrations are done in the application main routine as printed above:} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ab\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\b\loch\f3\fs20\lang1033\b {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b [Code]} +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\loch\f3\fs20\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 program tcp_server;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 \{$INCLUDE wst.inc\}} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 uses} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Classes, SysUtils,} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 base_service_intf, server_service_soap,} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 base_binary_formatter, server_binary_formatter,} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 metadata_service, metadata_service_imp, metadata_service_binder,} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 synapse_tcp_server,} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 user_service_intf, user_service_intf_binder, user_service_intf_imp , imp_helper;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 var} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 listnerThread : TServerListnerThread;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 begin} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 SetLogger(TConsoleLogger.Create());} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Server_service_RegisterBinaryFormat();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Server_service_RegisterSoapFormat();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Server_service_RegisterWSTMetadataServiceService();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 RegisterWSTMetadataServiceImplementationFactory();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Server_service_RegisterUserServiceService();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 RegisterUserServiceImplementationFactory();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Logger().Log('WST sample TCP Server listning on "%s"',[sSERVER_PORT]);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Logger().Log('Hit to stop.');} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 listnerThread := TServerListnerThread.Create();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ReadLn;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 end. } +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ab\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\b\loch\f3\fs20\lang1033\b {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b [/Code]} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0{\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b Server_service_RegisterUserServiceService}}{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 located in the {\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\b\loch\f3\fs20\b user_service_intf_binder} unit ( generated by {\rtlch\ltrch\dbch\hich\f4\i\b\loch\f4\i\b ws_helper} ) registers the {\rtlch\ltrch\dbch\hich\i\b\loch\i\b UserService} service by calling in turn {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b GetServerServiceRegistry:}} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ab\ltrch\dbch\af8\langfe255\hich\f4\fs24\lang1033\b\loch\f4\fs24\lang1033\b +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ab\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\b\loch\f3\fs20\lang1033\b {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b [Code located in user_service_intf_binder.pas]} +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\loch\f3\fs20\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 procedure Server_service_RegisterUserServiceService();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Begin} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 GetServerServiceRegistry().Register(} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 'UserService',TUserService_ServiceBinderFactory.Create() as IitemFactory} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 );} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 End; } +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ab\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\b\loch\f3\fs20\lang1033\b {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b [Code]} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0{\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b RegisterUserServiceImplementationFactory}}{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 located in the {\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\b\loch\f3\fs20\b user_service_intf_imp} unit ( generated by {\rtlch\ltrch\dbch\hich\i\b\loch\i\b ws_helper} ) registers the {\rtlch\ltrch\dbch\hich\i\b\loch\i\b UserService} implementation by calling in turn {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b GetServiceImplementationRegistry:}} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ab\ltrch\dbch\af8\langfe255\hich\f4\fs24\lang1033\b\loch\f4\fs24\lang1033\b +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ab\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\b\loch\f3\fs20\lang1033\b {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b [Code located in user_service_intf_imp.pas]} +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\loch\f3\fs20\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 procedure RegisterUserServiceImplementationFactory();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Begin} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 GetServiceImplementationRegistry().Register(} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 'UserService',TImplementationFactory.Create(TUserService_ServiceImp) as IServiceImplementationFactory);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 End;} +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ab\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\b\loch\f3\fs20\lang1033\b {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b [Code]} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0{\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b Server_service_RegisterSoapFormat}}{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 located in the {\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\b\loch\f3\fs20\b server_service_soap} unit ( provided by the toolkit ) registers the {\rtlch\ltrch\dbch\hich\i\b\loch\i\b SOAP} implementation by calling in turn {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b GetFormatterRegistry:}} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ab\ltrch\dbch\af8\langfe255\hich\f4\fs24\lang1033\b\loch\f4\fs24\lang1033\b +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ab\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\b\loch\f3\fs20\lang1033\b {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b [Code located in server_service_soap.pas]} +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\loch\f3\fs20\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 procedure Server_service_RegisterSoapFormat();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 begin} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 GetFormatterRegistry().Register(} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 sSOAP_CONTENT_TYPE,} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 TSimpleItemFactory.Create(TSOAPFormatter) as IitemFactory} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 );} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 RegisterStdTypes();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 end;} +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ab\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\b\loch\f3\fs20\lang1033\b {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b [Code]} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0{\ltrch\hich\f4\loch\f4 Server_service_RegisterBinaryFormat}}{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 located in the {\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\b\loch\f3\fs20\b server_binary_formatter} unit ( provided by the toolkit ) registers the {\rtlch\ltrch\dbch\hich\i\b\loch\i\b Binary message} implementation by calling in turn {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b GetFormatterRegistry:}} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ab\ltrch\dbch\af8\langfe255\hich\f4\fs24\lang1033\b\loch\f4\fs24\lang1033\b +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ab\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\b\loch\f3\fs20\lang1033\b {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b [Code located in server_binary_formatter.pas]} +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\loch\f3\fs20\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 procedure Server_service_RegisterBinaryFormat();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 begin} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 GetFormatterRegistry().Register(} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 sCONTENT_TYPE,} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 TBinaryFormatterFactory.Create() as IitemFactory} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 );} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 end;} +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ab\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\b\loch\f3\fs20\lang1033\b {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b [Code]} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Incoming requests are processed in the client thread {\ltrch\hich\f6\loch\f6 TClientHandlerThread.Execute()} method (located in the {\ltrch\hich\f6\loch\f6 synapse_tcp_server.pas} file) invoking the {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b HandleServiceRequest()} method.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ab\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\b\loch\f3\fs20\lang1033\b {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b [Code file = {\ltrch\hich\f6\loch\f6 synapse_tcp_server.pas}]} +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\loch\f3\fs20\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 procedure TClientHandlerThread.Execute();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 var} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 wrtr : IDataStore;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 rdr : IDataStoreReader;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 buff, trgt,ctntyp : string;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 rqst : IRequestBuffer;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 i : PtrUInt;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 begin} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 FInputStream := TMemoryStream.Create();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 FOutputStream := TMemoryStream.Create();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 FSocketObject := TTCPBlockSocket.Create();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 try} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 FSocketObject.RaiseExcept := True;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 try} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 FSocketObject.Socket := FSocketHandle;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 FSocketObject.GetSins();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 while not Terminated do begin} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 FOutputStream.Size := 0;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 if ( ReadInputBuffer() >= SizeOf(LongInt) ) then begin} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 rdr := CreateBinaryReader(FInputStream);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 trgt := rdr.ReadStr();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ctntyp := rdr.ReadStr();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 buff := rdr.ReadStr();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 rdr := nil;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 FInputStream.Size := 0;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 FInputStream.Write(buff[1],Length(buff));} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 FInputStream.Position := 0;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 rqst := TRequestBuffer.Create(trgt,ctntyp,FInputStream,FOutputStream);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 HandleServiceRequest(rqst);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 i := FOutputStream.Size;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 SetLength(buff,i);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 FOutputStream.Position := 0;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 FOutputStream.Read(buff[1],i);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 FOutputStream.Size := 0;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 wrtr := CreateBinaryWriter(FOutputStream);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 wrtr.WriteStr(buff);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 SendOutputBuffer();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ClearBuffers();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 end;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 end;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 except} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 on e : Exception do begin} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Logger().Log('Error : ThreadID = %d; Message = %s',[Self.ThreadID,e.Message]);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 end;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 end;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 finally} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 FreeAndNil(FSocketObject);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 end;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 end;} +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ab\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\b\loch\f3\fs20\lang1033\b {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b [/Code]} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 In order to give it a try one have to :} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\tx2550 1.\tab}\ilvl0 \ltrpar\s1\cf0\tx2550{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls6\aspalpha\li720\ri0\lin720\rin0\fi-360\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 compile the server ( {\ltrch\hich\f6\loch\f6 \\samples\\tcp_server\\tcp_server.lpi} it is a console program),} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360 2.\tab}\ilvl0 \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls6\aspalpha\li720\ri0\lin720\rin0\fi-360\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 compile the client application ( {\ltrch\hich\f6\loch\f6 \\samples\\user_client_console\\user_client_console.lpi} ),} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360 3.\tab}\ilvl0 \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls6\aspalpha\li720\ri0\lin720\rin0\fi-360\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 execute the server and start listening,} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360 4.\tab}\ilvl0 \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls6\aspalpha\li720\ri0\lin720\rin0\fi-360\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 execute the client.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \sb240\sa120\keepn\f2\fs28\b\f9\fs28\b\fs28\b \ltrpar\s6\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs28\lang255\ab\ltrch\dbch\af9\langfe255\hich\f2\fs28\lang1033\b\loch\f2\fs28\lang1033\b {\rtlch \ltrch\loch\f2\fs28\lang1033\i0\b WSDL generation.} +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Services in the toolkit are organized into {\rtlch\ltrch\dbch\hich\i\b\loch\i\b meta data repositories}. Conceptually a repository corresponds :} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u57354\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls5\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 at compile time to the pascal unit containing the service definition} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u57354\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls5\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 at runtime to a name space. } +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The repository is the toolkit WSDL generation unit.} +\par \pard\plain \sb240\sa120\keepn\f2\fs23\i\b\f9\fs23\i\b\fs23\i\b \ltrpar\s7\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs23\lang255\ai\ab\ltrch\dbch\af9\langfe255\hich\f2\fs23\lang1033\i\b\loch\f2\fs23\lang1033\i\b {\rtlch \ltrch\loch\f2\fs23\lang1033\i\b The Meta data Service.} +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The toolkit is provided with an easy to use metadata service implementation which in turn uses the raw interface defined in the {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b metadata_repository} unit (see above). A Lazarus GUI client application is located in the {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b tests\\metadata_browser} folder.} +\par \pard\plain \sb240\sa120\keepn\f2\fs23\i\b\f9\fs23\i\b\fs23\i\b \ltrpar\s7\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs23\lang255\ai\ab\ltrch\dbch\af9\langfe255\hich\f2\fs23\lang1033\i\b\loch\f2\fs23\lang1033\i\b {\rtlch \ltrch\loch\f2\fs23\lang1033\i\b WSDL generation API.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b metadata_wsdl} pascal unit contains the {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b GenerateWSDL} function for WSDL generation from a repository (see the signature below). } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\loch\f3\fs20\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 PServiceRepository = ^TServiceRepository;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 TServiceRepository = record} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 NameSpace : ShortString;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Name : ShortString;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 RootAddress : ShortString;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ServicesCount : Byte;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Services : PService;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 end;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 procedure GenerateWSDL(AMdtdRep : PServiceRepository; ADoc : TDOMDocument);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \sb240\sa120\keepn\f2\fs23\b\f9\fs23\b\fs23\b \ltrpar\s8\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs23\lang255\ab\ltrch\dbch\af9\langfe255\hich\f2\fs23\lang1033\b\loch\f2\fs23\lang1033\b {\rtlch \ltrch\loch\f2\fs23\lang1033\i0\b WSDL Customization.} +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The WSDL generation is based on the {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b IWsdlTypeHandler} and the {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b IWsdlTypeHandlerRegistry} interfaces located in the {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b metadata_wsdl} unit. In order to customize the generated WSDL, one has to provide a class implementing the {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b IWsdlTypeHandler} interface. Then that + class has to be registered in the registry. The {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b metadata_wsdl} unit contains implementations for pascal enumerations, {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b TBaseComplexRemotable} descendants, and {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b TBaseArrayRemotable} descendants.} +\par \pard\plain \sb240\sa120\keepn\f2\fs23\i\b\f9\fs23\i\b\fs23\i\b \ltrpar\s7\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs23\lang255\ai\ab\ltrch\dbch\af9\langfe255\hich\f2\fs23\lang1033\i\b\loch\f2\fs23\lang1033\i\b {\rtlch \ltrch\loch\f2\fs23\lang1033\i\b Sample} +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 A functional sample project is located under {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b \\samples\\http_server} . It is an Indy based http server.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \sb240\sa120\keepn\f2\fs28\b\f9\fs28\b\fs28\b \ltrpar\s6\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs28\lang255\ab\ltrch\dbch\af9\langfe255\hich\f2\fs28\lang1033\b\loch\f2\fs28\lang1033\b {\rtlch \ltrch\loch\f2\fs28\lang1033\i0\b Services Extensions \'96 Server side} +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Services extensions provide a mean to hook into all the services request processing stages. Services extensions may be used, for example, to implement authentication, request logging, data compression, etc.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The IServiceExtension below is the interface used by the toolkit runtime to call services extensions.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\loch\f3\fs20\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 TMessageStage = (} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 msAfterDeserialize, msAfterSerialize, msBeforeDeserialize, msBeforeSerialize} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 );} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 IServiceExtension = interface} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ['\{E192E6B3-7932-4D44-A8AC-135D7A0B8C93\}']} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 procedure ProcessMessage(} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 const AMessageStage : TMessageStage;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ACallContext : ICallContext;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 AMsgData : IInterface} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 );} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\chcbpat4\rtlch\ltrch\dbch\hich\loch{\rtlch \ltrch\loch }}{\chcbpat4{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 end;}}{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 } +\par \pard\plain \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sa120\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s2\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sa120\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The "{\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b AMsgData}" parameter actual type depends on the message processing state and corresponds to :} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\sa120\qj\f5\fs18\f5\fs18\f5\fs18 \u57354\'3f\tab}\ilvl0 \ltrpar\s2\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls4\aspalpha\li720\ri0\lin720\rin0\fi-360\sa120\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0{\ltrch\hich\f4\loch\f4 IRequestBuffer}}{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 on "{\ltrch\hich\f4\loch\f4 msBeforeDeserialize}" and "{\ltrch\hich\f4\loch\f4 msAfterSerialize}"} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\sa120\qj\f5\fs18\f5\fs18\f5\fs18 \u57354\'3f\tab}\ilvl0 \ltrpar\s2\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls4\aspalpha\li720\ri0\lin720\rin0\fi-360\sa120\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0{\ltrch\hich\f4\loch\f4 IFormatterResponse}}{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 on "{\ltrch\hich\f4\loch\f4 msAfterDeserialize}" and "{\ltrch\hich\f4\loch\f4 msBeforeSerialize}" } +\par \pard\plain \ltrpar\s2\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sa120\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 These types are located in the {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b server_service_intf} unit. Extensions have to be registered in the extensions registry ( located in the {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b server_service_intf unit }) printed below :} +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\loch\f3\fs20\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 IServiceExtensionRegistry = Interface} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ['\{68DC78F1-E6CF-4D6B-8473-75288794769C\}']} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 function Find(const AName : string):IServiceExtension;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 procedure Register(} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 const AName : string;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 AFactory : IItemFactory} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 );} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 end;} +\par \pard\plain \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sa120\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s2\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sa120\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 In order for an service implementation to use a service extension, it has to register himself to that extension. To that end, the {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b IServiceImplementationFactory} interface provides the {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b RegisterExtension} method. A complete sample is included in the {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b \\samples\\h +ttp_server}{\rtlch\ltrch\dbch\hich\b\loch\b\rtlch\ltrch\dbch\hich\b\loch\b }sample ( implemented in {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b \\samples\\logger_extension.pas} ).} +\par \page\pard\plain \sb240\sa120\keepn\f2\fs28\i\b\f9\fs28\i\b\fs28\i\b \ltrpar\s5\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs28\lang255\ai\ab\ltrch\dbch\af9\langfe255\hich\f2\fs28\lang1033\i\b\loch\f2\fs28\lang1033\i\b {\rtlch \ltrch\loch\f2\fs28\lang1033\i\b Services meta data.} +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Services in the toolkit are organized into {\rtlch\ltrch\dbch\hich\i\b\loch\i\b meta data repositories( see the \'93services's meta data\'94 below )}. Conceptually a repository corresponds :} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u57354\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls5\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 at compile time to the pascal unit containing the service definition} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u57354\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls5\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 at runtime to a name space. } +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The {\rtlch\ltrch\dbch\hich\f4\i\b\loch\f4\i\b ws_helper} tool, when parsing the interface definition file, records the meta data of the services contained in the file to a resource file. The resource file is then embedded into the generated binder's unit file( see the unit \'93initialization\'94 part ). +At runtime the service's recorded meta data are accessible through the interface {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b IModuleMetadataMngr} defined in the {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b metadata_repository} unit ( see below ). The {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b GetModuleMetadataMngr} function defined in the same unit returns an instance of an object support +ing that interface.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\loch\f3\fs20\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 IModuleMetadataMngr = interface} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ['\{B10ACF6A-A599-45A3-B083-BEEFB810C889\}']} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 function IndexOfName(const ARepName : shortstring):Integer;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 function GetCount():Integer;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 function GetRepositoryName(const AIndex : Integer):shortstring;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 procedure SetRepositoryNameSpace(const ARepName,ANameSpace : shortstring);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 function LoadRepositoryName(} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 const ARepName,ARootAddress : shortstring;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 out ARepository : PServiceRepository} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ):Integer;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 procedure ClearRepository(var ARepository : PServiceRepository);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 procedure SetServiceCustomData(} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 const ARepName : shortstring;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 const AServiceName : shortstring;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 const ADataName,} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 AData : string} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 );} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 procedure SetOperationCustomData(} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 const ARepName : shortstring;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 const AServiceName : shortstring;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 const AOperationName : shortstring;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 const ADataName,} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 AData : string} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 );} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 //---------------------------------} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 function GetServiceMetadata(const ARepName,AServiceName : shortstring) : PService;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 procedure ClearServiceMetadata(var AService : PService);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\chcbpat4\rtlch\ltrch\dbch\hich\loch{\rtlch \ltrch\loch }}{\chcbpat4{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 end;}}{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \sb240\sa120\keepn\f2\fs28\b\f9\fs28\b\fs28\b \ltrpar\s6\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs28\lang255\ab\ltrch\dbch\af9\langfe255\hich\f2\fs28\lang1033\b\loch\f2\fs28\lang1033\b {\rtlch \ltrch\loch\f2\fs28\lang1033\i0\b Extended Meta data.} +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The meta data interface provides a way to add custom data to recorded ones. Services's metadata can be set through {\rtlch\ltrch\dbch\hich\f3\fs20\loch\f3\fs20 SetServiceCustomData, }operation's metadata be set through the {\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\b\loch\f3\fs20\b SetOperationCustomData} method.} +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 A repository's extended meta data has to be registered after the service meta data recorded in the resource file have been registered. So for client application the generated proxy unit contains a conditional code fragment to call a registration procedure +like showed below for the eBay sample located in the {\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\b\loch\f3\fs20\b tests\\ebay} folder. The procedure name is obtained from the interface unit name ( the repository's name ) : {\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\loch\f3\fs20 Register_}{\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\b\loch\f3\fs20\b %UNIT_NAME%}{\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\loch\f3\fs20 _ServiceMetadata} . } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\loch\f3\fs20\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 initialization} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 \{$i ebay.wst\}} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 \{$IF DECLARED(Register_ebay_ServiceMetadata)\}} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Register_ebay_ServiceMetadata();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 \{$ENDIF\}} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 End. } +\par \pard\plain \sb240\sa120\keepn\f2\fs28\i\b\f9\fs28\i\b\fs28\i\b \ltrpar\s5\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs28\lang255\ai\ab\ltrch\dbch\af9\langfe255\hich\f2\fs28\lang1033\i\b\loch\f2\fs28\lang1033\i\b +\par \page\pard\plain \sb240\sa120\keepn\f2\fs28\i\b\f9\fs28\i\b\fs28\i\b \ltrpar\s5\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs28\lang255\ai\ab\ltrch\dbch\af9\langfe255\hich\f2\fs28\lang1033\i\b\loch\f2\fs28\lang1033\i\b {\rtlch \ltrch\loch\f2\fs28\lang1033\i\b Headers support.} +\par \pard\plain \sb240\sa120\keepn\f2\fs28\b\f9\fs28\b\fs28\b \ltrpar\s6\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs28\lang255\ab\ltrch\dbch\af9\langfe255\hich\f2\fs28\lang1033\b\loch\f2\fs28\lang1033\b {\rtlch \ltrch\loch\f2\fs28\lang1033\i0\b The THeaderBlock class } +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\loch\f3\fs20\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 THeaderBlock = class(TBaseComplexRemotable)} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 public} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 property Direction : THeaderDirection read FDirection write FDirection;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 property Understood : Boolean read FUnderstood write FUnderstood;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 published} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 property mustUnderstand : Integer read FmustUnderstand write SetmustUnderstand } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 stored HasmustUnderstand;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 end;} +\par \pard\plain \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sa120\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s2\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sa120\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b TheaderBlock} showed above ( the private part has been omitted for brevity), located in the {\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\b\loch\f3\fs20\b base_service_intf} unit, is the root class all header classes are derived from.. The {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b Direction} property indicate whether it is an incoming header or an outgoin +g one. The {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b mustUnderstand} property define whether the header is a mandatory one.} +\par \pard\plain \sb240\sa120\keepn\f2\fs28\b\f9\fs28\b\fs28\b \ltrpar\s6\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs28\lang255\ab\ltrch\dbch\af9\langfe255\hich\f2\fs28\lang1033\b\loch\f2\fs28\lang1033\b {\rtlch \ltrch\loch\f2\fs28\lang1033\i0\b Defining header class.} +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Soap headers are derived from the THeaderBlock base class located in the {\rtlch\ltrch\dbch\hich\f3\fs20\b\loch\f3\fs20\b base_service_intf} unit. They have to be registered in the type registry. Below is reproduced an header example extracted from the {\rtlch\ltrch\dbch\hich\b\loch\b \'93calculator\'94} sample project located the {\ltrch\hich\f6\loch\f6 tests\\calcula +tor}.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\loch\f3\fs20\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 TCalcHeader = class(THeaderBlock)} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 published} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 property Login : string read FLogin write FLogin;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 property Password : string read FPassword write FPassword;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 property WantedPrecision : Integer read FWantedPrecision write FWantedPrecision;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 end; } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \sb240\sa120\keepn\f2\fs28\b\f9\fs28\b\fs28\b \ltrpar\s6\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs28\lang255\ab\ltrch\dbch\af9\langfe255\hich\f2\fs28\lang1033\b\loch\f2\fs28\lang1033\b {\rtlch \ltrch\loch\f2\fs28\lang1033\i0\b The ICallContext interface.} +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\loch\f3\fs20\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ICallContext = Interface} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ['\{855EB8E2-0700-45B1-B852-2101023200E0\}']} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 procedure AddObjectToFree(const AObject : TObject);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 procedure Clear();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 function AddHeader(} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 const AHeader : THeaderBlock;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 const AKeepOwnership : Boolean} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ):Integer;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 function GetHeaderCount(const ADirections : THeaderDirections):Integer;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 function GetHeader(const AIndex : Integer) : THeaderBlock;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 procedure ClearHeaders(const ADirection : THeaderDirection);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 End; } +\par \pard\plain \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sa120\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s2\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sa120\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The ICallContext interface defined in the {\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\b\loch\f3\fs20\b base_service_intf} unit represents the service call context. The {\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\loch\f3\fs20 AddHeader} method allows headers sending while the {\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\loch\f3\fs20 GetHeader} method retrieves header in the call context.} +\par \pard\plain \sb240\sa120\keepn\f2\fs28\b\f9\fs28\b\fs28\b \ltrpar\s6\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs28\lang255\ab\ltrch\dbch\af9\langfe255\hich\f2\fs28\lang1033\b\loch\f2\fs28\lang1033\b {\rtlch \ltrch\loch\f2\fs28\lang1033\i0\b Client side headers.} +\par \pard\plain \ltrpar\s2\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sa120\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 An {\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\loch\f3\fs20 ICallContext} reference may be obtained from the current service proxy instance simply by querying it for that interface as showed in the code fragment below extracted from the {\rtlch\ltrch\dbch\hich\b\loch\b \'93calculator\'94} client example project.} +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\loch\f3\fs20\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 var} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ch : TCalcHeader;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 hdrs : ICallContext;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 begin} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 FObj := TCalculator_Proxy.Create('Calculator', edtFormat.Text, edtAddress.Text);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ch := TCalcHeader.Create();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ch.mustUnderstand := 1;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ch.Login := 'azerty';} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ch.Password := 'qwerty';} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ch.WantedPrecision := 121076;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 hdrs := FObj as ICallContext;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 hdrs.AddHeader(ch,true);} +\par \pard\plain \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sa120\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s2\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sa120\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 A header may be made mandatory by setting its {\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\loch\f3\fs20 mustUnderstand} property to 1 as in the code above.} +\par \pard\plain \sb240\sa120\keepn\f2\fs28\b\f9\fs28\b\fs28\b \ltrpar\s6\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs28\lang255\ab\ltrch\dbch\af9\langfe255\hich\f2\fs28\lang1033\b\loch\f2\fs28\lang1033\b {\rtlch \ltrch\loch\f2\fs28\lang1033\i0\b Server side headers.} +\par \pard\plain \sb240\sa120\keepn\f2\fs23\i\b\f9\fs23\i\b\fs23\i\b \ltrpar\s7\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs23\lang255\ai\ab\ltrch\dbch\af9\langfe255\hich\f2\fs23\lang1033\i\b\loch\f2\fs23\lang1033\i\b {\rtlch \ltrch\loch\f2\fs23\lang1033\i\b The ICallControl interface.} +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\loch\f3\fs20\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ICallControl = interface} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ['\{7B4B7192-EE96-4B52-92C7-AE855FBC31E7\}']} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 procedure SetCallContext(ACallContext : ICallContext);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 function GetCallContext():ICallContext;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 end;} +\par \pard\plain \ltrpar\s2\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sa120\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sa120\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The {\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\b\loch\f3\fs20\b ICallControl} interface, located in the {\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\b\loch\f3\fs20\b server_service_intf} unit, is used by the toolkit runtime to share the executing call environment with service implementation classes. When the runtime is about to issue a call against a implementation class insta +nce, it queries that instance for ICallControl interface support; If the implementation has ICallControl interface support then the obtained reference is used to set the call context through the {\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\loch\f3\fs20 SetCallContext} method. The implementation instance can then a +ccess the call context by calling the {\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\loch\f3\fs20 GetCallContex} method.} +\par \pard\plain \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sa120\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The toolkit provides the {\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\b\loch\f3\fs20\b TBaseServiceImplementation} class which has support for the ICallControl interface and can be used as a base implementation class. It is the base class used by the {\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\i\b\loch\f3\fs20\i\b ws_helpe}{\rtlch\ltrch\dbch\hich\i\b\loch\i\b r} generated skeleton implementation class when invoked the + {\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\b\loch\f3\fs20\b -i }command line option.} +\par \pard\plain \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sa120\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The method printed below, extracted from the {\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\b\loch\f3\fs20\b calculator} sample service demonstrates the access to headers for read and write.} +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\loch\f3\fs20\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 function TCalculator_ServiceImp.AddInt(} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Const A : Integer;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Const B : Integer} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ):TBinaryArgsResult;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 var} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 hdr : TCalcResultHeader;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 h : TCalcHeader;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 cc : ICallContext;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Begin} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 hdr := TCalcResultHeader.Create();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 cc := GetCallContext();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 if Assigned(cc) and ( cc.GetHeaderCount([hdIn]) > 0 ) and ( cc.GetHeader(0).InheritsFrom(TCalcHeader) ) then begin} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 h := cc.GetHeader(0) as TCalcHeader;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 h.Understood := True;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 hdr.Assign(h);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 end;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 hdr.TimeStamp := DateTimeToStr(Now());} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 hdr.SessionID := 'testSession';} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 cc.AddHeader(hdr,True);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 hdr := nil;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Result := TBinaryArgsResult.Create();} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Try} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Result.Arg_OP := '+';} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Result.Arg_OpEnum := coAdd;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Result.Arg_A := A;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Result.Arg_B := B;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Result.Arg_R := A + B;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Result.Comment := 'Doing an + operation';} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Except} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 FreeAndNil(Result);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Raise;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 End;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 End; } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sa120\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \page\pard\plain \sb240\sa120\keepn\f2\fs28\i\b\f9\fs28\i\b\fs28\i\b \ltrpar\s5\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs28\lang255\ai\ab\ltrch\dbch\af9\langfe255\hich\f2\fs28\lang1033\i\b\loch\f2\fs28\lang1033\i\b {\rtlch \ltrch\loch\f2\fs28\lang1033\i\b SOAP Specific.} +\par \pard\plain \sb240\sa120\keepn\f2\fs28\b\f9\fs28\b\fs28\b \ltrpar\s6\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs28\lang255\ab\ltrch\dbch\af9\langfe255\hich\f2\fs28\lang1033\b\loch\f2\fs28\lang1033\b {\rtlch \ltrch\loch\f2\fs28\lang1033\i0\b Binding style.} +\par \pard\plain \ltrpar\s2\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sa120\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The binding style is used to indicate whether the service is {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b \'93RPC\'94} oriented or {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b \'93Document\'94} oriented.} +\par \pard\plain \sb240\sa120\keepn\f2\fs23\i\b\f9\fs23\i\b\fs23\i\b \ltrpar\s7\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs23\lang255\ai\ab\ltrch\dbch\af9\langfe255\hich\f2\fs23\lang1033\i\b\loch\f2\fs23\lang1033\i\b {\rtlch \ltrch\loch\f2\fs23\lang1033\i\b Client side.} +\par \pard\plain \ltrpar\s2\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sa120\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The binding style may be specified in the SOAP protocol string on the creation of a service proxy. The default value for the binding style is \'93RPC\'94. Below is printed a sample code that demonstrates the use of \'93Document\'94 style.} +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\loch\f3\fs20\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 locService := TSampleService_Proxy.Create(} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 'SampleService',} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0{\rtlch\ltrch\dbch\hich\b\loch\b 'SOAP:Style=Document;EncodingStyle=Litteral'}}{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ,} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 'http:address=http://127.0.0.1/services/SampleService'} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 ); } +\par \pard\plain \sb240\sa120\keepn\f2\fs23\i\b\f9\fs23\i\b\fs23\i\b \ltrpar\s7\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs23\lang255\ai\ab\ltrch\dbch\af9\langfe255\hich\f2\fs23\lang1033\i\b\loch\f2\fs23\lang1033\i\b {\rtlch \ltrch\loch\f2\fs23\lang1033\i\b Server side.} +\par \pard\plain \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sa120\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Currently services created with the toolkit use the \'93RPC\'94 binding style.} +\par \pard\plain \sb240\sa120\keepn\f2\fs28\b\f9\fs28\b\fs28\b \ltrpar\s6\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs28\lang255\ab\ltrch\dbch\af9\langfe255\hich\f2\fs28\lang1033\b\loch\f2\fs28\lang1033\b {\rtlch \ltrch\loch\f2\fs28\lang1033\i0\b Encoding style.} +\par \pard\plain \ltrpar\s2\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sa120\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The encoding style indicates the rules used to encode types in XML. Supported values are {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b \'93Encoded\'94} and {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b \'93Litteral\'94}.} +\par \pard\plain \sb240\sa120\keepn\f2\fs23\i\b\f9\fs23\i\b\fs23\i\b \ltrpar\s7\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs23\lang255\ai\ab\ltrch\dbch\af9\langfe255\hich\f2\fs23\lang1033\i\b\loch\f2\fs23\lang1033\i\b {\rtlch \ltrch\loch\f2\fs23\lang1033\i\b Client side.} +\par \pard\plain \ltrpar\s2\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sa120\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The encoding style may be specified in the SOAP protocol string on the creation of a service proxy. The default value for the encoding style is \'93Encoded\'94. The above sample demonstrates the use of \'93Litteral\'94 style.} +\par \pard\plain \sb240\sa120\keepn\f2\fs23\i\b\f9\fs23\i\b\fs23\i\b \ltrpar\s7\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs23\lang255\ai\ab\ltrch\dbch\af9\langfe255\hich\f2\fs23\lang1033\i\b\loch\f2\fs23\lang1033\i\b {\rtlch \ltrch\loch\f2\fs23\lang1033\i\b Server side.} +\par \pard\plain \ltrpar\s2\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sa120\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Currently services created with the toolkit use the \'93Encoded\'94 encoding style.} +\par \page\pard\plain \sb240\sa120\keepn\f2\fs28\i\b\f9\fs28\i\b\fs28\i\b \ltrpar\s5\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs28\lang255\ai\ab\ltrch\dbch\af9\langfe255\hich\f2\fs28\lang1033\i\b\loch\f2\fs28\lang1033\i\b {\rtlch \ltrch\loch\f2\fs28\lang1033\i\b Provided examples} +\par \pard\plain \ltrpar\s2\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sa120\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The HTTP server side samples has been tested on Windows XP and Ubuntu. The client side has been tested under Windows XP and Ubuntu. The samples are located under the {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b \'93samples\'94 and some under the 'tests'} folder.} +\par \pard\plain \sb240\sa120\keepn\f2\fs28\b\f9\fs28\b\fs28\b \ltrpar\s6\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs28\lang255\ab\ltrch\dbch\af9\langfe255\hich\f2\fs28\lang1033\b\loch\f2\fs28\lang1033\b {\rtlch \ltrch\loch\f2\fs28\lang1033\i0\b Client side examples} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u57354\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls3\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 UserService, {\ltrch\hich\f6\loch\f6 samples\\http_server, samples\\tcp_server, samples\\user_client_console, sample\\library_server} : the client console uses the three client and server protocols (HTTP, TCP, LIBRARY)} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u57354\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls3\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Google sample : It demonstrates use of class and array data types.} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u57354\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls3\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Metadata Browser : This sample demonstrates use of class and array data types and mainly the toolkit metadata service.} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u57354\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls3\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 eBay sample, this sample uses OpenSLL which can be found at {\field{\*\fldinst HYPERLINK "http://www.openssl.org/" }{\fldrslt \*\cs24\cf2\ul\ulc0\rtlch\ltrch\dbch\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 http://www.openssl.org}} and SYNAPSE ( http://www.ararat.cz/synapse/ ).} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u57354\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls3\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0{\ltrch\hich\f6\loch\f6 \\samples\\delphi\\user_client_console}}{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 : Delphi ( compile with Delphi 7) client sample. Used protocol : the TCP, HTTP, LIBRARY; Used format : BINARY. } +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \sb240\sa120\keepn\f2\fs28\b\f9\fs28\b\fs28\b \ltrpar\s6\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs28\lang255\ab\ltrch\dbch\af9\langfe255\hich\f2\fs28\lang1033\b\loch\f2\fs28\lang1033\b {\rtlch \ltrch\loch\f2\fs28\lang1033\i0\b Server side examples} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u57354\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls2\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0{\ltrch\hich\f6\loch\f6 samples\\tcp_server}}{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 : This is a sample TCP server based on the Synapse components. It uses the UserService.} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u57354\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls2\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0{\ltrch\hich\f6\loch\f6 samples\\http_server}}{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 : This is a sample HTTP server based on the Indy10 components. It uses the UserService and the toolkit metadata service. It demonstrates the WSDL generation.} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u57354\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls2\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0{\ltrch\hich\f6\loch\f6 samples\\apache_module}}{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 : Apache module sample, this sample demonstrates the hosting of the toolkit into the Apache HTTP web server. It is based on Sekelsenmat 's Apache headers translation. It uses the UserService service and the toolkit metadata service. +It demonstrates the WSDL generation.} +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \sb240\sa120\keepn\f2\fs28\i\b\f9\fs28\i\b\fs28\i\b \ltrpar\s5\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs28\lang255\ai\ab\ltrch\dbch\af9\langfe255\hich\f2\fs28\lang1033\i\b\loch\f2\fs28\lang1033\i\b {\rtlch \ltrch\loch\f2\fs28\lang1033\i\b Status} +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The toolkit is usable for simple types and for class types. The serialization is designed to allow customization of basic types and class types by implementing classes derived from \'93{\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\loch\f3\fs20 TBaseRemotable}{\chcbpat4 \'94}. This classes have to be registered in the type registry. +} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The toolkit is provide with a SOAP 1.1 message format implementation ( based on the FCL XML units) and a binary one.} +\par \pard\plain \sb240\sa120\keepn\f2\fs28\b\f9\fs28\b\fs28\b \ltrpar\s6\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs28\lang255\ab\ltrch\dbch\af9\langfe255\hich\f2\fs28\lang1033\b\loch\f2\fs28\lang1033\b {\rtlch \ltrch\loch\f2\fs28\lang1033\i0\b Serialization} +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The serialization is based on the {\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\loch\f3\fs20 IFormatterBase} interface located in the {\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\loch\f3\fs20 base_service_intf} unit.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The toolkit has two serializers implementations : the SOAP serializer and a binary serializer.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \sb240\sa120\keepn\f2\fs23\i\b\f9\fs23\i\b\fs23\i\b \ltrpar\s7\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs23\lang255\ai\ab\ltrch\dbch\af9\langfe255\hich\f2\fs23\lang1033\i\b\loch\f2\fs23\lang1033\i\b {\rtlch \ltrch\loch\f2\fs23\lang1033\i\b SOAP serializer} +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The SOAP serializer implements SOAP 1.1. It has support for the following pascal types:} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10004\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Available integers : } +\par \pard\plain {\listtext\pard\plain \li1789\ri0\lin1789\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10146\'3f\tab}\ilvl1 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li1789\ri0\lin1789\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Byte mapped to unsignedByte} +\par \pard\plain {\listtext\pard\plain \li1789\ri0\lin1789\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10146\'3f\tab}\ilvl1 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li1789\ri0\lin1789\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 ShortInt mapped to byte} +\par \pard\plain {\listtext\pard\plain \li1789\ri0\lin1789\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10146\'3f\tab}\ilvl1 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li1789\ri0\lin1789\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 SmallInt mapped to short} +\par \pard\plain {\listtext\pard\plain \li1789\ri0\lin1789\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10146\'3f\tab}\ilvl1 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li1789\ri0\lin1789\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Word mapped to unsignedShort} +\par \pard\plain {\listtext\pard\plain \li1789\ri0\lin1789\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10146\'3f\tab}\ilvl1 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li1789\ri0\lin1789\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 LongInt mapped to int} +\par \pard\plain {\listtext\pard\plain \li1789\ri0\lin1789\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10146\'3f\tab}\ilvl1 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li1789\ri0\lin1789\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 LongWord mapped to unsignedInt} +\par \pard\plain {\listtext\pard\plain \li1789\ri0\lin1789\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10146\'3f\tab}\ilvl1 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li1789\ri0\lin1789\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Int64 mapped to long} +\par \pard\plain {\listtext\pard\plain \li1789\ri0\lin1789\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10146\'3f\tab}\ilvl1 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li1789\ri0\lin1789\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Qword mapped to int} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10004\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 String mapped to string} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10004\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Boolean mapped to boolean} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10004\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Enumerations mapped to their string representation (?)} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10004\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Float types : } +\par \pard\plain {\listtext\pard\plain \li1789\ri0\lin1789\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10146\'3f\tab}\ilvl1 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li1789\ri0\lin1789\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Single mapped to float} +\par \pard\plain {\listtext\pard\plain \li1789\ri0\lin1789\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10146\'3f\tab}\ilvl1 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li1789\ri0\lin1789\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Double mapped to double} +\par \pard\plain {\listtext\pard\plain \li1789\ri0\lin1789\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10146\'3f\tab}\ilvl1 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li1789\ri0\lin1789\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Extended mapped to double} +\par \pard\plain {\listtext\pard\plain \li1789\ri0\lin1789\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10146\'3f\tab}\ilvl1 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li1789\ri0\lin1789\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Currency mapped to float} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10004\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Object (class intances, not TP ones ) :} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10004\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The toolkit has support for instances of classes derived from {\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\loch\f3\fs20 TBaseRemotable}. {\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\loch\f3\fs20 TBaseRemotable} is the base class used by the formatter interface to allow customization of the serialization.. The toolkit provides the {\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\loch\f3\fs20 TBaseComplexRemotable} class which impleme +nts serialization for its ( or its descendants ) published properties. } +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \sb240\sa120\keepn\f2\fs23\i\b\f9\fs23\i\b\fs23\i\b \ltrpar\s7\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs23\lang255\ai\ab\ltrch\dbch\af9\langfe255\hich\f2\fs23\lang1033\i\b\loch\f2\fs23\lang1033\i\b {\rtlch \ltrch\loch\f2\fs23\lang1033\i\b Binary serializer ( usable in Delphi )} +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The Binary serializer is more efficient in time and space compared to the SOAP serializer . It uses big endian to stream data. This serializer has been tested with Delphi 7 ( {\ltrch\hich\f6\loch\f6 \\samples\\delphi\\user_client_console} ) It has support for the following pascal typ +es:} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10004\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Available integers : } +\par \pard\plain {\listtext\pard\plain \li1789\ri0\lin1789\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10146\'3f\tab}\ilvl1 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li1789\ri0\lin1789\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Byte } +\par \pard\plain {\listtext\pard\plain \li1789\ri0\lin1789\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10146\'3f\tab}\ilvl1 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li1789\ri0\lin1789\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 ShortInt } +\par \pard\plain {\listtext\pard\plain \li1789\ri0\lin1789\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10146\'3f\tab}\ilvl1 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li1789\ri0\lin1789\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 SmallInt } +\par \pard\plain {\listtext\pard\plain \li1789\ri0\lin1789\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10146\'3f\tab}\ilvl1 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li1789\ri0\lin1789\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Word } +\par \pard\plain {\listtext\pard\plain \li1789\ri0\lin1789\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10146\'3f\tab}\ilvl1 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li1789\ri0\lin1789\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 LongInt } +\par \pard\plain {\listtext\pard\plain \li1789\ri0\lin1789\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10146\'3f\tab}\ilvl1 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li1789\ri0\lin1789\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 LongWord} +\par \pard\plain {\listtext\pard\plain \li1789\ri0\lin1789\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10146\'3f\tab}\ilvl1 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li1789\ri0\lin1789\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Int64 } +\par \pard\plain {\listtext\pard\plain \li1789\ri0\lin1789\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10146\'3f\tab}\ilvl1 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li1789\ri0\lin1789\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Qword } +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10004\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 String } +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10004\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Boolean } +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10004\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Enumerations } +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10004\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Float types : } +\par \pard\plain {\listtext\pard\plain \li1789\ri0\lin1789\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10146\'3f\tab}\ilvl1 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li1789\ri0\lin1789\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Single } +\par \pard\plain {\listtext\pard\plain \li1789\ri0\lin1789\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10146\'3f\tab}\ilvl1 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li1789\ri0\lin1789\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Double} +\par \pard\plain {\listtext\pard\plain \li1789\ri0\lin1789\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10146\'3f\tab}\ilvl1 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li1789\ri0\lin1789\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Extended } +\par \pard\plain {\listtext\pard\plain \li1789\ri0\lin1789\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10146\'3f\tab}\ilvl1 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li1789\ri0\lin1789\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Currency } +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10004\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Object (class intances, not TP ones ) :} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10004\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The toolkit has support for instances of classes derived from {\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\loch\f3\fs20 TBaseRemotable}. {\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\loch\f3\fs20 TBaseRemotable} is the base class used by the formatter interface to allow customization of the serialization.. The toolkit provides the {\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\loch\f3\fs20 TBaseComplexRemotable} class which implemen +ts serialization for its ( or its descendants ) published properties. } +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \sb240\sa120\keepn\f2\fs23\i\b\f9\fs23\i\b\fs23\i\b \ltrpar\s7\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs23\lang255\ai\ab\ltrch\dbch\af9\langfe255\hich\f2\fs23\lang1033\i\b\loch\f2\fs23\lang1033\i\b {\rtlch \ltrch\loch\f2\fs23\lang1033\i\b Class type serialization. } +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The toolkit has support for instances of classes derived from {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b TBaseRemotable}. {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b TBaseRemotable} is the abstract base class used by the formatter interface to allow customization of the serialization. The toolkit provides the {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b TBaseComplexRemotable} class which +implements serialization for its descendants classes published properties. It also provides {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b TBaseObjectArrayRemotable} class for serialization of array of {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b TBaseRemotable} descendant classes.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \sb240\sa120\keepn\f2\fs23\b\f9\fs23\b\fs23\b \ltrpar\s8\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs23\lang255\ab\ltrch\dbch\af9\langfe255\hich\f2\fs23\lang1033\b\loch\f2\fs23\lang1033\b {\rtlch \ltrch\loch\f2\fs23\lang1033\i0\b The root \'93TBaseRemotable\'94 class.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch {\chcbpat4 }}{\chcbpat4{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 TBaseRemotable = class(TPersistent)}} +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\loch\f3\fs20\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Public} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 constructor Create();virtual;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 class procedure Save(} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 AObject : TBaseRemotable;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 AStore : IFormatterBase;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Const AName : String;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Const ATypeInfo : PTypeInfo} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 );virtual;abstract;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 class procedure Load(} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 Var AObject : TObject;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 AStore : IFormatterBase;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 var AName : String;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 const ATypeInfo : PTypeInfo} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 );virtual;abstract;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 End; } +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ab\ltrch\dbch\af8\langfe255\hich\f4\fs24\lang1033\b\loch\f4\fs24\lang1033\b +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0{\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b TBaseRemotable}}{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 is the abstract base class used by the formatter interface to allow customization of the serialization. This class defines a virtual constructor and mainly two(2) virtual abstract class methods :} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0{\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b Save}}{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 : this method is called when the toolkit needs to serialize the {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b AObject} parameter.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0{\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b Load}}{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 : this method is called when the toolkit needs to un-serialize to the {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b AObject} parameter.} +\par \pard\plain \sb240\sa120\keepn\f2\fs23\b\f9\fs23\b\fs23\b \ltrpar\s8\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs23\lang255\ab\ltrch\dbch\af9\langfe255\hich\f2\fs23\lang1033\b\loch\f2\fs23\lang1033\b {\rtlch \ltrch\loch\f2\fs23\lang1033\i0\b The \'93TBaseComplexRemotable\'94 serialization.} +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\loch\f3\fs20\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 TBaseComplexRemotable = class(TAbstractComplexRemotable)} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 public} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 class procedure Save(} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 AObject : TBaseRemotable;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 AStore : IFormatterBase;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 const AName : string;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 const ATypeInfo : PTypeInfo} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 );override;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 class procedure Load(} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 var AObject : TObject;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 AStore : IFormatterBase;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 var AName : string;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 const ATypeInfo : PTypeInfo} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 );override;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 class procedure RegisterAttributeProperty(const AProperty : shortstring);virtual;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 class procedure RegisterAttributeProperties(const APropertList : array of shortstring);virtual;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 class function IsAttributeProperty(const AProperty : shortstring):Boolean;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 procedure Assign(Source: TPersistent); override;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 end;} +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0{\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b TBaseComplexRemotable}}{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 implements serialization for its descendants classes published properties. The serialization is based on runtime type information (RTTI) and can be customized to:} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u57354\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls0\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 ignore always some published properties.} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u57354\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls0\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 ignore conditionally some published properties.} +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The following class shows a the serialization's customization sample.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch {\chcbpat4 }}{\chcbpat4{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 TSampleClass = class(TBaseComplexRemotable)}} +\par \pard\plain \ltrpar\s1\cf0\chcbpat4{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs20\lang255\ltrch\dbch\af8\langfe255\hich\f3\fs20\lang1033\loch\f3\fs20\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 private} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 FProp_Always: Integer;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 FProp_Never: Integer;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 FProp_Optional: Integer;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 function GetStoredProp_Optional: boolean;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 published} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 //This property will always be serialized} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 property Prop_Always : Integer read FProp_Always write FProp_Always;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 //This property will never be serialized} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 property Prop_Never : Integer read FProp_Never write FProp_Never stored False;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 //This property will be serialized if "Self.GetStoredProp_Optional() = True"} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 property Prop_Optional : Integer read FProp_Optional write FProp_Optional stored GetStoredProp_Optional;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f3\fs20\lang1033\i0\b0 End;} +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \sb240\sa120\keepn\f2\fs21\b\f9\fs21\b\fs21\b \ltrpar\s9\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs21\lang255\ab\ltrch\dbch\af9\langfe255\hich\f2\fs21\lang1033\b\loch\f2\fs21\lang1033\b {\rtlch \ltrch\loch\f2\fs21\lang1033\i0\b Attribute properties.} +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0{\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b TBaseComplexRemotable}}{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 allows properties serialization as attributes. Theses properties have to be registered as such with the {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b RegisterAttributeProperty} class method or {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b RegisterAttributeProperties} one.} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0{\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b TBaseComplexSimpleContentRemotable}}{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 provides implementation for the \'93XML Schema\'94 complex types which extend simple types with attributes. The following example illustrates this :} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f6\fs24\lang1033\loch\f6\fs24\lang1033 {\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 [XML-SCHEMA]} +\par \pard\plain \ltrpar\s1\cf0\chcbpat5{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f6\fs24\lang1033\loch\f6\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 } +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f6\fs24\lang1033\loch\f6\fs24\lang1033 {\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 [/XML-SCHEMA]} +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 This type will be translate by {\rtlch\ltrch\dbch\hich\f6\i\b\loch\f6\i\b ws_helper} to Pascal as} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 [code]} +\par \pard\plain \ltrpar\s1\cf0\chcbpat5{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f6\fs24\lang1033\loch\f6\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 DecimalWithUnits = class(TComplexFloatExtendedContentRemotable)} +\par \pard\plain \ltrpar\s1\cf0\chcbpat5\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f6\fs24\lang1033\loch\f6\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 private} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 FUnits : string;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 published} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 property Units : string read FUnits write FUnits;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 end;} +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 [/code]} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 using the predefined types ( in {\ltrch\hich\f6\loch\f6 base_service_intf.pas} )} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 [code]} +\par \pard\plain \ltrpar\s1\cf0\chcbpat5{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f6\fs24\lang1033\loch\f6\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 TBaseComplexSimpleContentRemotable =} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 class(TAbstractComplexRemotable)} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 protected} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 class procedure SaveValue(} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 AObject : TBaseRemotable; } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 AStore : IformatterBase} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 );virtual;abstract;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 class procedure LoadValue(} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 var AObject : TObject; } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 AStore : IformatterBase} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 );virtual;abstract;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 public} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 class procedure Save(} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 AObject : TBaseRemotable;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 AStore : IFormatterBase;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 const AName : string;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 const ATypeInfo : PTypeInfo} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 );override;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 class procedure Load(} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 var AObject : TObject;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 AStore : IFormatterBase;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 var AName : string;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 const ATypeInfo : PTypeInfo} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 );override;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 end;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 TComplexFloatExtendedContentRemotable =} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 class(TBaseComplexSimpleContentRemotable)} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 private} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 FValue: Extended;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 protected} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 class procedure SaveValue(} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 AObject : TBaseRemotable; } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 AStore : IformatterBase} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 );override;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 class procedure LoadValue(} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 var AObject : TObject; } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 AStore : IformatterBase} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 );override;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 public} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 property Value : Extended read FValue write FValue;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 end;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 [/code]} +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 An instance of this type looks like the one below. Every attribute must be registered using the {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b RegisterAttributeProperty() }method. The toolkit provides class for Pascal basic types( {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b TComplexInt8UContentRemotable, TComplexInt8SContentRemotable, TComplexInt +16SContentRemotable}, ...).} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 [XML]} +\par \pard\plain \ltrpar\s1\cf0\chcbpat5\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f6\fs24\lang1033\loch\f6\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 12.10} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 } +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 [/XML]} +\par \pard\plain \sb240\sa120\keepn\f2\fs23\b\f9\fs23\b\fs23\b \ltrpar\s8\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs23\lang255\ab\ltrch\dbch\af9\langfe255\hich\f2\fs23\lang1033\b\loch\f2\fs23\lang1033\b {\rtlch \ltrch\loch\f2\fs23\lang1033\i0\b Provided array implementations.} +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The toolkit provides array implementation for basic types ( in the {\rtlch\ltrch\dbch\hich\f4\b\loch\f4\b base_service_intf} unit ) listed below. The implementations are based on the serialization's customization.} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10004\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Available integers : } +\par \pard\plain {\listtext\pard\plain \li1789\ri0\lin1789\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10146\'3f\tab}\ilvl1 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li1789\ri0\lin1789\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Byte \tab TArrayOfInt8URemotable} +\par \pard\plain {\listtext\pard\plain \li1789\ri0\lin1789\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10146\'3f\tab}\ilvl1 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li1789\ri0\lin1789\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 ShortInt \tab TArrayOfInt8SRemotable} +\par \pard\plain {\listtext\pard\plain \li1789\ri0\lin1789\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10146\'3f\tab}\ilvl1 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li1789\ri0\lin1789\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 SmallInt \tab TArrayOfInt16SRemotable} +\par \pard\plain {\listtext\pard\plain \li1789\ri0\lin1789\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10146\'3f\tab}\ilvl1 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li1789\ri0\lin1789\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Word \tab TArrayOfInt16URemotable} +\par \pard\plain {\listtext\pard\plain \li1789\ri0\lin1789\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10146\'3f\tab}\ilvl1 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li1789\ri0\lin1789\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 LongInt \tab TArrayOfInt32SRemotable} +\par \pard\plain {\listtext\pard\plain \li1789\ri0\lin1789\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10146\'3f\tab}\ilvl1 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li1789\ri0\lin1789\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 LongWord\tab TArrayOfInt32URemotable} +\par \pard\plain {\listtext\pard\plain \li1789\ri0\lin1789\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10146\'3f\tab}\ilvl1 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li1789\ri0\lin1789\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Int64 \tab TArrayOfInt64SRemotable} +\par \pard\plain {\listtext\pard\plain \li1789\ri0\lin1789\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10146\'3f\tab}\ilvl1 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li1789\ri0\lin1789\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Qword \tab \tab TArrayOfInt64URemotable} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10004\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 String \tab TarrayOfStringRemotable( AnsiString )} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10004\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Boolean \tab TArrayOfBooleanRemotable} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10004\'3f\tab}\ilvl0 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li720\ri0\lin720\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Float types : } +\par \pard\plain {\listtext\pard\plain \li1789\ri0\lin1789\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10146\'3f\tab}\ilvl1 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li1789\ri0\lin1789\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Single \tab \tab TArrayOfFloatSingleRemotable} +\par \pard\plain {\listtext\pard\plain \li1789\ri0\lin1789\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10146\'3f\tab}\ilvl1 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li1789\ri0\lin1789\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Double\tab \tab TArrayOfFloatDoubleRemotable} +\par \pard\plain {\listtext\pard\plain \li1789\ri0\lin1789\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10146\'3f\tab}\ilvl1 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li1789\ri0\lin1789\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Extended \tab TArrayOfFloatExtendedRemotable} +\par \pard\plain {\listtext\pard\plain \li1789\ri0\lin1789\rin0\fi-360\qj\f5\fs18\f5\fs18\f5\fs18 \u10146\'3f\tab}\ilvl1 \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li1789\ri0\lin1789\rin0\fi-360\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Currency \tab TArrayOfFloatCurrencyRemotable} +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The toolkit array's implementation support \'93embedded\'94 array serialization. This type of array occurs typically with types like the following one ( the {\chcbpat5\ltrch\hich\f6\loch\f6 "ResponseGroup"} may be repeated ):} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 [XML-SCHEMA]} +\par \pard\plain \ltrpar\s1\cf0\chcbpat5{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f6\fs24\lang1033\loch\f6\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 } +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 [/XML-SCHEMA]} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 which could be instantiated as} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 [XML]} +\par \pard\plain \ltrpar\s1\cf0\chcbpat5\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f6\fs24\lang1033\loch\f6\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 1 } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 Sample name} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 Group 1} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 Group 2} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 Group 3} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 } +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 [/XML]} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 This type will be translate to Pascal by {\rtlch\ltrch\dbch\hich\f6\i\b\loch\f6\i\b ws_helper} as (the private and protected parts are omitted to be short)} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 [code]} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 (...)} +\par \pard\plain \ltrpar\s1\cf0\chcbpat5{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f6\fs24\lang1033\loch\f6\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 CustomerContentSearchRequest_ResponseGroupArray =} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 class(TBaseSimpleTypeArrayRemotable)} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 public} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 class function GetItemTypeInfo():PTypeInfo;override;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 procedure SetLength(const ANewSize : Integer);override;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 property Item[AIndex:Integer] : string } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 read GetItem write SetItem; default;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 end;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 CustomerContentSearchRequest = class(TBaseComplexRemotable)} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 published} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 property CustomerPage : positiveInteger } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 read FCustomerPage } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 write FCustomerPage stored HasCustomerPage;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 property Email : string } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 read FEmail } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 write FEmail } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 stored HasEmail;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 property Name : string read FName write FName stored HasName;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 property ResponseGroup :} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 CustomerContentSearchRequest_ResponseGroupArray} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 read FResponseGroup } +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 write FResponseGroup;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 end;} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 implementation} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 (...)} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 GetTypeRegistry().ItemByTypeInfo[} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 TypeInfo({\chcbpat5\ltrch\hich\f6\loch\f6 CustomerContentSearchRequest_ResponseGroupArray)]}} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 .RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded);} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f6\fs24\lang1033\i0\b0 (...)} +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\chcbpat5}{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 [/code]} +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The last instruction set the array style to {\rtlch\ltrch\dbch\hich\f6\b\loch\f6\b \'81\'67Embedded\'81\'68} and so the SOAP formatter will serialize the array accordingly.} +\par \pard\plain \sb240\sa120\keepn\f2\fs23\i\b\f9\fs23\i\b\fs23\i\b \ltrpar\s7\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs23\lang255\ai\ab\ltrch\dbch\af9\langfe255\hich\f2\fs23\lang1033\i\b\loch\f2\fs23\lang1033\i\b {\rtlch \ltrch\loch\f2\fs23\lang1033\i\b Test cases} +\par \pard\plain {\listtext\pard\plain \li720\ri0\lin720\rin0\fi-360\f5\fs18\f5\fs18\f5\fs18 \u10004\'3f\tab}\ilvl0 \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls1\aspalpha\li720\ri0\lin720\rin0\fi-360\ql\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 The toolkit uses {\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\loch\f3\fs20 FPCUnit} for test cases. The test project is located in the {\chcbpat4\rtlch\ltrch\dbch\hich\f3\fs20\loch\f3\fs20 \\tests\\test_suite} folder. } +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 +\par \pard\plain \sb240\sa120\keepn\f2\fs28\i\b\f9\fs28\i\b\fs28\i\b \ltrpar\s5\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs28\lang255\ai\ab\ltrch\dbch\af9\langfe255\hich\f2\fs28\lang1033\i\b\loch\f2\fs28\lang1033\i\b +\par \pard\plain \sb240\sa120\keepn\f2\fs28\i\b\f9\fs28\i\b\fs28\i\b \ltrpar\s5\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\sb240\sa120\keepn\ql\rtlch\afs28\lang255\ai\ab\ltrch\dbch\af9\langfe255\hich\f2\fs28\lang1033\i\b\loch\f2\fs28\lang1033\i\b {\rtlch \ltrch\loch\f2\fs28\lang1033\i\b Author} +\par \pard\plain \ltrpar\s1\cf0\qj{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af8\afs24\lang255\ltrch\dbch\af8\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0 Inoussa OUEDRAOGO, {\field{\*\fldinst HYPERLINK "mailto:inoussa12@gmail.com" }{\fldrslt \*\cs24\cf2\ul\ulc0\rtlch\ltrch\dbch\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\field{\*\fldinst HYPERLINK "mailto:inoussa12@gmail.com" }{\fldrslt \*\cs24\cf2\ul\ulc0\rtlch\ltrch\dbch\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\field{\*\fldinst HYPERLINK "mailto:inoussa12@gmail.com" }{\fldrslt \*\cs24\cf2\ul\ulc0\rtlch\ltrch\dbch\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 inoussa12@gmail.com}}}}}}. } +\par } \ No newline at end of file diff --git a/wst/tags/0.4/ics_http_protocol.pas b/wst/tags/0.4/ics_http_protocol.pas new file mode 100644 index 000000000..329db10e8 --- /dev/null +++ b/wst/tags/0.4/ics_http_protocol.pas @@ -0,0 +1,203 @@ +{ + This file is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This file is provide under modified LGPL licence + ( the files COPYING.modifiedLGPL and COPYING.LGPL). + + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +} +unit ics_http_protocol; + +{$mode objfpc}{$H+} + +{$DEFINE WST_DBG} + +interface + +uses + Classes, SysUtils, {$IFDEF WST_DBG}Dialogs,{$ENDIF} + service_intf, imp_utils, base_service_intf, + HttpProt; + +Const + sTRANSPORT_NAME = 'HTTP'; + +Type + +{$M+} + { THTTPTransport } + THTTPTransport = class(TSimpleFactoryItem,ITransport) + Private + FPropMngr : IPropertyManager; + FConnection : THttpCli; + FSoapAction: string; + function GetAddress: string; + function GetContentType: string; + function GetProxyPassword: string; + function GetProxyPort: Integer; + function GetProxyServer: string; + function GetProxyUsername: string; + procedure SetAddress(const AValue: string); + procedure SetContentType(const AValue: string); + procedure SetProxyPassword(const AValue: string); + procedure SetProxyPort(const AValue: Integer); + procedure SetProxyServer(const AValue: string); + procedure SetProxyUsername(const AValue: string); + private + procedure HttpBeforeHeaderSendHandler( + Sender : TObject; + const Method : String; + Headers : TStrings + ); + Public + constructor Create();override; + destructor Destroy();override; + function GetPropertyManager():IPropertyManager; + procedure SendAndReceive(ARequest,AResponse:TStream); + Published + property ContentType : string Read GetContentType Write SetContentType; + property Address : string Read GetAddress Write SetAddress; + property ProxyServer : string Read GetProxyServer Write SetProxyServer; + property ProxyPort : Integer Read GetProxyPort Write SetProxyPort; + property ProxyUsername : string read GetProxyUsername write SetProxyUsername; + property ProxyPassword : string read GetProxyPassword write SetProxyPassword; + property SoapAction : string read FSoapAction write FSoapAction; + End; +{$M+} + + procedure ICS_RegisterHTTP_Transport(); + +implementation + +{ THTTPTransport } + +function THTTPTransport.GetAddress: string; +begin + Result := FConnection.URL; +end; + +function THTTPTransport.GetContentType: string; +begin + Result := FConnection.ContentTypePost; +end; + +function THTTPTransport.GetProxyPassword: string; +begin + Result := FConnection.ProxyPassword; +end; + +function THTTPTransport.GetProxyPort: Integer; +begin + Result := StrToIntDef(FConnection.ProxyPort,0); +end; + +function THTTPTransport.GetProxyServer: string; +begin + Result := FConnection.Proxy; +end; + +function THTTPTransport.GetProxyUsername: string; +begin + Result := FConnection.ProxyUsername; +end; + +procedure THTTPTransport.SetAddress(const AValue: string); +begin + FConnection.URL := AValue; +end; + +procedure THTTPTransport.SetContentType(const AValue: string); +begin + FConnection.ContentTypePost := AValue; +end; + +procedure THTTPTransport.SetProxyPassword(const AValue: string); +begin + FConnection.ProxyPassword := AValue; +end; + +procedure THTTPTransport.SetProxyPort(const AValue: Integer); +begin + FConnection.ProxyPort := IntToStr(AValue); +end; + +procedure THTTPTransport.SetProxyServer(const AValue: string); +begin + FConnection.Proxy := AValue; +end; + +procedure THTTPTransport.SetProxyUsername(const AValue: string); +begin + FConnection.ProxyUsername := AValue; +end; + +procedure THTTPTransport.HttpBeforeHeaderSendHandler( + Sender: TObject; + const Method: String; + Headers: TStrings +); +begin + Headers.Add('soapAction:' + SoapAction); +end; + +constructor THTTPTransport.Create(); +begin + FPropMngr := TPublishedPropertyManager.Create(Self); + FConnection := THttpCli.Create(Nil); +end; + +destructor THTTPTransport.Destroy(); +begin + FreeAndNil(FConnection); + FPropMngr := Nil; + inherited Destroy(); +end; + +function THTTPTransport.GetPropertyManager(): IPropertyManager; +begin + Result := FPropMngr; +end; + +procedure THTTPTransport.SendAndReceive(ARequest, AResponse: TStream); +{$IFDEF WST_DBG} +Var + s : string; + i : Int64; +{$ENDIF WST_DBG} +begin + {$IFDEF WST_DBG} + i := ARequest.Position; + ARequest.Position := 0; + SetLength(s,ARequest.Size); + ARequest.Read(s[1],ARequest.Size); + TMemoryStream(AResponse).SaveToFile('request.log'); + ARequest.Position := i; + {$ENDIF WST_DBG} + + FConnection.SendStream := ARequest; + FConnection.RcvdStream := AResponse; + FConnection.Post(); + + {$IFDEF WST_DBG} + TMemoryStream(AResponse).SaveToFile('request.log'); + i := AResponse.Position; + SetLength(s,AResponse.Size); + AResponse.Read(s[1],AResponse.Size); + TMemoryStream(AResponse).SaveToFile('response.log'); + if IsConsole then + WriteLn(s) + else + ShowMessage(s); + {$ENDIF WST_DBG} +end; + +procedure ICS_RegisterHTTP_Transport(); +begin + GetTransportRegistry().Register(sTRANSPORT_NAME,TSimpleItemFactory.Create(THTTPTransport) as IItemFactory); +end; + +end. diff --git a/wst/tags/0.4/ics_tcp_protocol.pas b/wst/tags/0.4/ics_tcp_protocol.pas new file mode 100644 index 000000000..799216fb2 --- /dev/null +++ b/wst/tags/0.4/ics_tcp_protocol.pas @@ -0,0 +1,222 @@ +{ + This file is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This file is provide under modified LGPL licence + ( the files COPYING.modifiedLGPL and COPYING.LGPL). + + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +} +unit ics_tcp_protocol; + +{$INCLUDE wst.inc} + +interface + +uses + Classes, SysUtils, + service_intf, imp_utils, base_service_intf, + WSocket; + +Const + sTRANSPORT_NAME = 'TCP'; + +Type + + ETCPException = class(EServiceException) + End; + +{$M+} + { TTCPTransport } + TTCPTransport = class(TSimpleFactoryItem,ITransport) + Private + FPropMngr : IPropertyManager; + FConnection : TWSocket; + FContentType : string; + FTarget: string; + function GetAddress: string; + function GetPort: string; + procedure SetAddress(const AValue: string); + procedure SetPort(const AValue: string); + private + FDataLength : LongInt; + FDataBuffer : string; + FAllDataRead : Boolean; + FBeginRead : Boolean; + FHasException : Boolean; + FExceptionMessage : string; + procedure DataAvailable(Sender: TObject; Error: Word); + procedure BgExceptionHandler(Sender : TObject;E : Exception;var CanClose : Boolean); + Public + constructor Create();override; + destructor Destroy();override; + function GetPropertyManager():IPropertyManager; + procedure SendAndReceive(ARequest,AResponse:TStream); + Published + property Target : string Read FTarget Write FTarget; + property ContentType : string Read FContentType Write FContentType; + property Address : string Read GetAddress Write SetAddress; + property Port : string Read GetPort Write SetPort; + End; +{$M+} + + procedure ICS_RegisterTCP_Transport(); + +implementation +uses binary_streamer, Math; + +{ TTCPTransport } + +function TTCPTransport.GetAddress: string; +begin + Result := FConnection.Addr; +end; + +function TTCPTransport.GetPort: string; +begin + Result := FConnection.Port; +end; + +procedure TTCPTransport.SetAddress(const AValue: string); +begin + FConnection.Addr := AValue; +end; + +procedure TTCPTransport.SetPort(const AValue: string); +begin + FConnection.Port := AValue; +end; + +procedure TTCPTransport.DataAvailable(Sender: TObject; Error: Word); +Var + i,j : PtrInt; + buff : string; +begin + If Not FBeginRead Then Begin + i := 1024; + SetLength(buff,i); + While ( FConnection.Receive(@(buff[1]),i) = i ) Do + ; + FDataBuffer := ''; + FDataLength := -1; + Exit; + End; + + If ( FDataLength < 0 ) Then Begin + i := 4; + if ( FConnection.Receive(@FDataLength,i) < i ) then + raise ETCPException.Create('Error reading data length.'); + FDataLength := Reverse_32(FDataLength); + End; + If ( FDataLength > Length(FDataBuffer) ) Then Begin + i := 1024; + If ( i > FDataLength ) Then + i := FDataLength; + SetLength(buff,i); + Repeat + j := FConnection.Receive(@(buff[1]),i); + FDataBuffer := FDataBuffer + Copy(buff,1,j); + i := Min(1024,(FDataLength-Length(FDataBuffer))); + Until ( i =0 ) or ( j <= 0 ); + End; + FAllDataRead := ( FDataLength <= Length(FDataBuffer) ); +end; + +procedure TTCPTransport.BgExceptionHandler(Sender: TObject; E: Exception;var CanClose: Boolean); +begin + CanClose := True; + FHasException := True; + FExceptionMessage := E.Message; +end; + +constructor TTCPTransport.Create(); +begin + FDataLength := -1; + FAllDataRead := False; + FPropMngr := TPublishedPropertyManager.Create(Self); + FConnection := TWSocket.Create(Nil); + FConnection.OnDataAvailable := {$IFDEF FPC}@{$ENDIF}DataAvailable; + FConnection.OnBgException := {$IFDEF FPC}@{$ENDIF}BgExceptionHandler; +end; + +destructor TTCPTransport.Destroy(); +begin + FreeAndNil(FConnection); + FPropMngr := Nil; + inherited Destroy(); +end; + +function TTCPTransport.GetPropertyManager(): IPropertyManager; +begin + Result := FPropMngr; +end; + +procedure TTCPTransport.SendAndReceive(ARequest, AResponse: TStream); + +Var + wrtr : IDataStore; + buffStream : TMemoryStream; + strBuff : string; +{$IFDEF WST_DBG} + s : string; + i : Int64; +{$ENDIF WST_DBG} +begin + buffStream := TMemoryStream.Create(); + Try + wrtr := CreateBinaryWriter(buffStream); + wrtr.WriteInt32S(0); + wrtr.WriteStr(Target); + wrtr.WriteStr(ContentType); + SetLength(strBuff,ARequest.Size); + ARequest.Position := 0; + ARequest.Read(strBuff[1],Length(strBuff)); + wrtr.WriteStr(strBuff); + buffStream.Position := 0; + wrtr.WriteInt32S(buffStream.Size-4); + + If ( FConnection.State = wsClosed ) Then Begin + FConnection.Connect(); + While ( FConnection.State < wsConnected ) Do + FConnection.ProcessMessage(); + End; + + FDataBuffer := ''; + FDataLength := -1; + FAllDataRead := False; + FHasException := False; + FExceptionMessage := ''; + FBeginRead := True; + + FConnection.Send(buffStream.Memory,buffStream.Size); + FConnection.Flush(); + While Not ( FAllDataRead Or FHasException ) Do + FConnection.ProcessMessage(); + If FHasException Then + Raise ETCPException.Create(FExceptionMessage); + AResponse.Size := 0; + AResponse.Write(FDataBuffer[1],Length(FDataBuffer)); + FDataBuffer := ''; + FDataLength := -1; + FAllDataRead := False; + AResponse.Position := 0; + {$IFDEF WST_DBG} + i := AResponse.Position; + SetLength(s,AResponse.Size); + AResponse.Read(s[1],AResponse.Size); + WriteLn(s); + {$ENDIF WST_DBG} + Finally + buffStream.Free(); + End; +end; + +procedure ICS_RegisterTCP_Transport(); +begin + GetTransportRegistry().Register(sTRANSPORT_NAME,TSimpleItemFactory.Create(TTCPTransport) as IItemFactory); +end; + +end. diff --git a/wst/tags/0.4/imp_utils.pas b/wst/tags/0.4/imp_utils.pas new file mode 100644 index 000000000..35f0a8319 --- /dev/null +++ b/wst/tags/0.4/imp_utils.pas @@ -0,0 +1,202 @@ +{ + This file is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This file is provide under modified LGPL licence + ( the files COPYING.modifiedLGPL and COPYING.LGPL). + + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +} +unit imp_utils; + +interface + +uses + Classes, SysUtils, TypInfo, + base_service_intf; + +{$INCLUDE wst.inc} + +Type + + EPropertyManagerException = class(EServiceException) + End; + + { TPublishedPropertyManager } + + TPublishedPropertyManager = class(TInterfacedObject,IPropertyManager) + Private + FParent : TObject; + procedure Error(Const AMsg:string);overload; + procedure Error(Const AMsg:string; Const AArgs : array of const);overload; + Protected + procedure SetProperty(Const AName,AValue:string); + procedure SetProperties(Const APropsStr:string); + function GetProperty(Const AName:String):string; + function GetPropertyNames(ADest : TStrings):Integer; + procedure Clear(); + procedure Copy(ASource:IPropertyManager; Const AClearBefore : Boolean); + Public + constructor Create(AParent : TObject); + End; + + function IsStrEmpty(Const AStr:String):Boolean; + function ExtractOptionName(const ACompleteName : string):string; + +implementation + +function IsStrEmpty(Const AStr:String):Boolean; +begin + Result := ( Length(Trim(AStr)) = 0 ); +end; + +function ExtractOptionName(const ACompleteName : string):string; +var + i, c : Integer; +begin + Result := ''; + c := Length(ACompleteName); + for i := c downto 1 do begin + if ( ACompleteName[i] = '_' ) then + Break; + Result := ACompleteName[i] + Result; + end; + Result := Trim(Result); +end; + +{ TPublishedPropertyManager } + +procedure TPublishedPropertyManager.Error(const AMsg: string); +begin + Raise EPropertyManagerException.Create(AMsg); +end; + +procedure TPublishedPropertyManager.Error(const AMsg: string;const AArgs: array of const); +begin + Raise EPropertyManagerException.CreateFmt(AMsg,AArgs); +end; + +procedure TPublishedPropertyManager.SetProperty(const AName, AValue: string); +Var + pinf : PPropInfo; + int64Val : Int64; +begin + pinf := GetPropInfo(FParent,AName); + If Assigned(pinf) And Assigned(pinf^.SetProc) Then Begin + Case pinf^.PropType^.Kind of + tkLString{$IFDEF FPC},tkSString,tkAString{$ENDIF},tkWString: + SetStrProp(FParent,pinf,AValue); + tkEnumeration : + SetEnumProp(FParent,pinf,AValue); + tkInteger,tkInt64{$IFDEF FPC},tkQWord{$ENDIF} : + Begin + If TryStrToInt64(AValue,int64Val) Then + SetOrdProp(FParent,AName,int64Val); + End; + End; + End; +end; + +procedure TPublishedPropertyManager.SetProperties(const APropsStr: string); +Var + lst : TStringList; + i : Integer; +begin + If IsStrEmpty(APropsStr) Then + Exit; + lst := TStringList.Create(); + Try + lst.QuoteChar := #0; + lst.Delimiter := PROP_LIST_DELIMITER; + lst.DelimitedText := APropsStr; + For i := 0 To Pred(lst.Count) Do + SetProperty(lst.Names[i],lst.ValueFromIndex[i]); + Finally + lst.Free(); + End; +end; + +function TPublishedPropertyManager.GetProperty(const AName: String): string; +Var + pinf : PPropInfo; +begin + Result := ''; + pinf := GetPropInfo(FParent,AName); + If Assigned(pinf) And Assigned(pinf^.SetProc) Then Begin + Case pinf^.PropType^.Kind of + tkLString{$IFDEF FPC},tkSString,tkAString{$ENDIF},tkWString: + Result := GetStrProp(FParent,pinf); + tkEnumeration : + Result := GetEnumProp(FParent,pinf); + tkInteger,tkInt64{$IFDEF FPC},tkQWord{$ENDIF} : + Result := IntToStr(GetOrdProp(FParent,pinf)); + End; + End; +end; + +function TPublishedPropertyManager.GetPropertyNames(ADest: TStrings): Integer; +Var + propList : PPropList; + i, propListLen : Integer; +begin + ADest.Clear(); + propListLen := GetPropList(PTypeInfo(FParent.ClassInfo),propList); + Try + For i := 0 To Pred(propListLen) Do Begin + If ( propList^[i]^.PropType^.Kind in + [ tkLString{$IFDEF FPC},tkSString,tkAString{$ENDIF},tkWString, + tkEnumeration, + tkInteger,tkInt64{$IFDEF FPC},tkQWord{$ENDIF} + ] + ) + Then + ADest.Add(propList^[i]^.Name); + End; + Finally + Freemem(propList,propListLen*SizeOf(Pointer)); + End; + Result := ADest.Count; +end; + +procedure TPublishedPropertyManager.Clear(); +begin + +end; + +procedure TPublishedPropertyManager.Copy( + ASource: IPropertyManager; + const AClearBefore: Boolean +); +Var + lst : TStringList; + i : Integer; + s : string; +begin + If AClearBefore Then + Clear(); + If Assigned(ASource) Then Begin + lst := TStringList.Create(); + Try + ASource.GetPropertyNames(lst); + For i := 0 To Pred(lst.Count) Do Begin + s := lst[i]; + SetProperty(s,ASource.GetProperty(s)); + End; + Finally + lst.Free(); + End; + End; +end; + +constructor TPublishedPropertyManager.Create(AParent: TObject); +begin + Assert(Assigned(AParent)); + FParent := AParent; +end; + + +end. + diff --git a/wst/tags/0.4/indy_http_protocol.pas b/wst/tags/0.4/indy_http_protocol.pas new file mode 100644 index 000000000..071c39823 --- /dev/null +++ b/wst/tags/0.4/indy_http_protocol.pas @@ -0,0 +1,170 @@ +{ + This file is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This file is provide under modified LGPL licence + ( the files COPYING.modifiedLGPL and COPYING.LGPL). + + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +} +unit indy_http_protocol; + +{$mode objfpc}{$H+} + +//{$DEFINE WST_DBG} + +interface + +uses + Classes, SysUtils, + service_intf, imp_utils, base_service_intf, + IdHTTP; + +Const + sTRANSPORT_NAME = 'HTTP'; + +Type + +{$M+} + { THTTPTransport } + THTTPTransport = class(TSimpleFactoryItem,ITransport) + Private + FPropMngr : IPropertyManager; + FConnection : TidHttp; + FSoapAction: string; + FContentType: string; + function GetAddress: string; + function GetProxyPassword: string; + function GetProxyPort: Integer; + function GetProxyServer: string; + function GetProxyUsername: string; + procedure SetAddress(const AValue: string); + procedure SetProxyPassword(const AValue: string); + procedure SetProxyPort(const AValue: Integer); + procedure SetProxyServer(const AValue: string); + procedure SetProxyUsername(const AValue: string); + Public + constructor Create();override; + destructor Destroy();override; + function GetPropertyManager():IPropertyManager; + procedure SendAndReceive(ARequest,AResponse:TStream); + Published + property ContentType : string Read FContentType Write FContentType; + property Address : string Read GetAddress Write SetAddress; + property ProxyServer : string Read GetProxyServer Write SetProxyServer; + property ProxyPort : Integer Read GetProxyPort Write SetProxyPort; + property ProxyUsername : string read GetProxyUsername write SetProxyUsername; + property ProxyPassword : string read GetProxyPassword write SetProxyPassword; + property SoapAction : string read FSoapAction write FSoapAction; + End; +{$M+} + + procedure INDY_RegisterHTTP_Transport(); + +implementation + +{ THTTPTransport } + +function THTTPTransport.GetAddress: string; +begin + Result := FConnection.Request.URL; +end; + +function THTTPTransport.GetProxyPassword: string; +begin + Result := FConnection.ProxyParams.ProxyPassword; +end; + +function THTTPTransport.GetProxyPort: Integer; +begin + Result := FConnection.ProxyParams.ProxyPort; +end; + +function THTTPTransport.GetProxyServer: string; +begin + Result := FConnection.ProxyParams.ProxyServer; +end; + +function THTTPTransport.GetProxyUsername: string; +begin + Result := FConnection.ProxyParams.ProxyUsername; +end; + +procedure THTTPTransport.SetAddress(const AValue: string); +begin + FConnection.Request.URL := AValue; +end; + +procedure THTTPTransport.SetProxyPassword(const AValue: string); +begin + FConnection.ProxyParams.ProxyPassword := AValue; +end; + +procedure THTTPTransport.SetProxyPort(const AValue: Integer); +begin + FConnection.ProxyParams.ProxyPort := AValue; +end; + +procedure THTTPTransport.SetProxyServer(const AValue: string); +begin + FConnection.ProxyParams.ProxyServer := AValue; +end; + +procedure THTTPTransport.SetProxyUsername(const AValue: string); +begin + FConnection.ProxyParams.ProxyUsername := AValue; +end; + +constructor THTTPTransport.Create(); +begin + FPropMngr := TPublishedPropertyManager.Create(Self); + FConnection := TidHttp.Create(Nil); +end; + +destructor THTTPTransport.Destroy(); +begin + FreeAndNil(FConnection); + FPropMngr := Nil; + inherited Destroy(); +end; + +function THTTPTransport.GetPropertyManager(): IPropertyManager; +begin + Result := FPropMngr; +end; + +procedure THTTPTransport.SendAndReceive(ARequest, AResponse: TStream); +{$IFDEF WST_DBG} +var + s : string; + i : Int64; +{$ENDIF WST_DBG} +begin + if not ( IsStrEmpty(FConnection.ProxyParams.ProxyUsername) and + IsStrEmpty(FConnection.ProxyParams.ProxyPassword) + ) + then begin + FConnection.ProxyParams.BasicAuthentication := True; + end; + FConnection.Request.CustomHeaders.Clear(); + FConnection.Request.CustomHeaders.Values['soapAction'] := SoapAction; + FConnection.Request.ContentType := ContentType; + FConnection.Post(Address,ARequest, AResponse); + {$IFDEF WST_DBG} + i := AResponse.Size; + SetLength(s,i); + Move(TMemoryStream(AResponse).Memory^,s[1],i); + WriteLn('--------------------------------------------'); + WriteLn(s); + {$ENDIF WST_DBG} +end; + +procedure INDY_RegisterHTTP_Transport(); +begin + GetTransportRegistry().Register(sTRANSPORT_NAME,TSimpleItemFactory.Create(THTTPTransport) as IItemFactory); +end; + +end. diff --git a/wst/tags/0.4/library_base_intf.pas b/wst/tags/0.4/library_base_intf.pas new file mode 100644 index 000000000..ee10bc329 --- /dev/null +++ b/wst/tags/0.4/library_base_intf.pas @@ -0,0 +1,87 @@ +{ + This file is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This file is provide under modified LGPL licence + ( the files COPYING.modifiedLGPL and COPYING.LGPL). + + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +} +unit library_base_intf; + +interface +uses base_service_intf; + +{$INCLUDE wst.inc} + +const + RET_OK = 0; + RET_FALSE = 1; + WST_LIB_HANDLER = 'wstHandleRequest'; + +type + + EwstCheckException = class(EServiceException) + private + FReturnCode: Integer; + public + property ReturnCode : Integer read FReturnCode write FReturnCode; + end; + + IwstStream = interface + ['{95700F89-3E36-4678-AD84-347162E39288}'] + function Read( + ABuffer : Pointer; + const ALenToRead : LongWord; + out AReadedLen : LongWord + ):LongInt; + function Write( + ABuffer : Pointer; + const ALenToWrite : LongWord; + out AWrittenLen : LongWord + ):LongInt; + function GetSize(out ASize : LongWord):LongInt; + function SetSize(const ANewSize : LongWord):LongInt; + function GetPosition(out APos : LongWord):LongWord; + function SetPosition(const ANewPos : LongWord):LongInt; + end; + + TwstLibraryHandlerFunction = + function( + ARequestBuffer : IwstStream; + AErrorBuffer : Pointer; + var AErrorBufferLen : LongInt + ):LongInt; + + procedure wstCheck(const AReturn : LongInt);overload; + procedure wstCheck(const AReturn : LongInt; const AMsg : string);overload; + +implementation + +procedure wstCheck(const AReturn : LongInt); +var + e : EwstCheckException; +begin + if ( AReturn <> RET_OK ) then begin + e := EwstCheckException.CreateFmt('wst Check Exception , return = %d',[AReturn]); + e.ReturnCode := AReturn; + raise e; + end; +end; + +procedure wstCheck(const AReturn : LongInt; const AMsg : string); +var + e : EwstCheckException; +begin + if ( AReturn <> RET_OK ) then begin + e := EwstCheckException.Create(AMsg); + e.ReturnCode := AReturn; + raise e; + end; +end; + +end. + diff --git a/wst/tags/0.4/library_imp_utils.pas b/wst/tags/0.4/library_imp_utils.pas new file mode 100644 index 000000000..4b02c695c --- /dev/null +++ b/wst/tags/0.4/library_imp_utils.pas @@ -0,0 +1,185 @@ +unit library_imp_utils; + +interface + +uses + Classes, SysUtils; + +{$INCLUDE wst.inc} + +type + + IwstModule = interface + ['{A62A9A71-727E-47AD-9B84-0F7CA0AE51D5}'] + function GetFileName():string; + function GetProc(const AProcName : string):Pointer; + end; + + IwstModuleManager = interface + ['{0A49D315-FF3E-40CD-BCA0-F958BCD5C57F}'] + function Get(const AFileName : string):IwstModule; + procedure Clear(); + end; + +var + LibraryManager : IwstModuleManager = nil; + +implementation +{$IFDEF FPC} + uses DynLibs; +{$ELSE} + uses Windows; + + type TLibHandle = THandle; + const NilHandle = 0; +{$ENDIF} + + +type + + { TwstModule } + + TwstModule = class(TInterfacedObject,IwstModule) + private + FFileName : string; + FHandle : TLibHandle; + private + procedure Load(const ADoLoad : Boolean); + protected + function GetFileName():string; + function GetProc(const AProcName : string):Pointer; + public + constructor Create(const AFileName : string); + destructor Destroy();override; + end; + + { TwstModuleManager } + + TwstModuleManager = class(TInterfacedObject,IwstModuleManager) + private + FList : IInterfaceList; + private + function Load(const AFileName : string):IwstModule; + function GetItem(const AIndex : Integer):IwstModule; + function IndexOf(const AFileName : string):Integer; + protected + function Get(const AFileName : string):IwstModule; + procedure Clear(); + public + constructor Create(); + destructor Destroy();override; + end; + +procedure TwstModule.Load(const ADoLoad : Boolean); +begin + if ADoLoad then begin + if ( FHandle = NilHandle ) then begin + {$IFDEF FPC} + FHandle := LoadLibrary(FFileName); + {$ELSE} + FHandle := LoadLibrary(PCHAR(FFileName)); + {$ENDIF} + if ( FHandle = NilHandle ) then + raise Exception.CreateFmt('Error while loading : "%s".',[FFileName]); + end; + end else begin + if ( FHandle <> NilHandle ) then begin + FreeLibrary(FHandle); + FHandle := NilHandle; + end; + end; +end; + +function TwstModule.GetFileName(): string; +begin + Result := FFileName; +end; + +function TwstModule.GetProc(const AProcName: string): Pointer; +begin + {$IFDEF FPC} + Result := GetProcAddress(FHandle,AProcName); + {$ELSE} + Result := GetProcAddress(FHandle,PCHAR(AProcName)); + {$ENDIF} + if not Assigned(Result) then + raise Exception.CreateFmt('Procedure "%s" not found in this module( "%s" ).',[AProcName,FFileName]); +end; + +constructor TwstModule.Create(const AFileName: string); +begin + if not FileExists(AFileName) then + raise Exception.CreateFmt('File not found : "%s".',[AFileName]); + FHandle := NilHandle; + FFileName := AFileName; + Load(True); +end; + +destructor TwstModule.Destroy(); +begin + Load(False); + inherited Destroy(); +end; + +{ TwstModuleManager } + +function TwstModuleManager.Get(const AFileName: string): IwstModule; +var + i : Integer; +begin + i := IndexOf(AFileName); + if ( i < 0 ) then + Result := Load(AFileName) + else + Result := GetItem(i); +end; + +procedure TwstModuleManager.Clear(); +begin + FList.Clear(); +end; + +function TwstModuleManager.Load(const AFileName: string): IwstModule; +begin + Result := TwstModule.Create(AFileName); +end; + +function TwstModuleManager.GetItem(const AIndex: Integer): IwstModule; +begin + Result := FList[AIndex] as IwstModule; +end; + +function TwstModuleManager.IndexOf(const AFileName: string): Integer; +begin + for Result := 0 to Pred(FList.Count) do begin + if AnsiSameStr(AFileName,(FList[Result] as IwstModule).GetFileName()) then + Exit; + end; + Result := -1; +end; + +constructor TwstModuleManager.Create(); +begin + inherited; + FList := TInterfaceList.Create(); +end; + +destructor TwstModuleManager.Destroy(); +begin + FList := nil; + inherited Destroy(); +end; + +procedure InitLibraryManager(); +begin + LibraryManager := TwstModuleManager.Create(); +end; + +initialization + InitLibraryManager(); + +finalization + LibraryManager := nil; + +end. + diff --git a/wst/tags/0.4/library_protocol.pas b/wst/tags/0.4/library_protocol.pas new file mode 100644 index 000000000..722d1cf7c --- /dev/null +++ b/wst/tags/0.4/library_protocol.pas @@ -0,0 +1,245 @@ +{ + This file is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This file is provide under modified LGPL licence + ( the files COPYING.modifiedLGPL and COPYING.LGPL). + + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +} +unit library_protocol; + +//{$DEFINE WST_DBG} + +interface + +uses + Classes, SysUtils,{$IFDEF WST_DBG}Dialogs,{$ENDIF} + service_intf, imp_utils, base_service_intf, library_base_intf, + library_imp_utils; + +{$INCLUDE wst.inc} + +const + sTRANSPORT_NAME = 'LIB'; + +Type + +{$M+} + { TLIBTransport } + TLIBTransport = class(TSimpleFactoryItem,ITransport) + Private + FPropMngr : IPropertyManager; + FModule : IwstModule; + FHandler : TwstLibraryHandlerFunction; + private + FContentType: string; + FFileName: string; + FTarget: string; + private + procedure SetFileName(const AValue: string); + procedure LoadModule(); + public + constructor Create();override; + destructor Destroy();override; + function GetPropertyManager():IPropertyManager; + procedure SendAndReceive(ARequest,AResponse:TStream); + published + property ContentType : string read FContentType write FContentType; + property Target : string read FTarget write FTarget; + property FileName : string read FFileName write SetFileName; + end; +{$M+} + + procedure LIB_Register_Transport(); + +implementation +uses binary_streamer; + +type + + { TwstStream } + + TwstStream = class(TInterfacedObject,IwstStream) + private + FStream : TStream; + protected + function Read( + ABuffer : Pointer; + const ALenToRead : LongWord; + out AReadedLen : LongWord + ):LongInt; + function Write( + ABuffer : Pointer; + const ALenToWrite : LongWord; + out AWrittenLen : LongWord + ):LongInt; + function GetSize(out ASize : LongWord):LongInt; + function SetSize(const ANewSize : LongWord):LongInt; + function GetPosition(out APos : LongWord):LongWord; + function SetPosition(const ANewPos : LongWord):LongInt; + public + constructor Create(AStream : TStream); + end; + +{ TwstStream } + +function TwstStream.Read( + ABuffer : Pointer; + const ALenToRead : LongWord; + out AReadedLen : LongWord +): LongInt; +begin + try + AReadedLen := FStream.Read(ABuffer^,ALenToRead); + Result := RET_OK; + except + Result := RET_FALSE; + end; +end; + +function TwstStream.Write( + ABuffer : Pointer; + const ALenToWrite : LongWord; + out AWrittenLen : LongWord +): LongInt; +begin + try + AWrittenLen := FStream.Write(ABuffer^,ALenToWrite); + Result := RET_OK; + except + Result := RET_FALSE; + end; +end; + +function TwstStream.GetSize(out ASize: LongWord): LongInt; +begin + ASize := FStream.Size; + Result := RET_OK; +end; + +function TwstStream.SetSize(const ANewSize: LongWord): LongInt; +begin + FStream.Size := ANewSize; + Result := RET_OK; +end; + +function TwstStream.GetPosition(out APos: LongWord): LongWord; +begin + APos := FStream.Position; + Result := RET_OK; +end; + +function TwstStream.SetPosition(const ANewPos: LongWord): LongInt; +begin + FStream.Position := ANewPos; + Result := RET_OK; +end; + +constructor TwstStream.Create(AStream: TStream); +begin + Assert(Assigned(AStream)); + FStream := AStream; +end; + +{ TLIBTransport } + +procedure TLIBTransport.SetFileName(const AValue: string); +begin + FFileName := AValue; + if Assigned(FModule) and ( not AnsiSameStr(FFileName,FModule.GetFileName()) ) then begin + FHandler := nil; + FModule := nil; + end; +end; + +procedure TLIBTransport.LoadModule(); +begin + if ( FModule = nil ) then begin + FModule := LibraryManager.Get(FFileName); + FHandler := TwstLibraryHandlerFunction(FModule.GetProc(WST_LIB_HANDLER)); + end; +end; + +constructor TLIBTransport.Create(); +begin + inherited Create(); + FPropMngr := TPublishedPropertyManager.Create(Self); + FModule := nil; + FHandler := nil +end; + +destructor TLIBTransport.Destroy(); +begin + FPropMngr := Nil; + FModule := nil; + FHandler := nil; + inherited Destroy(); +end; + +function TLIBTransport.GetPropertyManager(): IPropertyManager; +begin + Result := FPropMngr; +end; + +const MAX_ERR_LEN = 500; +procedure TLIBTransport.SendAndReceive(ARequest, AResponse: TStream); +Var + wrtr : IDataStore; + buffStream : TMemoryStream; + strBuff : string; + intfBuffer : IwstStream; + bl : LongInt; +{$IFDEF WST_DBG} + s : string; + i : Int64; +{$ENDIF WST_DBG} +begin + LoadModule(); + buffStream := TMemoryStream.Create(); + try + wrtr := CreateBinaryWriter(buffStream); + wrtr.WriteInt32S(0); + wrtr.WriteStr(Target); + wrtr.WriteStr(ContentType); + SetLength(strBuff,ARequest.Size); + ARequest.Position := 0; + ARequest.Read(strBuff[1],Length(strBuff)); + wrtr.WriteStr(strBuff); + buffStream.Position := 0; + wrtr.WriteInt32S(buffStream.Size-4); + + buffStream.Position := 0; + intfBuffer := TwstStream.Create(buffStream); + bl := MAX_ERR_LEN; + strBuff := StringOfChar(#0,bl); + if ( FHandler(intfBuffer,Pointer(strBuff),bl) <> RET_OK ) then + raise Exception.Create(strBuff); + + buffStream.Position := 0; + AResponse.Size := 0; + AResponse.CopyFrom(buffStream,0); + AResponse.Position := 0; + {$IFDEF WST_DBG} + i := AResponse.Position; + SetLength(s,AResponse.Size); + AResponse.Read(s[1],AResponse.Size); + if IsConsole then + WriteLn(s) + else + ShowMessage(s); + {$ENDIF WST_DBG} + finally + buffStream.Free(); + end; +end; + +procedure LIB_Register_Transport(); +begin + GetTransportRegistry().Register(sTRANSPORT_NAME,TSimpleItemFactory.Create(TLIBTransport) as IItemFactory); +end; + +end. diff --git a/wst/tags/0.4/library_server_intf.pas b/wst/tags/0.4/library_server_intf.pas new file mode 100644 index 000000000..0d25616cc --- /dev/null +++ b/wst/tags/0.4/library_server_intf.pas @@ -0,0 +1,121 @@ +{ + This file is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This file is provide under modified LGPL licence + ( the files COPYING.modifiedLGPL and COPYING.LGPL). + + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +} +unit library_server_intf; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, + library_base_intf; + + function wstHandleRequest( + ARequestBuffer : IwstStream; + AErrorBuffer : Pointer; + var AErrorBufferLen : LongInt + ):LongInt; + +implementation +uses base_service_intf, server_service_intf, server_service_imputils, binary_streamer; + +function wstHandleRequest( + ARequestBuffer : IwstStream; + AErrorBuffer : Pointer; + var AErrorBufferLen : LongInt +):LongInt; + + procedure CopyErrMsg(const AMsg : string); + var + j,m : Integer; + begin + m := AErrorBufferLen; + j := Length(AMsg); + if ( j > 0 ) then begin + if ( j > m ) then + j := m; + try + Move(AMsg[1],AErrorBuffer^,j); + except + end; + end; + end; + +Var + buff, trgt,ctntyp : string; + rqst : IRequestBuffer; + rdr : IDataStoreReader; + inStream, bufStream : TMemoryStream; + bs, bytesCount : LongWord; +begin + Result := RET_FALSE; + try + inStream := nil; + bufStream := nil; + if Assigned(ARequestBuffer) then begin + wstCheck(ARequestBuffer.GetSize(bs)); + if ( bs > 0 ) then begin + try + inStream := TMemoryStream.Create(); + bufStream := TMemoryStream.Create(); + + bufStream.Size := bs; + wstCheck(ARequestBuffer.SetPosition(0)); + wstCheck(ARequestBuffer.Read(bufStream.Memory,bs,bytesCount)); + if ( bs <> bytesCount ) then + wstCheck(RET_FALSE,'Invalid buffer operation (READ)'); + wstCheck(ARequestBuffer.SetSize(0)); + + bufStream.Position := 0; + rdr := CreateBinaryReader(bufStream); + if ( rdr.ReadInt32S() <> ( bs - 4 ) ) then + wstCheck(RET_FALSE,'Invalid buffer.'); + trgt := rdr.ReadStr(); + ctntyp := rdr.ReadStr(); + buff := rdr.ReadStr(); + rdr := nil; + bufStream.Size := 0; + bufStream.Position := 0; + inStream.Write(buff[1],Length(buff)); + SetLength(buff,0); + inStream.Position := 0; + rqst := TRequestBuffer.Create(trgt,ctntyp,inStream,bufStream); + HandleServiceRequest(rqst); + bs := bufStream.Size; + wstCheck(ARequestBuffer.SetSize(bs)); + wstCheck(ARequestBuffer.SetPosition(0)); + wstCheck(ARequestBuffer.Write(bufStream.Memory,bs,bytesCount)); + if ( bs <> bytesCount ) then + wstCheck(RET_FALSE,'Invalid buffer operation (WRITE)'); + Result := RET_OK; + finally + bufStream.Free(); + inStream.Free(); + end; + end; + end; + except + on e : EwstCheckException do begin + Result := e.ReturnCode; + CopyErrMsg(e.Message); + end; + on e : Exception do begin + Result := RET_FALSE; + CopyErrMsg(e.Message); + end else begin + Result := RET_FALSE; + end; + end; +end; + +end. diff --git a/wst/tags/0.4/metadata_repository.pas b/wst/tags/0.4/metadata_repository.pas new file mode 100644 index 000000000..eb39bfe8a --- /dev/null +++ b/wst/tags/0.4/metadata_repository.pas @@ -0,0 +1,826 @@ +{ + This file is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This file is provide under modified LGPL licence + ( the files COPYING.modifiedLGPL and COPYING.LGPL). + + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +} + +unit metadata_repository; + +interface + +uses + Classes, SysUtils, TypInfo; + +{$INCLUDE wst.inc} + +const + sWST_SIGNATURE = 'WST_METADATA_0.2.2.0'; + sWST_META = 'wst_meta'; + sFORMAT = 'FORMAT'; + sTRANSPORT = 'TRANSPORT'; + +type + + EMetadataException = class(Exception) + end; + + PPropertyData = ^TPropertyData; + TPropertyData = record + Name : string; + Data : string; + Next : PPropertyData; + end; + + TOperationParamFlag = ( opfNone, opfIn, opfVar, opfOut ); + + POperationParam = ^TOperationParam; + TOperationParam = record + Name : ShortString; + TypeName : ShortString; + Modifier : TOperationParamFlag; + end; + + PServiceOperation = ^TServiceOperation; + TServiceOperation = record + Name : ShortString; + ParamsCount : Byte; + Params : POperationParam; + Properties : PPropertyData; + end; + + PService = ^TService; + TService = record + Name : ShortString; + OperationsCount : Byte; + Operations : PServiceOperation; + Properties : PPropertyData; + end; + + PServiceRepository = ^TServiceRepository; + TServiceRepository = record + NameSpace : ShortString; + Name : ShortString; + RootAddress : ShortString; + ServicesCount : Byte; + Services : PService; + end; + + IModuleMetadataMngr = interface + ['{B10ACF6A-A599-45A3-B083-BEEFB810C889}'] + function IndexOfName(const ARepName : shortstring):Integer; + function GetCount():Integer; + function GetRepositoryName(const AIndex : Integer):shortstring; + procedure SetRepositoryNameSpace(const ARepName,ANameSpace : shortstring); + function LoadRepositoryName( + const ARepName,ARootAddress : shortstring; + out ARepository : PServiceRepository + ):Integer; + procedure ClearRepository(var ARepository : PServiceRepository); + procedure SetServiceCustomData( + const ARepName : shortstring; + const AServiceName : shortstring; + const ADataName, + AData : string + ); + procedure SetOperationCustomData( + const ARepName : shortstring; + const AServiceName : shortstring; + const AOperationName : shortstring; + const ADataName, + AData : string + ); + //--------------------------------- + function GetServiceMetadata(const ARepName,AServiceName : shortstring) : PService; + procedure ClearServiceMetadata(var AService : PService); + end; + + function GetModuleMetadataMngr():IModuleMetadataMngr; + + function LoadRepositoryData( + const AStream : TStream; + out ARepository : PServiceRepository + ):LongInt; + procedure ClearRepositoryData(var ARepository : PServiceRepository); + + function Find(const AProps : PPropertyData; const APropName : string) : PPropertyData; + + + function GetServiceDefaultAddress(AServiceTyp : PTypeInfo):string; + function GetServiceDefaultFormatProperties(AServiceTyp : PTypeInfo):string; + +implementation +uses wst_resources_imp, binary_streamer, imp_utils; + +{$INCLUDE wst_rtl_imp.inc} + +const sADDRESS = 'Address'; +function GetServiceDefaultAddress(AServiceTyp : PTypeInfo):string; +var + typData : PTypeData; + servcMdt : PService; + propData : PPropertyData; +begin + Result := ''; + if Assigned(AServiceTyp) and (AServiceTyp^.Kind = tkInterface) then begin + typData := GetTypeData(AServiceTyp); + if Assigned(typData) then begin + servcMdt := GetModuleMetadataMngr().GetServiceMetadata(typData^.IntfUnit,AServiceTyp^.Name); + if Assigned(AServiceTyp) then begin + propData := Find(servcMdt^.Properties,sTRANSPORT + '_' + sADDRESS); + if Assigned(propData) then + Result := propData^.Data; + end; + end; + end; +end; + +function GetServiceDefaultFormatProperties(AServiceTyp : PTypeInfo):string; +var + typData : PTypeData; + servcMdt : PService; + propData : PPropertyData; + strName : string; +begin + Result := ''; + if Assigned(AServiceTyp) and (AServiceTyp^.Kind = tkInterface) then begin + typData := GetTypeData(AServiceTyp); + if Assigned(typData) then begin + servcMdt := GetModuleMetadataMngr().GetServiceMetadata(typData^.IntfUnit,AServiceTyp^.Name); + if Assigned(AServiceTyp) then begin + propData := servcMdt^.Properties; + while Assigned(propData) do begin + if ( AnsiPos(sFORMAT + '_',propData^.Name) = 1 ) then begin + strName := ExtractOptionName(propData^.Name); + if ( Length(strName) > 0 ) then begin + Result := Format('%s%s=%s;',[Result,strName,propData^.Data]); + end; + end; + propData := propData^.Next; + end; + if not IsStrEmpty(Result) then begin + Delete(Result,Length(Result),1); + end; + end; + end; + end; +end; + +procedure ClearProperties(var AProps : PPropertyData); +var + c : Integer; + q, p : PPropertyData; +begin + if not Assigned(AProps) then + Exit; + c := SizeOf(TPropertyData); + p := AProps; + while Assigned(p) do begin + q := p; + p := p^.Next; + q^.Name := ''; + q^.Data := ''; + Freemem(q,c); + end; + AProps := nil; +end; + +function CloneProperties(const AProps : PPropertyData) : PPropertyData; +var + c : Integer; + p,q, q0 : PPropertyData; +begin + Result := nil; + if not Assigned(AProps) then + Exit; + c := SizeOf(TPropertyData); + q0 := wst_GetMem(c); + q := q0; + p := AProps; + while Assigned(p) do begin + q^.Next := wst_GetMem(c); + FillChar(q^.Next^,c,#0); + q := q^.Next; + q^.Name := p^.Name; + q^.Data := p^.Data; + p := p^.Next; + end; + Result := q0^.Next; + Freemem(q0,c); +end; + +function Find(const AProps : PPropertyData; const APropName : string) : PPropertyData; +begin + if Assigned(AProps) then begin + Result := AProps; + while Assigned(Result) do begin + if AnsiSameText(APropName,Result^.Name) then + Exit; + Result := Result^.Next; + end; + end; + Result := nil; +end; + +function Add( + var AProps : PPropertyData; + const APropName, + APropData : string +) : PPropertyData; +begin + if not Assigned(AProps) then begin + AProps := wst_GetMem(SizeOf(TPropertyData)); + FillChar(AProps^,SizeOf(TPropertyData),#0); + AProps^.Next := nil; + Result := AProps; + end else begin + Result := Find(AProps,APropName); + if not Assigned(Result) then begin + Result := wst_GetMem(SizeOf(TPropertyData)); + FillChar(Result^,SizeOf(TPropertyData),#0); + Result^.Next := AProps; + AProps := Result; + end; + end; + Result^.Name := APropName; + Result^.Data := APropData; +end; + +procedure ClearService(AService : PService; const AFreeService : Boolean); + + procedure ClearOperation(AOperation : PServiceOperation); + var + cc : LongInt; + begin + cc := AOperation^.ParamsCount; + if ( cc > 0 ) then begin + Freemem(AOperation^.Params, cc * SizeOf(TOperationParam) ); + end; + ClearProperties(AOperation^.Properties); + end; + +var + j, k : LongInt; + po : PServiceOperation; +begin + if not Assigned(AService) then + Exit; + k := AService^.OperationsCount; + if ( k > 0 ) then begin + po := AService^.Operations; + for j := 0 to Pred(k) do begin + //ClearOperation(@(po[j])); + ClearOperation(po); + Inc(po); + end; + Freemem(AService^.Operations, k * SizeOf(TServiceOperation) ); + AService^.Operations := nil; + ClearProperties(AService^.Properties); + AService^.Properties := nil; + end; + if AFreeService then + Freemem(AService,SizeOf(TService)); +end; + +procedure ClearRepositoryData(var ARepository : PServiceRepository); +var + i, c : LongInt; + ps : PService; +begin + if Assigned(ARepository) then begin + c := ARepository^.ServicesCount; + if ( c > 0 ) then begin + ps := ARepository^.Services; + for i := 0 to Pred(c) do begin + //ClearService(@(ps[i]),false); + ClearService(ps,false); + Inc(ps); + end; + Freemem(ARepository^.Services, c * SizeOf(TService) ); + end; + Freemem(ARepository,SizeOf(TServiceRepository)); + ARepository := nil; + end; +end; + +function LoadRepositoryData( + const AStream : TStream; + out ARepository : PServiceRepository +):LongInt; +var + rdr : IDataStoreReader; + + procedure LoadService(AService : PService); + + procedure LoadOperation(AOperation : PServiceOperation); + + procedure LoadParam(APrm : POperationParam); + begin + APrm^.Name := rdr.ReadStr(); + APrm^.TypeName := rdr.ReadStr(); + APrm^.Modifier := TOperationParamFlag(rdr.ReadEnum()); + end; + + var + ii, cc : LongInt; + pp : POperationParam; + begin + AOperation^.Name := rdr.ReadStr(); + AOperation^.Properties := nil; + cc := rdr.ReadInt8U(); + if ( cc > 0 ) then begin + AOperation^.Params := wst_GetMem( cc * SizeOf(TOperationParam) ); + FillChar(AOperation^.Params^, cc * SizeOf(TOperationParam), #0); + AOperation^.ParamsCount := cc; + pp := AOperation^.Params; + for ii := 0 to Pred(cc) do begin + //LoadParam(@(pp[ii])); + LoadParam(pp); + Inc(pp); + end; + end; + end; + + var + j, k : LongInt; + po : PServiceOperation; + begin + AService^.Name := rdr.ReadStr(); + AService^.Properties := nil; + k := rdr.ReadInt8U(); + if ( k > 0 ) then begin + AService^.Operations := wst_GetMem( k * SizeOf(TServiceOperation) ); + AService^.OperationsCount := k; + FillChar(AService^.Operations^,k * SizeOf(TServiceOperation), #0); + po := AService^.Operations; + for j := 0 to Pred(k) do begin + //LoadOperation(@(po[j])); + LoadOperation(po); + Inc(po); + end; + end; + end; + +var + buf : string; + i, c : LongInt; + ps : PService; +begin + ARepository := nil; + Result := 0; + rdr := CreateBinaryReader(AStream); + buf := rdr.ReadStr(); + if ( sWST_SIGNATURE <> buf ) then + raise EMetadataException.CreateFmt('Invalid Metadata signature : "%s"',[buf]); + c := SizeOf(TServiceRepository); + ARepository := wst_GetMem(c); + try + FillChar(ARepository^,c,#0); + ARepository^.Name := rdr.ReadStr(); + c := rdr.ReadInt8U(); + if ( c > 0 ) then begin + ARepository^.Services := wst_GetMem( c * SizeOf(TService) ); + ARepository^.ServicesCount := c; + FillChar(ARepository^.Services^,c * SizeOf(TService),#0); + ps := ARepository^.Services; + for i := 0 to Pred(c) do begin + //LoadService(@(ps[i])); + LoadService(ps); + Inc(ps); + end; + end; + Result := c; + except + ClearRepositoryData(ARepository); + raise; + end; +end; + + +procedure CopyService(ASrcService,ADestService : PService); + + procedure CopyOperation(ASrcOperation, ADstOperation : PServiceOperation); + + procedure CopyParam(ASrcPrm, ADstPrm : POperationParam); + begin + ADstPrm^ := ASrcPrm^; + end; + + var + ii, cc : LongInt; + ppSrc, pp : POperationParam; + begin + ADstOperation^.Name := ASrcOperation^.Name; + ADstOperation^.Properties := CloneProperties(ASrcOperation^.Properties); + cc := ASrcOperation^.ParamsCount; + if ( cc > 0 ) then begin + ADstOperation^.Params := wst_GetMem( cc * SizeOf(TOperationParam) ); + FillChar(ADstOperation^.Params^, cc * SizeOf(TOperationParam), #0); + ADstOperation^.ParamsCount := cc; + ppSrc := ASrcOperation^.Params; + pp := ADstOperation^.Params; + for ii := 0 to Pred(cc) do begin + //CopyParam(@(ASrcOperation^.Params[ii]),@(pp[ii])); + CopyParam(ppSrc,pp); + Inc(ppSrc); + Inc(pp); + end; + end; + end; + +var + j, k : LongInt; + poSrc, po : PServiceOperation; +begin + ADestService^.Name := ASrcService^.Name; + ADestService^.Properties := CloneProperties(ASrcService^.Properties); + k := ASrcService^.OperationsCount; + if ( k > 0 ) then begin + ADestService^.Operations := wst_GetMem( k * SizeOf(TServiceOperation) ); + ADestService^.OperationsCount := k; + FillChar(ADestService^.Operations^,k * SizeOf(TServiceOperation), #0); + po := ADestService^.Operations; + poSrc := ASrcService^.Operations; + for j := 0 to Pred(k) do begin + //CopyOperation(@(ASrcService^.Operations[j]),@(po[j])); + CopyOperation(poSrc,po); + Inc(poSrc); + Inc(po); + end; + end; +end; + +function CloneService(const ASrcService : PService) : PService; +var + c : Integer; +begin + c := SizeOf(TService); + Result := wst_GetMem(c); + FillChar(Result^,c,#0); + CopyService(ASrcService,Result); +end; + +procedure CloneRepository( + const ASource : PServiceRepository; + out ADest : PServiceRepository +); +var + i, c : LongInt; + psSrc, ps : PService; +begin + ADest := nil; + if not Assigned(ASource) then + Exit; + c := SizeOf(TServiceRepository); + ADest := wst_GetMem(c); + try + FillChar(ADest^,c,#0); + ADest^.Name := ASource^.Name; + ADest^.NameSpace := ASource^.NameSpace; + ADest^.RootAddress := ASource^.RootAddress; + c := ASource^.ServicesCount; + if ( c > 0 ) then begin + ADest^.Services := wst_GetMem( c * SizeOf(TService) ); + ADest^.ServicesCount := c; + FillChar(ADest^.Services^,c * SizeOf(TService),#0); + ps := ADest^.Services; + psSrc := ASource^.Services; + for i := 0 to Pred(c) do begin + //CopyService(@(ASource^.Services[i]),@(ps[i])); + CopyService(psSrc,ps); + end; + end; + except + ClearRepositoryData(ADest); + raise; + end; +end; + +type + + { TModuleMetadataMngr } + + TModuleMetadataMngr = class(TInterfacedObject,IInterface,IModuleMetadataMngr) + private + FList : TStringList; + FRepositories : array of PServiceRepository; + private + procedure LoadRegisteredNames(); + procedure ClearList(); + function FindInnerListIndex(const ARepName : shortstring):Integer; + function InternalLoadRepository(const ARepName : shortstring):Integer; + protected + function IndexOfName(const ARepName : shortstring):Integer; + procedure RegisterRepository(const ARepName : shortstring); + function GetCount():Integer; + function GetRepositoryName(const AIndex : Integer):shortstring; + procedure SetRepositoryNameSpace(const ARepName,ANameSpace : shortstring); + function LoadRepositoryName( + const ARepName,ARootAddress : shortstring; + out ARepository : PServiceRepository + ):Integer; + procedure ClearRepository(var ARepository : PServiceRepository); + procedure SetServiceCustomData( + const ARepName : shortstring; + const AServiceName : shortstring; + const ADataName, + AData : string + ); + procedure SetOperationCustomData( + const ARepName : shortstring; + const AServiceName : shortstring; + const AOperationName : shortstring; + const ADataName, + AData : string + ); + function GetServiceMetadata(const ARepName,AServiceName : shortstring) : PService; + procedure ClearServiceMetadata(var AService : PService); + public + constructor Create(); + destructor Destroy();override; + end; + +var + ModuleMetadataMngrInst : IModuleMetadataMngr = nil; + +function GetModuleMetadataMngr():IModuleMetadataMngr; +begin + if not Assigned(ModuleMetadataMngrInst) then + ModuleMetadataMngrInst := TModuleMetadataMngr.Create() as IModuleMetadataMngr; + Result := ModuleMetadataMngrInst; +end; + +{ TModuleMetadataMngr } + +procedure TModuleMetadataMngr.LoadRegisteredNames(); + +var + i : Integer; + L : TStrings; + +begin + L:=TStringList.Create; + Try + GetWSTResourceManager.GetResourceList(L); + For I:=0 to L.Count-1 do + RegisterRepository(L[i]); + finally + L.Free; + end; +end; + +procedure TModuleMetadataMngr.ClearList(); +var + i : Integer; +begin + for i := 0 to Length(FRepositories) - 1 do begin + ClearRepository(FRepositories[i]); + end; + SetLength(FRepositories,0); +end; + +function TModuleMetadataMngr.FindInnerListIndex(const ARepName: shortstring): Integer; +begin + for Result := 0 to Pred(Length(FRepositories)) do begin + if AnsiSameText(ARepName,FRepositories[Result]^.Name) then + Exit; + end; + Result := -1; +end; + +function TModuleMetadataMngr.InternalLoadRepository(const ARepName: shortstring): Integer; +var + tmpStrm : TMemoryStream; + strBuffer : string; + i : Integer; + tmpRes : PServiceRepository; + +begin + If not GetWSTResourceManager.HasResource(ARepName) then + raise EMetadataException.CreateFmt('Repository not registered : "%s"',[ARepName]); + Result := FindInnerListIndex(ARepName); + if ( Result < 0 ) then begin + tmpStrm := TMemoryStream.Create(); + try + strBuffer := GetWSTResourceManager.ResourceAsString(ARepName); + i := Length(strBuffer); + tmpStrm.Write(strBuffer[1],i); + tmpStrm.Position := 0; + LoadRepositoryData(tmpStrm,tmpRes); + if Assigned(tmpRes) then begin + Result := Length(FRepositories); + SetLength(FRepositories, ( Result + 1 ) ); + FRepositories[Result] := tmpRes; + i := Length(tmpRes^.RootAddress); + if ( i = 0 ) or ( tmpRes^.RootAddress[i] <> '/' ) then + tmpRes^.RootAddress := tmpRes^.RootAddress + '/'; + tmpRes^.RootAddress := tmpRes^.RootAddress + 'services/'; + tmpRes^.NameSpace := FList.Values[tmpRes^.Name]; + if ( Length(tmpRes^.NameSpace) = 0 ) then + tmpRes^.NameSpace := 'urn:' + tmpRes^.Name; + end; + finally + tmpStrm.Free(); + end; + end; +end; + +function TModuleMetadataMngr.IndexOfName(const ARepName: shortstring): Integer; +begin + Result := FList.IndexOfName(ARepName); +end; + +procedure TModuleMetadataMngr.RegisterRepository(const ARepName: shortstring); +begin + if ( FList.IndexOfName(ARepName) = -1 ) then begin + FList.Values[ARepName] := 'urn:' + ARepName; + end; +end; + +function TModuleMetadataMngr.GetCount(): Integer; +begin + Result := FList.Count; +end; + +function TModuleMetadataMngr.GetRepositoryName(const AIndex: Integer): shortstring; +begin + Result := FList.Names[AIndex]; +end; + +procedure TModuleMetadataMngr.SetRepositoryNameSpace(const ARepName,ANameSpace: shortstring); +var + i : Integer; +begin + FList.Values[ARepName] := ANameSpace; + i := FindInnerListIndex(ARepName); + if ( i >= 0 ) then + FRepositories[i]^.NameSpace := ANameSpace; +end; + +function TModuleMetadataMngr.LoadRepositoryName( + const ARepName,ARootAddress : shortstring; + out ARepository : PServiceRepository +): Integer; +var + strBuffer : string; + i : Integer; +begin + Result := 0; + ARepository := nil; + i := FindInnerListIndex(ARepName); + if ( i < 0 ) then begin + i := InternalLoadRepository(ARepName); + end; + if ( Length(ARootAddress) > 0 ) and ( AnsiPos(ARootAddress,FRepositories[i]^.RootAddress) <> 1 ) then begin + strBuffer := ARootAddress; + if ( strBuffer[Length(strBuffer)] = '/' ) then + Delete(strBuffer,Length(strBuffer),1); + FRepositories[i]^.RootAddress := strBuffer + FRepositories[i]^.RootAddress; + end; + if ( i >= 0 ) then begin + CloneRepository(FRepositories[i],ARepository); + Exit; + end; +end; + +procedure TModuleMetadataMngr.ClearRepository(var ARepository: PServiceRepository); +begin + ClearRepositoryData(ARepository); +end; + +function FindService( + const ARep : PServiceRepository; + const AServiceName : shortstring +) : PService; +var + i : Integer; + srv : PService; +begin + srv := ARep^.Services; + for i := 0 to Pred(ARep^.ServicesCount) do begin + //if AnsiSameText(AServiceName,ARep^.Services[i].Name) then begin + if AnsiSameText(AServiceName,srv^.Name) then begin + Result := srv; + Exit; + end; + Inc(srv); + end; + Result := nil; +end; + +procedure TModuleMetadataMngr.SetServiceCustomData( + const ARepName : shortstring; + const AServiceName : shortstring; + const ADataName, + AData : string +); +var + i : Integer; + rp : PServiceRepository; + sp : PService; +begin + i := FindInnerListIndex(ARepName); + if ( i < 0 ) then + i := InternalLoadRepository(ARepName); + rp := FRepositories[i]; + sp := FindService(rp,AServiceName); + if not Assigned(sp) then + raise EMetadataException.CreateFmt('Service non found : "%s"',[AServiceName]); + Add(sp^.Properties,ADataName,AData); +end; + +function FindOperation( + const AServ : PService; + const AOperationName : shortstring +) : PServiceOperation; +var + i : Integer; + sop : PServiceOperation; +begin + sop := AServ^.Operations; + for i := 0 to Pred(AServ^.OperationsCount) do begin + if AnsiSameText(AOperationName,sop^.Name) then begin + Result := sop; + Exit; + end; + Inc(sop); + end; + Result := nil; +end; + +procedure TModuleMetadataMngr.SetOperationCustomData( + const ARepName : shortstring; + const AServiceName : shortstring; + const AOperationName : shortstring; + const ADataName, + AData : string +); +var + i : Integer; + rp : PServiceRepository; + sp : PService; + sop : PServiceOperation; +begin + i := FindInnerListIndex(ARepName); + if ( i < 0 ) then + i := InternalLoadRepository(ARepName); + rp := FRepositories[i]; + sp := FindService(rp,AServiceName); + if not Assigned(sp) then + raise EMetadataException.CreateFmt('Service non found : "%s"',[AServiceName]); + sop := FindOperation(sp,AOperationName); + if not Assigned(sop) then + raise EMetadataException.CreateFmt('Operation non found : "%s"',[AOperationName]); + Add(sop^.Properties,ADataName,AData); +end; + +function TModuleMetadataMngr.GetServiceMetadata(const ARepName,AServiceName: shortstring): PService; +var + i : Integer; + rp : PServiceRepository; +begin + Result := nil; + i := FindInnerListIndex(ARepName); + if ( i < 0 ) then + i := InternalLoadRepository(ARepName); + rp := FRepositories[i]; + Result := FindService(rp,AServiceName); + if ( Result <> nil ) then begin + Result := CloneService(Result); + end; +end; + +procedure TModuleMetadataMngr.ClearServiceMetadata(var AService: PService); +begin + ClearService(AService,True); + AService := nil; +end; + +constructor TModuleMetadataMngr.Create(); +begin + inherited Create(); + FRepositories := nil; + FList := TStringList.Create(); + LoadRegisteredNames(); +end; + +destructor TModuleMetadataMngr.Destroy(); +begin + ClearList(); + FreeAndNil(FList); + inherited Destroy(); +end; + + +initialization + +finalization + ModuleMetadataMngrInst := nil; + +End. diff --git a/wst/tags/0.4/metadata_service.pas b/wst/tags/0.4/metadata_service.pas new file mode 100644 index 000000000..5f6f53f39 --- /dev/null +++ b/wst/tags/0.4/metadata_service.pas @@ -0,0 +1,254 @@ +{ + This file is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This file is provide under modified LGPL licence + ( the files COPYING.modifiedLGPL and COPYING.LGPL). + + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +} + +unit metadata_service; + +{$INCLUDE wst.inc} + +interface + +uses + Classes, SysUtils, + base_service_intf, metadata_repository; + +type + + TWSTMtdOperationParam = class(TBaseComplexRemotable) + private + FModifier: TOperationParamFlag; + FName: string; + FTypeName: string; + published + property Name : string read FName write FName; + property TypeName : string read FTypeName write FTypeName; + property Modifier : TOperationParamFlag read FModifier write FModifier; + end; + + TWSTMtdOperationParamArray = class(TBaseObjectArrayRemotable) + protected + function GetParam(AIndex: Integer): TWSTMtdOperationParam; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : TWSTMtdOperationParam read GetParam;default; + end; + + TWSTMtdServiceOperation = class(TBaseComplexRemotable) + private + FName: string; + FParams: TWSTMtdOperationParamArray; + function GetParams: TWSTMtdOperationParamArray; + procedure SetParams(const AValue: TWSTMtdOperationParamArray); + public + constructor Create();override; + destructor Destroy();override; + published + property Name : string read FName write FName; + property Params : TWSTMtdOperationParamArray read GetParams write SetParams; + end; + + TWSTMtdServiceOperationArray = class(TBaseObjectArrayRemotable) + private + function GetOperation(AIndex: Integer): TWSTMtdServiceOperation; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : TWSTMtdServiceOperation read GetOperation;default; + end; + + TWSTMtdService = class(TBaseComplexRemotable) + private + FName: string; + FOperations: TWSTMtdServiceOperationArray; + function GetOperations: TWSTMtdServiceOperationArray; + procedure SetOperations(const AValue: TWSTMtdServiceOperationArray); + public + constructor Create();override; + destructor Destroy();override; + published + property Name : string read FName write FName; + property Operations : TWSTMtdServiceOperationArray read GetOperations write SetOperations; + end; + + TWSTMtdServiceArray = class(TBaseObjectArrayRemotable) + protected + function GetService(AIndex: Integer): TWSTMtdService; + public + class function GetItemClass():TBaseRemotableClass;override; + Property Item[AIndex:Integer] : TWSTMtdService Read GetService;Default; + end; + + TWSTMtdRepository = class(TBaseComplexRemotable) + private + FName: string; + FNameSpace: string; + FServices : TWSTMtdServiceArray; + function GetServices: TWSTMtdServiceArray; + procedure SetServices(const AValue: TWSTMtdServiceArray); + public + constructor Create();override; + destructor Destroy();override; + published + property Name : string read FName write FName; + property NameSpace : string read FNameSpace write FNameSpace; + property Services : TWSTMtdServiceArray read GetServices write SetServices; + end; + + {The unique metadata public service} + IWSTMetadataService = interface + ['{804A3825-ADA5-4499-87BF-CF5491BFD674}'] + function GetRepositoryList():TArrayOfStringRemotable; + function GetRepositoryInfo(const AName : string):TWSTMtdRepository; + end; + + procedure Register_metadata_service_NameSpace(); + +implementation + +procedure Register_metadata_service_NameSpace(); +begin + GetModuleMetadataMngr().SetRepositoryNameSpace('metadata_service',sWST_BASE_NS); +end; + +procedure Register_metadata_service_Types(); +var + r : TTypeRegistry; +begin + r := GetTypeRegistry(); + + r.Register(sWST_BASE_NS,TypeInfo(TOperationParamFlag),'TOperationParamFlag'); + r.Register(sWST_BASE_NS,TypeInfo(TWSTMtdOperationParam),'TWSTMtdOperationParam'); + r.Register(sWST_BASE_NS,TypeInfo(TWSTMtdOperationParamArray),'TWSTMtdOperationParamArray'); + + r.Register(sWST_BASE_NS,TypeInfo(TWSTMtdOperationParam),'TWSTMtdOperationParam'); + r.Register(sWST_BASE_NS,TypeInfo(TWSTMtdOperationParamArray),'TWSTMtdOperationParamArray'); + + r.Register(sWST_BASE_NS,TypeInfo(TWSTMtdServiceOperation),'TWSTMtdServiceOperation'); + r.Register(sWST_BASE_NS,TypeInfo(TWSTMtdServiceOperationArray),'TWSTMtdServiceOperationArray'); + + r.Register(sWST_BASE_NS,TypeInfo(TWSTMtdService),'TWSTMtdService'); + r.Register(sWST_BASE_NS,TypeInfo(TWSTMtdServiceArray),'TWSTMtdServiceArray'); + + r.Register(sWST_BASE_NS,TypeInfo(TWSTMtdRepository),'TWSTMtdRepository'); +end; + +{ TWSTMtdServiceArray } + +function TWSTMtdServiceArray.GetService(AIndex: Integer): TWSTMtdService; +begin + Result := inherited Item[AIndex] as TWSTMtdService; +end; + +class function TWSTMtdServiceArray.GetItemClass(): TBaseRemotableClass; +begin + Result := TWSTMtdService; +end; + +{ TWSTMtdRepository } + +function TWSTMtdRepository.GetServices: TWSTMtdServiceArray; +begin + Result := FServices; +end; + +procedure TWSTMtdRepository.SetServices(const AValue: TWSTMtdServiceArray); +begin + FServices.Assign(AValue); +end; + +constructor TWSTMtdRepository.Create(); +begin + inherited Create(); + FServices := TWSTMtdServiceArray.Create(); +end; + +destructor TWSTMtdRepository.Destroy(); +begin + FreeAndNil(FServices); + inherited Destroy(); +end; + +{ TWSTMtdOperationParamArray } + +function TWSTMtdOperationParamArray.GetParam(AIndex: Integer): TWSTMtdOperationParam; +begin + Result := inherited Item[AIndex] as TWSTMtdOperationParam; +end; + +class function TWSTMtdOperationParamArray.GetItemClass(): TBaseRemotableClass; +begin + Result := TWSTMtdOperationParam; +end; + +{ TWSTMtdServiceOperation } + +function TWSTMtdServiceOperation.GetParams: TWSTMtdOperationParamArray; +begin + Result := FParams; +end; + +procedure TWSTMtdServiceOperation.SetParams(const AValue: TWSTMtdOperationParamArray); +begin + FParams.Assign(AValue); +end; + +constructor TWSTMtdServiceOperation.Create(); +begin + inherited Create(); + FParams := TWSTMtdOperationParamArray.Create(); +end; + +destructor TWSTMtdServiceOperation.Destroy(); +begin + FreeAndNil(FParams); + inherited Destroy(); +end; + +{ TWSTMtdServiceOperationArray } + +function TWSTMtdServiceOperationArray.GetOperation(AIndex: Integer): TWSTMtdServiceOperation; +begin + Result := inherited Item[AIndex] as TWSTMtdServiceOperation; +end; + +class function TWSTMtdServiceOperationArray.GetItemClass(): TBaseRemotableClass; +begin + Result := TWSTMtdServiceOperation; +end; + +{ TWSTMtdService } + +function TWSTMtdService.GetOperations: TWSTMtdServiceOperationArray; +begin + Result := FOperations; +end; + +procedure TWSTMtdService.SetOperations(const AValue: TWSTMtdServiceOperationArray); +begin + FOperations.Assign(AValue); +end; + +constructor TWSTMtdService.Create(); +begin + FOperations := TWSTMtdServiceOperationArray.Create(); + inherited Create(); +end; + +destructor TWSTMtdService.Destroy(); +begin + FreeAndNil(FOperations); + inherited Destroy(); +end; + +initialization + Register_metadata_service_Types(); + +end. diff --git a/wst/tags/0.4/metadata_service.wst b/wst/tags/0.4/metadata_service.wst new file mode 100644 index 000000000..d8202b979 --- /dev/null +++ b/wst/tags/0.4/metadata_service.wst @@ -0,0 +1,7 @@ + GetWSTResourceManager().AddResource('METADATA_SERVICE', + #0#0#0#20'WST_METADATA_0.2.2.0'#0#0#0#16'metadata_service'#1#0#0#0#19'IWSTMe' + +'tadataService'#2#0#0#0#17'GetRepositoryList'#1#0#0#0#6'result'#0#0#0#23'TAr' + +'rayOfStringRemotable'#0#0#0#0#0#0#0#3#0#0#0#17'GetRepositoryInfo'#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#17'TWSTMtdRepo' + +'sitory'#0#0#0#0#0#0#0#3'' + ); \ No newline at end of file diff --git a/wst/tags/0.4/metadata_service.wst_meta b/wst/tags/0.4/metadata_service.wst_meta new file mode 100644 index 000000000..1e634ff45 Binary files /dev/null and b/wst/tags/0.4/metadata_service.wst_meta differ diff --git a/wst/tags/0.4/metadata_service_binder.pas b/wst/tags/0.4/metadata_service_binder.pas new file mode 100644 index 000000000..db0a34e67 --- /dev/null +++ b/wst/tags/0.4/metadata_service_binder.pas @@ -0,0 +1,129 @@ +{ +This unit has been produced by ws_helper. + Input unit name : "metadata_service". + This unit name : "metadata_service_binder". + Date : "12/11/2006 11:12". +} +unit metadata_service_binder; +{$INCLUDE wst.inc} +interface + +uses SysUtils, Classes, base_service_intf, server_service_intf, metadata_service; + +type + + + TWSTMetadataService_ServiceBinder=class(TBaseServiceBinder) + Protected + procedure GetRepositoryListHandler(AFormatter:IFormatterResponse); + procedure GetRepositoryInfoHandler(AFormatter:IFormatterResponse); + Public + constructor Create(); + End; + + TWSTMetadataService_ServiceBinderFactory = class(TInterfacedObject,IItemFactory) + protected + function CreateInstance():IInterface; + End; + + procedure Server_service_RegisterWSTMetadataServiceService(); + +Implementation +uses TypInfo, wst_resources_imp,metadata_repository; + +{ TWSTMetadataService_ServiceBinder implementation } +procedure TWSTMetadataService_ServiceBinder.GetRepositoryListHandler(AFormatter:IFormatterResponse); +Var + cllCntrl : ICallControl; + tmpObj : IWSTMetadataService; + callCtx : ICallContext; + strPrmName : string; + procName,trgName : string; + returnVal : TArrayOfStringRemotable; +Begin + callCtx := GetCallContext(); + If ( PTypeInfo(TypeInfo(TArrayOfStringRemotable))^.Kind in [tkClass,tkInterface] ) Then + Pointer(returnVal) := Nil; + + + tmpObj := Self.GetFactory().CreateInstance() as IWSTMetadataService; + if Supports(tmpObj,ICallControl,cllCntrl) then + cllCntrl.SetCallContext(GetCallContext()); + + returnVal := tmpObj.GetRepositoryList(); + If ( PTypeInfo(TypeInfo(TArrayOfStringRemotable))^.Kind = tkClass ) And Assigned(Pointer(returnVal)) Then + callCtx.AddObjectToFree(TObject(returnVal)); + + procName := AFormatter.GetCallProcedureName(); + trgName := AFormatter.GetCallTarget(); + AFormatter.Clear(); + AFormatter.BeginCallResponse(procName,trgName); + AFormatter.Put('return',TypeInfo(TArrayOfStringRemotable),returnVal); + AFormatter.EndCallResponse(); + + callCtx := Nil; +End; + +procedure TWSTMetadataService_ServiceBinder.GetRepositoryInfoHandler(AFormatter:IFormatterResponse); +Var + cllCntrl : ICallControl; + tmpObj : IWSTMetadataService; + callCtx : ICallContext; + strPrmName : string; + procName,trgName : string; + AName : string; + returnVal : TWSTMtdRepository; +Begin + callCtx := GetCallContext(); + Pointer(returnVal) := Nil; + + strPrmName := 'AName'; AFormatter.Get(TypeInfo(string),strPrmName,AName); + + tmpObj := Self.GetFactory().CreateInstance() as IWSTMetadataService; + if Supports(tmpObj,ICallControl,cllCntrl) then + cllCntrl.SetCallContext(GetCallContext()); + + returnVal := tmpObj.GetRepositoryInfo(AName); + If Assigned(Pointer(returnVal)) Then + callCtx.AddObjectToFree(TObject(returnVal)); + + procName := AFormatter.GetCallProcedureName(); + trgName := AFormatter.GetCallTarget(); + AFormatter.Clear(); + AFormatter.BeginCallResponse(procName,trgName); + AFormatter.Put('return',TypeInfo(TWSTMtdRepository),returnVal); + AFormatter.EndCallResponse(); + + callCtx := Nil; +End; + + +constructor TWSTMetadataService_ServiceBinder.Create(); +Begin + Inherited Create(GetServiceImplementationRegistry().FindFactory('IWSTMetadataService')); + RegisterVerbHandler('GetRepositoryList',@GetRepositoryListHandler); + RegisterVerbHandler('GetRepositoryInfo',@GetRepositoryInfoHandler); +End; + + +{ TWSTMetadataService_ServiceBinderFactory } +function TWSTMetadataService_ServiceBinderFactory.CreateInstance():IInterface; +Begin + Result := TWSTMetadataService_ServiceBinder.Create() as IInterface; +End; + + +procedure Server_service_RegisterWSTMetadataServiceService(); +Begin + GetServerServiceRegistry().Register('IWSTMetadataService',TWSTMetadataService_ServiceBinderFactory.Create() as IItemFactory); +End; + +initialization + + {$IF DECLARED(Register_metadata_service_NameSpace)} + Register_metadata_service_NameSpace(); + {$ENDIF} + + {$i metadata_service.wst} + +End. diff --git a/wst/tags/0.4/metadata_service_imp.pas b/wst/tags/0.4/metadata_service_imp.pas new file mode 100644 index 000000000..fc3f35761 --- /dev/null +++ b/wst/tags/0.4/metadata_service_imp.pas @@ -0,0 +1,126 @@ +{ +This unit has been produced by ws_helper. + Input unit name : "metadata_service". + This unit name : "metadata_service_imp". + Date : "01/07/2006 22:14". +} +Unit metadata_service_imp; +{$INCLUDE wst.inc} +Interface + +Uses SysUtils, Classes, + base_service_intf, server_service_intf, server_service_imputils, metadata_service; + +Type + + + TWSTMetadataService_ServiceImp=class(TSimpleFactoryItem,IWSTMetadataService) + Protected + function GetRepositoryList():TArrayOfStringRemotable; + function GetRepositoryInfo( + Const AName : string + ):TWSTMtdRepository; + End; + + + procedure RegisterWSTMetadataServiceImplementationFactory(); + +Implementation +uses metadata_repository; + +{ TWSTMetadataService_ServiceImp implementation } +function TWSTMetadataService_ServiceImp.GetRepositoryList():TArrayOfStringRemotable; +var + i, c : Integer; + mn : IModuleMetadataMngr; +Begin + Result := TArrayOfStringRemotable.Create(); + try + mn := GetModuleMetadataMngr(); + c := mn.GetCount(); + Result.SetLength(c); + for i := 0 to Pred(c) do + Result[i] := mn.GetRepositoryName(i); + except + FreeAndNil(Result); + raise; + end; +End; + +function TWSTMetadataService_ServiceImp.GetRepositoryInfo(Const AName : string):TWSTMtdRepository; + + procedure LoadService(ARawServ : PService; AObjServ : TWSTMtdService); + + procedure LoadOperation(ARawOper : PServiceOperation; AObjOper : TWSTMtdServiceOperation); + + procedure LoadParam(ARawParam : POperationParam; AObjPrm : TWSTMtdOperationParam); + begin + if Assigned(ARawParam) and Assigned(AObjPrm) then begin + AObjPrm.Name :=ARawParam^.Name; + AObjPrm.TypeName := ARawParam^.TypeName; + AObjPrm.Modifier := ARawParam^.Modifier; + end; + end; + + var + ii, cc : Integer; + begin + if Assigned(ARawOper) and Assigned(AObjOper) then begin + AObjOper.Name :=ARawOper^.Name; + cc := ARawOper^.ParamsCount; + AObjOper.Params.SetLength(cc); + for ii := 0 to Pred(cc) do + LoadParam(@(ARawOper^.Params[ii]),AObjOper.Params[ii]); + end; + end; + + var + k, d : Integer; + begin + if Assigned(ARawServ) and Assigned(AObjServ) then begin + AObjServ.Name :=ARawServ^.Name; + d := ARawServ^.OperationsCount; + AObjServ.Operations.SetLength(d); + for k := 0 to Pred(d) do + LoadOperation(@(ARawServ^.Operations[k]),AObjServ.Operations[k]); + end; + end; + +var + repData : PServiceRepository; + mn : IModuleMetadataMngr; + i, c : Integer; +Begin + Result := nil; + mn := GetModuleMetadataMngr(); + mn.LoadRepositoryName(AName,'/',repData); + if Assigned(repData) then begin + try + try + Result := TWSTMtdRepository.Create(); + Result.Name := repData^.Name; + Result.NameSpace := repData^.NameSpace; + c := repData^.ServicesCount; + Result.Services.SetLength(c); + if ( c > 0 ) then begin + for i := 0 to Pred(c) do begin + LoadService(@(repData^.Services[i]),Result.Services[i]); + end; + end; + except + FreeAndNil(Result); + raise; + end; + finally + mn.ClearRepository(repData); + end; + end; +End; + + +procedure RegisterWSTMetadataServiceImplementationFactory(); +Begin + GetServiceImplementationRegistry().Register('IWSTMetadataService',TImplementationFactory.Create(TWSTMetadataService_ServiceImp) as IServiceImplementationFactory); +End; + +End. diff --git a/wst/tags/0.4/metadata_service_proxy.pas b/wst/tags/0.4/metadata_service_proxy.pas new file mode 100644 index 000000000..f2b2d29f3 --- /dev/null +++ b/wst/tags/0.4/metadata_service_proxy.pas @@ -0,0 +1,90 @@ +{ +This unit has been produced by ws_helper. + Input unit name : "metadata_service". + This unit name : "metadata_service_proxy". + Date : "12/11/2006 11:12". +} +Unit metadata_service_proxy; +{$mode objfpc}{$H+} +Interface + +Uses SysUtils, Classes, TypInfo, base_service_intf, service_intf, metadata_service; + +Type + + + TWSTMetadataService_Proxy=class(TBaseProxy,IWSTMetadataService) + Protected + class function GetServiceType() : PTypeInfo;override; + function GetRepositoryList():TArrayOfStringRemotable; + function GetRepositoryInfo( + Const AName : string + ):TWSTMtdRepository; + End; + +Implementation +uses wst_resources_imp, metadata_repository; + +{ TWSTMetadataService_Proxy implementation } + +class function TWSTMetadataService_Proxy.GetServiceType() : PTypeInfo; +begin + result := TypeInfo(IWSTMetadataService); +end; + +function TWSTMetadataService_Proxy.GetRepositoryList():TArrayOfStringRemotable; +Var + locSerializer : IFormatterClient; + strPrmName : string; +Begin + locSerializer := GetSerializer(); + Try + locSerializer.BeginCall('GetRepositoryList', GetTarget(),(Self as ICallContext)); + locSerializer.EndCall(); + + MakeCall(); + + locSerializer.BeginCallRead((Self as ICallContext)); + If ( PTypeInfo(TypeInfo(TArrayOfStringRemotable))^.Kind in [tkClass,tkInterface] ) Then + Pointer(Result) := Nil; + strPrmName := 'return'; + locSerializer.Get(TypeInfo(TArrayOfStringRemotable), strPrmName, result); + + Finally + locSerializer.Clear(); + End; +End; + +function TWSTMetadataService_Proxy.GetRepositoryInfo( + Const AName : string +):TWSTMtdRepository; +Var + locSerializer : IFormatterClient; + strPrmName : string; +Begin + locSerializer := GetSerializer(); + Try + locSerializer.BeginCall('GetRepositoryInfo', GetTarget(),(Self as ICallContext)); + locSerializer.Put('AName', TypeInfo(string), AName); + locSerializer.EndCall(); + + MakeCall(); + + locSerializer.BeginCallRead((Self as ICallContext)); + Pointer(Result) := Nil; + strPrmName := 'return'; + locSerializer.Get(TypeInfo(TWSTMtdRepository), strPrmName, result); + + Finally + locSerializer.Clear(); + End; +End; + + +initialization + {$i metadata_service.wst} + + {$IF DECLARED(Register_metadata_service_ServiceMetadata)} + Register_metadata_service_ServiceMetadata(); + {$ENDIF} +End. diff --git a/wst/tags/0.4/metadata_wsdl.pas b/wst/tags/0.4/metadata_wsdl.pas new file mode 100644 index 000000000..3fc8d011d --- /dev/null +++ b/wst/tags/0.4/metadata_wsdl.pas @@ -0,0 +1,825 @@ +{ + This file is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This file is provide under modified LGPL licence + ( the files COPYING.modifiedLGPL and COPYING.LGPL). + + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +} + +unit metadata_wsdl; + +{$INCLUDE wst.inc} + +interface + +uses + Classes, SysUtils, TypInfo, + DOM, + base_service_intf, metadata_repository; + +type + + IWsdlTypeHandler = interface + ['{DA9AF8B1-392B-49A8-91CC-6B5C5131E6FA}'] + procedure Generate( + const APascalTypeName : string; + AWsdlDocument : TDOMDocument + ); + end; + + IWsdlTypeHandlerRegistry = Interface + ['{A2FA2FE4-933D-44CC-B266-BF48674DECE9}'] + function Find(const APascalTypeName : string):IWsdlTypeHandler; + procedure Register( + const APascalTypeName : string; + AFactory : IItemFactory + ); + procedure RegisterDefaultHandler( + const ATypeKind : TTypeKind; + AFactory : IItemFactory + ); + End; + + { TEnumTypeHandler } + + TEnumTypeHandler = class(TSimpleFactoryItem,IWsdlTypeHandler) + protected + procedure Generate( + const APascalTypeName : string; + AWsdlDocument : TDOMDocument + ); + end; + + { TBaseComplexRemotable_TypeHandler } + + TBaseComplexRemotable_TypeHandler = class(TSimpleFactoryItem,IWsdlTypeHandler) + protected + procedure Generate( + const APascalTypeName : string; + AWsdlDocument : TDOMDocument + ); + end; + + { TBaseObjectArrayRemotable_TypeHandler } + + TBaseArrayRemotable_TypeHandler = class(TSimpleFactoryItem,IWsdlTypeHandler) + protected + procedure Generate( + const APascalTypeName : string; + AWsdlDocument : TDOMDocument + ); + end; + + procedure GenerateWSDL(AMdtdRep : PServiceRepository; ADoc : TDOMDocument); + + function GetWsdlTypeHandlerRegistry():IWsdlTypeHandlerRegistry; + +implementation + +const + sWSDL_NS = 'http://schemas.xmlsoap.org/wsdl/'; + sSOAP_NS = 'http://schemas.xmlsoap.org/wsdl/soap/'; + sSOAP = 'soap'; + sSOAP_ENC_NS = 'http://schemas.xmlsoap.org/soap/encoding/'; + sXMLNS = 'xmlns'; + sXSD_NS = 'http://www.w3.org/2001/XMLSchema'; + sXSD = 'xsd'; + sTNS = 'tns'; + + sSOAP_ACTION = 'soapAction'; + sSOAP_ENCODED = 'encoded'; + sSOAP_ENCODING_STYLE = 'encodingStyle'; + sSOAP_RPC = 'rpc'; + sSOAP_TRANSPORT = 'http://schemas.xmlsoap.org/soap/http'; + sSOAP_USE = 'use'; + + sADDRESS = 'address'; + sATTRIBUTE = 'attribute'; + sBASE = 'base'; + sBINDING = 'binding'; + sBODY = 'body'; + sCOMPLEX_TYPE = 'complexType'; + sELEMENT = 'element'; + sENUMERATION = 'enumeration'; + sITEM = 'item'; + sLOCATION = 'location'; + sMIN_OCCURS = 'minOccurs'; + sMAX_OCCURS = 'maxOccurs'; + sNAME = 'name'; + sNAME_SPACE = 'namespace'; + sPORT_TYPE = 'portType'; + sRESTRICTION = 'restriction'; + sSEQUENCE = 'sequence'; + sSERVICE = 'service'; + sSIMPLE_TYPE = 'simpleType'; + sSTYLE = 'style'; + sTRANSPORT = 'transport'; + sTYPE = 'type'; + sUNBOUNDED = 'unbounded'; + sUSE = 'use'; + sVALUE = 'value'; + + sWSDL_DEFINITIONS = 'definitions'; + sWSDL_INPUT = 'input'; + sWSDL_MESSAGE = 'message'; + sWSDL_NAME = 'name'; + sWSDL_OPERATION = 'operation'; + sWSDL_OUTPUT = 'output'; + sWSDL_PART = 'part'; + sWSDL_PORT = 'port'; + sWSDL_PORT_TYPE = sPORT_TYPE; + sWSDL_SCHEMA = 'schema'; + sWSDL_TARGET_NS = 'targetNamespace'; + sWSDL_TYPE = sTYPE; + sWSDL_TYPES = 'types'; + + sFORMAT_Input_EncodingStyle = 'FORMAT_Input_EncodingStyle'; + sFORMAT_Input_EncodingStyleURI = 'FORMAT_Input_EncodingStyleURI'; + +var + WsdlTypeHandlerRegistryInst : IWsdlTypeHandlerRegistry; + +type + + { TWsdlTypeHandlerRegistry } + + TWsdlTypeHandlerRegistry = class(TBaseFactoryRegistry,IInterface,IWsdlTypeHandlerRegistry) + private + FDefaultHandlerTable : Array[TTypeKind] of IItemFactory; + private + function FindNearestClass(const AClassType : TClass):IItemFactory; + protected + function Find(const APascalTypeName : string):IWsdlTypeHandler; + procedure RegisterDefaultHandler( + const ATypeKind : TTypeKind; + AFactory : IItemFactory + ); + public + destructor Destroy();override; + End; + +{ TWsdlTypeHandlerRegistry } + +function DistanceFromChildToParent(AChildClass,AParentClass : TClass):Integer; +var + ch : TClass; +begin + if Assigned(AChildClass) and Assigned(AParentClass) then begin + Result := 0; + ch := AChildClass; + while Assigned(ch) do begin + if ( ch = AParentClass ) then + Exit; + Inc(Result); + ch := ch.ClassParent; + end; + end; + Result := MaxInt; +end; + +function TWsdlTypeHandlerRegistry.FindNearestClass(const AClassType : TClass):IItemFactory; +var + i,c, foundIndex,tmpScore, score : Integer; + itm : TBaseFactoryRegistryItem; + typData : PTypeData; + r : TTypeRegistry; + ri : TTypeRegistryItem; +begin + Result := nil; + foundIndex := -1; + score := MaxInt; + r := GetTypeRegistry(); + c := Count; + for i := 0 to Pred(c) do begin + itm := Item[i]; + ri := r.Find(itm.Name); + if Assigned(ri) and ( ri.DataType^.Kind = tkClass ) then begin + typData := GetTypeData(ri.DataType); + tmpScore := DistanceFromChildToParent(AClassType,typData^.ClassType); + if ( tmpScore < score ) then begin + foundIndex := i; + score := tmpScore; + end; + end; + end; + if ( foundIndex >= 0 ) then begin + Result := Item[foundIndex].Factory; + end; +end; + +function TWsdlTypeHandlerRegistry.Find(const APascalTypeName: string): IWsdlTypeHandler; +Var + fct : IItemFactory; + ri : TTypeRegistryItem; +begin + Result := nil; + fct := FindFactory(APascalTypeName); + if not Assigned(fct) then begin + ri := GetTypeRegistry().Find(APascalTypeName); + if Assigned(ri) then begin + if ( ri.DataType^.Kind = tkClass ) then + fct := FindNearestClass(GetTypeData(ri.DataType)^.ClassType); + if not Assigned(fct) then + fct := FDefaultHandlerTable[ri.DataType^.Kind]; + end; + end; + if Assigned(fct) then + Result := fct.CreateInstance() as IWsdlTypeHandler; +end; + +procedure TWsdlTypeHandlerRegistry.RegisterDefaultHandler( + const ATypeKind: TTypeKind; + AFactory: IItemFactory +); +begin + FDefaultHandlerTable[ATypeKind] := AFactory; +end; + +destructor TWsdlTypeHandlerRegistry.Destroy(); +var + i : TTypeKind; +begin + for i := Low(TTypeKind) to High(TTypeKind) do + FDefaultHandlerTable[i] := nil; + inherited Destroy(); +end; + +function CreateElement(const ANodeName : DOMString; AParent : TDOMNode; ADoc : TDOMDocument):TDOMElement;//inline; +begin + Result := ADoc.CreateElement(ANodeName); + AParent.AppendChild(Result); +end; + +function FindAttributeByValueInNode( + const AAttValue : string; + const ANode : TDOMNode; + out AResAtt : string; + const AStartIndex : Integer = 0; + const AStartingWith : string = '' +):boolean; +var + i,c : Integer; + b : Boolean; +begin + AResAtt := ''; + if Assigned(ANode) and Assigned(ANode.Attributes) then begin + b := ( Length(AStartingWith) = 0); + c := Pred(ANode.Attributes.Length); + if ( AStartIndex >= 0 ) then + i := AStartIndex; + for i := 0 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 + AResAtt := ANode.Attributes.Item[i].NodeName; + Result := True; + Exit; + end; + end; + end; + Result := False; +end; + +function GetNameSpaceShortName( + const ANameSpace : string; + AWsdlDocument : TDOMDocument +):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}]) ; + AWsdlDocument.DocumentElement.SetAttribute(Format('%s:%s',[sXMLNS,Result]),ANameSpace); + end; +end; + +type TServiceElementType = ( setPortType, setBinding, setPort, setService,setAddress ); +function GetServicePartName(AService : PService; const AServicePart : TServiceElementType):string; +const PART_NAME_MAP : array[TServiceElementType] of shortstring = ('', 'Binding', 'Port', '',''); +begin + Result := AService^.Name + PART_NAME_MAP[AServicePart]; +end; + +procedure GenerateWSDL(AMdtdRep : PServiceRepository; ADoc : TDOMDocument); + + procedure GenerateServiceMessages( + AService : PService; + ARootNode : TDOMElement + ); + + procedure GenerateOperationMessage(AOperation : PServiceOperation); + + procedure GenerateParam(APrm : POperationParam; AMsgNode : TDOMElement); + var + tmpNode : TDOMElement; + typItm : TTypeRegistryItem; + ns_shortName, s : string; + begin + tmpNode := CreateElement(sWSDL_PART,AMsgNode,ADoc); + tmpNode.SetAttribute(sWSDL_NAME,APrm^.Name); + typItm := GetTypeRegistry().Find(APrm^.TypeName); + if not Assigned(typItm) then + raise EMetadataException.CreateFmt('Type not registered : "%s".',[APrm^.TypeName]); + //Assert(Assigned(typItm),APrm^.TypeName); + ns_shortName := GetNameSpaceShortName(typItm.NameSpace,ADoc); + s := Format('%s:%s',[ns_shortName,typItm.DeclaredName]); + tmpNode.SetAttribute(sWSDL_TYPE,s); + end; + + var + qryNode, rspNode : TDOMElement; + ii, cc : Integer; + pp : POperationParam; + begin + qryNode := CreateElement(sWSDL_MESSAGE,ARootNode,ADoc); + qryNode.SetAttribute(sWSDL_NAME,Format('%s',[AOperation^.Name])); + rspNode := CreateElement(sWSDL_MESSAGE,ARootNode,ADoc); + rspNode.SetAttribute(sWSDL_NAME,Format('%sResponse',[AOperation^.Name])); + cc := AOperation^.ParamsCount; + 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); + end; + end; + + Var + j, k : Integer; + po : PServiceOperation; + begin + k := AService^.OperationsCount; + if ( k > 0 ) then begin + po := AService^.Operations; + for j := 0 to pred(k) do + GenerateOperationMessage(@(po[j])); + end; + end; + + procedure GenerateServicePortType(AService : PService; ARootNode : TDOMElement); + + procedure GenerateOperation(AOperation : PServiceOperation; APrtTypeNode : TDOMElement); + var + opNode, inNode, outNode : TDOMElement; + begin + opNode := CreateElement(sWSDL_OPERATION,APrtTypeNode,ADoc); + opNode.SetAttribute(sWSDL_NAME,AOperation^.Name); + inNode := CreateElement(sWSDL_INPUT,opNode,ADoc); + inNode.SetAttribute(sWSDL_MESSAGE,Format('%s:%s',[sTNS,AOperation^.Name])); + outNode := CreateElement(sWSDL_OUTPUT,opNode,ADoc); + outNode.SetAttribute(sWSDL_MESSAGE,Format('%s:%sResponse',[sTNS,AOperation^.Name])); + end; + + var + prtTypeNode : TDOMElement; + j, k : Integer; + po : PServiceOperation; + begin + prtTypeNode := CreateElement(sWSDL_PORT_TYPE,ARootNode,ADoc); + prtTypeNode.SetAttribute(sWSDL_NAME,GetServicePartName(AService,setPortType)); + k := AService^.OperationsCount; + if ( k > 0 ) then begin + po := AService^.Operations; + for j := 0 to pred(k) do begin + GenerateOperation(@(po[j]),prtTypeNode); + end; + end; + end; + + procedure GenerateServiceBinding(AService : PService; ARootNode : TDOMElement); + + procedure GenerateOperation(AOperation : PServiceOperation; ABndngNode : TDOMElement); + var + opNode, inNode, outNode, bdyNode : TDOMElement; + strBuff : string; + propData : PPropertyData; + encdStyl,encdStylURI : string; + begin + strBuff := Format('%s:%s',[sSOAP,sWSDL_OPERATION]); + //CreateElement(strBuff,ABndngNode,ADoc).SetAttribute(sSOAP_ACTION,Format('%s/%s%s',[AMdtdRep^.NameSpace,AService^.Name,AOperation^.Name])); + opNode := CreateElement(sWSDL_OPERATION,ABndngNode,ADoc); + opNode.SetAttribute(sWSDL_NAME,AOperation^.Name); + CreateElement(strBuff,opNode,ADoc).SetAttribute(sSOAP_ACTION,Format('%s/%s%s',[AMdtdRep^.NameSpace,AService^.Name,AOperation^.Name])); + inNode := CreateElement(sWSDL_INPUT,opNode,ADoc); + strBuff := Format('%s:%s',[sSOAP,sBODY]); + bdyNode := CreateElement(strBuff,inNode,ADoc); + encdStyl := 'literal'; + encdStylURI := ''; + propData := Find(AOperation^.Properties,sFORMAT_Input_EncodingStyle); + if Assigned(propData) and ( Length(Trim(propData^.Data)) > 0 ) then begin + encdStyl := Trim(propData^.Data); + end; + bdyNode.SetAttribute(sSOAP_USE,encdStyl); + bdyNode.SetAttribute(sNAME_SPACE,Format('%s',[AMdtdRep^.NameSpace])); + propData := Find(AOperation^.Properties,sFORMAT_Input_EncodingStyleURI); + if Assigned(propData) and ( Length(Trim(propData^.Data)) > 0 ) then begin + encdStylURI := Trim(propData^.Data); + end; + if ( Length(encdStylURI) > 0 ) then + bdyNode.SetAttribute(sSOAP_ENCODING_STYLE,encdStylURI); + + outNode := CreateElement(sWSDL_OUTPUT,opNode,ADoc); + strBuff := Format('%s:%s',[sSOAP,sBODY]); + bdyNode := CreateElement(strBuff,outNode,ADoc); + bdyNode.SetAttribute(sSOAP_USE,encdStyl); + bdyNode.SetAttribute(sNAME_SPACE,Format('%s',[AMdtdRep^.NameSpace])); + if ( Length(encdStylURI) > 0 ) then + bdyNode.SetAttribute(sSOAP_ENCODING_STYLE,encdStylURI); + end; + + var + bndgNode, soapbndgNode : TDOMElement; + j, k : Integer; + po : PServiceOperation; + strBuf : string; + begin + bndgNode := CreateElement(sBINDING,ARootNode,ADoc); + bndgNode.SetAttribute(sWSDL_NAME,GetServicePartName(AService,setBinding)); + bndgNode.SetAttribute(sWSDL_TYPE,Format('%s:%s',[sTNS,GetServicePartName(AService,setPortType)])); + + strBuf := Format('%s:%s',[sSOAP,sBINDING]); + soapbndgNode := CreateElement(strBuf,bndgNode,ADoc); + soapbndgNode.SetAttribute(sSTYLE,sSOAP_RPC); + soapbndgNode.SetAttribute(sTRANSPORT,sSOAP_TRANSPORT); + + k := AService^.OperationsCount; + if ( k > 0 ) then begin + po := AService^.Operations; + for j := 0 to pred(k) do begin + GenerateOperation(@(po[j]),bndgNode); + end; + end; + end; + + procedure GenerateServicePublication(AService : PService; ARootNode : TDOMElement); + var + srvcNode, portNode, soapAdrNode : TDOMElement; + strBuf : string; + begin + srvcNode := CreateElement(sSERVICE,ARootNode,ADoc); + srvcNode.SetAttribute(sWSDL_NAME,GetServicePartName(AService,setService)); + + strBuf := Format('%s',[sWSDL_PORT]); + portNode := CreateElement(strBuf,srvcNode,ADoc); + portNode.SetAttribute(sWSDL_NAME,GetServicePartName(AService,setPort)); + portNode.SetAttribute(sBINDING,Format('%s:%s',[sTNS,GetServicePartName(AService,setBinding)])); + + strBuf := Format('%s:%s',[sSOAP,sADDRESS]); + soapAdrNode := CreateElement(strBuf,portNode,ADoc); + soapAdrNode.SetAttribute(sLOCATION,Format('%s%s',[AMdtdRep^.RootAddress,GetServicePartName(AService,setAddress)])); + end; + + procedure GenerateServiceTypes(); + var + j, k : Integer; + tr : TTypeRegistry; + tri : TTypeRegistryItem; + g : IWsdlTypeHandler; + gr : IWsdlTypeHandlerRegistry; + begin + tr := GetTypeRegistry(); + gr := GetWsdlTypeHandlerRegistry(); + k := tr.Count; + for j := 0 to Pred(k) do begin + tri := tr[j]; + if ( not ( trioNonVisibleToMetadataService in tri.Options ) ) and + AnsiSameText(AMdtdRep^.NameSpace,tri.NameSpace) + then begin + g := gr.Find(tri.DataType^.Name); + if assigned(g) then + g.Generate(tri.DataType^.Name,ADoc); + end; + end; + end; + + function CreateRootNode():TDOMElement; + begin + Result := CreateElement(sWSDL_DEFINITIONS,ADoc,ADoc); + Result.SetAttribute(sWSDL_NAME,AMdtdRep^.Name); + + Result.SetAttribute(sWSDL_TARGET_NS,AMdtdRep^.NameSpace); + Result.SetAttribute(Format('%s:%s',[sXMLNS,sSOAP]),sSOAP_NS); + Result.SetAttribute(Format('%s:%s',[sXMLNS,sXSD]),sXSD_NS); + Result.SetAttribute(Format('%s:%s',[sXMLNS,sTNS]),AMdtdRep^.NameSpace); + Result.SetAttribute(sXMLNS,sWSDL_NS); + end; + + function CreateTypesRootNode(ARootNode : TDOMNode):TDOMElement; + begin + Result := CreateElement(sWSDL_TYPES,ARootNode,ADoc); + //Result.SetAttribute(sWSDL_TARGET_NS,AMdtdRep^.NameSpace); + end; + +var + defNode, typesNode, schNode : TDOMElement; + i, c : Integer; + ps : PService; +begin + if not ( Assigned(AMdtdRep) and Assigned(ADoc)) then + Exit; + + defNode := CreateRootNode(); + typesNode := CreateTypesRootNode(defNode); + schNode := CreateElement(sXSD + ':' + sWSDL_SCHEMA,typesNode,ADoc); + schNode.SetAttribute(sXMLNS,sXSD_NS); + schNode.SetAttribute(sWSDL_TARGET_NS,AMdtdRep^.NameSpace); + + GenerateServiceTypes(); + + c := AMdtdRep^.ServicesCount; + if ( c > 0 ) then begin + ps := AMdtdRep^.Services; + for i := 0 to Pred(c) do begin + GenerateServiceMessages(@(ps[i]),defNode); + end; + for i := 0 to Pred(c) do begin + GenerateServicePortType(@(ps[i]),defNode); + end; + for i := 0 to Pred(c) do begin + GenerateServiceBinding(@(ps[i]),defNode); + end; + for i := 0 to Pred(c) do begin + GenerateServicePublication(@(ps[i]),defNode); + end; + end; + +end; + +function GetWsdlTypeHandlerRegistry():IWsdlTypeHandlerRegistry; +begin + Result := WsdlTypeHandlerRegistryInst; +end; + +type + + { TFakeTypeHandler } + + TFakeTypeHandler = class(TSimpleFactoryItem,IWsdlTypeHandler) + protected + procedure Generate( + const APascalTypeName : string; + AWsdlDocument : TDOMDocument + ); + end; + +{ TBaseComplexRemotable_TypeHandler } + +procedure TBaseComplexRemotable_TypeHandler.Generate( + const APascalTypeName : string; + AWsdlDocument : TDOMDocument +); +var + typItm, propTypItm : TTypeRegistryItem; + s, prop_ns_shortName : string; + defTypesNode, defSchemaNode, cplxNode, sqcNode, propNode, eltNode : TDOMElement; + i : Integer; + propList : PPropList; + propCount, propListLen : Integer; + p : PPropInfo; + persistType : TPropStoreType; + objTypeData : PTypeData; + clsTyp : TBaseComplexRemotableClass; + attProp : Boolean; +begin + typItm := GetTypeRegistry().Find(APascalTypeName); + if Assigned(typItm) and + ( typItm.DataType^.Kind = tkClass ) + then begin + GetNameSpaceShortName(typItm.NameSpace,AWsdlDocument); + defTypesNode := AWsdlDocument.DocumentElement.FindNode(sWSDL_TYPES) as TDOMElement; + Assert(Assigned(defTypesNode)); + defSchemaNode := defTypesNode.FirstChild as TDOMElement; + + s := Format('%s:%s',[sXSD,sELEMENT]); + eltNode := CreateElement(s,defSchemaNode,AWsdlDocument); + eltNode.SetAttribute(sNAME, typItm.DeclaredName) ; + + s := Format('%s:%s',[sXSD,sCOMPLEX_TYPE]); + cplxNode := CreateElement(s,eltNode,AWsdlDocument); + //cplxNode.SetAttribute(sNAME, typItm.DeclaredName) ; + s := Format('%s:%s',[sXSD,sSEQUENCE]); + sqcNode := CreateElement(s,cplxNode,AWsdlDocument); + objTypeData := GetTypeData(typItm.DataType); + clsTyp := TBaseComplexRemotableClass(objTypeData^.ClassType); + propCount := objTypeData^.PropCount; + if ( propCount > 0 ) then begin + propListLen := GetPropList(typItm.DataType,propList); + try + for i := 0 to Pred(propCount) do begin + p := propList^[i]; + persistType := IsStoredPropClass(objTypeData^.ClassType,p); + if ( persistType in [pstOptional,pstAlways] ) then begin + attProp := clsTyp.IsAttributeProperty(p^.Name); + if attProp then begin + s := Format('%s:%s',[sXSD,sATTRIBUTE]); + propNode := CreateElement(s,cplxNode,AWsdlDocument) + end else begin + s := Format('%s:%s',[sXSD,sELEMENT]); + propNode := CreateElement(s,sqcNode,AWsdlDocument); + end; + propNode.SetAttribute(sNAME,p^.Name); + propTypItm := GetTypeRegistry().Find(p^.PropType^.Name); + if Assigned(propTypItm) then begin + prop_ns_shortName := GetNameSpaceShortName(propTypItm.NameSpace,AWsdlDocument); + propNode.SetAttribute(sTYPE,Format('%s:%s',[prop_ns_shortName,propTypItm.DeclaredName])); + if attProp then begin + if ( persistType = pstOptional ) then + propNode.SetAttribute(sATTRIBUTE,'optional') + else + propNode.SetAttribute(sATTRIBUTE,'required'); + end else begin + if ( persistType = pstOptional ) then + propNode.SetAttribute(sMIN_OCCURS,'0') + else + propNode.SetAttribute(sMIN_OCCURS,'1'); + propNode.SetAttribute(sMAX_OCCURS,'1'); + end; + end; + end; + end; + finally + Freemem(propList,propListLen*SizeOf(Pointer)); + end; + end; + end; +end; + +{ TEnumTypeHandler } + +procedure TEnumTypeHandler.Generate( + const APascalTypeName: string; + AWsdlDocument: TDOMDocument +); +var + typItm : TTypeRegistryItem; + ns_shortName, s : string; + defTypesNode, defSchemaNode, resNode, restrictNode, eltNode : TDOMElement; + i, c : Integer; +begin + typItm := GetTypeRegistry().Find(APascalTypeName); + if Assigned(typItm) and + ( typItm.DataType^.Kind = tkEnumeration ) + then 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}]) ; + AWsdlDocument.DocumentElement.SetAttribute(Format('%s:%s',[sXMLNS,ns_shortName]),typItm.NameSpace); + end; + defTypesNode := AWsdlDocument.DocumentElement.FindNode(sWSDL_TYPES) as TDOMElement; + Assert(Assigned(defTypesNode)); + defSchemaNode := defTypesNode.FirstChild as TDOMElement; + + //s := Format('%s:%s',[sXSD,sELEMENT]); + //eltNode := CreateElement(s,defSchemaNode,AWsdlDocument); + //eltNode.SetAttribute(sNAME, typItm.DeclaredName) ; + s := Format('%s:%s',[sXSD,sSIMPLE_TYPE]); + resNode := CreateElement(s,defSchemaNode,AWsdlDocument); + resNode.SetAttribute(sNAME, typItm.DeclaredName) ; + s := Format('%s:%s',[sXSD,sRESTRICTION]); + restrictNode := CreateElement(s,resNode,AWsdlDocument); + restrictNode.SetAttribute(sBASE,Format('%s:%s',[sXSD,'string'])) ; + c := GetEnumNameCount(typItm.DataType); + for i := 0 to pred(c) do begin + s := Format('%s:%s',[sXSD,sENUMERATION]); + //CreateElement(s,restrictNode,AWsdlDocument).SetAttribute(sVALUE,GetEnumName(typItm.DataType,i)); + CreateElement(s,restrictNode,AWsdlDocument).SetAttribute( + sVALUE, + typItm.GetExternalPropertyName(GetEnumName(typItm.DataType,i)) + ); + end; + end; +end; + + +{ TFakeTypeHandler } + +procedure TFakeTypeHandler.Generate( + const APascalTypeName: string; + AWsdlDocument: TDOMDocument +); +begin +end; + +procedure RegisterFondamentalTypes(); +var + r : IWsdlTypeHandlerRegistry; +begin + r := GetWsdlTypeHandlerRegistry(); + r.RegisterDefaultHandler(tkInteger,TSimpleItemFactory.Create(TFakeTypeHandler) as IItemFactory); + r.RegisterDefaultHandler(tkInt64,TSimpleItemFactory.Create(TFakeTypeHandler) as IItemFactory); + 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); + + r.RegisterDefaultHandler(tkEnumeration,TSimpleItemFactory.Create(TEnumTypeHandler) as IItemFactory); + + r.RegisterDefaultHandler(tkClass,TSimpleItemFactory.Create(TBaseComplexRemotable_TypeHandler) as IItemFactory); + + r.Register('TBaseArrayRemotable',TSimpleItemFactory.Create(TBaseArrayRemotable_TypeHandler) as IItemFactory); + +{ r.Register('Integer',TSimpleItemFactory.Create(TFakeTypeHandler) as IItemFactory); + r.Register('LongWord',TSimpleItemFactory.Create(TFakeTypeHandler) as IItemFactory); + + r.Register('string',TSimpleItemFactory.Create(TFakeTypeHandler) as IItemFactory); + r.Register('shortstring',TSimpleItemFactory.Create(TFakeTypeHandler) as IItemFactory); + r.Register('ansistring',TSimpleItemFactory.Create(TFakeTypeHandler) as IItemFactory); + r.Register('boolean',TSimpleItemFactory.Create(TFakeTypeHandler) as IItemFactory); + + r.Register('Byte',TSimpleItemFactory.Create(TFakeTypeHandler) as IItemFactory); + r.Register('ShortInt',TSimpleItemFactory.Create(TFakeTypeHandler) as IItemFactory); + r.Register('Word',TSimpleItemFactory.Create(TFakeTypeHandler) as IItemFactory); + r.Register('SmallInt',TSimpleItemFactory.Create(TFakeTypeHandler) as IItemFactory); + r.Register('Int64',TSimpleItemFactory.Create(TFakeTypeHandler) as IItemFactory); + r.Register('QWord',TSimpleItemFactory.Create(TFakeTypeHandler) as IItemFactory); + + r.Register('Single',TSimpleItemFactory.Create(TFakeTypeHandler) as IItemFactory); + r.Register('Currency',TSimpleItemFactory.Create(TFakeTypeHandler) as IItemFactory); + r.Register('Comp',TSimpleItemFactory.Create(TFakeTypeHandler) as IItemFactory); + r.Register('Double',TSimpleItemFactory.Create(TFakeTypeHandler) as IItemFactory); + r.Register('Extended',TSimpleItemFactory.Create(TFakeTypeHandler) as IItemFactory); +} +end; + + +{ TBaseArrayRemotable_TypeHandler } + +procedure TBaseArrayRemotable_TypeHandler.Generate( + const APascalTypeName: string; + AWsdlDocument: TDOMDocument +); + + function GetNameSpaceShortName(const ANameSpace : string):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}]) ; + AWsdlDocument.DocumentElement.SetAttribute(Format('%s:%s',[sXMLNS,Result]),ANameSpace); + end; + end; + +var + typItm, propTypItm : TTypeRegistryItem; + s, prop_ns_shortName : string; + defTypesNode, defSchemaNode, cplxNode, sqcNode, propNode, eltNode : TDOMElement; + arrayTypeData : PTypeData; + arrayTypeClass : TBaseArrayRemotableClass; +begin + typItm := GetTypeRegistry().Find(APascalTypeName); + if not Assigned(typItm) then + Exit; + arrayTypeData := GetTypeData(typItm.DataType); + if Assigned(typItm) and + ( typItm.DataType^.Kind = tkClass ) and + ( arrayTypeData^.ClassType.InheritsFrom(TBaseArrayRemotable) ) + then begin + GetNameSpaceShortName(typItm.NameSpace); + defTypesNode := AWsdlDocument.DocumentElement.FindNode(sWSDL_TYPES) as TDOMElement; + Assert(Assigned(defTypesNode)); + defSchemaNode := defTypesNode.FirstChild as TDOMElement; + + s := Format('%s:%s',[sXSD,sELEMENT]); + eltNode := CreateElement(s,defSchemaNode,AWsdlDocument); + eltNode.SetAttribute(sNAME, typItm.DeclaredName) ; + + s := Format('%s:%s',[sXSD,sCOMPLEX_TYPE]); + cplxNode := CreateElement(s,eltNode,AWsdlDocument); + //cplxNode.SetAttribute(sNAME, typItm.DeclaredName) ; + s := Format('%s:%s',[sXSD,sSEQUENCE]); + sqcNode := CreateElement(s,cplxNode,AWsdlDocument); + arrayTypeClass := TBaseArrayRemotableClass(arrayTypeData^.ClassType); + propTypItm := GetTypeRegistry().Find(arrayTypeClass.GetItemTypeInfo()^.Name); + s := Format('%s:%s',[sXSD,sELEMENT]); + propNode := CreateElement(s,sqcNode,AWsdlDocument); + propNode.SetAttribute(sNAME,sITEM); + if Assigned(propTypItm) then begin + prop_ns_shortName := GetNameSpaceShortName(propTypItm.NameSpace); + propNode.SetAttribute(sTYPE,Format('%s:%s',[prop_ns_shortName,propTypItm.DeclaredName])); + propNode.SetAttribute(sMIN_OCCURS,'0'); + propNode.SetAttribute(sMAX_OCCURS,sUNBOUNDED); + end; + end; +end; + +initialization + WsdlTypeHandlerRegistryInst := TWsdlTypeHandlerRegistry.Create() as IWsdlTypeHandlerRegistry; + RegisterFondamentalTypes(); + +finalization + WsdlTypeHandlerRegistryInst := nil; + +end. diff --git a/wst/tags/0.4/same_process_protocol.pas b/wst/tags/0.4/same_process_protocol.pas new file mode 100644 index 000000000..4502eccf0 --- /dev/null +++ b/wst/tags/0.4/same_process_protocol.pas @@ -0,0 +1,94 @@ +{ + This file is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This file is provide under modified LGPL licence + ( the files COPYING.modifiedLGPL and COPYING.LGPL). + + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +} +unit same_process_protocol; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, + service_intf, imp_utils, + server_service_intf, server_service_imputils, base_service_intf; + +Const + sTRANSPORT_NAME = 'SAME_PROCESS'; + +Type + +{$M+} + + { TInProcessTransport } + + TInProcessTransport = class(TSimpleFactoryItem,ITransport) + Private + FAdress: string; + FContentType: string; + FPropMngr : IPropertyManager; + Public + constructor Create();override; + destructor Destroy();override; + function GetPropertyManager():IPropertyManager; + procedure SendAndReceive(ARequest,AResponse:TStream); + Published + property ContentType : string Read FContentType Write FContentType; + property Adress : string Read FAdress Write FAdress; + End; +{$M+} + + procedure SAME_PROCESS_Register_Local_Transport(); + +implementation + +{ TInProcessTransport } + +constructor TInProcessTransport.Create(); +begin + FPropMngr := TPublishedPropertyManager.Create(Self); +end; + +destructor TInProcessTransport.Destroy(); +begin + FPropMngr := Nil; + inherited Destroy(); +end; + +function TInProcessTransport.GetPropertyManager(): IPropertyManager; +begin + Result := FPropMngr; +end; + +procedure TInProcessTransport.SendAndReceive(ARequest, AResponse: TStream); +Var + bffr : IRequestBuffer; +{$IFDEF WST_DBG} + s : string; + i : Int64; +{$ENDIF WST_DBG} +begin + bffr := TRequestBuffer.Create(Adress,ContentType,ARequest,AResponse); + HandleServiceRequest(bffr); + {$IFDEF WST_DBG} + i := AResponse.Position; + SetLength(s,AResponse.Size); + AResponse.Read(s[1],AResponse.Size); + WriteLn(s); + {$ENDIF WST_DBG} +end; + +procedure SAME_PROCESS_Register_Local_Transport(); +begin + GetTransportRegistry().Register(sTRANSPORT_NAME,TSimpleItemFactory.Create(TInProcessTransport) as IItemFactory); +end; + +end. diff --git a/wst/tags/0.4/samples/amazon/AWSECommerceService.pas b/wst/tags/0.4/samples/amazon/AWSECommerceService.pas new file mode 100644 index 000000000..78b7cb8bd --- /dev/null +++ b/wst/tags/0.4/samples/amazon/AWSECommerceService.pas @@ -0,0 +1,20241 @@ +{ +This unit has been produced by ws_helper. + Input unit name : "AWSECommerceService". + This unit name : "AWSECommerceService". + Date : "6-5-07 19:37:08". +} +unit AWSECommerceService; +{$IFDEF FPC} {$mode objfpc}{$H+} {$ENDIF} +interface + +uses SysUtils, Classes, TypInfo, base_service_intf, service_intf; + +const + sNAME_SPACE = 'http://webservices.amazon.com/AWSECommerceService/2007-04-04'; + sUNIT_NAME = 'AWSECommerceService'; + +type + + HelpRequest = class; + Help_RequestArray = class; + Help_Type = class; + OperationRequest_Type = class; + Information_Type = class; + HelpResponse_InformationArray = class; + HelpResponse_Type = class; + ItemSearchRequest = class; + ItemSearch_RequestArray = class; + ItemSearch_Type = class; + Items_Type = class; + ItemSearchResponse_ItemsArray = class; + ItemSearchResponse_Type = class; + ItemLookupRequest = class; + ItemLookup_RequestArray = class; + ItemLookup_Type = class; + ItemLookupResponse_ItemsArray = class; + ItemLookupResponse_Type = class; + BrowseNodeLookupRequest = class; + BrowseNodeLookup_RequestArray = class; + BrowseNodeLookup_Type = class; + BrowseNodes_Type = class; + BrowseNodeLookupResponse_BrowseNodesArray = class; + BrowseNodeLookupResponse_Type = class; + ListSearchRequest = class; + ListSearch_RequestArray = class; + ListSearch_Type = class; + Lists_Type = class; + ListSearchResponse_ListsArray = class; + ListSearchResponse_Type = class; + ListLookupRequest = class; + ListLookup_RequestArray = class; + ListLookup_Type = class; + ListLookupResponse_ListsArray = class; + ListLookupResponse_Type = class; + CustomerContentSearchRequest = class; + CustomerContentSearch_RequestArray = class; + CustomerContentSearch_Type = class; + Customers_Type = class; + CustomerContentSearchResponse_CustomersArray = class; + CustomerContentSearchResponse_Type = class; + CustomerContentLookupRequest = class; + CustomerContentLookup_RequestArray = class; + CustomerContentLookup_Type = class; + CustomerContentLookupResponse_CustomersArray = class; + CustomerContentLookupResponse_Type = class; + SimilarityLookupRequest = class; + SimilarityLookup_RequestArray = class; + SimilarityLookup_Type = class; + SimilarityLookupResponse_ItemsArray = class; + SimilarityLookupResponse_Type = class; + SellerLookupRequest = class; + SellerLookup_RequestArray = class; + SellerLookup_Type = class; + Sellers_Type = class; + SellerLookupResponse_SellersArray = class; + SellerLookupResponse_Type = class; + CartGetRequest = class; + CartGet_RequestArray = class; + CartGet_Type = class; + Cart_Type = class; + CartGetResponse_CartArray = class; + CartGetResponse_Type = class; + CartAddRequest = class; + CartAdd_RequestArray = class; + CartAdd_Type = class; + CartAddResponse_CartArray = class; + CartAddResponse_Type = class; + CartCreateRequest = class; + CartCreate_RequestArray = class; + CartCreate_Type = class; + CartCreateResponse_CartArray = class; + CartCreateResponse_Type = class; + CartModifyRequest = class; + CartModify_RequestArray = class; + CartModify_Type = class; + CartModifyResponse_CartArray = class; + CartModifyResponse_Type = class; + CartClearRequest = class; + CartClear_RequestArray = class; + CartClear_Type = class; + CartClearResponse_CartArray = class; + CartClearResponse_Type = class; + TransactionLookupRequest = class; + TransactionLookup_RequestArray = class; + TransactionLookup_Type = class; + Transactions_Type = class; + TransactionLookupResponse_TransactionsArray = class; + TransactionLookupResponse_Type = class; + SellerListingSearchRequest = class; + SellerListingSearch_RequestArray = class; + SellerListingSearch_Type = class; + SellerListings_Type = class; + SellerListingSearchResponse_SellerListingsArray = class; + SellerListingSearchResponse_Type = class; + SellerListingLookupRequest = class; + SellerListingLookup_RequestArray = class; + SellerListingLookup_Type = class; + SellerListingLookupResponse_SellerListingsArray = class; + SellerListingLookupResponse_Type = class; + MultiOperationType = class; + MultiOperationResponse = class; + Bin_BinParameter_Type = class; + Bin_BinParameterArray = class; + Bin_Type = class; + SearchBinSet_BinArray = class; + SearchBinSet_Type = class; + SearchBinSets_Type = class; + HelpRequest_ResponseGroupArray = class; + ItemSearchRequest_AudienceRatingArray = class; + ItemSearchRequest_ResponseGroupArray = class; + ItemLookupRequest_ItemIdArray = class; + ItemLookupRequest_ResponseGroupArray = class; + ListSearchRequest_ResponseGroupArray = class; + ListLookupRequest_ResponseGroupArray = class; + CustomerContentSearchRequest_ResponseGroupArray = class; + CustomerContentLookupRequest_ResponseGroupArray = class; + SimilarityLookupRequest_ItemIdArray = class; + SimilarityLookupRequest_ResponseGroupArray = class; + SellerLookupRequest_ResponseGroupArray = class; + SellerLookupRequest_SellerIdArray = class; + CartGetRequest_ResponseGroupArray = class; + CartAddRequest_Items_Type_Item_Type = class; + CartAddRequest_Items_Type = class; + CartAddRequest_ResponseGroupArray = class; + CartCreateRequest_Items_Type_Item_Type = class; + CartCreateRequest_Items_Type = class; + CartCreateRequest_ResponseGroupArray = class; + CartModifyRequest_Items_Type_Item_Type = class; + CartModifyRequest_Items_Type = class; + CartModifyRequest_ResponseGroupArray = class; + CartClearRequest_ResponseGroupArray = class; + TransactionLookupRequest_ResponseGroupArray = class; + TransactionLookupRequest_TransactionIdArray = class; + SellerListingSearchRequest_ResponseGroupArray = class; + SellerListingLookupRequest_ResponseGroupArray = class; + BrowseNodeLookupRequest_BrowseNodeIdArray = class; + BrowseNodeLookupRequest_ResponseGroupArray = class; + HTTPHeaders_Type = class; + Arguments_Type = class; + Errors_Type = class; + Request_Type = class; + Arguments_Argument_Type = class; + HTTPHeaders_Header_Type = class; + Errors_Error_Type = class; + OperationInformation_Type = class; + ResponseGroupInformation_Type = class; + Information_OperationInformationArray = class; + Information_ResponseGroupInformationArray = class; + CorrectedQuery_Type = class; + SearchResultsMap_Type = class; + Item_Type = class; + Items__ItemArray = class; + List_Type = class; + Lists_ListArray = class; + Customer_Type = class; + Customers_CustomerArray = class; + Price = class; + CartItems_Type = class; + SavedForLaterItems_Type = class; + SimilarProducts_Type = class; + TopSellers_Type = class; + NewReleases_Type = class; + SimilarViewedProducts_Type = class; + OtherCategoriesSimilarProducts_Type = class; + Transaction_Type = class; + Transactions_TransactionArray = class; + Seller_Type = class; + Sellers_SellerArray = class; + SellerListing_Type = class; + SellerListings_SellerListingArray = class; + OperationInformation_RequiredParameters_Type = class; + OperationInformation_AvailableParameters_Type = class; + OperationInformation_DefaultResponseGroups_Type = class; + OperationInformation_AvailableResponseGroups_Type = class; + ResponseGroupInformation_ValidOperations_Type = class; + ResponseGroupInformation_Elements_Type = class; + Image = class; + ListItem_Type = class; + List_ListItemArray = class; + Customer_Location_Type = class; + CustomerReviews_Type = class; + Customer_CustomerReviewsArray = class; + SearchResultsMap_SearchIndex_Type_ASINArray = class; + SearchResultsMap_SearchIndex_Type = class; + ImageSet_Type = class; + Item_ImageSets_Type_ImageSetArray = class; + Item_ImageSets_Type = class; + ItemAttributes_Type = class; + MerchantItemAttributes_Type = class; + Collections_Type = class; + Item_Subjects_Type = class; + OfferSummary_Type = class; + Offers_Type = class; + VariationSummary_Type = class; + Variations_Type = class; + EditorialReviews_Type = class; + Accessories_Type = class; + Tracks_Type = class; + ListmaniaLists_Type = class; + SearchInside_Type = class; + Item_AlternateVersions_Type_AlternateVersion_Type = class; + Item_AlternateVersions_Type = class; + _Item_ImageSetsArray = class; + Offer_Type = class; + Offers_OfferArray = class; + Merchant_Type = class; + OfferAttributes_Type = class; + OfferListing_Type = class; + LoyaltyPoints_Type = class; + Promotions_Type = class; + Offer_OfferListingArray = class; + OfferListing_AvailabilityAttributes_Type = class; + Address = class; + OfferListing_ShippingCharge_Type = class; + OfferListing_ShippingChargeArray = class; + VariationDimensions_Type = class; + Variations__ItemArray = class; + EditorialReview_Type = class; + Collections_Collection_Type_CollectionSummary_Type = class; + Collections_Collection_Type_CollectionParent_Type = class; + Collections_Collection_Type_CollectionItem_Type = class; + Collections_Collection_Type_CollectionItemArray = class; + Collections_Collection_Type = class; + Review_Type = class; + CustomerReviews_ReviewArray = class; + Reviewer_Type = class; + Tracks_Disc_Type_Track_Type = class; + Tracks_Disc_Type_TrackArray = class; + Tracks_Disc_Type = class; + SimilarProducts_SimilarProduct_Type = class; + TopSellers_TopSeller_Type = class; + NewReleases_NewRelease_Type = class; + SimilarViewedProducts_SimilarViewedProduct_Type = class; + OtherCategoriesSimilarProducts_OtherCategoriesSimilarProduct_Type = class; + Accessories_Accessory_Type = class; + Promotion_Type = class; + Promotion_Summary_Type = class; + PromotionEligibilityRequirements = class; + PromotionBenefits = class; + PromotionItemApplicability = class; + Promotion_Details_Type = class; + PromotionEligibilityRequirement = class; + PromotionBenefit = class; + BrowseNode_Type = class; + BrowseNodes_BrowseNodeArray = class; + BrowseNode_Children_Type = class; + BrowseNode_Ancestors_Type = class; + ListmaniaLists_ListmaniaList_Type = class; + SearchInside_Excerpt_Type = class; + CartItem = class; + CartItems_CartItemArray = class; + SavedForLaterItems_SavedForLaterItemArray = class; + Transaction_Totals_Type = class; + TransactionItem_Type = class; + Transaction_TransactionItems_Type = class; + Transaction_Shipments_Type_Shipment_Type_ShipmentItems_Type = class; + Transaction_Shipments_Type_Shipment_Type_Packages_Type_Package_Type = class; + Transaction_Shipments_Type_Shipment_Type_Packages_Type = class; + Transaction_Shipments_Type_Shipment_Type = class; + Transaction_Shipments_Type = class; + TransactionItem_ChildTransactionItems_Type = class; + Seller_Location_Type = class; + Seller_SellerFeedbackSummary_Type_FeedbackDateRange_Type_SellerFeedbackRating_Type = class; + Seller_SellerFeedbackSummary_Type_FeedbackDateRange_Type_SellerFeedbackRatingArray = class; + Seller_SellerFeedbackSummary_Type_FeedbackDateRange_Type = class; + Seller_SellerFeedbackSummary_Type = class; + SellerFeedback_Type = class; + SellerFeedback_Feedback_Type = class; + DecimalWithUnits = class; + NonNegativeIntegerWithUnits = class; + ItemAttributes_Creator_Type = class; + StringWithUnits = class; + ItemAttributes_ItemDimensions_Type = class; + ItemAttributes_Languages_Type_Language_Type = class; + ItemAttributes_Languages_Type = class; + ItemAttributes_PackageDimensions_Type = class; + ItemAttributes_ActorArray = class; + ItemAttributes_ArtistArray = class; + ItemAttributes_AudioFormatArray = class; + ItemAttributes_AuthorArray = class; + ItemAttributes_CameraManualFeaturesArray = class; + ItemAttributes_CompatibleDevicesArray = class; + ItemAttributes_CreatorArray = class; + ItemAttributes_DataLinkProtocolArray = class; + ItemAttributes_DirectorArray = class; + ItemAttributes_FeatureArray = class; + ItemAttributes_FormatArray = class; + ItemAttributes_FormFactorArray = class; + ItemAttributes_PhotoFlashTypeArray = class; + ItemAttributes_PictureFormatArray = class; + ItemAttributes_PlatformArray = class; + ItemAttributes_ReturnMethodArray = class; + ItemAttributes_SpecialFeaturesArray = class; + ItemAttributes_SupportedImageTypeArray = class; + MerchantItemAttributes_Creator_Type = class; + MerchantItemAttributes_ItemDimensions_Type = class; + MerchantItemAttributes_Languages_Type_Language_Type = class; + MerchantItemAttributes_Languages_Type = class; + MerchantItemAttributes_PackageDimensions_Type = class; + MerchantItemAttributes_VendorRebate_Type = class; + MerchantItemAttributes_ActorArray = class; + MerchantItemAttributes_ArtistArray = class; + MerchantItemAttributes_AudioFormatArray = class; + MerchantItemAttributes_AuthorArray = class; + MerchantItemAttributes_CameraManualFeaturesArray = class; + MerchantItemAttributes_CreatorArray = class; + MerchantItemAttributes_DirectorArray = class; + MerchantItemAttributes_FeatureArray = class; + MerchantItemAttributes_FormatArray = class; + MerchantItemAttributes_PhotoFlashTypeArray = class; + MerchantItemAttributes_PictureFormatArray = class; + MerchantItemAttributes_PlatformArray = class; + MerchantItemAttributes_PurchasingChannelArray = class; + MerchantItemAttributes_ReturnMethodArray = class; + MerchantItemAttributes_SpecialFeaturesArray = class; + MerchantItemAttributes_SupportedImageTypeArray = class; + + HelpRequest_HelpType_Type = ( + Operation + ,ResponseGroup + ); + + ItemSearchRequest_Availability_Type = ( + Available + ); + + AudienceRating_Type = ( + G + ,PG + ,AudienceRatingPG_13 + ,R + ,AudienceRatingNC_17 + ,NR + ,Unrated + ,AudienceRating_6 + ,AudienceRating_12 + ,AudienceRating_16 + ,AudienceRating_18 + ,FamilyViewing + ); + + Condition_Type = ( + All + ,New + ,Used + ,Collectible + ,Refurbished + ); + + DeliveryMethod_Type = ( + Ship + ,ISPU + ); + + ItemLookupRequest_IdType_Type = ( + ASIN + ,UPC + ,SKU + ,EAN + ,ISBN + ); + + ListSearchRequest_ListType_Type = ( + WishList + ,WeddingRegistry + ,BabyRegistry + ); + + ListLookupRequest_ListType_Type = ( + ListLookupRequest_ListType_TypeWishList + ,Listmania + ,ListLookupRequest_ListType_TypeWeddingRegistry + ); + + SimilarityLookupRequest_SimilarityType_Type = ( + Intersection + ,Random + ); + + CartModifyRequest_Items_Type_Item_Type_Action_Type = ( + MoveToCart + ,SaveForLater + ); + + SellerListingSearchRequest_OfferStatus_Type = ( + Open + ,Closed + ); + + SellerListingLookupRequest_IdType_Type = ( + Exchange + ,Listing + ,SellerListingLookupRequest_IdType_TypeASIN + ,SellerListingLookupRequest_IdType_TypeSKU + ); + + List_ListType_Type = ( + List_ListType_TypeWishList + ,List_ListType_TypeWeddingRegistry + ,List_ListType_TypeBabyRegistry + ,List_ListType_TypeListmania + ); + + positiveIntegerOrAll = type string; + + HelpRequest = class(TBaseComplexRemotable) + private + FAbout : string; + FHelpType : HelpRequest_HelpType_Type; + FResponseGroup : HelpRequest_ResponseGroupArray; + private + function HasAbout() : Boolean; + function HasHelpType() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property About : string read FAbout write FAbout stored HasAbout; + property HelpType : HelpRequest_HelpType_Type read FHelpType write FHelpType stored HasHelpType; + property ResponseGroup : HelpRequest_ResponseGroupArray read FResponseGroup write FResponseGroup; + end; + + Help_Type = class(TBaseComplexRemotable) + private + FMarketplaceDomain : string; + FAWSAccessKeyId : string; + FSubscriptionId : string; + FAssociateTag : string; + FValidate : string; + FShared : HelpRequest; + FRequest : Help_RequestArray; + private + function HasMarketplaceDomain() : Boolean; + function HasAWSAccessKeyId() : Boolean; + function HasSubscriptionId() : Boolean; + function HasAssociateTag() : Boolean; + function HasValidate() : Boolean; + function HasShared() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property MarketplaceDomain : string read FMarketplaceDomain write FMarketplaceDomain stored HasMarketplaceDomain; + property AWSAccessKeyId : string read FAWSAccessKeyId write FAWSAccessKeyId stored HasAWSAccessKeyId; + property SubscriptionId : string read FSubscriptionId write FSubscriptionId stored HasSubscriptionId; + property AssociateTag : string read FAssociateTag write FAssociateTag stored HasAssociateTag; + property Validate : string read FValidate write FValidate stored HasValidate; + property Shared : HelpRequest read FShared write FShared stored HasShared; + property Request : Help_RequestArray read FRequest write FRequest; + end; + + OperationRequest_Type = class(TBaseComplexRemotable) + private + FHTTPHeaders : HTTPHeaders_Type; + FRequestId : string; + FArguments : Arguments_Type; + FErrors : Errors_Type; + FRequestProcessingTime : float; + private + function HasHTTPHeaders() : Boolean; + function HasRequestId() : Boolean; + function HasArguments() : Boolean; + function HasErrors() : Boolean; + function HasRequestProcessingTime() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property HTTPHeaders : HTTPHeaders_Type read FHTTPHeaders write FHTTPHeaders stored HasHTTPHeaders; + property RequestId : string read FRequestId write FRequestId stored HasRequestId; + property Arguments : Arguments_Type read FArguments write FArguments stored HasArguments; + property Errors : Errors_Type read FErrors write FErrors stored HasErrors; + property RequestProcessingTime : float read FRequestProcessingTime write FRequestProcessingTime stored HasRequestProcessingTime; + end; + + Information_Type = class(TBaseComplexRemotable) + private + FRequest : Request_Type; + FOperationInformation : Information_OperationInformationArray; + FResponseGroupInformation : Information_ResponseGroupInformationArray; + private + function HasRequest() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property Request : Request_Type read FRequest write FRequest stored HasRequest; + property OperationInformation : Information_OperationInformationArray read FOperationInformation write FOperationInformation; + property ResponseGroupInformation : Information_ResponseGroupInformationArray read FResponseGroupInformation write FResponseGroupInformation; + end; + + HelpResponse_Type = class(TBaseComplexRemotable) + private + FOperationRequest : OperationRequest_Type; + FInformation : HelpResponse_InformationArray; + private + function HasOperationRequest() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property OperationRequest : OperationRequest_Type read FOperationRequest write FOperationRequest stored HasOperationRequest; + property Information : HelpResponse_InformationArray read FInformation write FInformation; + end; + + ItemSearchRequest = class(TBaseComplexRemotable) + private + FActor : string; + FArtist : string; + FAvailability : ItemSearchRequest_Availability_Type; + FAudienceRating : ItemSearchRequest_AudienceRatingArray; + FAuthor : string; + FBrand : string; + FBrowseNode : string; + FCity : string; + FComposer : string; + FCondition : Condition_Type; + FConductor : string; + FCount : positiveInteger; + FCuisine : string; + FDeliveryMethod : DeliveryMethod_Type; + FDirector : string; + FFutureLaunchDate : string; + FISPUPostalCode : string; + FItemPage : positiveInteger; + FKeywords : string; + FManufacturer : string; + FMaximumPrice : nonNegativeInteger; + FMerchantId : string; + FMinimumPrice : nonNegativeInteger; + FMusicLabel : string; + FNeighborhood : string; + FOrchestra : string; + FPostalCode : string; + FPower : string; + FPublisher : string; + FResponseGroup : ItemSearchRequest_ResponseGroupArray; + FReviewSort : string; + FSearchIndex : string; + FSort : string; + FState : string; + FTextStream : string; + FTitle : string; + FReleaseDate : string; + private + function HasActor() : Boolean; + function HasArtist() : Boolean; + function HasAvailability() : Boolean; + function HasAuthor() : Boolean; + function HasBrand() : Boolean; + function HasBrowseNode() : Boolean; + function HasCity() : Boolean; + function HasComposer() : Boolean; + function HasCondition() : Boolean; + function HasConductor() : Boolean; + function HasCount() : Boolean; + function HasCuisine() : Boolean; + function HasDeliveryMethod() : Boolean; + function HasDirector() : Boolean; + function HasFutureLaunchDate() : Boolean; + function HasISPUPostalCode() : Boolean; + function HasItemPage() : Boolean; + function HasKeywords() : Boolean; + function HasManufacturer() : Boolean; + function HasMaximumPrice() : Boolean; + function HasMerchantId() : Boolean; + function HasMinimumPrice() : Boolean; + function HasMusicLabel() : Boolean; + function HasNeighborhood() : Boolean; + function HasOrchestra() : Boolean; + function HasPostalCode() : Boolean; + function HasPower() : Boolean; + function HasPublisher() : Boolean; + function HasReviewSort() : Boolean; + function HasSearchIndex() : Boolean; + function HasSort() : Boolean; + function HasState() : Boolean; + function HasTextStream() : Boolean; + function HasTitle() : Boolean; + function HasReleaseDate() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property Actor : string read FActor write FActor stored HasActor; + property Artist : string read FArtist write FArtist stored HasArtist; + property Availability : ItemSearchRequest_Availability_Type read FAvailability write FAvailability stored HasAvailability; + property AudienceRating : ItemSearchRequest_AudienceRatingArray read FAudienceRating write FAudienceRating; + property Author : string read FAuthor write FAuthor stored HasAuthor; + property Brand : string read FBrand write FBrand stored HasBrand; + property BrowseNode : string read FBrowseNode write FBrowseNode stored HasBrowseNode; + property City : string read FCity write FCity stored HasCity; + property Composer : string read FComposer write FComposer stored HasComposer; + property Condition : Condition_Type read FCondition write FCondition stored HasCondition; + property Conductor : string read FConductor write FConductor stored HasConductor; + property Count : positiveInteger read FCount write FCount stored HasCount; + property Cuisine : string read FCuisine write FCuisine stored HasCuisine; + property DeliveryMethod : DeliveryMethod_Type read FDeliveryMethod write FDeliveryMethod stored HasDeliveryMethod; + property Director : string read FDirector write FDirector stored HasDirector; + property FutureLaunchDate : string read FFutureLaunchDate write FFutureLaunchDate stored HasFutureLaunchDate; + property ISPUPostalCode : string read FISPUPostalCode write FISPUPostalCode stored HasISPUPostalCode; + property ItemPage : positiveInteger read FItemPage write FItemPage stored HasItemPage; + property Keywords : string read FKeywords write FKeywords stored HasKeywords; + property Manufacturer : string read FManufacturer write FManufacturer stored HasManufacturer; + property MaximumPrice : nonNegativeInteger read FMaximumPrice write FMaximumPrice stored HasMaximumPrice; + property MerchantId : string read FMerchantId write FMerchantId stored HasMerchantId; + property MinimumPrice : nonNegativeInteger read FMinimumPrice write FMinimumPrice stored HasMinimumPrice; + property MusicLabel : string read FMusicLabel write FMusicLabel stored HasMusicLabel; + property Neighborhood : string read FNeighborhood write FNeighborhood stored HasNeighborhood; + property Orchestra : string read FOrchestra write FOrchestra stored HasOrchestra; + property PostalCode : string read FPostalCode write FPostalCode stored HasPostalCode; + property Power : string read FPower write FPower stored HasPower; + property Publisher : string read FPublisher write FPublisher stored HasPublisher; + property ResponseGroup : ItemSearchRequest_ResponseGroupArray read FResponseGroup write FResponseGroup; + property ReviewSort : string read FReviewSort write FReviewSort stored HasReviewSort; + property SearchIndex : string read FSearchIndex write FSearchIndex stored HasSearchIndex; + property Sort : string read FSort write FSort stored HasSort; + property State : string read FState write FState stored HasState; + property TextStream : string read FTextStream write FTextStream stored HasTextStream; + property Title : string read FTitle write FTitle stored HasTitle; + property ReleaseDate : string read FReleaseDate write FReleaseDate stored HasReleaseDate; + end; + + ItemSearch_Type = class(TBaseComplexRemotable) + private + FMarketplaceDomain : string; + FAWSAccessKeyId : string; + FSubscriptionId : string; + FAssociateTag : string; + FXMLEscaping : string; + FValidate : string; + FShared : ItemSearchRequest; + FRequest : ItemSearch_RequestArray; + private + function HasMarketplaceDomain() : Boolean; + function HasAWSAccessKeyId() : Boolean; + function HasSubscriptionId() : Boolean; + function HasAssociateTag() : Boolean; + function HasXMLEscaping() : Boolean; + function HasValidate() : Boolean; + function HasShared() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property MarketplaceDomain : string read FMarketplaceDomain write FMarketplaceDomain stored HasMarketplaceDomain; + property AWSAccessKeyId : string read FAWSAccessKeyId write FAWSAccessKeyId stored HasAWSAccessKeyId; + property SubscriptionId : string read FSubscriptionId write FSubscriptionId stored HasSubscriptionId; + property AssociateTag : string read FAssociateTag write FAssociateTag stored HasAssociateTag; + property XMLEscaping : string read FXMLEscaping write FXMLEscaping stored HasXMLEscaping; + property Validate : string read FValidate write FValidate stored HasValidate; + property Shared : ItemSearchRequest read FShared write FShared stored HasShared; + property Request : ItemSearch_RequestArray read FRequest write FRequest; + end; + + Items_Type = class(TBaseComplexRemotable) + private + FRequest : Request_Type; + FCorrectedQuery : CorrectedQuery_Type; + FQid : string; + FTotalResults : nonNegativeInteger; + FTotalPages : nonNegativeInteger; + FSearchResultsMap : SearchResultsMap_Type; + F_Item : Items__ItemArray; + FSearchBinSets : SearchBinSets_Type; + private + function HasRequest() : Boolean; + function HasCorrectedQuery() : Boolean; + function HasQid() : Boolean; + function HasTotalResults() : Boolean; + function HasTotalPages() : Boolean; + function HasSearchResultsMap() : Boolean; + function HasSearchBinSets() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property Request : Request_Type read FRequest write FRequest stored HasRequest; + property CorrectedQuery : CorrectedQuery_Type read FCorrectedQuery write FCorrectedQuery stored HasCorrectedQuery; + property Qid : string read FQid write FQid stored HasQid; + property TotalResults : nonNegativeInteger read FTotalResults write FTotalResults stored HasTotalResults; + property TotalPages : nonNegativeInteger read FTotalPages write FTotalPages stored HasTotalPages; + property SearchResultsMap : SearchResultsMap_Type read FSearchResultsMap write FSearchResultsMap stored HasSearchResultsMap; + property _Item : Items__ItemArray read F_Item write F_Item; + property SearchBinSets : SearchBinSets_Type read FSearchBinSets write FSearchBinSets stored HasSearchBinSets; + end; + + ItemSearchResponse_Type = class(TBaseComplexRemotable) + private + FOperationRequest : OperationRequest_Type; + FItems : ItemSearchResponse_ItemsArray; + private + function HasOperationRequest() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property OperationRequest : OperationRequest_Type read FOperationRequest write FOperationRequest stored HasOperationRequest; + property Items : ItemSearchResponse_ItemsArray read FItems write FItems; + end; + + ItemLookupRequest = class(TBaseComplexRemotable) + private + FCondition : Condition_Type; + FDeliveryMethod : DeliveryMethod_Type; + FFutureLaunchDate : string; + FIdType : ItemLookupRequest_IdType_Type; + FISPUPostalCode : string; + FMerchantId : string; + FOfferPage : positiveInteger; + FItemId : ItemLookupRequest_ItemIdArray; + FResponseGroup : ItemLookupRequest_ResponseGroupArray; + FReviewPage : positiveInteger; + FReviewSort : string; + FSearchIndex : string; + FSearchInsideKeywords : string; + FVariationPage : positiveIntegerOrAll; + private + function HasCondition() : Boolean; + function HasDeliveryMethod() : Boolean; + function HasFutureLaunchDate() : Boolean; + function HasIdType() : Boolean; + function HasISPUPostalCode() : Boolean; + function HasMerchantId() : Boolean; + function HasOfferPage() : Boolean; + function HasReviewPage() : Boolean; + function HasReviewSort() : Boolean; + function HasSearchIndex() : Boolean; + function HasSearchInsideKeywords() : Boolean; + function HasVariationPage() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property Condition : Condition_Type read FCondition write FCondition stored HasCondition; + property DeliveryMethod : DeliveryMethod_Type read FDeliveryMethod write FDeliveryMethod stored HasDeliveryMethod; + property FutureLaunchDate : string read FFutureLaunchDate write FFutureLaunchDate stored HasFutureLaunchDate; + property IdType : ItemLookupRequest_IdType_Type read FIdType write FIdType stored HasIdType; + property ISPUPostalCode : string read FISPUPostalCode write FISPUPostalCode stored HasISPUPostalCode; + property MerchantId : string read FMerchantId write FMerchantId stored HasMerchantId; + property OfferPage : positiveInteger read FOfferPage write FOfferPage stored HasOfferPage; + property ItemId : ItemLookupRequest_ItemIdArray read FItemId write FItemId; + property ResponseGroup : ItemLookupRequest_ResponseGroupArray read FResponseGroup write FResponseGroup; + property ReviewPage : positiveInteger read FReviewPage write FReviewPage stored HasReviewPage; + property ReviewSort : string read FReviewSort write FReviewSort stored HasReviewSort; + property SearchIndex : string read FSearchIndex write FSearchIndex stored HasSearchIndex; + property SearchInsideKeywords : string read FSearchInsideKeywords write FSearchInsideKeywords stored HasSearchInsideKeywords; + property VariationPage : positiveIntegerOrAll read FVariationPage write FVariationPage stored HasVariationPage; + end; + + ItemLookup_Type = class(TBaseComplexRemotable) + private + FMarketplaceDomain : string; + FAWSAccessKeyId : string; + FSubscriptionId : string; + FAssociateTag : string; + FValidate : string; + FXMLEscaping : string; + FShared : ItemLookupRequest; + FRequest : ItemLookup_RequestArray; + private + function HasMarketplaceDomain() : Boolean; + function HasAWSAccessKeyId() : Boolean; + function HasSubscriptionId() : Boolean; + function HasAssociateTag() : Boolean; + function HasValidate() : Boolean; + function HasXMLEscaping() : Boolean; + function HasShared() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property MarketplaceDomain : string read FMarketplaceDomain write FMarketplaceDomain stored HasMarketplaceDomain; + property AWSAccessKeyId : string read FAWSAccessKeyId write FAWSAccessKeyId stored HasAWSAccessKeyId; + property SubscriptionId : string read FSubscriptionId write FSubscriptionId stored HasSubscriptionId; + property AssociateTag : string read FAssociateTag write FAssociateTag stored HasAssociateTag; + property Validate : string read FValidate write FValidate stored HasValidate; + property XMLEscaping : string read FXMLEscaping write FXMLEscaping stored HasXMLEscaping; + property Shared : ItemLookupRequest read FShared write FShared stored HasShared; + property Request : ItemLookup_RequestArray read FRequest write FRequest; + end; + + ItemLookupResponse_Type = class(TBaseComplexRemotable) + private + FOperationRequest : OperationRequest_Type; + FItems : ItemLookupResponse_ItemsArray; + private + function HasOperationRequest() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property OperationRequest : OperationRequest_Type read FOperationRequest write FOperationRequest stored HasOperationRequest; + property Items : ItemLookupResponse_ItemsArray read FItems write FItems; + end; + + BrowseNodeLookupRequest = class(TBaseComplexRemotable) + private + FBrowseNodeId : BrowseNodeLookupRequest_BrowseNodeIdArray; + FResponseGroup : BrowseNodeLookupRequest_ResponseGroupArray; + public + constructor Create();override; + destructor Destroy();override; + published + property BrowseNodeId : BrowseNodeLookupRequest_BrowseNodeIdArray read FBrowseNodeId write FBrowseNodeId; + property ResponseGroup : BrowseNodeLookupRequest_ResponseGroupArray read FResponseGroup write FResponseGroup; + end; + + BrowseNodeLookup_Type = class(TBaseComplexRemotable) + private + FMarketplaceDomain : string; + FAWSAccessKeyId : string; + FSubscriptionId : string; + FAssociateTag : string; + FValidate : string; + FXMLEscaping : string; + FShared : BrowseNodeLookupRequest; + FRequest : BrowseNodeLookup_RequestArray; + private + function HasMarketplaceDomain() : Boolean; + function HasAWSAccessKeyId() : Boolean; + function HasSubscriptionId() : Boolean; + function HasAssociateTag() : Boolean; + function HasValidate() : Boolean; + function HasXMLEscaping() : Boolean; + function HasShared() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property MarketplaceDomain : string read FMarketplaceDomain write FMarketplaceDomain stored HasMarketplaceDomain; + property AWSAccessKeyId : string read FAWSAccessKeyId write FAWSAccessKeyId stored HasAWSAccessKeyId; + property SubscriptionId : string read FSubscriptionId write FSubscriptionId stored HasSubscriptionId; + property AssociateTag : string read FAssociateTag write FAssociateTag stored HasAssociateTag; + property Validate : string read FValidate write FValidate stored HasValidate; + property XMLEscaping : string read FXMLEscaping write FXMLEscaping stored HasXMLEscaping; + property Shared : BrowseNodeLookupRequest read FShared write FShared stored HasShared; + property Request : BrowseNodeLookup_RequestArray read FRequest write FRequest; + end; + + BrowseNodes_Type = class(TBaseComplexRemotable) + private + FRequest : Request_Type; + FBrowseNode : BrowseNodes_BrowseNodeArray; + private + function HasRequest() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property Request : Request_Type read FRequest write FRequest stored HasRequest; + property BrowseNode : BrowseNodes_BrowseNodeArray read FBrowseNode write FBrowseNode; + end; + + BrowseNodeLookupResponse_Type = class(TBaseComplexRemotable) + private + FOperationRequest : OperationRequest_Type; + FBrowseNodes : BrowseNodeLookupResponse_BrowseNodesArray; + private + function HasOperationRequest() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property OperationRequest : OperationRequest_Type read FOperationRequest write FOperationRequest stored HasOperationRequest; + property BrowseNodes : BrowseNodeLookupResponse_BrowseNodesArray read FBrowseNodes write FBrowseNodes; + end; + + ListSearchRequest = class(TBaseComplexRemotable) + private + FCity : string; + FEmail : string; + FFirstName : string; + FLastName : string; + FListPage : positiveInteger; + FListType : ListSearchRequest_ListType_Type; + FName : string; + FResponseGroup : ListSearchRequest_ResponseGroupArray; + FState : string; + private + function HasCity() : Boolean; + function HasEmail() : Boolean; + function HasFirstName() : Boolean; + function HasLastName() : Boolean; + function HasListPage() : Boolean; + function HasName() : Boolean; + function HasState() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property City : string read FCity write FCity stored HasCity; + property Email : string read FEmail write FEmail stored HasEmail; + property FirstName : string read FFirstName write FFirstName stored HasFirstName; + property LastName : string read FLastName write FLastName stored HasLastName; + property ListPage : positiveInteger read FListPage write FListPage stored HasListPage; + property ListType : ListSearchRequest_ListType_Type read FListType write FListType; + property Name : string read FName write FName stored HasName; + property ResponseGroup : ListSearchRequest_ResponseGroupArray read FResponseGroup write FResponseGroup; + property State : string read FState write FState stored HasState; + end; + + ListSearch_Type = class(TBaseComplexRemotable) + private + FMarketplaceDomain : string; + FAWSAccessKeyId : string; + FSubscriptionId : string; + FAssociateTag : string; + FValidate : string; + FXMLEscaping : string; + FShared : ListSearchRequest; + FRequest : ListSearch_RequestArray; + private + function HasMarketplaceDomain() : Boolean; + function HasAWSAccessKeyId() : Boolean; + function HasSubscriptionId() : Boolean; + function HasAssociateTag() : Boolean; + function HasValidate() : Boolean; + function HasXMLEscaping() : Boolean; + function HasShared() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property MarketplaceDomain : string read FMarketplaceDomain write FMarketplaceDomain stored HasMarketplaceDomain; + property AWSAccessKeyId : string read FAWSAccessKeyId write FAWSAccessKeyId stored HasAWSAccessKeyId; + property SubscriptionId : string read FSubscriptionId write FSubscriptionId stored HasSubscriptionId; + property AssociateTag : string read FAssociateTag write FAssociateTag stored HasAssociateTag; + property Validate : string read FValidate write FValidate stored HasValidate; + property XMLEscaping : string read FXMLEscaping write FXMLEscaping stored HasXMLEscaping; + property Shared : ListSearchRequest read FShared write FShared stored HasShared; + property Request : ListSearch_RequestArray read FRequest write FRequest; + end; + + Lists_Type = class(TBaseComplexRemotable) + private + FRequest : Request_Type; + FTotalResults : nonNegativeInteger; + FTotalPages : nonNegativeInteger; + FList : Lists_ListArray; + private + function HasRequest() : Boolean; + function HasTotalResults() : Boolean; + function HasTotalPages() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property Request : Request_Type read FRequest write FRequest stored HasRequest; + property TotalResults : nonNegativeInteger read FTotalResults write FTotalResults stored HasTotalResults; + property TotalPages : nonNegativeInteger read FTotalPages write FTotalPages stored HasTotalPages; + property List : Lists_ListArray read FList write FList; + end; + + ListSearchResponse_Type = class(TBaseComplexRemotable) + private + FOperationRequest : OperationRequest_Type; + FLists : ListSearchResponse_ListsArray; + private + function HasOperationRequest() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property OperationRequest : OperationRequest_Type read FOperationRequest write FOperationRequest stored HasOperationRequest; + property Lists : ListSearchResponse_ListsArray read FLists write FLists; + end; + + ListLookupRequest = class(TBaseComplexRemotable) + private + FCondition : Condition_Type; + FDeliveryMethod : DeliveryMethod_Type; + FISPUPostalCode : string; + FListId : string; + FListType : ListLookupRequest_ListType_Type; + FMerchantId : string; + FProductGroup : string; + FProductPage : positiveInteger; + FResponseGroup : ListLookupRequest_ResponseGroupArray; + FReviewSort : string; + FSort : string; + private + function HasCondition() : Boolean; + function HasDeliveryMethod() : Boolean; + function HasISPUPostalCode() : Boolean; + function HasListId() : Boolean; + function HasListType() : Boolean; + function HasMerchantId() : Boolean; + function HasProductGroup() : Boolean; + function HasProductPage() : Boolean; + function HasReviewSort() : Boolean; + function HasSort() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property Condition : Condition_Type read FCondition write FCondition stored HasCondition; + property DeliveryMethod : DeliveryMethod_Type read FDeliveryMethod write FDeliveryMethod stored HasDeliveryMethod; + property ISPUPostalCode : string read FISPUPostalCode write FISPUPostalCode stored HasISPUPostalCode; + property ListId : string read FListId write FListId stored HasListId; + property ListType : ListLookupRequest_ListType_Type read FListType write FListType stored HasListType; + property MerchantId : string read FMerchantId write FMerchantId stored HasMerchantId; + property ProductGroup : string read FProductGroup write FProductGroup stored HasProductGroup; + property ProductPage : positiveInteger read FProductPage write FProductPage stored HasProductPage; + property ResponseGroup : ListLookupRequest_ResponseGroupArray read FResponseGroup write FResponseGroup; + property ReviewSort : string read FReviewSort write FReviewSort stored HasReviewSort; + property Sort : string read FSort write FSort stored HasSort; + end; + + ListLookup_Type = class(TBaseComplexRemotable) + private + FMarketplaceDomain : string; + FAWSAccessKeyId : string; + FSubscriptionId : string; + FAssociateTag : string; + FValidate : string; + FXMLEscaping : string; + FShared : ListLookupRequest; + FRequest : ListLookup_RequestArray; + private + function HasMarketplaceDomain() : Boolean; + function HasAWSAccessKeyId() : Boolean; + function HasSubscriptionId() : Boolean; + function HasAssociateTag() : Boolean; + function HasValidate() : Boolean; + function HasXMLEscaping() : Boolean; + function HasShared() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property MarketplaceDomain : string read FMarketplaceDomain write FMarketplaceDomain stored HasMarketplaceDomain; + property AWSAccessKeyId : string read FAWSAccessKeyId write FAWSAccessKeyId stored HasAWSAccessKeyId; + property SubscriptionId : string read FSubscriptionId write FSubscriptionId stored HasSubscriptionId; + property AssociateTag : string read FAssociateTag write FAssociateTag stored HasAssociateTag; + property Validate : string read FValidate write FValidate stored HasValidate; + property XMLEscaping : string read FXMLEscaping write FXMLEscaping stored HasXMLEscaping; + property Shared : ListLookupRequest read FShared write FShared stored HasShared; + property Request : ListLookup_RequestArray read FRequest write FRequest; + end; + + ListLookupResponse_Type = class(TBaseComplexRemotable) + private + FOperationRequest : OperationRequest_Type; + FLists : ListLookupResponse_ListsArray; + private + function HasOperationRequest() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property OperationRequest : OperationRequest_Type read FOperationRequest write FOperationRequest stored HasOperationRequest; + property Lists : ListLookupResponse_ListsArray read FLists write FLists; + end; + + CustomerContentSearchRequest = class(TBaseComplexRemotable) + private + FCustomerPage : positiveInteger; + FEmail : string; + FName : string; + FResponseGroup : CustomerContentSearchRequest_ResponseGroupArray; + private + function HasCustomerPage() : Boolean; + function HasEmail() : Boolean; + function HasName() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property CustomerPage : positiveInteger read FCustomerPage write FCustomerPage stored HasCustomerPage; + property Email : string read FEmail write FEmail stored HasEmail; + property Name : string read FName write FName stored HasName; + property ResponseGroup : CustomerContentSearchRequest_ResponseGroupArray read FResponseGroup write FResponseGroup; + end; + + CustomerContentSearch_Type = class(TBaseComplexRemotable) + private + FMarketplaceDomain : string; + FAWSAccessKeyId : string; + FSubscriptionId : string; + FAssociateTag : string; + FValidate : string; + FXMLEscaping : string; + FShared : CustomerContentSearchRequest; + FRequest : CustomerContentSearch_RequestArray; + private + function HasMarketplaceDomain() : Boolean; + function HasAWSAccessKeyId() : Boolean; + function HasSubscriptionId() : Boolean; + function HasAssociateTag() : Boolean; + function HasValidate() : Boolean; + function HasXMLEscaping() : Boolean; + function HasShared() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property MarketplaceDomain : string read FMarketplaceDomain write FMarketplaceDomain stored HasMarketplaceDomain; + property AWSAccessKeyId : string read FAWSAccessKeyId write FAWSAccessKeyId stored HasAWSAccessKeyId; + property SubscriptionId : string read FSubscriptionId write FSubscriptionId stored HasSubscriptionId; + property AssociateTag : string read FAssociateTag write FAssociateTag stored HasAssociateTag; + property Validate : string read FValidate write FValidate stored HasValidate; + property XMLEscaping : string read FXMLEscaping write FXMLEscaping stored HasXMLEscaping; + property Shared : CustomerContentSearchRequest read FShared write FShared stored HasShared; + property Request : CustomerContentSearch_RequestArray read FRequest write FRequest; + end; + + Customers_Type = class(TBaseComplexRemotable) + private + FRequest : Request_Type; + FTotalResults : nonNegativeInteger; + FTotalPages : nonNegativeInteger; + FCustomer : Customers_CustomerArray; + private + function HasRequest() : Boolean; + function HasTotalResults() : Boolean; + function HasTotalPages() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property Request : Request_Type read FRequest write FRequest stored HasRequest; + property TotalResults : nonNegativeInteger read FTotalResults write FTotalResults stored HasTotalResults; + property TotalPages : nonNegativeInteger read FTotalPages write FTotalPages stored HasTotalPages; + property Customer : Customers_CustomerArray read FCustomer write FCustomer; + end; + + CustomerContentSearchResponse_Type = class(TBaseComplexRemotable) + private + FOperationRequest : OperationRequest_Type; + FCustomers : CustomerContentSearchResponse_CustomersArray; + private + function HasOperationRequest() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property OperationRequest : OperationRequest_Type read FOperationRequest write FOperationRequest stored HasOperationRequest; + property Customers : CustomerContentSearchResponse_CustomersArray read FCustomers write FCustomers; + end; + + CustomerContentLookupRequest = class(TBaseComplexRemotable) + private + FCustomerId : string; + FResponseGroup : CustomerContentLookupRequest_ResponseGroupArray; + FReviewPage : positiveInteger; + private + function HasCustomerId() : Boolean; + function HasReviewPage() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property CustomerId : string read FCustomerId write FCustomerId stored HasCustomerId; + property ResponseGroup : CustomerContentLookupRequest_ResponseGroupArray read FResponseGroup write FResponseGroup; + property ReviewPage : positiveInteger read FReviewPage write FReviewPage stored HasReviewPage; + end; + + CustomerContentLookup_Type = class(TBaseComplexRemotable) + private + FMarketplaceDomain : string; + FAWSAccessKeyId : string; + FSubscriptionId : string; + FAssociateTag : string; + FValidate : string; + FXMLEscaping : string; + FShared : CustomerContentLookupRequest; + FRequest : CustomerContentLookup_RequestArray; + private + function HasMarketplaceDomain() : Boolean; + function HasAWSAccessKeyId() : Boolean; + function HasSubscriptionId() : Boolean; + function HasAssociateTag() : Boolean; + function HasValidate() : Boolean; + function HasXMLEscaping() : Boolean; + function HasShared() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property MarketplaceDomain : string read FMarketplaceDomain write FMarketplaceDomain stored HasMarketplaceDomain; + property AWSAccessKeyId : string read FAWSAccessKeyId write FAWSAccessKeyId stored HasAWSAccessKeyId; + property SubscriptionId : string read FSubscriptionId write FSubscriptionId stored HasSubscriptionId; + property AssociateTag : string read FAssociateTag write FAssociateTag stored HasAssociateTag; + property Validate : string read FValidate write FValidate stored HasValidate; + property XMLEscaping : string read FXMLEscaping write FXMLEscaping stored HasXMLEscaping; + property Shared : CustomerContentLookupRequest read FShared write FShared stored HasShared; + property Request : CustomerContentLookup_RequestArray read FRequest write FRequest; + end; + + CustomerContentLookupResponse_Type = class(TBaseComplexRemotable) + private + FOperationRequest : OperationRequest_Type; + FCustomers : CustomerContentLookupResponse_CustomersArray; + private + function HasOperationRequest() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property OperationRequest : OperationRequest_Type read FOperationRequest write FOperationRequest stored HasOperationRequest; + property Customers : CustomerContentLookupResponse_CustomersArray read FCustomers write FCustomers; + end; + + SimilarityLookupRequest = class(TBaseComplexRemotable) + private + FCondition : Condition_Type; + FDeliveryMethod : DeliveryMethod_Type; + FItemId : SimilarityLookupRequest_ItemIdArray; + FISPUPostalCode : string; + FMerchantId : string; + FResponseGroup : SimilarityLookupRequest_ResponseGroupArray; + FReviewSort : string; + FSimilarityType : SimilarityLookupRequest_SimilarityType_Type; + private + function HasCondition() : Boolean; + function HasDeliveryMethod() : Boolean; + function HasISPUPostalCode() : Boolean; + function HasMerchantId() : Boolean; + function HasReviewSort() : Boolean; + function HasSimilarityType() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property Condition : Condition_Type read FCondition write FCondition stored HasCondition; + property DeliveryMethod : DeliveryMethod_Type read FDeliveryMethod write FDeliveryMethod stored HasDeliveryMethod; + property ItemId : SimilarityLookupRequest_ItemIdArray read FItemId write FItemId; + property ISPUPostalCode : string read FISPUPostalCode write FISPUPostalCode stored HasISPUPostalCode; + property MerchantId : string read FMerchantId write FMerchantId stored HasMerchantId; + property ResponseGroup : SimilarityLookupRequest_ResponseGroupArray read FResponseGroup write FResponseGroup; + property ReviewSort : string read FReviewSort write FReviewSort stored HasReviewSort; + property SimilarityType : SimilarityLookupRequest_SimilarityType_Type read FSimilarityType write FSimilarityType stored HasSimilarityType; + end; + + SimilarityLookup_Type = class(TBaseComplexRemotable) + private + FMarketplaceDomain : string; + FAWSAccessKeyId : string; + FSubscriptionId : string; + FAssociateTag : string; + FValidate : string; + FXMLEscaping : string; + FShared : SimilarityLookupRequest; + FRequest : SimilarityLookup_RequestArray; + private + function HasMarketplaceDomain() : Boolean; + function HasAWSAccessKeyId() : Boolean; + function HasSubscriptionId() : Boolean; + function HasAssociateTag() : Boolean; + function HasValidate() : Boolean; + function HasXMLEscaping() : Boolean; + function HasShared() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property MarketplaceDomain : string read FMarketplaceDomain write FMarketplaceDomain stored HasMarketplaceDomain; + property AWSAccessKeyId : string read FAWSAccessKeyId write FAWSAccessKeyId stored HasAWSAccessKeyId; + property SubscriptionId : string read FSubscriptionId write FSubscriptionId stored HasSubscriptionId; + property AssociateTag : string read FAssociateTag write FAssociateTag stored HasAssociateTag; + property Validate : string read FValidate write FValidate stored HasValidate; + property XMLEscaping : string read FXMLEscaping write FXMLEscaping stored HasXMLEscaping; + property Shared : SimilarityLookupRequest read FShared write FShared stored HasShared; + property Request : SimilarityLookup_RequestArray read FRequest write FRequest; + end; + + SimilarityLookupResponse_Type = class(TBaseComplexRemotable) + private + FOperationRequest : OperationRequest_Type; + FItems : SimilarityLookupResponse_ItemsArray; + private + function HasOperationRequest() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property OperationRequest : OperationRequest_Type read FOperationRequest write FOperationRequest stored HasOperationRequest; + property Items : SimilarityLookupResponse_ItemsArray read FItems write FItems; + end; + + SellerLookupRequest = class(TBaseComplexRemotable) + private + FResponseGroup : SellerLookupRequest_ResponseGroupArray; + FSellerId : SellerLookupRequest_SellerIdArray; + FFeedbackPage : positiveInteger; + private + function HasFeedbackPage() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property ResponseGroup : SellerLookupRequest_ResponseGroupArray read FResponseGroup write FResponseGroup; + property SellerId : SellerLookupRequest_SellerIdArray read FSellerId write FSellerId; + property FeedbackPage : positiveInteger read FFeedbackPage write FFeedbackPage stored HasFeedbackPage; + end; + + SellerLookup_Type = class(TBaseComplexRemotable) + private + FMarketplaceDomain : string; + FAWSAccessKeyId : string; + FSubscriptionId : string; + FAssociateTag : string; + FValidate : string; + FXMLEscaping : string; + FShared : SellerLookupRequest; + FRequest : SellerLookup_RequestArray; + private + function HasMarketplaceDomain() : Boolean; + function HasAWSAccessKeyId() : Boolean; + function HasSubscriptionId() : Boolean; + function HasAssociateTag() : Boolean; + function HasValidate() : Boolean; + function HasXMLEscaping() : Boolean; + function HasShared() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property MarketplaceDomain : string read FMarketplaceDomain write FMarketplaceDomain stored HasMarketplaceDomain; + property AWSAccessKeyId : string read FAWSAccessKeyId write FAWSAccessKeyId stored HasAWSAccessKeyId; + property SubscriptionId : string read FSubscriptionId write FSubscriptionId stored HasSubscriptionId; + property AssociateTag : string read FAssociateTag write FAssociateTag stored HasAssociateTag; + property Validate : string read FValidate write FValidate stored HasValidate; + property XMLEscaping : string read FXMLEscaping write FXMLEscaping stored HasXMLEscaping; + property Shared : SellerLookupRequest read FShared write FShared stored HasShared; + property Request : SellerLookup_RequestArray read FRequest write FRequest; + end; + + Sellers_Type = class(TBaseComplexRemotable) + private + FRequest : Request_Type; + FTotalResults : nonNegativeInteger; + FTotalPages : nonNegativeInteger; + FSeller : Sellers_SellerArray; + private + function HasRequest() : Boolean; + function HasTotalResults() : Boolean; + function HasTotalPages() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property Request : Request_Type read FRequest write FRequest stored HasRequest; + property TotalResults : nonNegativeInteger read FTotalResults write FTotalResults stored HasTotalResults; + property TotalPages : nonNegativeInteger read FTotalPages write FTotalPages stored HasTotalPages; + property Seller : Sellers_SellerArray read FSeller write FSeller; + end; + + SellerLookupResponse_Type = class(TBaseComplexRemotable) + private + FOperationRequest : OperationRequest_Type; + FSellers : SellerLookupResponse_SellersArray; + private + function HasOperationRequest() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property OperationRequest : OperationRequest_Type read FOperationRequest write FOperationRequest stored HasOperationRequest; + property Sellers : SellerLookupResponse_SellersArray read FSellers write FSellers; + end; + + CartGetRequest = class(TBaseComplexRemotable) + private + FCartId : string; + FHMAC : string; + FMergeCart : string; + FResponseGroup : CartGetRequest_ResponseGroupArray; + private + function HasCartId() : Boolean; + function HasHMAC() : Boolean; + function HasMergeCart() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property CartId : string read FCartId write FCartId stored HasCartId; + property HMAC : string read FHMAC write FHMAC stored HasHMAC; + property MergeCart : string read FMergeCart write FMergeCart stored HasMergeCart; + property ResponseGroup : CartGetRequest_ResponseGroupArray read FResponseGroup write FResponseGroup; + end; + + CartGet_Type = class(TBaseComplexRemotable) + private + FMarketplaceDomain : string; + FAWSAccessKeyId : string; + FSubscriptionId : string; + FAssociateTag : string; + FValidate : string; + FXMLEscaping : string; + FShared : CartGetRequest; + FRequest : CartGet_RequestArray; + private + function HasMarketplaceDomain() : Boolean; + function HasAWSAccessKeyId() : Boolean; + function HasSubscriptionId() : Boolean; + function HasAssociateTag() : Boolean; + function HasValidate() : Boolean; + function HasXMLEscaping() : Boolean; + function HasShared() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property MarketplaceDomain : string read FMarketplaceDomain write FMarketplaceDomain stored HasMarketplaceDomain; + property AWSAccessKeyId : string read FAWSAccessKeyId write FAWSAccessKeyId stored HasAWSAccessKeyId; + property SubscriptionId : string read FSubscriptionId write FSubscriptionId stored HasSubscriptionId; + property AssociateTag : string read FAssociateTag write FAssociateTag stored HasAssociateTag; + property Validate : string read FValidate write FValidate stored HasValidate; + property XMLEscaping : string read FXMLEscaping write FXMLEscaping stored HasXMLEscaping; + property Shared : CartGetRequest read FShared write FShared stored HasShared; + property Request : CartGet_RequestArray read FRequest write FRequest; + end; + + Cart_Type = class(TBaseComplexRemotable) + private + FRequest : Request_Type; + FCartId : string; + FHMAC : string; + FURLEncodedHMAC : string; + FPurchaseURL : string; + FSubTotal : Price; + FCartItems : CartItems_Type; + FSavedForLaterItems : SavedForLaterItems_Type; + FSimilarProducts : SimilarProducts_Type; + FTopSellers : TopSellers_Type; + FNewReleases : NewReleases_Type; + FSimilarViewedProducts : SimilarViewedProducts_Type; + FOtherCategoriesSimilarProducts : OtherCategoriesSimilarProducts_Type; + private + function HasRequest() : Boolean; + function HasPurchaseURL() : Boolean; + function HasSubTotal() : Boolean; + function HasCartItems() : Boolean; + function HasSavedForLaterItems() : Boolean; + function HasSimilarProducts() : Boolean; + function HasTopSellers() : Boolean; + function HasNewReleases() : Boolean; + function HasSimilarViewedProducts() : Boolean; + function HasOtherCategoriesSimilarProducts() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property Request : Request_Type read FRequest write FRequest stored HasRequest; + property CartId : string read FCartId write FCartId; + property HMAC : string read FHMAC write FHMAC; + property URLEncodedHMAC : string read FURLEncodedHMAC write FURLEncodedHMAC; + property PurchaseURL : string read FPurchaseURL write FPurchaseURL stored HasPurchaseURL; + property SubTotal : Price read FSubTotal write FSubTotal stored HasSubTotal; + property CartItems : CartItems_Type read FCartItems write FCartItems stored HasCartItems; + property SavedForLaterItems : SavedForLaterItems_Type read FSavedForLaterItems write FSavedForLaterItems stored HasSavedForLaterItems; + property SimilarProducts : SimilarProducts_Type read FSimilarProducts write FSimilarProducts stored HasSimilarProducts; + property TopSellers : TopSellers_Type read FTopSellers write FTopSellers stored HasTopSellers; + property NewReleases : NewReleases_Type read FNewReleases write FNewReleases stored HasNewReleases; + property SimilarViewedProducts : SimilarViewedProducts_Type read FSimilarViewedProducts write FSimilarViewedProducts stored HasSimilarViewedProducts; + property OtherCategoriesSimilarProducts : OtherCategoriesSimilarProducts_Type read FOtherCategoriesSimilarProducts write FOtherCategoriesSimilarProducts stored HasOtherCategoriesSimilarProducts; + end; + + CartGetResponse_Type = class(TBaseComplexRemotable) + private + FOperationRequest : OperationRequest_Type; + FCart : CartGetResponse_CartArray; + private + function HasOperationRequest() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property OperationRequest : OperationRequest_Type read FOperationRequest write FOperationRequest stored HasOperationRequest; + property Cart : CartGetResponse_CartArray read FCart write FCart; + end; + + CartAddRequest = class(TBaseComplexRemotable) + private + FCartId : string; + FHMAC : string; + FMergeCart : string; + FItems : CartAddRequest_Items_Type; + FResponseGroup : CartAddRequest_ResponseGroupArray; + private + function HasCartId() : Boolean; + function HasHMAC() : Boolean; + function HasMergeCart() : Boolean; + function HasItems() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property CartId : string read FCartId write FCartId stored HasCartId; + property HMAC : string read FHMAC write FHMAC stored HasHMAC; + property MergeCart : string read FMergeCart write FMergeCart stored HasMergeCart; + property Items : CartAddRequest_Items_Type read FItems write FItems stored HasItems; + property ResponseGroup : CartAddRequest_ResponseGroupArray read FResponseGroup write FResponseGroup; + end; + + CartAdd_Type = class(TBaseComplexRemotable) + private + FMarketplaceDomain : string; + FAWSAccessKeyId : string; + FSubscriptionId : string; + FAssociateTag : string; + FValidate : string; + FXMLEscaping : string; + FShared : CartAddRequest; + FRequest : CartAdd_RequestArray; + private + function HasMarketplaceDomain() : Boolean; + function HasAWSAccessKeyId() : Boolean; + function HasSubscriptionId() : Boolean; + function HasAssociateTag() : Boolean; + function HasValidate() : Boolean; + function HasXMLEscaping() : Boolean; + function HasShared() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property MarketplaceDomain : string read FMarketplaceDomain write FMarketplaceDomain stored HasMarketplaceDomain; + property AWSAccessKeyId : string read FAWSAccessKeyId write FAWSAccessKeyId stored HasAWSAccessKeyId; + property SubscriptionId : string read FSubscriptionId write FSubscriptionId stored HasSubscriptionId; + property AssociateTag : string read FAssociateTag write FAssociateTag stored HasAssociateTag; + property Validate : string read FValidate write FValidate stored HasValidate; + property XMLEscaping : string read FXMLEscaping write FXMLEscaping stored HasXMLEscaping; + property Shared : CartAddRequest read FShared write FShared stored HasShared; + property Request : CartAdd_RequestArray read FRequest write FRequest; + end; + + CartAddResponse_Type = class(TBaseComplexRemotable) + private + FOperationRequest : OperationRequest_Type; + FCart : CartAddResponse_CartArray; + private + function HasOperationRequest() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property OperationRequest : OperationRequest_Type read FOperationRequest write FOperationRequest stored HasOperationRequest; + property Cart : CartAddResponse_CartArray read FCart write FCart; + end; + + CartCreateRequest = class(TBaseComplexRemotable) + private + FMergeCart : string; + FItems : CartCreateRequest_Items_Type; + FResponseGroup : CartCreateRequest_ResponseGroupArray; + private + function HasMergeCart() : Boolean; + function HasItems() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property MergeCart : string read FMergeCart write FMergeCart stored HasMergeCart; + property Items : CartCreateRequest_Items_Type read FItems write FItems stored HasItems; + property ResponseGroup : CartCreateRequest_ResponseGroupArray read FResponseGroup write FResponseGroup; + end; + + CartCreate_Type = class(TBaseComplexRemotable) + private + FMarketplaceDomain : string; + FAWSAccessKeyId : string; + FSubscriptionId : string; + FAssociateTag : string; + FValidate : string; + FXMLEscaping : string; + FShared : CartCreateRequest; + FRequest : CartCreate_RequestArray; + private + function HasMarketplaceDomain() : Boolean; + function HasAWSAccessKeyId() : Boolean; + function HasSubscriptionId() : Boolean; + function HasAssociateTag() : Boolean; + function HasValidate() : Boolean; + function HasXMLEscaping() : Boolean; + function HasShared() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property MarketplaceDomain : string read FMarketplaceDomain write FMarketplaceDomain stored HasMarketplaceDomain; + property AWSAccessKeyId : string read FAWSAccessKeyId write FAWSAccessKeyId stored HasAWSAccessKeyId; + property SubscriptionId : string read FSubscriptionId write FSubscriptionId stored HasSubscriptionId; + property AssociateTag : string read FAssociateTag write FAssociateTag stored HasAssociateTag; + property Validate : string read FValidate write FValidate stored HasValidate; + property XMLEscaping : string read FXMLEscaping write FXMLEscaping stored HasXMLEscaping; + property Shared : CartCreateRequest read FShared write FShared stored HasShared; + property Request : CartCreate_RequestArray read FRequest write FRequest; + end; + + CartCreateResponse_Type = class(TBaseComplexRemotable) + private + FOperationRequest : OperationRequest_Type; + FCart : CartCreateResponse_CartArray; + private + function HasOperationRequest() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property OperationRequest : OperationRequest_Type read FOperationRequest write FOperationRequest stored HasOperationRequest; + property Cart : CartCreateResponse_CartArray read FCart write FCart; + end; + + CartModifyRequest = class(TBaseComplexRemotable) + private + FCartId : string; + FHMAC : string; + FMergeCart : string; + FItems : CartModifyRequest_Items_Type; + FResponseGroup : CartModifyRequest_ResponseGroupArray; + private + function HasCartId() : Boolean; + function HasHMAC() : Boolean; + function HasMergeCart() : Boolean; + function HasItems() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property CartId : string read FCartId write FCartId stored HasCartId; + property HMAC : string read FHMAC write FHMAC stored HasHMAC; + property MergeCart : string read FMergeCart write FMergeCart stored HasMergeCart; + property Items : CartModifyRequest_Items_Type read FItems write FItems stored HasItems; + property ResponseGroup : CartModifyRequest_ResponseGroupArray read FResponseGroup write FResponseGroup; + end; + + CartModify_Type = class(TBaseComplexRemotable) + private + FMarketplaceDomain : string; + FAWSAccessKeyId : string; + FSubscriptionId : string; + FAssociateTag : string; + FValidate : string; + FXMLEscaping : string; + FShared : CartModifyRequest; + FRequest : CartModify_RequestArray; + private + function HasMarketplaceDomain() : Boolean; + function HasAWSAccessKeyId() : Boolean; + function HasSubscriptionId() : Boolean; + function HasAssociateTag() : Boolean; + function HasValidate() : Boolean; + function HasXMLEscaping() : Boolean; + function HasShared() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property MarketplaceDomain : string read FMarketplaceDomain write FMarketplaceDomain stored HasMarketplaceDomain; + property AWSAccessKeyId : string read FAWSAccessKeyId write FAWSAccessKeyId stored HasAWSAccessKeyId; + property SubscriptionId : string read FSubscriptionId write FSubscriptionId stored HasSubscriptionId; + property AssociateTag : string read FAssociateTag write FAssociateTag stored HasAssociateTag; + property Validate : string read FValidate write FValidate stored HasValidate; + property XMLEscaping : string read FXMLEscaping write FXMLEscaping stored HasXMLEscaping; + property Shared : CartModifyRequest read FShared write FShared stored HasShared; + property Request : CartModify_RequestArray read FRequest write FRequest; + end; + + CartModifyResponse_Type = class(TBaseComplexRemotable) + private + FOperationRequest : OperationRequest_Type; + FCart : CartModifyResponse_CartArray; + private + function HasOperationRequest() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property OperationRequest : OperationRequest_Type read FOperationRequest write FOperationRequest stored HasOperationRequest; + property Cart : CartModifyResponse_CartArray read FCart write FCart; + end; + + CartClearRequest = class(TBaseComplexRemotable) + private + FCartId : string; + FHMAC : string; + FMergeCart : string; + FResponseGroup : CartClearRequest_ResponseGroupArray; + private + function HasCartId() : Boolean; + function HasHMAC() : Boolean; + function HasMergeCart() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property CartId : string read FCartId write FCartId stored HasCartId; + property HMAC : string read FHMAC write FHMAC stored HasHMAC; + property MergeCart : string read FMergeCart write FMergeCart stored HasMergeCart; + property ResponseGroup : CartClearRequest_ResponseGroupArray read FResponseGroup write FResponseGroup; + end; + + CartClear_Type = class(TBaseComplexRemotable) + private + FMarketplaceDomain : string; + FAWSAccessKeyId : string; + FSubscriptionId : string; + FAssociateTag : string; + FValidate : string; + FXMLEscaping : string; + FShared : CartClearRequest; + FRequest : CartClear_RequestArray; + private + function HasMarketplaceDomain() : Boolean; + function HasAWSAccessKeyId() : Boolean; + function HasSubscriptionId() : Boolean; + function HasAssociateTag() : Boolean; + function HasValidate() : Boolean; + function HasXMLEscaping() : Boolean; + function HasShared() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property MarketplaceDomain : string read FMarketplaceDomain write FMarketplaceDomain stored HasMarketplaceDomain; + property AWSAccessKeyId : string read FAWSAccessKeyId write FAWSAccessKeyId stored HasAWSAccessKeyId; + property SubscriptionId : string read FSubscriptionId write FSubscriptionId stored HasSubscriptionId; + property AssociateTag : string read FAssociateTag write FAssociateTag stored HasAssociateTag; + property Validate : string read FValidate write FValidate stored HasValidate; + property XMLEscaping : string read FXMLEscaping write FXMLEscaping stored HasXMLEscaping; + property Shared : CartClearRequest read FShared write FShared stored HasShared; + property Request : CartClear_RequestArray read FRequest write FRequest; + end; + + CartClearResponse_Type = class(TBaseComplexRemotable) + private + FOperationRequest : OperationRequest_Type; + FCart : CartClearResponse_CartArray; + private + function HasOperationRequest() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property OperationRequest : OperationRequest_Type read FOperationRequest write FOperationRequest stored HasOperationRequest; + property Cart : CartClearResponse_CartArray read FCart write FCart; + end; + + TransactionLookupRequest = class(TBaseComplexRemotable) + private + FResponseGroup : TransactionLookupRequest_ResponseGroupArray; + FTransactionId : TransactionLookupRequest_TransactionIdArray; + public + constructor Create();override; + destructor Destroy();override; + published + property ResponseGroup : TransactionLookupRequest_ResponseGroupArray read FResponseGroup write FResponseGroup; + property TransactionId : TransactionLookupRequest_TransactionIdArray read FTransactionId write FTransactionId; + end; + + TransactionLookup_Type = class(TBaseComplexRemotable) + private + FMarketplaceDomain : string; + FAWSAccessKeyId : string; + FSubscriptionId : string; + FAssociateTag : string; + FValidate : string; + FXMLEscaping : string; + FShared : TransactionLookupRequest; + FRequest : TransactionLookup_RequestArray; + private + function HasMarketplaceDomain() : Boolean; + function HasAWSAccessKeyId() : Boolean; + function HasSubscriptionId() : Boolean; + function HasAssociateTag() : Boolean; + function HasValidate() : Boolean; + function HasXMLEscaping() : Boolean; + function HasShared() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property MarketplaceDomain : string read FMarketplaceDomain write FMarketplaceDomain stored HasMarketplaceDomain; + property AWSAccessKeyId : string read FAWSAccessKeyId write FAWSAccessKeyId stored HasAWSAccessKeyId; + property SubscriptionId : string read FSubscriptionId write FSubscriptionId stored HasSubscriptionId; + property AssociateTag : string read FAssociateTag write FAssociateTag stored HasAssociateTag; + property Validate : string read FValidate write FValidate stored HasValidate; + property XMLEscaping : string read FXMLEscaping write FXMLEscaping stored HasXMLEscaping; + property Shared : TransactionLookupRequest read FShared write FShared stored HasShared; + property Request : TransactionLookup_RequestArray read FRequest write FRequest; + end; + + Transactions_Type = class(TBaseComplexRemotable) + private + FRequest : Request_Type; + FTotalResults : nonNegativeInteger; + FTotalPages : nonNegativeInteger; + FTransaction : Transactions_TransactionArray; + private + function HasRequest() : Boolean; + function HasTotalResults() : Boolean; + function HasTotalPages() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property Request : Request_Type read FRequest write FRequest stored HasRequest; + property TotalResults : nonNegativeInteger read FTotalResults write FTotalResults stored HasTotalResults; + property TotalPages : nonNegativeInteger read FTotalPages write FTotalPages stored HasTotalPages; + property Transaction : Transactions_TransactionArray read FTransaction write FTransaction; + end; + + TransactionLookupResponse_Type = class(TBaseComplexRemotable) + private + FOperationRequest : OperationRequest_Type; + FTransactions : TransactionLookupResponse_TransactionsArray; + private + function HasOperationRequest() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property OperationRequest : OperationRequest_Type read FOperationRequest write FOperationRequest stored HasOperationRequest; + property Transactions : TransactionLookupResponse_TransactionsArray read FTransactions write FTransactions; + end; + + SellerListingSearchRequest = class(TBaseComplexRemotable) + private + FKeywords : string; + FListingPage : positiveInteger; + FOfferStatus : SellerListingSearchRequest_OfferStatus_Type; + FResponseGroup : SellerListingSearchRequest_ResponseGroupArray; + FSellerId : string; + FSort : string; + FTitle : string; + private + function HasKeywords() : Boolean; + function HasListingPage() : Boolean; + function HasOfferStatus() : Boolean; + function HasSort() : Boolean; + function HasTitle() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property Keywords : string read FKeywords write FKeywords stored HasKeywords; + property ListingPage : positiveInteger read FListingPage write FListingPage stored HasListingPage; + property OfferStatus : SellerListingSearchRequest_OfferStatus_Type read FOfferStatus write FOfferStatus stored HasOfferStatus; + property ResponseGroup : SellerListingSearchRequest_ResponseGroupArray read FResponseGroup write FResponseGroup; + property SellerId : string read FSellerId write FSellerId; + property Sort : string read FSort write FSort stored HasSort; + property Title : string read FTitle write FTitle stored HasTitle; + end; + + SellerListingSearch_Type = class(TBaseComplexRemotable) + private + FMarketplaceDomain : string; + FAWSAccessKeyId : string; + FSubscriptionId : string; + FAssociateTag : string; + FValidate : string; + FXMLEscaping : string; + FShared : SellerListingSearchRequest; + FRequest : SellerListingSearch_RequestArray; + private + function HasMarketplaceDomain() : Boolean; + function HasAWSAccessKeyId() : Boolean; + function HasSubscriptionId() : Boolean; + function HasAssociateTag() : Boolean; + function HasValidate() : Boolean; + function HasXMLEscaping() : Boolean; + function HasShared() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property MarketplaceDomain : string read FMarketplaceDomain write FMarketplaceDomain stored HasMarketplaceDomain; + property AWSAccessKeyId : string read FAWSAccessKeyId write FAWSAccessKeyId stored HasAWSAccessKeyId; + property SubscriptionId : string read FSubscriptionId write FSubscriptionId stored HasSubscriptionId; + property AssociateTag : string read FAssociateTag write FAssociateTag stored HasAssociateTag; + property Validate : string read FValidate write FValidate stored HasValidate; + property XMLEscaping : string read FXMLEscaping write FXMLEscaping stored HasXMLEscaping; + property Shared : SellerListingSearchRequest read FShared write FShared stored HasShared; + property Request : SellerListingSearch_RequestArray read FRequest write FRequest; + end; + + SellerListings_Type = class(TBaseComplexRemotable) + private + FRequest : Request_Type; + FTotalResults : nonNegativeInteger; + FTotalPages : nonNegativeInteger; + FSellerListing : SellerListings_SellerListingArray; + private + function HasRequest() : Boolean; + function HasTotalResults() : Boolean; + function HasTotalPages() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property Request : Request_Type read FRequest write FRequest stored HasRequest; + property TotalResults : nonNegativeInteger read FTotalResults write FTotalResults stored HasTotalResults; + property TotalPages : nonNegativeInteger read FTotalPages write FTotalPages stored HasTotalPages; + property SellerListing : SellerListings_SellerListingArray read FSellerListing write FSellerListing; + end; + + SellerListingSearchResponse_Type = class(TBaseComplexRemotable) + private + FOperationRequest : OperationRequest_Type; + FSellerListings : SellerListingSearchResponse_SellerListingsArray; + private + function HasOperationRequest() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property OperationRequest : OperationRequest_Type read FOperationRequest write FOperationRequest stored HasOperationRequest; + property SellerListings : SellerListingSearchResponse_SellerListingsArray read FSellerListings write FSellerListings; + end; + + SellerListingLookupRequest = class(TBaseComplexRemotable) + private + FId : string; + FSellerId : string; + FIdType : SellerListingLookupRequest_IdType_Type; + FResponseGroup : SellerListingLookupRequest_ResponseGroupArray; + private + function HasSellerId() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property Id : string read FId write FId; + property SellerId : string read FSellerId write FSellerId stored HasSellerId; + property IdType : SellerListingLookupRequest_IdType_Type read FIdType write FIdType; + property ResponseGroup : SellerListingLookupRequest_ResponseGroupArray read FResponseGroup write FResponseGroup; + end; + + SellerListingLookup_Type = class(TBaseComplexRemotable) + private + FMarketplaceDomain : string; + FAWSAccessKeyId : string; + FSubscriptionId : string; + FAssociateTag : string; + FValidate : string; + FXMLEscaping : string; + FShared : SellerListingLookupRequest; + FRequest : SellerListingLookup_RequestArray; + private + function HasMarketplaceDomain() : Boolean; + function HasAWSAccessKeyId() : Boolean; + function HasSubscriptionId() : Boolean; + function HasAssociateTag() : Boolean; + function HasValidate() : Boolean; + function HasXMLEscaping() : Boolean; + function HasShared() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property MarketplaceDomain : string read FMarketplaceDomain write FMarketplaceDomain stored HasMarketplaceDomain; + property AWSAccessKeyId : string read FAWSAccessKeyId write FAWSAccessKeyId stored HasAWSAccessKeyId; + property SubscriptionId : string read FSubscriptionId write FSubscriptionId stored HasSubscriptionId; + property AssociateTag : string read FAssociateTag write FAssociateTag stored HasAssociateTag; + property Validate : string read FValidate write FValidate stored HasValidate; + property XMLEscaping : string read FXMLEscaping write FXMLEscaping stored HasXMLEscaping; + property Shared : SellerListingLookupRequest read FShared write FShared stored HasShared; + property Request : SellerListingLookup_RequestArray read FRequest write FRequest; + end; + + SellerListingLookupResponse_Type = class(TBaseComplexRemotable) + private + FOperationRequest : OperationRequest_Type; + FSellerListings : SellerListingLookupResponse_SellerListingsArray; + private + function HasOperationRequest() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property OperationRequest : OperationRequest_Type read FOperationRequest write FOperationRequest stored HasOperationRequest; + property SellerListings : SellerListingLookupResponse_SellerListingsArray read FSellerListings write FSellerListings; + end; + + MultiOperationType = class(TBaseComplexRemotable) + private + FHelp : Help_Type; + FItemSearch : ItemSearch_Type; + FItemLookup : ItemLookup_Type; + FListSearch : ListSearch_Type; + FListLookup : ListLookup_Type; + FCustomerContentSearch : CustomerContentSearch_Type; + FCustomerContentLookup : CustomerContentLookup_Type; + FSimilarityLookup : SimilarityLookup_Type; + FSellerLookup : SellerLookup_Type; + FCartGet : CartGet_Type; + FCartAdd : CartAdd_Type; + FCartCreate : CartCreate_Type; + FCartModify : CartModify_Type; + FCartClear : CartClear_Type; + FTransactionLookup : TransactionLookup_Type; + FSellerListingSearch : SellerListingSearch_Type; + FSellerListingLookup : SellerListingLookup_Type; + FBrowseNodeLookup : BrowseNodeLookup_Type; + private + function HasHelp() : Boolean; + function HasItemSearch() : Boolean; + function HasItemLookup() : Boolean; + function HasListSearch() : Boolean; + function HasListLookup() : Boolean; + function HasCustomerContentSearch() : Boolean; + function HasCustomerContentLookup() : Boolean; + function HasSimilarityLookup() : Boolean; + function HasSellerLookup() : Boolean; + function HasCartGet() : Boolean; + function HasCartAdd() : Boolean; + function HasCartCreate() : Boolean; + function HasCartModify() : Boolean; + function HasCartClear() : Boolean; + function HasTransactionLookup() : Boolean; + function HasSellerListingSearch() : Boolean; + function HasSellerListingLookup() : Boolean; + function HasBrowseNodeLookup() : Boolean; + public + destructor Destroy();override; + published + property Help : Help_Type read FHelp write FHelp stored HasHelp; + property ItemSearch : ItemSearch_Type read FItemSearch write FItemSearch stored HasItemSearch; + property ItemLookup : ItemLookup_Type read FItemLookup write FItemLookup stored HasItemLookup; + property ListSearch : ListSearch_Type read FListSearch write FListSearch stored HasListSearch; + property ListLookup : ListLookup_Type read FListLookup write FListLookup stored HasListLookup; + property CustomerContentSearch : CustomerContentSearch_Type read FCustomerContentSearch write FCustomerContentSearch stored HasCustomerContentSearch; + property CustomerContentLookup : CustomerContentLookup_Type read FCustomerContentLookup write FCustomerContentLookup stored HasCustomerContentLookup; + property SimilarityLookup : SimilarityLookup_Type read FSimilarityLookup write FSimilarityLookup stored HasSimilarityLookup; + property SellerLookup : SellerLookup_Type read FSellerLookup write FSellerLookup stored HasSellerLookup; + property CartGet : CartGet_Type read FCartGet write FCartGet stored HasCartGet; + property CartAdd : CartAdd_Type read FCartAdd write FCartAdd stored HasCartAdd; + property CartCreate : CartCreate_Type read FCartCreate write FCartCreate stored HasCartCreate; + property CartModify : CartModify_Type read FCartModify write FCartModify stored HasCartModify; + property CartClear : CartClear_Type read FCartClear write FCartClear stored HasCartClear; + property TransactionLookup : TransactionLookup_Type read FTransactionLookup write FTransactionLookup stored HasTransactionLookup; + property SellerListingSearch : SellerListingSearch_Type read FSellerListingSearch write FSellerListingSearch stored HasSellerListingSearch; + property SellerListingLookup : SellerListingLookup_Type read FSellerListingLookup write FSellerListingLookup stored HasSellerListingLookup; + property BrowseNodeLookup : BrowseNodeLookup_Type read FBrowseNodeLookup write FBrowseNodeLookup stored HasBrowseNodeLookup; + end; + + MultiOperationResponse = class(TBaseComplexRemotable) + private + FOperationRequest : OperationRequest_Type; + FHelpResponse : HelpResponse_Type; + FItemSearchResponse : ItemSearchResponse_Type; + FItemLookupResponse : ItemLookupResponse_Type; + FListSearchResponse : ListSearchResponse_Type; + FListLookupResponse : ListLookupResponse_Type; + FCustomerContentSearchResponse : CustomerContentSearchResponse_Type; + FCustomerContentLookupResponse : CustomerContentLookupResponse_Type; + FSimilarityLookupResponse : SimilarityLookupResponse_Type; + FSellerLookupResponse : SellerLookupResponse_Type; + FCartGetResponse : CartGetResponse_Type; + FCartAddResponse : CartAddResponse_Type; + FCartCreateResponse : CartCreateResponse_Type; + FCartModifyResponse : CartModifyResponse_Type; + FCartClearResponse : CartClearResponse_Type; + FTransactionLookupResponse : TransactionLookupResponse_Type; + FSellerListingSearchResponse : SellerListingSearchResponse_Type; + FSellerListingLookupResponse : SellerListingLookupResponse_Type; + FBrowseNodeLookupResponse : BrowseNodeLookupResponse_Type; + private + function HasOperationRequest() : Boolean; + function HasHelpResponse() : Boolean; + function HasItemSearchResponse() : Boolean; + function HasItemLookupResponse() : Boolean; + function HasListSearchResponse() : Boolean; + function HasListLookupResponse() : Boolean; + function HasCustomerContentSearchResponse() : Boolean; + function HasCustomerContentLookupResponse() : Boolean; + function HasSimilarityLookupResponse() : Boolean; + function HasSellerLookupResponse() : Boolean; + function HasCartGetResponse() : Boolean; + function HasCartAddResponse() : Boolean; + function HasCartCreateResponse() : Boolean; + function HasCartModifyResponse() : Boolean; + function HasCartClearResponse() : Boolean; + function HasTransactionLookupResponse() : Boolean; + function HasSellerListingSearchResponse() : Boolean; + function HasSellerListingLookupResponse() : Boolean; + function HasBrowseNodeLookupResponse() : Boolean; + public + destructor Destroy();override; + published + property OperationRequest : OperationRequest_Type read FOperationRequest write FOperationRequest stored HasOperationRequest; + property HelpResponse : HelpResponse_Type read FHelpResponse write FHelpResponse stored HasHelpResponse; + property ItemSearchResponse : ItemSearchResponse_Type read FItemSearchResponse write FItemSearchResponse stored HasItemSearchResponse; + property ItemLookupResponse : ItemLookupResponse_Type read FItemLookupResponse write FItemLookupResponse stored HasItemLookupResponse; + property ListSearchResponse : ListSearchResponse_Type read FListSearchResponse write FListSearchResponse stored HasListSearchResponse; + property ListLookupResponse : ListLookupResponse_Type read FListLookupResponse write FListLookupResponse stored HasListLookupResponse; + property CustomerContentSearchResponse : CustomerContentSearchResponse_Type read FCustomerContentSearchResponse write FCustomerContentSearchResponse stored HasCustomerContentSearchResponse; + property CustomerContentLookupResponse : CustomerContentLookupResponse_Type read FCustomerContentLookupResponse write FCustomerContentLookupResponse stored HasCustomerContentLookupResponse; + property SimilarityLookupResponse : SimilarityLookupResponse_Type read FSimilarityLookupResponse write FSimilarityLookupResponse stored HasSimilarityLookupResponse; + property SellerLookupResponse : SellerLookupResponse_Type read FSellerLookupResponse write FSellerLookupResponse stored HasSellerLookupResponse; + property CartGetResponse : CartGetResponse_Type read FCartGetResponse write FCartGetResponse stored HasCartGetResponse; + property CartAddResponse : CartAddResponse_Type read FCartAddResponse write FCartAddResponse stored HasCartAddResponse; + property CartCreateResponse : CartCreateResponse_Type read FCartCreateResponse write FCartCreateResponse stored HasCartCreateResponse; + property CartModifyResponse : CartModifyResponse_Type read FCartModifyResponse write FCartModifyResponse stored HasCartModifyResponse; + property CartClearResponse : CartClearResponse_Type read FCartClearResponse write FCartClearResponse stored HasCartClearResponse; + property TransactionLookupResponse : TransactionLookupResponse_Type read FTransactionLookupResponse write FTransactionLookupResponse stored HasTransactionLookupResponse; + property SellerListingSearchResponse : SellerListingSearchResponse_Type read FSellerListingSearchResponse write FSellerListingSearchResponse stored HasSellerListingSearchResponse; + property SellerListingLookupResponse : SellerListingLookupResponse_Type read FSellerListingLookupResponse write FSellerListingLookupResponse stored HasSellerListingLookupResponse; + property BrowseNodeLookupResponse : BrowseNodeLookupResponse_Type read FBrowseNodeLookupResponse write FBrowseNodeLookupResponse stored HasBrowseNodeLookupResponse; + end; + + Bin_BinParameter_Type = class(TBaseComplexRemotable) + private + FName : string; + FValue : string; + published + property Name : string read FName write FName; + property Value : string read FValue write FValue; + end; + + Bin_Type = class(TBaseComplexRemotable) + private + FBinName : string; + FBinItemCount : positiveInteger; + FBinParameter : Bin_BinParameterArray; + public + constructor Create();override; + destructor Destroy();override; + published + property BinName : string read FBinName write FBinName; + property BinItemCount : positiveInteger read FBinItemCount write FBinItemCount; + property BinParameter : Bin_BinParameterArray read FBinParameter write FBinParameter; + end; + + SearchBinSet_Type = class(TBaseComplexRemotable) + private + FBin : SearchBinSet_BinArray; + FNarrowBy : string; + public + constructor Create();override; + destructor Destroy();override; + published + property Bin : SearchBinSet_BinArray read FBin write FBin; + property NarrowBy : string read FNarrowBy write FNarrowBy; + end; + + CartAddRequest_Items_Type_Item_Type = class(TBaseComplexRemotable) + private + FASIN : string; + FOfferListingId : string; + FQuantity : positiveInteger; + FAssociateTag : string; + FListItemId : string; + private + function HasASIN() : Boolean; + function HasOfferListingId() : Boolean; + function HasQuantity() : Boolean; + function HasAssociateTag() : Boolean; + function HasListItemId() : Boolean; + published + property ASIN : string read FASIN write FASIN stored HasASIN; + property OfferListingId : string read FOfferListingId write FOfferListingId stored HasOfferListingId; + property Quantity : positiveInteger read FQuantity write FQuantity stored HasQuantity; + property AssociateTag : string read FAssociateTag write FAssociateTag stored HasAssociateTag; + property ListItemId : string read FListItemId write FListItemId stored HasListItemId; + end; + + CartCreateRequest_Items_Type_Item_Type = class(TBaseComplexRemotable) + private + FASIN : string; + FOfferListingId : string; + FQuantity : positiveInteger; + FAssociateTag : string; + FListItemId : string; + private + function HasASIN() : Boolean; + function HasOfferListingId() : Boolean; + function HasQuantity() : Boolean; + function HasAssociateTag() : Boolean; + function HasListItemId() : Boolean; + published + property ASIN : string read FASIN write FASIN stored HasASIN; + property OfferListingId : string read FOfferListingId write FOfferListingId stored HasOfferListingId; + property Quantity : positiveInteger read FQuantity write FQuantity stored HasQuantity; + property AssociateTag : string read FAssociateTag write FAssociateTag stored HasAssociateTag; + property ListItemId : string read FListItemId write FListItemId stored HasListItemId; + end; + + CartModifyRequest_Items_Type_Item_Type = class(TBaseComplexRemotable) + private + FAction : CartModifyRequest_Items_Type_Item_Type_Action_Type; + FCartItemId : string; + FQuantity : nonNegativeInteger; + private + function HasAction() : Boolean; + function HasCartItemId() : Boolean; + function HasQuantity() : Boolean; + published + property Action : CartModifyRequest_Items_Type_Item_Type_Action_Type read FAction write FAction stored HasAction; + property CartItemId : string read FCartItemId write FCartItemId stored HasCartItemId; + property Quantity : nonNegativeInteger read FQuantity write FQuantity stored HasQuantity; + end; + + Request_Type = class(TBaseComplexRemotable) + private + FIsValid : string; + FHelpRequest : HelpRequest; + FBrowseNodeLookupRequest : BrowseNodeLookupRequest; + FItemSearchRequest : ItemSearchRequest; + FItemLookupRequest : ItemLookupRequest; + FListSearchRequest : ListSearchRequest; + FListLookupRequest : ListLookupRequest; + FCustomerContentSearchRequest : CustomerContentSearchRequest; + FCustomerContentLookupRequest : CustomerContentLookupRequest; + FSimilarityLookupRequest : SimilarityLookupRequest; + FCartGetRequest : CartGetRequest; + FCartAddRequest : CartAddRequest; + FCartCreateRequest : CartCreateRequest; + FCartModifyRequest : CartModifyRequest; + FCartClearRequest : CartClearRequest; + FTransactionLookupRequest : TransactionLookupRequest; + FSellerListingSearchRequest : SellerListingSearchRequest; + FSellerListingLookupRequest : SellerListingLookupRequest; + FSellerLookupRequest : SellerLookupRequest; + FErrors : Errors_Type; + private + function HasIsValid() : Boolean; + function HasHelpRequest() : Boolean; + function HasBrowseNodeLookupRequest() : Boolean; + function HasItemSearchRequest() : Boolean; + function HasItemLookupRequest() : Boolean; + function HasListSearchRequest() : Boolean; + function HasListLookupRequest() : Boolean; + function HasCustomerContentSearchRequest() : Boolean; + function HasCustomerContentLookupRequest() : Boolean; + function HasSimilarityLookupRequest() : Boolean; + function HasCartGetRequest() : Boolean; + function HasCartAddRequest() : Boolean; + function HasCartCreateRequest() : Boolean; + function HasCartModifyRequest() : Boolean; + function HasCartClearRequest() : Boolean; + function HasTransactionLookupRequest() : Boolean; + function HasSellerListingSearchRequest() : Boolean; + function HasSellerListingLookupRequest() : Boolean; + function HasSellerLookupRequest() : Boolean; + function HasErrors() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property IsValid : string read FIsValid write FIsValid stored HasIsValid; + property HelpRequest : HelpRequest read FHelpRequest write FHelpRequest stored HasHelpRequest; + property BrowseNodeLookupRequest : BrowseNodeLookupRequest read FBrowseNodeLookupRequest write FBrowseNodeLookupRequest stored HasBrowseNodeLookupRequest; + property ItemSearchRequest : ItemSearchRequest read FItemSearchRequest write FItemSearchRequest stored HasItemSearchRequest; + property ItemLookupRequest : ItemLookupRequest read FItemLookupRequest write FItemLookupRequest stored HasItemLookupRequest; + property ListSearchRequest : ListSearchRequest read FListSearchRequest write FListSearchRequest stored HasListSearchRequest; + property ListLookupRequest : ListLookupRequest read FListLookupRequest write FListLookupRequest stored HasListLookupRequest; + property CustomerContentSearchRequest : CustomerContentSearchRequest read FCustomerContentSearchRequest write FCustomerContentSearchRequest stored HasCustomerContentSearchRequest; + property CustomerContentLookupRequest : CustomerContentLookupRequest read FCustomerContentLookupRequest write FCustomerContentLookupRequest stored HasCustomerContentLookupRequest; + property SimilarityLookupRequest : SimilarityLookupRequest read FSimilarityLookupRequest write FSimilarityLookupRequest stored HasSimilarityLookupRequest; + property CartGetRequest : CartGetRequest read FCartGetRequest write FCartGetRequest stored HasCartGetRequest; + property CartAddRequest : CartAddRequest read FCartAddRequest write FCartAddRequest stored HasCartAddRequest; + property CartCreateRequest : CartCreateRequest read FCartCreateRequest write FCartCreateRequest stored HasCartCreateRequest; + property CartModifyRequest : CartModifyRequest read FCartModifyRequest write FCartModifyRequest stored HasCartModifyRequest; + property CartClearRequest : CartClearRequest read FCartClearRequest write FCartClearRequest stored HasCartClearRequest; + property TransactionLookupRequest : TransactionLookupRequest read FTransactionLookupRequest write FTransactionLookupRequest stored HasTransactionLookupRequest; + property SellerListingSearchRequest : SellerListingSearchRequest read FSellerListingSearchRequest write FSellerListingSearchRequest stored HasSellerListingSearchRequest; + property SellerListingLookupRequest : SellerListingLookupRequest read FSellerListingLookupRequest write FSellerListingLookupRequest stored HasSellerListingLookupRequest; + property SellerLookupRequest : SellerLookupRequest read FSellerLookupRequest write FSellerLookupRequest stored HasSellerLookupRequest; + property Errors : Errors_Type read FErrors write FErrors stored HasErrors; + end; + + Arguments_Argument_Type = class(TBaseComplexRemotable) + private + FName : string; + FValue : string; + published + property Name : string read FName write FName; + property Value : string read FValue write FValue; + end; + + HTTPHeaders_Header_Type = class(TBaseComplexRemotable) + private + FName : string; + FValue : string; + published + property Name : string read FName write FName; + property Value : string read FValue write FValue; + end; + + Errors_Error_Type = class(TBaseComplexRemotable) + private + FCode : string; + FMessage : string; + published + property Code : string read FCode write FCode; + property Message : string read FMessage write FMessage; + end; + + OperationInformation_Type = class(TBaseComplexRemotable) + private + FName : string; + FDescription : string; + FRequiredParameters : OperationInformation_RequiredParameters_Type; + FAvailableParameters : OperationInformation_AvailableParameters_Type; + FDefaultResponseGroups : OperationInformation_DefaultResponseGroups_Type; + FAvailableResponseGroups : OperationInformation_AvailableResponseGroups_Type; + private + function HasName() : Boolean; + function HasDescription() : Boolean; + function HasRequiredParameters() : Boolean; + function HasAvailableParameters() : Boolean; + function HasDefaultResponseGroups() : Boolean; + function HasAvailableResponseGroups() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property Name : string read FName write FName stored HasName; + property Description : string read FDescription write FDescription stored HasDescription; + property RequiredParameters : OperationInformation_RequiredParameters_Type read FRequiredParameters write FRequiredParameters stored HasRequiredParameters; + property AvailableParameters : OperationInformation_AvailableParameters_Type read FAvailableParameters write FAvailableParameters stored HasAvailableParameters; + property DefaultResponseGroups : OperationInformation_DefaultResponseGroups_Type read FDefaultResponseGroups write FDefaultResponseGroups stored HasDefaultResponseGroups; + property AvailableResponseGroups : OperationInformation_AvailableResponseGroups_Type read FAvailableResponseGroups write FAvailableResponseGroups stored HasAvailableResponseGroups; + end; + + ResponseGroupInformation_Type = class(TBaseComplexRemotable) + private + FName : string; + FCreationDate : string; + FValidOperations : ResponseGroupInformation_ValidOperations_Type; + FElements : ResponseGroupInformation_Elements_Type; + private + function HasName() : Boolean; + function HasCreationDate() : Boolean; + function HasValidOperations() : Boolean; + function HasElements() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property Name : string read FName write FName stored HasName; + property CreationDate : string read FCreationDate write FCreationDate stored HasCreationDate; + property ValidOperations : ResponseGroupInformation_ValidOperations_Type read FValidOperations write FValidOperations stored HasValidOperations; + property Elements : ResponseGroupInformation_Elements_Type read FElements write FElements stored HasElements; + end; + + CorrectedQuery_Type = class(TBaseComplexRemotable) + private + FKeywords : string; + FMessage : string; + private + function HasKeywords() : Boolean; + function HasMessage() : Boolean; + published + property Keywords : string read FKeywords write FKeywords stored HasKeywords; + property Message : string read FMessage write FMessage stored HasMessage; + end; + + Item_Type = class(TBaseComplexRemotable) + private + FASIN : string; + FParentASIN : string; + FErrors : Errors_Type; + FDetailPageURL : string; + FSalesRank : string; + FSmallImage : Image; + FMediumImage : Image; + FLargeImage : Image; + FImageSets : _Item_ImageSetsArray; + FItemAttributes : ItemAttributes_Type; + FMerchantItemAttributes : MerchantItemAttributes_Type; + FCollections : Collections_Type; + FSubjects : Item_Subjects_Type; + FOfferSummary : OfferSummary_Type; + FOffers : Offers_Type; + FVariationSummary : VariationSummary_Type; + FVariations : Variations_Type; + FCustomerReviews : CustomerReviews_Type; + FEditorialReviews : EditorialReviews_Type; + FSimilarProducts : SimilarProducts_Type; + FAccessories : Accessories_Type; + FTracks : Tracks_Type; + FBrowseNodes : BrowseNodes_Type; + FListmaniaLists : ListmaniaLists_Type; + FSearchInside : SearchInside_Type; + FAlternateVersions : Item_AlternateVersions_Type; + private + function HasParentASIN() : Boolean; + function HasErrors() : Boolean; + function HasDetailPageURL() : Boolean; + function HasSalesRank() : Boolean; + function HasSmallImage() : Boolean; + function HasMediumImage() : Boolean; + function HasLargeImage() : Boolean; + function HasItemAttributes() : Boolean; + function HasMerchantItemAttributes() : Boolean; + function HasCollections() : Boolean; + function HasSubjects() : Boolean; + function HasOfferSummary() : Boolean; + function HasOffers() : Boolean; + function HasVariationSummary() : Boolean; + function HasVariations() : Boolean; + function HasCustomerReviews() : Boolean; + function HasEditorialReviews() : Boolean; + function HasSimilarProducts() : Boolean; + function HasAccessories() : Boolean; + function HasTracks() : Boolean; + function HasBrowseNodes() : Boolean; + function HasListmaniaLists() : Boolean; + function HasSearchInside() : Boolean; + function HasAlternateVersions() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property ASIN : string read FASIN write FASIN; + property ParentASIN : string read FParentASIN write FParentASIN stored HasParentASIN; + property Errors : Errors_Type read FErrors write FErrors stored HasErrors; + property DetailPageURL : string read FDetailPageURL write FDetailPageURL stored HasDetailPageURL; + property SalesRank : string read FSalesRank write FSalesRank stored HasSalesRank; + property SmallImage : Image read FSmallImage write FSmallImage stored HasSmallImage; + property MediumImage : Image read FMediumImage write FMediumImage stored HasMediumImage; + property LargeImage : Image read FLargeImage write FLargeImage stored HasLargeImage; + property ImageSets : _Item_ImageSetsArray read FImageSets write FImageSets; + property ItemAttributes : ItemAttributes_Type read FItemAttributes write FItemAttributes stored HasItemAttributes; + property MerchantItemAttributes : MerchantItemAttributes_Type read FMerchantItemAttributes write FMerchantItemAttributes stored HasMerchantItemAttributes; + property Collections : Collections_Type read FCollections write FCollections stored HasCollections; + property Subjects : Item_Subjects_Type read FSubjects write FSubjects stored HasSubjects; + property OfferSummary : OfferSummary_Type read FOfferSummary write FOfferSummary stored HasOfferSummary; + property Offers : Offers_Type read FOffers write FOffers stored HasOffers; + property VariationSummary : VariationSummary_Type read FVariationSummary write FVariationSummary stored HasVariationSummary; + property Variations : Variations_Type read FVariations write FVariations stored HasVariations; + property CustomerReviews : CustomerReviews_Type read FCustomerReviews write FCustomerReviews stored HasCustomerReviews; + property EditorialReviews : EditorialReviews_Type read FEditorialReviews write FEditorialReviews stored HasEditorialReviews; + property SimilarProducts : SimilarProducts_Type read FSimilarProducts write FSimilarProducts stored HasSimilarProducts; + property Accessories : Accessories_Type read FAccessories write FAccessories stored HasAccessories; + property Tracks : Tracks_Type read FTracks write FTracks stored HasTracks; + property BrowseNodes : BrowseNodes_Type read FBrowseNodes write FBrowseNodes stored HasBrowseNodes; + property ListmaniaLists : ListmaniaLists_Type read FListmaniaLists write FListmaniaLists stored HasListmaniaLists; + property SearchInside : SearchInside_Type read FSearchInside write FSearchInside stored HasSearchInside; + property AlternateVersions : Item_AlternateVersions_Type read FAlternateVersions write FAlternateVersions stored HasAlternateVersions; + end; + + List_Type = class(TBaseComplexRemotable) + private + FListId : string; + FListURL : string; + FRegistryNumber : string; + FListName : string; + FListType : List_ListType_Type; + FTotalItems : nonNegativeInteger; + FTotalPages : nonNegativeInteger; + FDateCreated : string; + FOccasionDate : string; + FCustomerName : string; + FPartnerName : string; + FAdditionalName : string; + FComment : string; + FImage : Image; + FAverageRating : Extended; + FTotalVotes : nonNegativeInteger; + FTotalTimesRead : nonNegativeInteger; + FListItem : List_ListItemArray; + private + function HasListURL() : Boolean; + function HasRegistryNumber() : Boolean; + function HasListName() : Boolean; + function HasListType() : Boolean; + function HasTotalItems() : Boolean; + function HasTotalPages() : Boolean; + function HasDateCreated() : Boolean; + function HasOccasionDate() : Boolean; + function HasCustomerName() : Boolean; + function HasPartnerName() : Boolean; + function HasAdditionalName() : Boolean; + function HasComment() : Boolean; + function HasImage() : Boolean; + function HasAverageRating() : Boolean; + function HasTotalVotes() : Boolean; + function HasTotalTimesRead() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property ListId : string read FListId write FListId; + property ListURL : string read FListURL write FListURL stored HasListURL; + property RegistryNumber : string read FRegistryNumber write FRegistryNumber stored HasRegistryNumber; + property ListName : string read FListName write FListName stored HasListName; + property ListType : List_ListType_Type read FListType write FListType stored HasListType; + property TotalItems : nonNegativeInteger read FTotalItems write FTotalItems stored HasTotalItems; + property TotalPages : nonNegativeInteger read FTotalPages write FTotalPages stored HasTotalPages; + property DateCreated : string read FDateCreated write FDateCreated stored HasDateCreated; + property OccasionDate : string read FOccasionDate write FOccasionDate stored HasOccasionDate; + property CustomerName : string read FCustomerName write FCustomerName stored HasCustomerName; + property PartnerName : string read FPartnerName write FPartnerName stored HasPartnerName; + property AdditionalName : string read FAdditionalName write FAdditionalName stored HasAdditionalName; + property Comment : string read FComment write FComment stored HasComment; + property Image : Image read FImage write FImage stored HasImage; + property AverageRating : Extended read FAverageRating write FAverageRating stored HasAverageRating; + property TotalVotes : nonNegativeInteger read FTotalVotes write FTotalVotes stored HasTotalVotes; + property TotalTimesRead : nonNegativeInteger read FTotalTimesRead write FTotalTimesRead stored HasTotalTimesRead; + property ListItem : List_ListItemArray read FListItem write FListItem; + end; + + Customer_Type = class(TBaseComplexRemotable) + private + FCustomerId : string; + FNickname : string; + FBirthday : string; + FWishListId : string; + FLocation : Customer_Location_Type; + FCustomerReviews : Customer_CustomerReviewsArray; + private + function HasNickname() : Boolean; + function HasBirthday() : Boolean; + function HasWishListId() : Boolean; + function HasLocation() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property CustomerId : string read FCustomerId write FCustomerId; + property Nickname : string read FNickname write FNickname stored HasNickname; + property Birthday : string read FBirthday write FBirthday stored HasBirthday; + property WishListId : string read FWishListId write FWishListId stored HasWishListId; + property Location : Customer_Location_Type read FLocation write FLocation stored HasLocation; + property CustomerReviews : Customer_CustomerReviewsArray read FCustomerReviews write FCustomerReviews; + end; + + Price = class(TBaseComplexRemotable) + private + FAmount : integer; + FCurrencyCode : string; + FFormattedPrice : string; + private + function HasAmount() : Boolean; + function HasCurrencyCode() : Boolean; + published + property Amount : integer read FAmount write FAmount stored HasAmount; + property CurrencyCode : string read FCurrencyCode write FCurrencyCode stored HasCurrencyCode; + property FormattedPrice : string read FFormattedPrice write FFormattedPrice; + end; + + CartItems_Type = class(TBaseComplexRemotable) + private + FSubTotal : Price; + FCartItem : CartItems_CartItemArray; + private + function HasSubTotal() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property SubTotal : Price read FSubTotal write FSubTotal stored HasSubTotal; + property CartItem : CartItems_CartItemArray read FCartItem write FCartItem; + end; + + SavedForLaterItems_Type = class(TBaseComplexRemotable) + private + FSubTotal : Price; + FSavedForLaterItem : SavedForLaterItems_SavedForLaterItemArray; + private + function HasSubTotal() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property SubTotal : Price read FSubTotal write FSubTotal stored HasSubTotal; + property SavedForLaterItem : SavedForLaterItems_SavedForLaterItemArray read FSavedForLaterItem write FSavedForLaterItem; + end; + + Transaction_Type = class(TBaseComplexRemotable) + private + FTransactionId : string; + FSellerId : string; + FCondition : string; + FTransactionDate : string; + FTransactionDateEpoch : string; + FSellerName : string; + FPayingCustomerId : string; + FOrderingCustomerId : string; + FTotals : Transaction_Totals_Type; + FTransactionItems : Transaction_TransactionItems_Type; + FShipments : Transaction_Shipments_Type; + private + function HasSellerName() : Boolean; + function HasPayingCustomerId() : Boolean; + function HasOrderingCustomerId() : Boolean; + function HasTotals() : Boolean; + function HasTransactionItems() : Boolean; + function HasShipments() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property TransactionId : string read FTransactionId write FTransactionId; + property SellerId : string read FSellerId write FSellerId; + property Condition : string read FCondition write FCondition; + property TransactionDate : string read FTransactionDate write FTransactionDate; + property TransactionDateEpoch : string read FTransactionDateEpoch write FTransactionDateEpoch; + property SellerName : string read FSellerName write FSellerName stored HasSellerName; + property PayingCustomerId : string read FPayingCustomerId write FPayingCustomerId stored HasPayingCustomerId; + property OrderingCustomerId : string read FOrderingCustomerId write FOrderingCustomerId stored HasOrderingCustomerId; + property Totals : Transaction_Totals_Type read FTotals write FTotals stored HasTotals; + property TransactionItems : Transaction_TransactionItems_Type read FTransactionItems write FTransactionItems stored HasTransactionItems; + property Shipments : Transaction_Shipments_Type read FShipments write FShipments stored HasShipments; + end; + + Seller_Type = class(TBaseComplexRemotable) + private + FSellerId : string; + FSellerName : string; + FSellerLegalName : string; + FNickname : string; + FGlancePage : string; + FAbout : string; + FMoreAbout : string; + FLocation : Seller_Location_Type; + FAverageFeedbackRating : Extended; + FTotalFeedback : nonNegativeInteger; + FTotalFeedbackPages : nonNegativeInteger; + FSellerFeedbackSummary : Seller_SellerFeedbackSummary_Type; + FSellerFeedback : SellerFeedback_Type; + private + function HasSellerName() : Boolean; + function HasSellerLegalName() : Boolean; + function HasNickname() : Boolean; + function HasGlancePage() : Boolean; + function HasAbout() : Boolean; + function HasMoreAbout() : Boolean; + function HasLocation() : Boolean; + function HasAverageFeedbackRating() : Boolean; + function HasTotalFeedback() : Boolean; + function HasTotalFeedbackPages() : Boolean; + function HasSellerFeedbackSummary() : Boolean; + function HasSellerFeedback() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property SellerId : string read FSellerId write FSellerId; + property SellerName : string read FSellerName write FSellerName stored HasSellerName; + property SellerLegalName : string read FSellerLegalName write FSellerLegalName stored HasSellerLegalName; + property Nickname : string read FNickname write FNickname stored HasNickname; + property GlancePage : string read FGlancePage write FGlancePage stored HasGlancePage; + property About : string read FAbout write FAbout stored HasAbout; + property MoreAbout : string read FMoreAbout write FMoreAbout stored HasMoreAbout; + property Location : Seller_Location_Type read FLocation write FLocation stored HasLocation; + property AverageFeedbackRating : Extended read FAverageFeedbackRating write FAverageFeedbackRating stored HasAverageFeedbackRating; + property TotalFeedback : nonNegativeInteger read FTotalFeedback write FTotalFeedback stored HasTotalFeedback; + property TotalFeedbackPages : nonNegativeInteger read FTotalFeedbackPages write FTotalFeedbackPages stored HasTotalFeedbackPages; + property SellerFeedbackSummary : Seller_SellerFeedbackSummary_Type read FSellerFeedbackSummary write FSellerFeedbackSummary stored HasSellerFeedbackSummary; + property SellerFeedback : SellerFeedback_Type read FSellerFeedback write FSellerFeedback stored HasSellerFeedback; + end; + + SellerListing_Type = class(TBaseComplexRemotable) + private + FExchangeId : string; + FListingId : string; + FASIN : string; + FSKU : string; + FUPC : string; + FEAN : string; + FWillShipExpedited : boolean; + FWillShipInternational : boolean; + FTitle : string; + FPrice : Price; + FStartDate : string; + FEndDate : string; + FStatus : string; + FQuantity : string; + FCondition : string; + FSubCondition : string; + FSeller : Seller_Type; + private + function HasExchangeId() : Boolean; + function HasListingId() : Boolean; + function HasASIN() : Boolean; + function HasSKU() : Boolean; + function HasUPC() : Boolean; + function HasEAN() : Boolean; + function HasWillShipExpedited() : Boolean; + function HasWillShipInternational() : Boolean; + function HasTitle() : Boolean; + function HasPrice() : Boolean; + function HasStartDate() : Boolean; + function HasEndDate() : Boolean; + function HasStatus() : Boolean; + function HasQuantity() : Boolean; + function HasCondition() : Boolean; + function HasSubCondition() : Boolean; + function HasSeller() : Boolean; + public + destructor Destroy();override; + published + property ExchangeId : string read FExchangeId write FExchangeId stored HasExchangeId; + property ListingId : string read FListingId write FListingId stored HasListingId; + property ASIN : string read FASIN write FASIN stored HasASIN; + property SKU : string read FSKU write FSKU stored HasSKU; + property UPC : string read FUPC write FUPC stored HasUPC; + property EAN : string read FEAN write FEAN stored HasEAN; + property WillShipExpedited : boolean read FWillShipExpedited write FWillShipExpedited stored HasWillShipExpedited; + property WillShipInternational : boolean read FWillShipInternational write FWillShipInternational stored HasWillShipInternational; + property Title : string read FTitle write FTitle stored HasTitle; + property Price : Price read FPrice write FPrice stored HasPrice; + property StartDate : string read FStartDate write FStartDate stored HasStartDate; + property EndDate : string read FEndDate write FEndDate stored HasEndDate; + property Status : string read FStatus write FStatus stored HasStatus; + property Quantity : string read FQuantity write FQuantity stored HasQuantity; + property Condition : string read FCondition write FCondition stored HasCondition; + property SubCondition : string read FSubCondition write FSubCondition stored HasSubCondition; + property Seller : Seller_Type read FSeller write FSeller stored HasSeller; + end; + + Image = class(TBaseComplexRemotable) + private + FURL : string; + FHeight : DecimalWithUnits; + FWidth : DecimalWithUnits; + FIsVerified : string; + private + function HasIsVerified() : Boolean; + public + destructor Destroy();override; + published + property URL : string read FURL write FURL; + property Height : DecimalWithUnits read FHeight write FHeight; + property Width : DecimalWithUnits read FWidth write FWidth; + property IsVerified : string read FIsVerified write FIsVerified stored HasIsVerified; + end; + + ListItem_Type = class(TBaseComplexRemotable) + private + FListItemId : string; + FDateAdded : string; + FComment : string; + FQuantityDesired : string; + FQuantityReceived : string; + F_Item : Item_Type; + private + function HasListItemId() : Boolean; + function HasDateAdded() : Boolean; + function HasComment() : Boolean; + function HasQuantityDesired() : Boolean; + function HasQuantityReceived() : Boolean; + function Has_Item() : Boolean; + public + destructor Destroy();override; + published + property ListItemId : string read FListItemId write FListItemId stored HasListItemId; + property DateAdded : string read FDateAdded write FDateAdded stored HasDateAdded; + property Comment : string read FComment write FComment stored HasComment; + property QuantityDesired : string read FQuantityDesired write FQuantityDesired stored HasQuantityDesired; + property QuantityReceived : string read FQuantityReceived write FQuantityReceived stored HasQuantityReceived; + property _Item : Item_Type read F_Item write F_Item stored Has_Item; + end; + + Customer_Location_Type = class(TBaseComplexRemotable) + private + FUserDefinedLocation : string; + FCity : string; + FState : string; + FCountry : string; + private + function HasUserDefinedLocation() : Boolean; + function HasCity() : Boolean; + function HasState() : Boolean; + function HasCountry() : Boolean; + published + property UserDefinedLocation : string read FUserDefinedLocation write FUserDefinedLocation stored HasUserDefinedLocation; + property City : string read FCity write FCity stored HasCity; + property State : string read FState write FState stored HasState; + property Country : string read FCountry write FCountry stored HasCountry; + end; + + CustomerReviews_Type = class(TBaseComplexRemotable) + private + FAverageRating : Extended; + FTotalReviews : nonNegativeInteger; + FTotalReviewPages : nonNegativeInteger; + FReview : CustomerReviews_ReviewArray; + private + function HasAverageRating() : Boolean; + function HasTotalReviews() : Boolean; + function HasTotalReviewPages() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property AverageRating : Extended read FAverageRating write FAverageRating stored HasAverageRating; + property TotalReviews : nonNegativeInteger read FTotalReviews write FTotalReviews stored HasTotalReviews; + property TotalReviewPages : nonNegativeInteger read FTotalReviewPages write FTotalReviewPages stored HasTotalReviewPages; + property Review : CustomerReviews_ReviewArray read FReview write FReview; + end; + + SearchResultsMap_SearchIndex_Type = class(TBaseComplexRemotable) + private + FIndexName : string; + FResults : nonNegativeInteger; + FPages : nonNegativeInteger; + FCorrectedQuery : CorrectedQuery_Type; + FRelevanceRank : positiveInteger; + FASIN : SearchResultsMap_SearchIndex_Type_ASINArray; + private + function HasResults() : Boolean; + function HasPages() : Boolean; + function HasCorrectedQuery() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property IndexName : string read FIndexName write FIndexName; + property Results : nonNegativeInteger read FResults write FResults stored HasResults; + property Pages : nonNegativeInteger read FPages write FPages stored HasPages; + property CorrectedQuery : CorrectedQuery_Type read FCorrectedQuery write FCorrectedQuery stored HasCorrectedQuery; + property RelevanceRank : positiveInteger read FRelevanceRank write FRelevanceRank; + property ASIN : SearchResultsMap_SearchIndex_Type_ASINArray read FASIN write FASIN; + end; + + ImageSet_Type = class(TBaseComplexRemotable) + private + FSwatchImage : Image; + FSmallImage : Image; + FMediumImage : Image; + FLargeImage : Image; + FCategory : string; + private + function HasSwatchImage() : Boolean; + function HasSmallImage() : Boolean; + function HasMediumImage() : Boolean; + function HasLargeImage() : Boolean; + public + destructor Destroy();override; + published + property SwatchImage : Image read FSwatchImage write FSwatchImage stored HasSwatchImage; + property SmallImage : Image read FSmallImage write FSmallImage stored HasSmallImage; + property MediumImage : Image read FMediumImage write FMediumImage stored HasMediumImage; + property LargeImage : Image read FLargeImage write FLargeImage stored HasLargeImage; + property Category : string read FCategory write FCategory; + end; + + Item_ImageSets_Type = class(TBaseComplexRemotable) + private + FMerchantId : string; + FImageSet : Item_ImageSets_Type_ImageSetArray; + private + function HasMerchantId() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property MerchantId : string read FMerchantId write FMerchantId stored HasMerchantId; + property ImageSet : Item_ImageSets_Type_ImageSetArray read FImageSet write FImageSet; + end; + + ItemAttributes_Type = class(TBaseComplexRemotable) + private + FActor : ItemAttributes_ActorArray; + FAddress : Address; + FAmazonMaximumAge : DecimalWithUnits; + FAmazonMinimumAge : DecimalWithUnits; + FAnalogVideoFormat : string; + FApertureModes : string; + FArtist : ItemAttributes_ArtistArray; + FAspectRatio : string; + FAssemblyInstructions : string; + FAssemblyRequired : string; + FAudienceRating : string; + FAudioFormat : ItemAttributes_AudioFormatArray; + FAuthor : ItemAttributes_AuthorArray; + FBackFinding : string; + FBandMaterialType : string; + FBatteriesIncluded : string; + FBatteriesRequired : string; + FBatteries : NonNegativeIntegerWithUnits; + FBatteryDescription : string; + FBatteryType : string; + FBezelMaterialType : string; + FBinding : string; + FBrand : string; + FCalendarType : string; + FCameraManualFeatures : ItemAttributes_CameraManualFeaturesArray; + FCaseDiameter : DecimalWithUnits; + FCaseMaterialType : string; + FCaseThickness : DecimalWithUnits; + FCaseType : string; + FCatalogNumber : string; + FCDRWDescription : string; + FChainType : string; + FCEROAgeRating : string; + FClaspType : string; + FClothingSize : string; + FClubType : string; + FColor : string; + FCompatibility : string; + FCompatibleDevices : ItemAttributes_CompatibleDevicesArray; + FComputerHardwareType : string; + FComputerPlatform : string; + FConnectivity : string; + FContinuousShootingSpeed : DecimalWithUnits; + FCountry : string; + FCPUManufacturer : string; + FCPUSpeed : DecimalWithUnits; + FCPUType : string; + FCreator : ItemAttributes_CreatorArray; + FCuisine : string; + FDataLinkProtocol : ItemAttributes_DataLinkProtocolArray; + FDeliveryOption : string; + FDelayBetweenShots : DecimalWithUnits; + FDepartment : string; + FDeweyDecimalNumber : string; + FDialColor : string; + FDialWindowMaterialType : string; + FDigitalZoom : DecimalWithUnits; + FDirector : ItemAttributes_DirectorArray; + FDisplayColorSupport : string; + FDisplaySize : DecimalWithUnits; + FDrumSetPieceQuantity : nonNegativeInteger; + FDVDLayers : nonNegativeInteger; + FDVDRWDescription : string; + FDVDSides : nonNegativeInteger; + FDPCI : string; + FEAN : string; + FEdition : string; + FESRBAgeRating : string; + FExternalDisplaySupportDescription : string; + FFabricType : string; + FFaxNumber : string; + FFeature : ItemAttributes_FeatureArray; + FFilmColorType : string; + FFirstIssueLeadTime : StringWithUnits; + FFloppyDiskDriveDescription : string; + FFormat : ItemAttributes_FormatArray; + FFormFactor : ItemAttributes_FormFactorArray; + FGemType : string; + FGenre : string; + FGraphicsCardInterface : string; + FGraphicsDescription : string; + FGraphicsMemorySize : DecimalWithUnits; + FGuitarAttribute : string; + FGuitarBridgeSystem : string; + FGuitarPickThickness : string; + FGuitarPickupConfiguration : string; + FHandOrientation : string; + FHardDiskCount : nonNegativeInteger; + FHardDiskSize : DecimalWithUnits; + FHardDiskInterface : string; + FHardwarePlatform : string; + FHasAutoFocus : boolean; + FHasBurstMode : boolean; + FHasInCameraEditing : boolean; + FHasRedEyeReduction : boolean; + FHasSelfTimer : boolean; + FHasTripodMount : boolean; + FHasVideoOut : boolean; + FHasViewfinder : boolean; + FHazardousMaterialType : string; + FHoursOfOperation : string; + FIncludedSoftware : string; + FIncludesMp3Player : boolean; + FIngredients : string; + FInstrumentKey : string; + FIsAdultProduct : boolean; + FIsAutographed : boolean; + FISBN : string; + FIsFragile : boolean; + FIsLabCreated : boolean; + FIsMemorabilia : boolean; + FISOEquivalent : NonNegativeIntegerWithUnits; + FIsPreannounce : boolean; + FIssuesPerYear : string; + FItemDimensions : ItemAttributes_ItemDimensions_Type; + FKeyboardDescription : string; + F_Label : string; + FLanguages : ItemAttributes_Languages_Type; + FLegalDisclaimer : string; + FLensType : string; + FLineVoltage : string; + FListPrice : Price; + FMacroFocusRange : string; + FMagazineType : string; + FMalletHardness : string; + FManufacturer : string; + FManufacturerLaborWarrantyDescription : string; + FManufacturerMaximumAge : DecimalWithUnits; + FManufacturerMinimumAge : DecimalWithUnits; + FManufacturerPartsWarrantyDescription : string; + FMaterialType : string; + FMaximumAperture : DecimalWithUnits; + FMaximumColorDepth : string; + FMaximumFocalLength : DecimalWithUnits; + FMaximumHighResolutionImages : NonNegativeIntegerWithUnits; + FMaximumHorizontalResolution : NonNegativeIntegerWithUnits; + FMaximumLowResolutionImages : string; + FMaximumResolution : DecimalWithUnits; + FMaximumShutterSpeed : DecimalWithUnits; + FMaximumVerticalResolution : NonNegativeIntegerWithUnits; + FMaximumWeightRecommendation : DecimalWithUnits; + FMediaType : string; + FMemorySlotsAvailable : string; + FMetalStamp : string; + FMetalType : string; + FMiniMovieDescription : string; + FMinimumFocalLength : DecimalWithUnits; + FMinimumShutterSpeed : DecimalWithUnits; + FModel : string; + FModelYear : nonNegativeInteger; + FModemDescription : string; + FMonitorSize : DecimalWithUnits; + FMonitorViewableDiagonalSize : DecimalWithUnits; + FMouseDescription : string; + FMPN : string; + FMusicalStyle : string; + FNativeResolution : string; + FNeighborhood : string; + FNetworkInterfaceDescription : string; + FNotebookDisplayTechnology : string; + FNotebookPointingDeviceDescription : string; + FNumberOfDiscs : nonNegativeInteger; + FNumberOfIssues : nonNegativeInteger; + FNumberOfItems : nonNegativeInteger; + FNumberOfKeys : nonNegativeInteger; + FNumberOfPages : nonNegativeInteger; + FNumberOfPearls : nonNegativeInteger; + FNumberOfRapidFireShots : nonNegativeInteger; + FNumberOfStones : nonNegativeInteger; + FNumberOfStrings : nonNegativeInteger; + FNumberOfTracks : nonNegativeInteger; + FOperatingSystem : string; + FOpticalSensorResolution : DecimalWithUnits; + FOpticalZoom : DecimalWithUnits; + FOriginalReleaseDate : string; + FOutputWattage : nonNegativeInteger; + FPackageDimensions : ItemAttributes_PackageDimensions_Type; + FPackageQuantity : nonNegativeInteger; + FPearlLustre : string; + FPearlMinimumColor : string; + FPearlShape : string; + FPearlStringingMethod : string; + FPearlSurfaceBlemishes : string; + FPearlType : string; + FPearlUniformity : string; + FPhoneNumber : string; + FPhotoFlashType : ItemAttributes_PhotoFlashTypeArray; + FPictureFormat : ItemAttributes_PictureFormatArray; + FPlatform : ItemAttributes_PlatformArray; + FPriceRating : nonNegativeInteger; + FProcessorCount : nonNegativeInteger; + FProductGroup : string; + FProductSiteLaunchDate : string; + FProductTypeName : string; + FProductTypeSubcategory : string; + FPromotionalTag : string; + FPublicationDate : string; + FPublisher : string; + FPOBoxShippingExcluded : string; + FReadingLevel : string; + FReturnMethod : ItemAttributes_ReturnMethodArray; + FRecorderTrackCount : nonNegativeInteger; + FRegionCode : string; + FRegionOfOrigin : string; + FReturnPolicy : string; + FReleaseDate : string; + FRemovableMemory : string; + FRemovableStorage : string; + FRequiredVoltageRange : string; + FResolutionModes : string; + FRingSize : string; + FRunningTime : DecimalWithUnits; + FScentName : string; + FSecondaryCacheSize : NonNegativeIntegerWithUnits; + FSettingType : string; + FShaftMaterialType : string; + FSize : string; + FSizePerPearl : string; + FSkillLevel : string; + FSKU : string; + FSoldInStores : string; + FSoundCardDescription : string; + FSpeakerCount : nonNegativeInteger; + FSpeakerDescription : string; + FSpecialFeatures : ItemAttributes_SpecialFeaturesArray; + FStoneClarity : string; + FStoneColor : string; + FStoneCut : string; + FStoneShape : string; + FStoneWeight : DecimalWithUnits; + FStudio : string; + FStyle : string; + FSubscriptionLength : NonNegativeIntegerWithUnits; + FSupportedImageType : ItemAttributes_SupportedImageTypeArray; + FSupportedMediaSize : string; + FSystemBusSpeed : DecimalWithUnits; + FSystemMemorySizeMax : DecimalWithUnits; + FSystemMemorySize : DecimalWithUnits; + FSystemMemoryType : string; + FTellingPageIndicator : string; + FTheatricalReleaseDate : string; + FTitle : string; + FTotalDiamondWeight : DecimalWithUnits; + FTotalExternalBaysFree : nonNegativeInteger; + FTotalFirewirePorts : nonNegativeInteger; + FTotalGemWeight : DecimalWithUnits; + FTotalInternalBaysFree : nonNegativeInteger; + FTotalMetalWeight : DecimalWithUnits; + FTotalNTSCPALPorts : nonNegativeInteger; + FTotalParallelPorts : nonNegativeInteger; + FTotalPCCardSlots : nonNegativeInteger; + FTotalPCISlotsFree : nonNegativeInteger; + FTotalSerialPorts : nonNegativeInteger; + FTotalSVideoOutPorts : nonNegativeInteger; + FTotalUSB2Ports : nonNegativeInteger; + FTotalUSBPorts : nonNegativeInteger; + FTotalVGAOutPorts : nonNegativeInteger; + FUPC : string; + FVariationDenomination : string; + FVariationDescription : string; + FWarranty : string; + FWatchMovementType : string; + FWaterResistanceDepth : DecimalWithUnits; + FWEEETaxValue : Price; + FWirelessMicrophoneFrequency : nonNegativeInteger; + private + function HasAddress() : Boolean; + function HasAmazonMaximumAge() : Boolean; + function HasAmazonMinimumAge() : Boolean; + function HasAnalogVideoFormat() : Boolean; + function HasApertureModes() : Boolean; + function HasAspectRatio() : Boolean; + function HasAssemblyInstructions() : Boolean; + function HasAssemblyRequired() : Boolean; + function HasAudienceRating() : Boolean; + function HasBackFinding() : Boolean; + function HasBandMaterialType() : Boolean; + function HasBatteriesIncluded() : Boolean; + function HasBatteriesRequired() : Boolean; + function HasBatteries() : Boolean; + function HasBatteryDescription() : Boolean; + function HasBatteryType() : Boolean; + function HasBezelMaterialType() : Boolean; + function HasBinding() : Boolean; + function HasBrand() : Boolean; + function HasCalendarType() : Boolean; + function HasCaseDiameter() : Boolean; + function HasCaseMaterialType() : Boolean; + function HasCaseThickness() : Boolean; + function HasCaseType() : Boolean; + function HasCatalogNumber() : Boolean; + function HasCDRWDescription() : Boolean; + function HasChainType() : Boolean; + function HasCEROAgeRating() : Boolean; + function HasClaspType() : Boolean; + function HasClothingSize() : Boolean; + function HasClubType() : Boolean; + function HasColor() : Boolean; + function HasCompatibility() : Boolean; + function HasComputerHardwareType() : Boolean; + function HasComputerPlatform() : Boolean; + function HasConnectivity() : Boolean; + function HasContinuousShootingSpeed() : Boolean; + function HasCountry() : Boolean; + function HasCPUManufacturer() : Boolean; + function HasCPUSpeed() : Boolean; + function HasCPUType() : Boolean; + function HasCuisine() : Boolean; + function HasDeliveryOption() : Boolean; + function HasDelayBetweenShots() : Boolean; + function HasDepartment() : Boolean; + function HasDeweyDecimalNumber() : Boolean; + function HasDialColor() : Boolean; + function HasDialWindowMaterialType() : Boolean; + function HasDigitalZoom() : Boolean; + function HasDisplayColorSupport() : Boolean; + function HasDisplaySize() : Boolean; + function HasDrumSetPieceQuantity() : Boolean; + function HasDVDLayers() : Boolean; + function HasDVDRWDescription() : Boolean; + function HasDVDSides() : Boolean; + function HasDPCI() : Boolean; + function HasEAN() : Boolean; + function HasEdition() : Boolean; + function HasESRBAgeRating() : Boolean; + function HasExternalDisplaySupportDescription() : Boolean; + function HasFabricType() : Boolean; + function HasFaxNumber() : Boolean; + function HasFilmColorType() : Boolean; + function HasFirstIssueLeadTime() : Boolean; + function HasFloppyDiskDriveDescription() : Boolean; + function HasGemType() : Boolean; + function HasGenre() : Boolean; + function HasGraphicsCardInterface() : Boolean; + function HasGraphicsDescription() : Boolean; + function HasGraphicsMemorySize() : Boolean; + function HasGuitarAttribute() : Boolean; + function HasGuitarBridgeSystem() : Boolean; + function HasGuitarPickThickness() : Boolean; + function HasGuitarPickupConfiguration() : Boolean; + function HasHandOrientation() : Boolean; + function HasHardDiskCount() : Boolean; + function HasHardDiskSize() : Boolean; + function HasHardDiskInterface() : Boolean; + function HasHardwarePlatform() : Boolean; + function HasHasAutoFocus() : Boolean; + function HasHasBurstMode() : Boolean; + function HasHasInCameraEditing() : Boolean; + function HasHasRedEyeReduction() : Boolean; + function HasHasSelfTimer() : Boolean; + function HasHasTripodMount() : Boolean; + function HasHasVideoOut() : Boolean; + function HasHasViewfinder() : Boolean; + function HasHazardousMaterialType() : Boolean; + function HasHoursOfOperation() : Boolean; + function HasIncludedSoftware() : Boolean; + function HasIncludesMp3Player() : Boolean; + function HasIngredients() : Boolean; + function HasInstrumentKey() : Boolean; + function HasIsAdultProduct() : Boolean; + function HasIsAutographed() : Boolean; + function HasISBN() : Boolean; + function HasIsFragile() : Boolean; + function HasIsLabCreated() : Boolean; + function HasIsMemorabilia() : Boolean; + function HasISOEquivalent() : Boolean; + function HasIsPreannounce() : Boolean; + function HasIssuesPerYear() : Boolean; + function HasItemDimensions() : Boolean; + function HasKeyboardDescription() : Boolean; + function Has_Label() : Boolean; + function HasLanguages() : Boolean; + function HasLegalDisclaimer() : Boolean; + function HasLensType() : Boolean; + function HasLineVoltage() : Boolean; + function HasListPrice() : Boolean; + function HasMacroFocusRange() : Boolean; + function HasMagazineType() : Boolean; + function HasMalletHardness() : Boolean; + function HasManufacturer() : Boolean; + function HasManufacturerLaborWarrantyDescription() : Boolean; + function HasManufacturerMaximumAge() : Boolean; + function HasManufacturerMinimumAge() : Boolean; + function HasManufacturerPartsWarrantyDescription() : Boolean; + function HasMaterialType() : Boolean; + function HasMaximumAperture() : Boolean; + function HasMaximumColorDepth() : Boolean; + function HasMaximumFocalLength() : Boolean; + function HasMaximumHighResolutionImages() : Boolean; + function HasMaximumHorizontalResolution() : Boolean; + function HasMaximumLowResolutionImages() : Boolean; + function HasMaximumResolution() : Boolean; + function HasMaximumShutterSpeed() : Boolean; + function HasMaximumVerticalResolution() : Boolean; + function HasMaximumWeightRecommendation() : Boolean; + function HasMediaType() : Boolean; + function HasMemorySlotsAvailable() : Boolean; + function HasMetalStamp() : Boolean; + function HasMetalType() : Boolean; + function HasMiniMovieDescription() : Boolean; + function HasMinimumFocalLength() : Boolean; + function HasMinimumShutterSpeed() : Boolean; + function HasModel() : Boolean; + function HasModelYear() : Boolean; + function HasModemDescription() : Boolean; + function HasMonitorSize() : Boolean; + function HasMonitorViewableDiagonalSize() : Boolean; + function HasMouseDescription() : Boolean; + function HasMPN() : Boolean; + function HasMusicalStyle() : Boolean; + function HasNativeResolution() : Boolean; + function HasNeighborhood() : Boolean; + function HasNetworkInterfaceDescription() : Boolean; + function HasNotebookDisplayTechnology() : Boolean; + function HasNotebookPointingDeviceDescription() : Boolean; + function HasNumberOfDiscs() : Boolean; + function HasNumberOfIssues() : Boolean; + function HasNumberOfItems() : Boolean; + function HasNumberOfKeys() : Boolean; + function HasNumberOfPages() : Boolean; + function HasNumberOfPearls() : Boolean; + function HasNumberOfRapidFireShots() : Boolean; + function HasNumberOfStones() : Boolean; + function HasNumberOfStrings() : Boolean; + function HasNumberOfTracks() : Boolean; + function HasOperatingSystem() : Boolean; + function HasOpticalSensorResolution() : Boolean; + function HasOpticalZoom() : Boolean; + function HasOriginalReleaseDate() : Boolean; + function HasOutputWattage() : Boolean; + function HasPackageDimensions() : Boolean; + function HasPackageQuantity() : Boolean; + function HasPearlLustre() : Boolean; + function HasPearlMinimumColor() : Boolean; + function HasPearlShape() : Boolean; + function HasPearlStringingMethod() : Boolean; + function HasPearlSurfaceBlemishes() : Boolean; + function HasPearlType() : Boolean; + function HasPearlUniformity() : Boolean; + function HasPhoneNumber() : Boolean; + function HasPriceRating() : Boolean; + function HasProcessorCount() : Boolean; + function HasProductGroup() : Boolean; + function HasProductSiteLaunchDate() : Boolean; + function HasProductTypeName() : Boolean; + function HasProductTypeSubcategory() : Boolean; + function HasPromotionalTag() : Boolean; + function HasPublicationDate() : Boolean; + function HasPublisher() : Boolean; + function HasPOBoxShippingExcluded() : Boolean; + function HasReadingLevel() : Boolean; + function HasRecorderTrackCount() : Boolean; + function HasRegionCode() : Boolean; + function HasRegionOfOrigin() : Boolean; + function HasReturnPolicy() : Boolean; + function HasReleaseDate() : Boolean; + function HasRemovableMemory() : Boolean; + function HasRemovableStorage() : Boolean; + function HasRequiredVoltageRange() : Boolean; + function HasResolutionModes() : Boolean; + function HasRingSize() : Boolean; + function HasRunningTime() : Boolean; + function HasScentName() : Boolean; + function HasSecondaryCacheSize() : Boolean; + function HasSettingType() : Boolean; + function HasShaftMaterialType() : Boolean; + function HasSize() : Boolean; + function HasSizePerPearl() : Boolean; + function HasSkillLevel() : Boolean; + function HasSKU() : Boolean; + function HasSoldInStores() : Boolean; + function HasSoundCardDescription() : Boolean; + function HasSpeakerCount() : Boolean; + function HasSpeakerDescription() : Boolean; + function HasStoneClarity() : Boolean; + function HasStoneColor() : Boolean; + function HasStoneCut() : Boolean; + function HasStoneShape() : Boolean; + function HasStoneWeight() : Boolean; + function HasStudio() : Boolean; + function HasStyle() : Boolean; + function HasSubscriptionLength() : Boolean; + function HasSupportedMediaSize() : Boolean; + function HasSystemBusSpeed() : Boolean; + function HasSystemMemorySizeMax() : Boolean; + function HasSystemMemorySize() : Boolean; + function HasSystemMemoryType() : Boolean; + function HasTellingPageIndicator() : Boolean; + function HasTheatricalReleaseDate() : Boolean; + function HasTitle() : Boolean; + function HasTotalDiamondWeight() : Boolean; + function HasTotalExternalBaysFree() : Boolean; + function HasTotalFirewirePorts() : Boolean; + function HasTotalGemWeight() : Boolean; + function HasTotalInternalBaysFree() : Boolean; + function HasTotalMetalWeight() : Boolean; + function HasTotalNTSCPALPorts() : Boolean; + function HasTotalParallelPorts() : Boolean; + function HasTotalPCCardSlots() : Boolean; + function HasTotalPCISlotsFree() : Boolean; + function HasTotalSerialPorts() : Boolean; + function HasTotalSVideoOutPorts() : Boolean; + function HasTotalUSB2Ports() : Boolean; + function HasTotalUSBPorts() : Boolean; + function HasTotalVGAOutPorts() : Boolean; + function HasUPC() : Boolean; + function HasVariationDenomination() : Boolean; + function HasVariationDescription() : Boolean; + function HasWarranty() : Boolean; + function HasWatchMovementType() : Boolean; + function HasWaterResistanceDepth() : Boolean; + function HasWEEETaxValue() : Boolean; + function HasWirelessMicrophoneFrequency() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property Actor : ItemAttributes_ActorArray read FActor write FActor; + property Address : Address read FAddress write FAddress stored HasAddress; + property AmazonMaximumAge : DecimalWithUnits read FAmazonMaximumAge write FAmazonMaximumAge stored HasAmazonMaximumAge; + property AmazonMinimumAge : DecimalWithUnits read FAmazonMinimumAge write FAmazonMinimumAge stored HasAmazonMinimumAge; + property AnalogVideoFormat : string read FAnalogVideoFormat write FAnalogVideoFormat stored HasAnalogVideoFormat; + property ApertureModes : string read FApertureModes write FApertureModes stored HasApertureModes; + property Artist : ItemAttributes_ArtistArray read FArtist write FArtist; + property AspectRatio : string read FAspectRatio write FAspectRatio stored HasAspectRatio; + property AssemblyInstructions : string read FAssemblyInstructions write FAssemblyInstructions stored HasAssemblyInstructions; + property AssemblyRequired : string read FAssemblyRequired write FAssemblyRequired stored HasAssemblyRequired; + property AudienceRating : string read FAudienceRating write FAudienceRating stored HasAudienceRating; + property AudioFormat : ItemAttributes_AudioFormatArray read FAudioFormat write FAudioFormat; + property Author : ItemAttributes_AuthorArray read FAuthor write FAuthor; + property BackFinding : string read FBackFinding write FBackFinding stored HasBackFinding; + property BandMaterialType : string read FBandMaterialType write FBandMaterialType stored HasBandMaterialType; + property BatteriesIncluded : string read FBatteriesIncluded write FBatteriesIncluded stored HasBatteriesIncluded; + property BatteriesRequired : string read FBatteriesRequired write FBatteriesRequired stored HasBatteriesRequired; + property Batteries : NonNegativeIntegerWithUnits read FBatteries write FBatteries stored HasBatteries; + property BatteryDescription : string read FBatteryDescription write FBatteryDescription stored HasBatteryDescription; + property BatteryType : string read FBatteryType write FBatteryType stored HasBatteryType; + property BezelMaterialType : string read FBezelMaterialType write FBezelMaterialType stored HasBezelMaterialType; + property Binding : string read FBinding write FBinding stored HasBinding; + property Brand : string read FBrand write FBrand stored HasBrand; + property CalendarType : string read FCalendarType write FCalendarType stored HasCalendarType; + property CameraManualFeatures : ItemAttributes_CameraManualFeaturesArray read FCameraManualFeatures write FCameraManualFeatures; + property CaseDiameter : DecimalWithUnits read FCaseDiameter write FCaseDiameter stored HasCaseDiameter; + property CaseMaterialType : string read FCaseMaterialType write FCaseMaterialType stored HasCaseMaterialType; + property CaseThickness : DecimalWithUnits read FCaseThickness write FCaseThickness stored HasCaseThickness; + property CaseType : string read FCaseType write FCaseType stored HasCaseType; + property CatalogNumber : string read FCatalogNumber write FCatalogNumber stored HasCatalogNumber; + property CDRWDescription : string read FCDRWDescription write FCDRWDescription stored HasCDRWDescription; + property ChainType : string read FChainType write FChainType stored HasChainType; + property CEROAgeRating : string read FCEROAgeRating write FCEROAgeRating stored HasCEROAgeRating; + property ClaspType : string read FClaspType write FClaspType stored HasClaspType; + property ClothingSize : string read FClothingSize write FClothingSize stored HasClothingSize; + property ClubType : string read FClubType write FClubType stored HasClubType; + property Color : string read FColor write FColor stored HasColor; + property Compatibility : string read FCompatibility write FCompatibility stored HasCompatibility; + property CompatibleDevices : ItemAttributes_CompatibleDevicesArray read FCompatibleDevices write FCompatibleDevices; + property ComputerHardwareType : string read FComputerHardwareType write FComputerHardwareType stored HasComputerHardwareType; + property ComputerPlatform : string read FComputerPlatform write FComputerPlatform stored HasComputerPlatform; + property Connectivity : string read FConnectivity write FConnectivity stored HasConnectivity; + property ContinuousShootingSpeed : DecimalWithUnits read FContinuousShootingSpeed write FContinuousShootingSpeed stored HasContinuousShootingSpeed; + property Country : string read FCountry write FCountry stored HasCountry; + property CPUManufacturer : string read FCPUManufacturer write FCPUManufacturer stored HasCPUManufacturer; + property CPUSpeed : DecimalWithUnits read FCPUSpeed write FCPUSpeed stored HasCPUSpeed; + property CPUType : string read FCPUType write FCPUType stored HasCPUType; + property Creator : ItemAttributes_CreatorArray read FCreator write FCreator; + property Cuisine : string read FCuisine write FCuisine stored HasCuisine; + property DataLinkProtocol : ItemAttributes_DataLinkProtocolArray read FDataLinkProtocol write FDataLinkProtocol; + property DeliveryOption : string read FDeliveryOption write FDeliveryOption stored HasDeliveryOption; + property DelayBetweenShots : DecimalWithUnits read FDelayBetweenShots write FDelayBetweenShots stored HasDelayBetweenShots; + property Department : string read FDepartment write FDepartment stored HasDepartment; + property DeweyDecimalNumber : string read FDeweyDecimalNumber write FDeweyDecimalNumber stored HasDeweyDecimalNumber; + property DialColor : string read FDialColor write FDialColor stored HasDialColor; + property DialWindowMaterialType : string read FDialWindowMaterialType write FDialWindowMaterialType stored HasDialWindowMaterialType; + property DigitalZoom : DecimalWithUnits read FDigitalZoom write FDigitalZoom stored HasDigitalZoom; + property Director : ItemAttributes_DirectorArray read FDirector write FDirector; + property DisplayColorSupport : string read FDisplayColorSupport write FDisplayColorSupport stored HasDisplayColorSupport; + property DisplaySize : DecimalWithUnits read FDisplaySize write FDisplaySize stored HasDisplaySize; + property DrumSetPieceQuantity : nonNegativeInteger read FDrumSetPieceQuantity write FDrumSetPieceQuantity stored HasDrumSetPieceQuantity; + property DVDLayers : nonNegativeInteger read FDVDLayers write FDVDLayers stored HasDVDLayers; + property DVDRWDescription : string read FDVDRWDescription write FDVDRWDescription stored HasDVDRWDescription; + property DVDSides : nonNegativeInteger read FDVDSides write FDVDSides stored HasDVDSides; + property DPCI : string read FDPCI write FDPCI stored HasDPCI; + property EAN : string read FEAN write FEAN stored HasEAN; + property Edition : string read FEdition write FEdition stored HasEdition; + property ESRBAgeRating : string read FESRBAgeRating write FESRBAgeRating stored HasESRBAgeRating; + property ExternalDisplaySupportDescription : string read FExternalDisplaySupportDescription write FExternalDisplaySupportDescription stored HasExternalDisplaySupportDescription; + property FabricType : string read FFabricType write FFabricType stored HasFabricType; + property FaxNumber : string read FFaxNumber write FFaxNumber stored HasFaxNumber; + property Feature : ItemAttributes_FeatureArray read FFeature write FFeature; + property FilmColorType : string read FFilmColorType write FFilmColorType stored HasFilmColorType; + property FirstIssueLeadTime : StringWithUnits read FFirstIssueLeadTime write FFirstIssueLeadTime stored HasFirstIssueLeadTime; + property FloppyDiskDriveDescription : string read FFloppyDiskDriveDescription write FFloppyDiskDriveDescription stored HasFloppyDiskDriveDescription; + property Format : ItemAttributes_FormatArray read FFormat write FFormat; + property FormFactor : ItemAttributes_FormFactorArray read FFormFactor write FFormFactor; + property GemType : string read FGemType write FGemType stored HasGemType; + property Genre : string read FGenre write FGenre stored HasGenre; + property GraphicsCardInterface : string read FGraphicsCardInterface write FGraphicsCardInterface stored HasGraphicsCardInterface; + property GraphicsDescription : string read FGraphicsDescription write FGraphicsDescription stored HasGraphicsDescription; + property GraphicsMemorySize : DecimalWithUnits read FGraphicsMemorySize write FGraphicsMemorySize stored HasGraphicsMemorySize; + property GuitarAttribute : string read FGuitarAttribute write FGuitarAttribute stored HasGuitarAttribute; + property GuitarBridgeSystem : string read FGuitarBridgeSystem write FGuitarBridgeSystem stored HasGuitarBridgeSystem; + property GuitarPickThickness : string read FGuitarPickThickness write FGuitarPickThickness stored HasGuitarPickThickness; + property GuitarPickupConfiguration : string read FGuitarPickupConfiguration write FGuitarPickupConfiguration stored HasGuitarPickupConfiguration; + property HandOrientation : string read FHandOrientation write FHandOrientation stored HasHandOrientation; + property HardDiskCount : nonNegativeInteger read FHardDiskCount write FHardDiskCount stored HasHardDiskCount; + property HardDiskSize : DecimalWithUnits read FHardDiskSize write FHardDiskSize stored HasHardDiskSize; + property HardDiskInterface : string read FHardDiskInterface write FHardDiskInterface stored HasHardDiskInterface; + property HardwarePlatform : string read FHardwarePlatform write FHardwarePlatform stored HasHardwarePlatform; + property HasAutoFocus : boolean read FHasAutoFocus write FHasAutoFocus stored HasHasAutoFocus; + property HasBurstMode : boolean read FHasBurstMode write FHasBurstMode stored HasHasBurstMode; + property HasInCameraEditing : boolean read FHasInCameraEditing write FHasInCameraEditing stored HasHasInCameraEditing; + property HasRedEyeReduction : boolean read FHasRedEyeReduction write FHasRedEyeReduction stored HasHasRedEyeReduction; + property HasSelfTimer : boolean read FHasSelfTimer write FHasSelfTimer stored HasHasSelfTimer; + property HasTripodMount : boolean read FHasTripodMount write FHasTripodMount stored HasHasTripodMount; + property HasVideoOut : boolean read FHasVideoOut write FHasVideoOut stored HasHasVideoOut; + property HasViewfinder : boolean read FHasViewfinder write FHasViewfinder stored HasHasViewfinder; + property HazardousMaterialType : string read FHazardousMaterialType write FHazardousMaterialType stored HasHazardousMaterialType; + property HoursOfOperation : string read FHoursOfOperation write FHoursOfOperation stored HasHoursOfOperation; + property IncludedSoftware : string read FIncludedSoftware write FIncludedSoftware stored HasIncludedSoftware; + property IncludesMp3Player : boolean read FIncludesMp3Player write FIncludesMp3Player stored HasIncludesMp3Player; + property Ingredients : string read FIngredients write FIngredients stored HasIngredients; + property InstrumentKey : string read FInstrumentKey write FInstrumentKey stored HasInstrumentKey; + property IsAdultProduct : boolean read FIsAdultProduct write FIsAdultProduct stored HasIsAdultProduct; + property IsAutographed : boolean read FIsAutographed write FIsAutographed stored HasIsAutographed; + property ISBN : string read FISBN write FISBN stored HasISBN; + property IsFragile : boolean read FIsFragile write FIsFragile stored HasIsFragile; + property IsLabCreated : boolean read FIsLabCreated write FIsLabCreated stored HasIsLabCreated; + property IsMemorabilia : boolean read FIsMemorabilia write FIsMemorabilia stored HasIsMemorabilia; + property ISOEquivalent : NonNegativeIntegerWithUnits read FISOEquivalent write FISOEquivalent stored HasISOEquivalent; + property IsPreannounce : boolean read FIsPreannounce write FIsPreannounce stored HasIsPreannounce; + property IssuesPerYear : string read FIssuesPerYear write FIssuesPerYear stored HasIssuesPerYear; + property ItemDimensions : ItemAttributes_ItemDimensions_Type read FItemDimensions write FItemDimensions stored HasItemDimensions; + property KeyboardDescription : string read FKeyboardDescription write FKeyboardDescription stored HasKeyboardDescription; + property _Label : string read F_Label write F_Label stored Has_Label; + property Languages : ItemAttributes_Languages_Type read FLanguages write FLanguages stored HasLanguages; + property LegalDisclaimer : string read FLegalDisclaimer write FLegalDisclaimer stored HasLegalDisclaimer; + property LensType : string read FLensType write FLensType stored HasLensType; + property LineVoltage : string read FLineVoltage write FLineVoltage stored HasLineVoltage; + property ListPrice : Price read FListPrice write FListPrice stored HasListPrice; + property MacroFocusRange : string read FMacroFocusRange write FMacroFocusRange stored HasMacroFocusRange; + property MagazineType : string read FMagazineType write FMagazineType stored HasMagazineType; + property MalletHardness : string read FMalletHardness write FMalletHardness stored HasMalletHardness; + property Manufacturer : string read FManufacturer write FManufacturer stored HasManufacturer; + property ManufacturerLaborWarrantyDescription : string read FManufacturerLaborWarrantyDescription write FManufacturerLaborWarrantyDescription stored HasManufacturerLaborWarrantyDescription; + property ManufacturerMaximumAge : DecimalWithUnits read FManufacturerMaximumAge write FManufacturerMaximumAge stored HasManufacturerMaximumAge; + property ManufacturerMinimumAge : DecimalWithUnits read FManufacturerMinimumAge write FManufacturerMinimumAge stored HasManufacturerMinimumAge; + property ManufacturerPartsWarrantyDescription : string read FManufacturerPartsWarrantyDescription write FManufacturerPartsWarrantyDescription stored HasManufacturerPartsWarrantyDescription; + property MaterialType : string read FMaterialType write FMaterialType stored HasMaterialType; + property MaximumAperture : DecimalWithUnits read FMaximumAperture write FMaximumAperture stored HasMaximumAperture; + property MaximumColorDepth : string read FMaximumColorDepth write FMaximumColorDepth stored HasMaximumColorDepth; + property MaximumFocalLength : DecimalWithUnits read FMaximumFocalLength write FMaximumFocalLength stored HasMaximumFocalLength; + property MaximumHighResolutionImages : NonNegativeIntegerWithUnits read FMaximumHighResolutionImages write FMaximumHighResolutionImages stored HasMaximumHighResolutionImages; + property MaximumHorizontalResolution : NonNegativeIntegerWithUnits read FMaximumHorizontalResolution write FMaximumHorizontalResolution stored HasMaximumHorizontalResolution; + property MaximumLowResolutionImages : string read FMaximumLowResolutionImages write FMaximumLowResolutionImages stored HasMaximumLowResolutionImages; + property MaximumResolution : DecimalWithUnits read FMaximumResolution write FMaximumResolution stored HasMaximumResolution; + property MaximumShutterSpeed : DecimalWithUnits read FMaximumShutterSpeed write FMaximumShutterSpeed stored HasMaximumShutterSpeed; + property MaximumVerticalResolution : NonNegativeIntegerWithUnits read FMaximumVerticalResolution write FMaximumVerticalResolution stored HasMaximumVerticalResolution; + property MaximumWeightRecommendation : DecimalWithUnits read FMaximumWeightRecommendation write FMaximumWeightRecommendation stored HasMaximumWeightRecommendation; + property MediaType : string read FMediaType write FMediaType stored HasMediaType; + property MemorySlotsAvailable : string read FMemorySlotsAvailable write FMemorySlotsAvailable stored HasMemorySlotsAvailable; + property MetalStamp : string read FMetalStamp write FMetalStamp stored HasMetalStamp; + property MetalType : string read FMetalType write FMetalType stored HasMetalType; + property MiniMovieDescription : string read FMiniMovieDescription write FMiniMovieDescription stored HasMiniMovieDescription; + property MinimumFocalLength : DecimalWithUnits read FMinimumFocalLength write FMinimumFocalLength stored HasMinimumFocalLength; + property MinimumShutterSpeed : DecimalWithUnits read FMinimumShutterSpeed write FMinimumShutterSpeed stored HasMinimumShutterSpeed; + property Model : string read FModel write FModel stored HasModel; + property ModelYear : nonNegativeInteger read FModelYear write FModelYear stored HasModelYear; + property ModemDescription : string read FModemDescription write FModemDescription stored HasModemDescription; + property MonitorSize : DecimalWithUnits read FMonitorSize write FMonitorSize stored HasMonitorSize; + property MonitorViewableDiagonalSize : DecimalWithUnits read FMonitorViewableDiagonalSize write FMonitorViewableDiagonalSize stored HasMonitorViewableDiagonalSize; + property MouseDescription : string read FMouseDescription write FMouseDescription stored HasMouseDescription; + property MPN : string read FMPN write FMPN stored HasMPN; + property MusicalStyle : string read FMusicalStyle write FMusicalStyle stored HasMusicalStyle; + property NativeResolution : string read FNativeResolution write FNativeResolution stored HasNativeResolution; + property Neighborhood : string read FNeighborhood write FNeighborhood stored HasNeighborhood; + property NetworkInterfaceDescription : string read FNetworkInterfaceDescription write FNetworkInterfaceDescription stored HasNetworkInterfaceDescription; + property NotebookDisplayTechnology : string read FNotebookDisplayTechnology write FNotebookDisplayTechnology stored HasNotebookDisplayTechnology; + property NotebookPointingDeviceDescription : string read FNotebookPointingDeviceDescription write FNotebookPointingDeviceDescription stored HasNotebookPointingDeviceDescription; + property NumberOfDiscs : nonNegativeInteger read FNumberOfDiscs write FNumberOfDiscs stored HasNumberOfDiscs; + property NumberOfIssues : nonNegativeInteger read FNumberOfIssues write FNumberOfIssues stored HasNumberOfIssues; + property NumberOfItems : nonNegativeInteger read FNumberOfItems write FNumberOfItems stored HasNumberOfItems; + property NumberOfKeys : nonNegativeInteger read FNumberOfKeys write FNumberOfKeys stored HasNumberOfKeys; + property NumberOfPages : nonNegativeInteger read FNumberOfPages write FNumberOfPages stored HasNumberOfPages; + property NumberOfPearls : nonNegativeInteger read FNumberOfPearls write FNumberOfPearls stored HasNumberOfPearls; + property NumberOfRapidFireShots : nonNegativeInteger read FNumberOfRapidFireShots write FNumberOfRapidFireShots stored HasNumberOfRapidFireShots; + property NumberOfStones : nonNegativeInteger read FNumberOfStones write FNumberOfStones stored HasNumberOfStones; + property NumberOfStrings : nonNegativeInteger read FNumberOfStrings write FNumberOfStrings stored HasNumberOfStrings; + property NumberOfTracks : nonNegativeInteger read FNumberOfTracks write FNumberOfTracks stored HasNumberOfTracks; + property OperatingSystem : string read FOperatingSystem write FOperatingSystem stored HasOperatingSystem; + property OpticalSensorResolution : DecimalWithUnits read FOpticalSensorResolution write FOpticalSensorResolution stored HasOpticalSensorResolution; + property OpticalZoom : DecimalWithUnits read FOpticalZoom write FOpticalZoom stored HasOpticalZoom; + property OriginalReleaseDate : string read FOriginalReleaseDate write FOriginalReleaseDate stored HasOriginalReleaseDate; + property OutputWattage : nonNegativeInteger read FOutputWattage write FOutputWattage stored HasOutputWattage; + property PackageDimensions : ItemAttributes_PackageDimensions_Type read FPackageDimensions write FPackageDimensions stored HasPackageDimensions; + property PackageQuantity : nonNegativeInteger read FPackageQuantity write FPackageQuantity stored HasPackageQuantity; + property PearlLustre : string read FPearlLustre write FPearlLustre stored HasPearlLustre; + property PearlMinimumColor : string read FPearlMinimumColor write FPearlMinimumColor stored HasPearlMinimumColor; + property PearlShape : string read FPearlShape write FPearlShape stored HasPearlShape; + property PearlStringingMethod : string read FPearlStringingMethod write FPearlStringingMethod stored HasPearlStringingMethod; + property PearlSurfaceBlemishes : string read FPearlSurfaceBlemishes write FPearlSurfaceBlemishes stored HasPearlSurfaceBlemishes; + property PearlType : string read FPearlType write FPearlType stored HasPearlType; + property PearlUniformity : string read FPearlUniformity write FPearlUniformity stored HasPearlUniformity; + property PhoneNumber : string read FPhoneNumber write FPhoneNumber stored HasPhoneNumber; + property PhotoFlashType : ItemAttributes_PhotoFlashTypeArray read FPhotoFlashType write FPhotoFlashType; + property PictureFormat : ItemAttributes_PictureFormatArray read FPictureFormat write FPictureFormat; + property Platform : ItemAttributes_PlatformArray read FPlatform write FPlatform; + property PriceRating : nonNegativeInteger read FPriceRating write FPriceRating stored HasPriceRating; + property ProcessorCount : nonNegativeInteger read FProcessorCount write FProcessorCount stored HasProcessorCount; + property ProductGroup : string read FProductGroup write FProductGroup stored HasProductGroup; + property ProductSiteLaunchDate : string read FProductSiteLaunchDate write FProductSiteLaunchDate stored HasProductSiteLaunchDate; + property ProductTypeName : string read FProductTypeName write FProductTypeName stored HasProductTypeName; + property ProductTypeSubcategory : string read FProductTypeSubcategory write FProductTypeSubcategory stored HasProductTypeSubcategory; + property PromotionalTag : string read FPromotionalTag write FPromotionalTag stored HasPromotionalTag; + property PublicationDate : string read FPublicationDate write FPublicationDate stored HasPublicationDate; + property Publisher : string read FPublisher write FPublisher stored HasPublisher; + property POBoxShippingExcluded : string read FPOBoxShippingExcluded write FPOBoxShippingExcluded stored HasPOBoxShippingExcluded; + property ReadingLevel : string read FReadingLevel write FReadingLevel stored HasReadingLevel; + property ReturnMethod : ItemAttributes_ReturnMethodArray read FReturnMethod write FReturnMethod; + property RecorderTrackCount : nonNegativeInteger read FRecorderTrackCount write FRecorderTrackCount stored HasRecorderTrackCount; + property RegionCode : string read FRegionCode write FRegionCode stored HasRegionCode; + property RegionOfOrigin : string read FRegionOfOrigin write FRegionOfOrigin stored HasRegionOfOrigin; + property ReturnPolicy : string read FReturnPolicy write FReturnPolicy stored HasReturnPolicy; + property ReleaseDate : string read FReleaseDate write FReleaseDate stored HasReleaseDate; + property RemovableMemory : string read FRemovableMemory write FRemovableMemory stored HasRemovableMemory; + property RemovableStorage : string read FRemovableStorage write FRemovableStorage stored HasRemovableStorage; + property RequiredVoltageRange : string read FRequiredVoltageRange write FRequiredVoltageRange stored HasRequiredVoltageRange; + property ResolutionModes : string read FResolutionModes write FResolutionModes stored HasResolutionModes; + property RingSize : string read FRingSize write FRingSize stored HasRingSize; + property RunningTime : DecimalWithUnits read FRunningTime write FRunningTime stored HasRunningTime; + property ScentName : string read FScentName write FScentName stored HasScentName; + property SecondaryCacheSize : NonNegativeIntegerWithUnits read FSecondaryCacheSize write FSecondaryCacheSize stored HasSecondaryCacheSize; + property SettingType : string read FSettingType write FSettingType stored HasSettingType; + property ShaftMaterialType : string read FShaftMaterialType write FShaftMaterialType stored HasShaftMaterialType; + property Size : string read FSize write FSize stored HasSize; + property SizePerPearl : string read FSizePerPearl write FSizePerPearl stored HasSizePerPearl; + property SkillLevel : string read FSkillLevel write FSkillLevel stored HasSkillLevel; + property SKU : string read FSKU write FSKU stored HasSKU; + property SoldInStores : string read FSoldInStores write FSoldInStores stored HasSoldInStores; + property SoundCardDescription : string read FSoundCardDescription write FSoundCardDescription stored HasSoundCardDescription; + property SpeakerCount : nonNegativeInteger read FSpeakerCount write FSpeakerCount stored HasSpeakerCount; + property SpeakerDescription : string read FSpeakerDescription write FSpeakerDescription stored HasSpeakerDescription; + property SpecialFeatures : ItemAttributes_SpecialFeaturesArray read FSpecialFeatures write FSpecialFeatures; + property StoneClarity : string read FStoneClarity write FStoneClarity stored HasStoneClarity; + property StoneColor : string read FStoneColor write FStoneColor stored HasStoneColor; + property StoneCut : string read FStoneCut write FStoneCut stored HasStoneCut; + property StoneShape : string read FStoneShape write FStoneShape stored HasStoneShape; + property StoneWeight : DecimalWithUnits read FStoneWeight write FStoneWeight stored HasStoneWeight; + property Studio : string read FStudio write FStudio stored HasStudio; + property Style : string read FStyle write FStyle stored HasStyle; + property SubscriptionLength : NonNegativeIntegerWithUnits read FSubscriptionLength write FSubscriptionLength stored HasSubscriptionLength; + property SupportedImageType : ItemAttributes_SupportedImageTypeArray read FSupportedImageType write FSupportedImageType; + property SupportedMediaSize : string read FSupportedMediaSize write FSupportedMediaSize stored HasSupportedMediaSize; + property SystemBusSpeed : DecimalWithUnits read FSystemBusSpeed write FSystemBusSpeed stored HasSystemBusSpeed; + property SystemMemorySizeMax : DecimalWithUnits read FSystemMemorySizeMax write FSystemMemorySizeMax stored HasSystemMemorySizeMax; + property SystemMemorySize : DecimalWithUnits read FSystemMemorySize write FSystemMemorySize stored HasSystemMemorySize; + property SystemMemoryType : string read FSystemMemoryType write FSystemMemoryType stored HasSystemMemoryType; + property TellingPageIndicator : string read FTellingPageIndicator write FTellingPageIndicator stored HasTellingPageIndicator; + property TheatricalReleaseDate : string read FTheatricalReleaseDate write FTheatricalReleaseDate stored HasTheatricalReleaseDate; + property Title : string read FTitle write FTitle stored HasTitle; + property TotalDiamondWeight : DecimalWithUnits read FTotalDiamondWeight write FTotalDiamondWeight stored HasTotalDiamondWeight; + property TotalExternalBaysFree : nonNegativeInteger read FTotalExternalBaysFree write FTotalExternalBaysFree stored HasTotalExternalBaysFree; + property TotalFirewirePorts : nonNegativeInteger read FTotalFirewirePorts write FTotalFirewirePorts stored HasTotalFirewirePorts; + property TotalGemWeight : DecimalWithUnits read FTotalGemWeight write FTotalGemWeight stored HasTotalGemWeight; + property TotalInternalBaysFree : nonNegativeInteger read FTotalInternalBaysFree write FTotalInternalBaysFree stored HasTotalInternalBaysFree; + property TotalMetalWeight : DecimalWithUnits read FTotalMetalWeight write FTotalMetalWeight stored HasTotalMetalWeight; + property TotalNTSCPALPorts : nonNegativeInteger read FTotalNTSCPALPorts write FTotalNTSCPALPorts stored HasTotalNTSCPALPorts; + property TotalParallelPorts : nonNegativeInteger read FTotalParallelPorts write FTotalParallelPorts stored HasTotalParallelPorts; + property TotalPCCardSlots : nonNegativeInteger read FTotalPCCardSlots write FTotalPCCardSlots stored HasTotalPCCardSlots; + property TotalPCISlotsFree : nonNegativeInteger read FTotalPCISlotsFree write FTotalPCISlotsFree stored HasTotalPCISlotsFree; + property TotalSerialPorts : nonNegativeInteger read FTotalSerialPorts write FTotalSerialPorts stored HasTotalSerialPorts; + property TotalSVideoOutPorts : nonNegativeInteger read FTotalSVideoOutPorts write FTotalSVideoOutPorts stored HasTotalSVideoOutPorts; + property TotalUSB2Ports : nonNegativeInteger read FTotalUSB2Ports write FTotalUSB2Ports stored HasTotalUSB2Ports; + property TotalUSBPorts : nonNegativeInteger read FTotalUSBPorts write FTotalUSBPorts stored HasTotalUSBPorts; + property TotalVGAOutPorts : nonNegativeInteger read FTotalVGAOutPorts write FTotalVGAOutPorts stored HasTotalVGAOutPorts; + property UPC : string read FUPC write FUPC stored HasUPC; + property VariationDenomination : string read FVariationDenomination write FVariationDenomination stored HasVariationDenomination; + property VariationDescription : string read FVariationDescription write FVariationDescription stored HasVariationDescription; + property Warranty : string read FWarranty write FWarranty stored HasWarranty; + property WatchMovementType : string read FWatchMovementType write FWatchMovementType stored HasWatchMovementType; + property WaterResistanceDepth : DecimalWithUnits read FWaterResistanceDepth write FWaterResistanceDepth stored HasWaterResistanceDepth; + property WEEETaxValue : Price read FWEEETaxValue write FWEEETaxValue stored HasWEEETaxValue; + property WirelessMicrophoneFrequency : nonNegativeInteger read FWirelessMicrophoneFrequency write FWirelessMicrophoneFrequency stored HasWirelessMicrophoneFrequency; + end; + + MerchantItemAttributes_Type = class(TBaseComplexRemotable) + private + FActor : MerchantItemAttributes_ActorArray; + FAddress : Address; + FAmazonMaximumAge : DecimalWithUnits; + FAmazonMinimumAge : DecimalWithUnits; + FApertureModes : string; + FArtist : MerchantItemAttributes_ArtistArray; + FAspectRatio : string; + FAssemblyInstructions : string; + FAssemblyRequired : string; + FAudienceRating : string; + FAudioFormat : MerchantItemAttributes_AudioFormatArray; + FAuthor : MerchantItemAttributes_AuthorArray; + FBackFinding : string; + FBandMaterialType : string; + FBatteriesIncluded : string; + FBatteriesRequired : string; + FBatteries : NonNegativeIntegerWithUnits; + FBatteryDescription : string; + FBatteryType : string; + FBezelMaterialType : string; + FBinding : string; + FBrand : string; + FCalendarType : string; + FCameraManualFeatures : MerchantItemAttributes_CameraManualFeaturesArray; + FCaseDiameter : DecimalWithUnits; + FCaseMaterialType : string; + FCaseThickness : DecimalWithUnits; + FCaseType : string; + FCatalogNumber : string; + FCDRWDescription : string; + FChainType : string; + FClaspType : string; + FClothingSize : string; + FColor : string; + FCompatibility : string; + FComputerHardwareType : string; + FComputerPlatform : string; + FConnectivity : string; + FContinuousShootingSpeed : DecimalWithUnits; + FCountry : string; + FCountryOfOrigin : string; + FCPUManufacturer : string; + FCPUSpeed : DecimalWithUnits; + FCPUType : string; + FCreator : MerchantItemAttributes_CreatorArray; + FCuisine : string; + FCustomizable : string; + FDelayBetweenShots : DecimalWithUnits; + FDeliveryOption : string; + FDepartment : string; + FDescription : string; + FDeweyDecimalNumber : string; + FDialColor : string; + FDialWindowMaterialType : string; + FDigitalZoom : DecimalWithUnits; + FDirector : MerchantItemAttributes_DirectorArray; + FDisplaySize : DecimalWithUnits; + FDrumSetPieceQuantity : nonNegativeInteger; + FDVDLayers : nonNegativeInteger; + FDVDRWDescription : string; + FDVDSides : nonNegativeInteger; + FDPCI : string; + FEAN : string; + FEdition : string; + FESRBAgeRating : string; + FExternalDisplaySupportDescription : string; + FFabricType : string; + FFaxNumber : string; + FFeature : MerchantItemAttributes_FeatureArray; + FFirstIssueLeadTime : StringWithUnits; + FFloppyDiskDriveDescription : string; + FFormat : MerchantItemAttributes_FormatArray; + FFixedShippingCharge : Price; + FGemType : string; + FGraphicsCardInterface : string; + FGraphicsDescription : string; + FGraphicsMemorySize : DecimalWithUnits; + FGuitarAttribute : string; + FGuitarBridgeSystem : string; + FGuitarPickThickness : string; + FGuitarPickupConfiguration : string; + FHardDiskCount : nonNegativeInteger; + FHardDiskSize : NonNegativeIntegerWithUnits; + FHasAutoFocus : boolean; + FHasBurstMode : boolean; + FHasInCameraEditing : boolean; + FHasRedEyeReduction : boolean; + FHasSelfTimer : boolean; + FHasTripodMount : boolean; + FHasVideoOut : boolean; + FHasViewfinder : boolean; + FHazardousMaterialType : string; + FHoursOfOperation : string; + FIncludedSoftware : string; + FIncludesMp3Player : boolean; + FIndications : string; + FIngredients : string; + FInstrumentKey : string; + FIsAutographed : boolean; + FISBN : string; + FIsFragile : boolean; + FIsLabCreated : boolean; + FIsMemorabilia : boolean; + FISOEquivalent : NonNegativeIntegerWithUnits; + FIssuesPerYear : string; + FItemDimensions : MerchantItemAttributes_ItemDimensions_Type; + FKeyboardDescription : string; + F_Label : string; + FLanguages : MerchantItemAttributes_Languages_Type; + FLegalDisclaimer : string; + FLineVoltage : string; + FListPrice : Price; + FMacroFocusRange : string; + FMagazineType : string; + FMalletHardness : string; + FManufacturer : string; + FManufacturerLaborWarrantyDescription : string; + FManufacturerMaximumAge : DecimalWithUnits; + FManufacturerMinimumAge : DecimalWithUnits; + FManufacturerPartsWarrantyDescription : string; + FMaterialType : string; + FMaximumAperture : DecimalWithUnits; + FMaximumColorDepth : string; + FMaximumFocalLength : DecimalWithUnits; + FMaximumHighResolutionImages : NonNegativeIntegerWithUnits; + FMaximumHorizontalResolution : NonNegativeIntegerWithUnits; + FMaximumLowResolutionImages : string; + FMaximumResolution : DecimalWithUnits; + FMaximumShutterSpeed : DecimalWithUnits; + FMaximumVerticalResolution : NonNegativeIntegerWithUnits; + FMaximumWeightRecommendation : DecimalWithUnits; + FMemorySlotsAvailable : nonNegativeInteger; + FMetalStamp : string; + FMetalType : string; + FMiniMovieDescription : string; + FMinimumFocalLength : DecimalWithUnits; + FMinimumShutterSpeed : DecimalWithUnits; + FModel : string; + FModelYear : nonNegativeInteger; + FModemDescription : string; + FMonitorSize : DecimalWithUnits; + FMonitorViewableDiagonalSize : DecimalWithUnits; + FMouseDescription : string; + FMPN : string; + FMusicalStyle : string; + FNativeResolution : string; + FNeighborhood : string; + FNetworkInterfaceDescription : string; + FNotebookDisplayTechnology : string; + FNotebookPointingDeviceDescription : string; + FNumberOfDiscs : nonNegativeInteger; + FNumberOfIssues : nonNegativeInteger; + FNumberOfItems : nonNegativeInteger; + FNumberOfKeys : nonNegativeInteger; + FNumberOfPages : nonNegativeInteger; + FNumberOfPearls : nonNegativeInteger; + FNumberOfRapidFireShots : nonNegativeInteger; + FNumberOfStones : nonNegativeInteger; + FNumberOfStrings : nonNegativeInteger; + FNumberOfTracks : nonNegativeInteger; + FOpticalZoom : DecimalWithUnits; + FOriginalReleaseDate : string; + FOutputWattage : nonNegativeInteger; + FPackageDimensions : MerchantItemAttributes_PackageDimensions_Type; + FPearlLustre : string; + FPearlMinimumColor : string; + FPearlShape : string; + FPearlStringingMethod : string; + FPearlSurfaceBlemishes : string; + FPearlType : string; + FPearlUniformity : string; + FPhoneNumber : string; + FPhotoFlashType : MerchantItemAttributes_PhotoFlashTypeArray; + FPictureFormat : MerchantItemAttributes_PictureFormatArray; + FPlatform : MerchantItemAttributes_PlatformArray; + FPriceRating : nonNegativeInteger; + FProcessorCount : nonNegativeInteger; + FProductGroup : string; + FPromotionalTag : string; + FPOBoxShippingExcluded : string; + FPublicationDate : string; + FPublisher : string; + FPurchasingChannel : MerchantItemAttributes_PurchasingChannelArray; + FReadingLevel : string; + FRecorderTrackCount : nonNegativeInteger; + FRegionCode : string; + FRegionOfOrigin : string; + FReleaseDate : string; + FReturnMethod : MerchantItemAttributes_ReturnMethodArray; + FRemovableMemory : string; + FResolutionModes : string; + FReturnPolicy : string; + FRingSize : string; + FSafetyWarning : string; + FSalesRestriction : string; + FSecondaryCacheSize : NonNegativeIntegerWithUnits; + FSettingType : string; + FSize : string; + FSKU : string; + FSoldInStores : string; + FSizePerPearl : string; + FSkillLevel : string; + FSoundCardDescription : string; + FSpeakerCount : nonNegativeInteger; + FSpeakerDescription : string; + FSpecialFeatures : MerchantItemAttributes_SpecialFeaturesArray; + FStoneClarity : string; + FStoneColor : string; + FStoneCut : string; + FStoneShape : string; + FStoneWeight : DecimalWithUnits; + FStudio : string; + FSubscriptionLength : NonNegativeIntegerWithUnits; + FSupportedImageType : MerchantItemAttributes_SupportedImageTypeArray; + FSystemBusSpeed : DecimalWithUnits; + FSystemMemorySizeMax : DecimalWithUnits; + FSystemMemorySize : DecimalWithUnits; + FSystemMemoryType : string; + FTellingPageIndicator : string; + FTheatricalReleaseDate : string; + FTitle : string; + FTotalDiamondWeight : DecimalWithUnits; + FTotalExternalBaysFree : nonNegativeInteger; + FTotalFirewirePorts : nonNegativeInteger; + FTotalGemWeight : DecimalWithUnits; + FTotalInternalBaysFree : nonNegativeInteger; + FTotalMetalWeight : DecimalWithUnits; + FTotalNTSCPALPorts : nonNegativeInteger; + FTotalParallelPorts : nonNegativeInteger; + FTotalPCCardSlots : nonNegativeInteger; + FTotalPCISlotsFree : nonNegativeInteger; + FTotalSerialPorts : nonNegativeInteger; + FTotalSVideoOutPorts : nonNegativeInteger; + FTotalUSB2Ports : nonNegativeInteger; + FTotalUSBPorts : nonNegativeInteger; + FTotalVGAOutPorts : nonNegativeInteger; + FUPC : string; + FVariationDenomination : string; + FVariationDescription : string; + FVendorRebate : MerchantItemAttributes_VendorRebate_Type; + FWarranty : string; + FWatchMovementType : string; + FWebsiteBuyability : string; + FWaterResistanceDepth : DecimalWithUnits; + FWirelessMicrophoneFrequency : nonNegativeInteger; + private + function HasAddress() : Boolean; + function HasAmazonMaximumAge() : Boolean; + function HasAmazonMinimumAge() : Boolean; + function HasApertureModes() : Boolean; + function HasAspectRatio() : Boolean; + function HasAssemblyInstructions() : Boolean; + function HasAssemblyRequired() : Boolean; + function HasAudienceRating() : Boolean; + function HasBackFinding() : Boolean; + function HasBandMaterialType() : Boolean; + function HasBatteriesIncluded() : Boolean; + function HasBatteriesRequired() : Boolean; + function HasBatteries() : Boolean; + function HasBatteryDescription() : Boolean; + function HasBatteryType() : Boolean; + function HasBezelMaterialType() : Boolean; + function HasBinding() : Boolean; + function HasBrand() : Boolean; + function HasCalendarType() : Boolean; + function HasCaseDiameter() : Boolean; + function HasCaseMaterialType() : Boolean; + function HasCaseThickness() : Boolean; + function HasCaseType() : Boolean; + function HasCatalogNumber() : Boolean; + function HasCDRWDescription() : Boolean; + function HasChainType() : Boolean; + function HasClaspType() : Boolean; + function HasClothingSize() : Boolean; + function HasColor() : Boolean; + function HasCompatibility() : Boolean; + function HasComputerHardwareType() : Boolean; + function HasComputerPlatform() : Boolean; + function HasConnectivity() : Boolean; + function HasContinuousShootingSpeed() : Boolean; + function HasCountry() : Boolean; + function HasCountryOfOrigin() : Boolean; + function HasCPUManufacturer() : Boolean; + function HasCPUSpeed() : Boolean; + function HasCPUType() : Boolean; + function HasCuisine() : Boolean; + function HasCustomizable() : Boolean; + function HasDelayBetweenShots() : Boolean; + function HasDeliveryOption() : Boolean; + function HasDepartment() : Boolean; + function HasDescription() : Boolean; + function HasDeweyDecimalNumber() : Boolean; + function HasDialColor() : Boolean; + function HasDialWindowMaterialType() : Boolean; + function HasDigitalZoom() : Boolean; + function HasDisplaySize() : Boolean; + function HasDrumSetPieceQuantity() : Boolean; + function HasDVDLayers() : Boolean; + function HasDVDRWDescription() : Boolean; + function HasDVDSides() : Boolean; + function HasDPCI() : Boolean; + function HasEAN() : Boolean; + function HasEdition() : Boolean; + function HasESRBAgeRating() : Boolean; + function HasExternalDisplaySupportDescription() : Boolean; + function HasFabricType() : Boolean; + function HasFaxNumber() : Boolean; + function HasFirstIssueLeadTime() : Boolean; + function HasFloppyDiskDriveDescription() : Boolean; + function HasFixedShippingCharge() : Boolean; + function HasGemType() : Boolean; + function HasGraphicsCardInterface() : Boolean; + function HasGraphicsDescription() : Boolean; + function HasGraphicsMemorySize() : Boolean; + function HasGuitarAttribute() : Boolean; + function HasGuitarBridgeSystem() : Boolean; + function HasGuitarPickThickness() : Boolean; + function HasGuitarPickupConfiguration() : Boolean; + function HasHardDiskCount() : Boolean; + function HasHardDiskSize() : Boolean; + function HasHasAutoFocus() : Boolean; + function HasHasBurstMode() : Boolean; + function HasHasInCameraEditing() : Boolean; + function HasHasRedEyeReduction() : Boolean; + function HasHasSelfTimer() : Boolean; + function HasHasTripodMount() : Boolean; + function HasHasVideoOut() : Boolean; + function HasHasViewfinder() : Boolean; + function HasHazardousMaterialType() : Boolean; + function HasHoursOfOperation() : Boolean; + function HasIncludedSoftware() : Boolean; + function HasIncludesMp3Player() : Boolean; + function HasIndications() : Boolean; + function HasIngredients() : Boolean; + function HasInstrumentKey() : Boolean; + function HasIsAutographed() : Boolean; + function HasISBN() : Boolean; + function HasIsFragile() : Boolean; + function HasIsLabCreated() : Boolean; + function HasIsMemorabilia() : Boolean; + function HasISOEquivalent() : Boolean; + function HasIssuesPerYear() : Boolean; + function HasItemDimensions() : Boolean; + function HasKeyboardDescription() : Boolean; + function Has_Label() : Boolean; + function HasLanguages() : Boolean; + function HasLegalDisclaimer() : Boolean; + function HasLineVoltage() : Boolean; + function HasListPrice() : Boolean; + function HasMacroFocusRange() : Boolean; + function HasMagazineType() : Boolean; + function HasMalletHardness() : Boolean; + function HasManufacturer() : Boolean; + function HasManufacturerLaborWarrantyDescription() : Boolean; + function HasManufacturerMaximumAge() : Boolean; + function HasManufacturerMinimumAge() : Boolean; + function HasManufacturerPartsWarrantyDescription() : Boolean; + function HasMaterialType() : Boolean; + function HasMaximumAperture() : Boolean; + function HasMaximumColorDepth() : Boolean; + function HasMaximumFocalLength() : Boolean; + function HasMaximumHighResolutionImages() : Boolean; + function HasMaximumHorizontalResolution() : Boolean; + function HasMaximumLowResolutionImages() : Boolean; + function HasMaximumResolution() : Boolean; + function HasMaximumShutterSpeed() : Boolean; + function HasMaximumVerticalResolution() : Boolean; + function HasMaximumWeightRecommendation() : Boolean; + function HasMemorySlotsAvailable() : Boolean; + function HasMetalStamp() : Boolean; + function HasMetalType() : Boolean; + function HasMiniMovieDescription() : Boolean; + function HasMinimumFocalLength() : Boolean; + function HasMinimumShutterSpeed() : Boolean; + function HasModel() : Boolean; + function HasModelYear() : Boolean; + function HasModemDescription() : Boolean; + function HasMonitorSize() : Boolean; + function HasMonitorViewableDiagonalSize() : Boolean; + function HasMouseDescription() : Boolean; + function HasMPN() : Boolean; + function HasMusicalStyle() : Boolean; + function HasNativeResolution() : Boolean; + function HasNeighborhood() : Boolean; + function HasNetworkInterfaceDescription() : Boolean; + function HasNotebookDisplayTechnology() : Boolean; + function HasNotebookPointingDeviceDescription() : Boolean; + function HasNumberOfDiscs() : Boolean; + function HasNumberOfIssues() : Boolean; + function HasNumberOfItems() : Boolean; + function HasNumberOfKeys() : Boolean; + function HasNumberOfPages() : Boolean; + function HasNumberOfPearls() : Boolean; + function HasNumberOfRapidFireShots() : Boolean; + function HasNumberOfStones() : Boolean; + function HasNumberOfStrings() : Boolean; + function HasNumberOfTracks() : Boolean; + function HasOpticalZoom() : Boolean; + function HasOriginalReleaseDate() : Boolean; + function HasOutputWattage() : Boolean; + function HasPackageDimensions() : Boolean; + function HasPearlLustre() : Boolean; + function HasPearlMinimumColor() : Boolean; + function HasPearlShape() : Boolean; + function HasPearlStringingMethod() : Boolean; + function HasPearlSurfaceBlemishes() : Boolean; + function HasPearlType() : Boolean; + function HasPearlUniformity() : Boolean; + function HasPhoneNumber() : Boolean; + function HasPriceRating() : Boolean; + function HasProcessorCount() : Boolean; + function HasProductGroup() : Boolean; + function HasPromotionalTag() : Boolean; + function HasPOBoxShippingExcluded() : Boolean; + function HasPublicationDate() : Boolean; + function HasPublisher() : Boolean; + function HasReadingLevel() : Boolean; + function HasRecorderTrackCount() : Boolean; + function HasRegionCode() : Boolean; + function HasRegionOfOrigin() : Boolean; + function HasReleaseDate() : Boolean; + function HasRemovableMemory() : Boolean; + function HasResolutionModes() : Boolean; + function HasReturnPolicy() : Boolean; + function HasRingSize() : Boolean; + function HasSafetyWarning() : Boolean; + function HasSalesRestriction() : Boolean; + function HasSecondaryCacheSize() : Boolean; + function HasSettingType() : Boolean; + function HasSize() : Boolean; + function HasSKU() : Boolean; + function HasSoldInStores() : Boolean; + function HasSizePerPearl() : Boolean; + function HasSkillLevel() : Boolean; + function HasSoundCardDescription() : Boolean; + function HasSpeakerCount() : Boolean; + function HasSpeakerDescription() : Boolean; + function HasStoneClarity() : Boolean; + function HasStoneColor() : Boolean; + function HasStoneCut() : Boolean; + function HasStoneShape() : Boolean; + function HasStoneWeight() : Boolean; + function HasStudio() : Boolean; + function HasSubscriptionLength() : Boolean; + function HasSystemBusSpeed() : Boolean; + function HasSystemMemorySizeMax() : Boolean; + function HasSystemMemorySize() : Boolean; + function HasSystemMemoryType() : Boolean; + function HasTellingPageIndicator() : Boolean; + function HasTheatricalReleaseDate() : Boolean; + function HasTitle() : Boolean; + function HasTotalDiamondWeight() : Boolean; + function HasTotalExternalBaysFree() : Boolean; + function HasTotalFirewirePorts() : Boolean; + function HasTotalGemWeight() : Boolean; + function HasTotalInternalBaysFree() : Boolean; + function HasTotalMetalWeight() : Boolean; + function HasTotalNTSCPALPorts() : Boolean; + function HasTotalParallelPorts() : Boolean; + function HasTotalPCCardSlots() : Boolean; + function HasTotalPCISlotsFree() : Boolean; + function HasTotalSerialPorts() : Boolean; + function HasTotalSVideoOutPorts() : Boolean; + function HasTotalUSB2Ports() : Boolean; + function HasTotalUSBPorts() : Boolean; + function HasTotalVGAOutPorts() : Boolean; + function HasUPC() : Boolean; + function HasVariationDenomination() : Boolean; + function HasVariationDescription() : Boolean; + function HasVendorRebate() : Boolean; + function HasWarranty() : Boolean; + function HasWatchMovementType() : Boolean; + function HasWebsiteBuyability() : Boolean; + function HasWaterResistanceDepth() : Boolean; + function HasWirelessMicrophoneFrequency() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property Actor : MerchantItemAttributes_ActorArray read FActor write FActor; + property Address : Address read FAddress write FAddress stored HasAddress; + property AmazonMaximumAge : DecimalWithUnits read FAmazonMaximumAge write FAmazonMaximumAge stored HasAmazonMaximumAge; + property AmazonMinimumAge : DecimalWithUnits read FAmazonMinimumAge write FAmazonMinimumAge stored HasAmazonMinimumAge; + property ApertureModes : string read FApertureModes write FApertureModes stored HasApertureModes; + property Artist : MerchantItemAttributes_ArtistArray read FArtist write FArtist; + property AspectRatio : string read FAspectRatio write FAspectRatio stored HasAspectRatio; + property AssemblyInstructions : string read FAssemblyInstructions write FAssemblyInstructions stored HasAssemblyInstructions; + property AssemblyRequired : string read FAssemblyRequired write FAssemblyRequired stored HasAssemblyRequired; + property AudienceRating : string read FAudienceRating write FAudienceRating stored HasAudienceRating; + property AudioFormat : MerchantItemAttributes_AudioFormatArray read FAudioFormat write FAudioFormat; + property Author : MerchantItemAttributes_AuthorArray read FAuthor write FAuthor; + property BackFinding : string read FBackFinding write FBackFinding stored HasBackFinding; + property BandMaterialType : string read FBandMaterialType write FBandMaterialType stored HasBandMaterialType; + property BatteriesIncluded : string read FBatteriesIncluded write FBatteriesIncluded stored HasBatteriesIncluded; + property BatteriesRequired : string read FBatteriesRequired write FBatteriesRequired stored HasBatteriesRequired; + property Batteries : NonNegativeIntegerWithUnits read FBatteries write FBatteries stored HasBatteries; + property BatteryDescription : string read FBatteryDescription write FBatteryDescription stored HasBatteryDescription; + property BatteryType : string read FBatteryType write FBatteryType stored HasBatteryType; + property BezelMaterialType : string read FBezelMaterialType write FBezelMaterialType stored HasBezelMaterialType; + property Binding : string read FBinding write FBinding stored HasBinding; + property Brand : string read FBrand write FBrand stored HasBrand; + property CalendarType : string read FCalendarType write FCalendarType stored HasCalendarType; + property CameraManualFeatures : MerchantItemAttributes_CameraManualFeaturesArray read FCameraManualFeatures write FCameraManualFeatures; + property CaseDiameter : DecimalWithUnits read FCaseDiameter write FCaseDiameter stored HasCaseDiameter; + property CaseMaterialType : string read FCaseMaterialType write FCaseMaterialType stored HasCaseMaterialType; + property CaseThickness : DecimalWithUnits read FCaseThickness write FCaseThickness stored HasCaseThickness; + property CaseType : string read FCaseType write FCaseType stored HasCaseType; + property CatalogNumber : string read FCatalogNumber write FCatalogNumber stored HasCatalogNumber; + property CDRWDescription : string read FCDRWDescription write FCDRWDescription stored HasCDRWDescription; + property ChainType : string read FChainType write FChainType stored HasChainType; + property ClaspType : string read FClaspType write FClaspType stored HasClaspType; + property ClothingSize : string read FClothingSize write FClothingSize stored HasClothingSize; + property Color : string read FColor write FColor stored HasColor; + property Compatibility : string read FCompatibility write FCompatibility stored HasCompatibility; + property ComputerHardwareType : string read FComputerHardwareType write FComputerHardwareType stored HasComputerHardwareType; + property ComputerPlatform : string read FComputerPlatform write FComputerPlatform stored HasComputerPlatform; + property Connectivity : string read FConnectivity write FConnectivity stored HasConnectivity; + property ContinuousShootingSpeed : DecimalWithUnits read FContinuousShootingSpeed write FContinuousShootingSpeed stored HasContinuousShootingSpeed; + property Country : string read FCountry write FCountry stored HasCountry; + property CountryOfOrigin : string read FCountryOfOrigin write FCountryOfOrigin stored HasCountryOfOrigin; + property CPUManufacturer : string read FCPUManufacturer write FCPUManufacturer stored HasCPUManufacturer; + property CPUSpeed : DecimalWithUnits read FCPUSpeed write FCPUSpeed stored HasCPUSpeed; + property CPUType : string read FCPUType write FCPUType stored HasCPUType; + property Creator : MerchantItemAttributes_CreatorArray read FCreator write FCreator; + property Cuisine : string read FCuisine write FCuisine stored HasCuisine; + property Customizable : string read FCustomizable write FCustomizable stored HasCustomizable; + property DelayBetweenShots : DecimalWithUnits read FDelayBetweenShots write FDelayBetweenShots stored HasDelayBetweenShots; + property DeliveryOption : string read FDeliveryOption write FDeliveryOption stored HasDeliveryOption; + property Department : string read FDepartment write FDepartment stored HasDepartment; + property Description : string read FDescription write FDescription stored HasDescription; + property DeweyDecimalNumber : string read FDeweyDecimalNumber write FDeweyDecimalNumber stored HasDeweyDecimalNumber; + property DialColor : string read FDialColor write FDialColor stored HasDialColor; + property DialWindowMaterialType : string read FDialWindowMaterialType write FDialWindowMaterialType stored HasDialWindowMaterialType; + property DigitalZoom : DecimalWithUnits read FDigitalZoom write FDigitalZoom stored HasDigitalZoom; + property Director : MerchantItemAttributes_DirectorArray read FDirector write FDirector; + property DisplaySize : DecimalWithUnits read FDisplaySize write FDisplaySize stored HasDisplaySize; + property DrumSetPieceQuantity : nonNegativeInteger read FDrumSetPieceQuantity write FDrumSetPieceQuantity stored HasDrumSetPieceQuantity; + property DVDLayers : nonNegativeInteger read FDVDLayers write FDVDLayers stored HasDVDLayers; + property DVDRWDescription : string read FDVDRWDescription write FDVDRWDescription stored HasDVDRWDescription; + property DVDSides : nonNegativeInteger read FDVDSides write FDVDSides stored HasDVDSides; + property DPCI : string read FDPCI write FDPCI stored HasDPCI; + property EAN : string read FEAN write FEAN stored HasEAN; + property Edition : string read FEdition write FEdition stored HasEdition; + property ESRBAgeRating : string read FESRBAgeRating write FESRBAgeRating stored HasESRBAgeRating; + property ExternalDisplaySupportDescription : string read FExternalDisplaySupportDescription write FExternalDisplaySupportDescription stored HasExternalDisplaySupportDescription; + property FabricType : string read FFabricType write FFabricType stored HasFabricType; + property FaxNumber : string read FFaxNumber write FFaxNumber stored HasFaxNumber; + property Feature : MerchantItemAttributes_FeatureArray read FFeature write FFeature; + property FirstIssueLeadTime : StringWithUnits read FFirstIssueLeadTime write FFirstIssueLeadTime stored HasFirstIssueLeadTime; + property FloppyDiskDriveDescription : string read FFloppyDiskDriveDescription write FFloppyDiskDriveDescription stored HasFloppyDiskDriveDescription; + property Format : MerchantItemAttributes_FormatArray read FFormat write FFormat; + property FixedShippingCharge : Price read FFixedShippingCharge write FFixedShippingCharge stored HasFixedShippingCharge; + property GemType : string read FGemType write FGemType stored HasGemType; + property GraphicsCardInterface : string read FGraphicsCardInterface write FGraphicsCardInterface stored HasGraphicsCardInterface; + property GraphicsDescription : string read FGraphicsDescription write FGraphicsDescription stored HasGraphicsDescription; + property GraphicsMemorySize : DecimalWithUnits read FGraphicsMemorySize write FGraphicsMemorySize stored HasGraphicsMemorySize; + property GuitarAttribute : string read FGuitarAttribute write FGuitarAttribute stored HasGuitarAttribute; + property GuitarBridgeSystem : string read FGuitarBridgeSystem write FGuitarBridgeSystem stored HasGuitarBridgeSystem; + property GuitarPickThickness : string read FGuitarPickThickness write FGuitarPickThickness stored HasGuitarPickThickness; + property GuitarPickupConfiguration : string read FGuitarPickupConfiguration write FGuitarPickupConfiguration stored HasGuitarPickupConfiguration; + property HardDiskCount : nonNegativeInteger read FHardDiskCount write FHardDiskCount stored HasHardDiskCount; + property HardDiskSize : NonNegativeIntegerWithUnits read FHardDiskSize write FHardDiskSize stored HasHardDiskSize; + property HasAutoFocus : boolean read FHasAutoFocus write FHasAutoFocus stored HasHasAutoFocus; + property HasBurstMode : boolean read FHasBurstMode write FHasBurstMode stored HasHasBurstMode; + property HasInCameraEditing : boolean read FHasInCameraEditing write FHasInCameraEditing stored HasHasInCameraEditing; + property HasRedEyeReduction : boolean read FHasRedEyeReduction write FHasRedEyeReduction stored HasHasRedEyeReduction; + property HasSelfTimer : boolean read FHasSelfTimer write FHasSelfTimer stored HasHasSelfTimer; + property HasTripodMount : boolean read FHasTripodMount write FHasTripodMount stored HasHasTripodMount; + property HasVideoOut : boolean read FHasVideoOut write FHasVideoOut stored HasHasVideoOut; + property HasViewfinder : boolean read FHasViewfinder write FHasViewfinder stored HasHasViewfinder; + property HazardousMaterialType : string read FHazardousMaterialType write FHazardousMaterialType stored HasHazardousMaterialType; + property HoursOfOperation : string read FHoursOfOperation write FHoursOfOperation stored HasHoursOfOperation; + property IncludedSoftware : string read FIncludedSoftware write FIncludedSoftware stored HasIncludedSoftware; + property IncludesMp3Player : boolean read FIncludesMp3Player write FIncludesMp3Player stored HasIncludesMp3Player; + property Indications : string read FIndications write FIndications stored HasIndications; + property Ingredients : string read FIngredients write FIngredients stored HasIngredients; + property InstrumentKey : string read FInstrumentKey write FInstrumentKey stored HasInstrumentKey; + property IsAutographed : boolean read FIsAutographed write FIsAutographed stored HasIsAutographed; + property ISBN : string read FISBN write FISBN stored HasISBN; + property IsFragile : boolean read FIsFragile write FIsFragile stored HasIsFragile; + property IsLabCreated : boolean read FIsLabCreated write FIsLabCreated stored HasIsLabCreated; + property IsMemorabilia : boolean read FIsMemorabilia write FIsMemorabilia stored HasIsMemorabilia; + property ISOEquivalent : NonNegativeIntegerWithUnits read FISOEquivalent write FISOEquivalent stored HasISOEquivalent; + property IssuesPerYear : string read FIssuesPerYear write FIssuesPerYear stored HasIssuesPerYear; + property ItemDimensions : MerchantItemAttributes_ItemDimensions_Type read FItemDimensions write FItemDimensions stored HasItemDimensions; + property KeyboardDescription : string read FKeyboardDescription write FKeyboardDescription stored HasKeyboardDescription; + property _Label : string read F_Label write F_Label stored Has_Label; + property Languages : MerchantItemAttributes_Languages_Type read FLanguages write FLanguages stored HasLanguages; + property LegalDisclaimer : string read FLegalDisclaimer write FLegalDisclaimer stored HasLegalDisclaimer; + property LineVoltage : string read FLineVoltage write FLineVoltage stored HasLineVoltage; + property ListPrice : Price read FListPrice write FListPrice stored HasListPrice; + property MacroFocusRange : string read FMacroFocusRange write FMacroFocusRange stored HasMacroFocusRange; + property MagazineType : string read FMagazineType write FMagazineType stored HasMagazineType; + property MalletHardness : string read FMalletHardness write FMalletHardness stored HasMalletHardness; + property Manufacturer : string read FManufacturer write FManufacturer stored HasManufacturer; + property ManufacturerLaborWarrantyDescription : string read FManufacturerLaborWarrantyDescription write FManufacturerLaborWarrantyDescription stored HasManufacturerLaborWarrantyDescription; + property ManufacturerMaximumAge : DecimalWithUnits read FManufacturerMaximumAge write FManufacturerMaximumAge stored HasManufacturerMaximumAge; + property ManufacturerMinimumAge : DecimalWithUnits read FManufacturerMinimumAge write FManufacturerMinimumAge stored HasManufacturerMinimumAge; + property ManufacturerPartsWarrantyDescription : string read FManufacturerPartsWarrantyDescription write FManufacturerPartsWarrantyDescription stored HasManufacturerPartsWarrantyDescription; + property MaterialType : string read FMaterialType write FMaterialType stored HasMaterialType; + property MaximumAperture : DecimalWithUnits read FMaximumAperture write FMaximumAperture stored HasMaximumAperture; + property MaximumColorDepth : string read FMaximumColorDepth write FMaximumColorDepth stored HasMaximumColorDepth; + property MaximumFocalLength : DecimalWithUnits read FMaximumFocalLength write FMaximumFocalLength stored HasMaximumFocalLength; + property MaximumHighResolutionImages : NonNegativeIntegerWithUnits read FMaximumHighResolutionImages write FMaximumHighResolutionImages stored HasMaximumHighResolutionImages; + property MaximumHorizontalResolution : NonNegativeIntegerWithUnits read FMaximumHorizontalResolution write FMaximumHorizontalResolution stored HasMaximumHorizontalResolution; + property MaximumLowResolutionImages : string read FMaximumLowResolutionImages write FMaximumLowResolutionImages stored HasMaximumLowResolutionImages; + property MaximumResolution : DecimalWithUnits read FMaximumResolution write FMaximumResolution stored HasMaximumResolution; + property MaximumShutterSpeed : DecimalWithUnits read FMaximumShutterSpeed write FMaximumShutterSpeed stored HasMaximumShutterSpeed; + property MaximumVerticalResolution : NonNegativeIntegerWithUnits read FMaximumVerticalResolution write FMaximumVerticalResolution stored HasMaximumVerticalResolution; + property MaximumWeightRecommendation : DecimalWithUnits read FMaximumWeightRecommendation write FMaximumWeightRecommendation stored HasMaximumWeightRecommendation; + property MemorySlotsAvailable : nonNegativeInteger read FMemorySlotsAvailable write FMemorySlotsAvailable stored HasMemorySlotsAvailable; + property MetalStamp : string read FMetalStamp write FMetalStamp stored HasMetalStamp; + property MetalType : string read FMetalType write FMetalType stored HasMetalType; + property MiniMovieDescription : string read FMiniMovieDescription write FMiniMovieDescription stored HasMiniMovieDescription; + property MinimumFocalLength : DecimalWithUnits read FMinimumFocalLength write FMinimumFocalLength stored HasMinimumFocalLength; + property MinimumShutterSpeed : DecimalWithUnits read FMinimumShutterSpeed write FMinimumShutterSpeed stored HasMinimumShutterSpeed; + property Model : string read FModel write FModel stored HasModel; + property ModelYear : nonNegativeInteger read FModelYear write FModelYear stored HasModelYear; + property ModemDescription : string read FModemDescription write FModemDescription stored HasModemDescription; + property MonitorSize : DecimalWithUnits read FMonitorSize write FMonitorSize stored HasMonitorSize; + property MonitorViewableDiagonalSize : DecimalWithUnits read FMonitorViewableDiagonalSize write FMonitorViewableDiagonalSize stored HasMonitorViewableDiagonalSize; + property MouseDescription : string read FMouseDescription write FMouseDescription stored HasMouseDescription; + property MPN : string read FMPN write FMPN stored HasMPN; + property MusicalStyle : string read FMusicalStyle write FMusicalStyle stored HasMusicalStyle; + property NativeResolution : string read FNativeResolution write FNativeResolution stored HasNativeResolution; + property Neighborhood : string read FNeighborhood write FNeighborhood stored HasNeighborhood; + property NetworkInterfaceDescription : string read FNetworkInterfaceDescription write FNetworkInterfaceDescription stored HasNetworkInterfaceDescription; + property NotebookDisplayTechnology : string read FNotebookDisplayTechnology write FNotebookDisplayTechnology stored HasNotebookDisplayTechnology; + property NotebookPointingDeviceDescription : string read FNotebookPointingDeviceDescription write FNotebookPointingDeviceDescription stored HasNotebookPointingDeviceDescription; + property NumberOfDiscs : nonNegativeInteger read FNumberOfDiscs write FNumberOfDiscs stored HasNumberOfDiscs; + property NumberOfIssues : nonNegativeInteger read FNumberOfIssues write FNumberOfIssues stored HasNumberOfIssues; + property NumberOfItems : nonNegativeInteger read FNumberOfItems write FNumberOfItems stored HasNumberOfItems; + property NumberOfKeys : nonNegativeInteger read FNumberOfKeys write FNumberOfKeys stored HasNumberOfKeys; + property NumberOfPages : nonNegativeInteger read FNumberOfPages write FNumberOfPages stored HasNumberOfPages; + property NumberOfPearls : nonNegativeInteger read FNumberOfPearls write FNumberOfPearls stored HasNumberOfPearls; + property NumberOfRapidFireShots : nonNegativeInteger read FNumberOfRapidFireShots write FNumberOfRapidFireShots stored HasNumberOfRapidFireShots; + property NumberOfStones : nonNegativeInteger read FNumberOfStones write FNumberOfStones stored HasNumberOfStones; + property NumberOfStrings : nonNegativeInteger read FNumberOfStrings write FNumberOfStrings stored HasNumberOfStrings; + property NumberOfTracks : nonNegativeInteger read FNumberOfTracks write FNumberOfTracks stored HasNumberOfTracks; + property OpticalZoom : DecimalWithUnits read FOpticalZoom write FOpticalZoom stored HasOpticalZoom; + property OriginalReleaseDate : string read FOriginalReleaseDate write FOriginalReleaseDate stored HasOriginalReleaseDate; + property OutputWattage : nonNegativeInteger read FOutputWattage write FOutputWattage stored HasOutputWattage; + property PackageDimensions : MerchantItemAttributes_PackageDimensions_Type read FPackageDimensions write FPackageDimensions stored HasPackageDimensions; + property PearlLustre : string read FPearlLustre write FPearlLustre stored HasPearlLustre; + property PearlMinimumColor : string read FPearlMinimumColor write FPearlMinimumColor stored HasPearlMinimumColor; + property PearlShape : string read FPearlShape write FPearlShape stored HasPearlShape; + property PearlStringingMethod : string read FPearlStringingMethod write FPearlStringingMethod stored HasPearlStringingMethod; + property PearlSurfaceBlemishes : string read FPearlSurfaceBlemishes write FPearlSurfaceBlemishes stored HasPearlSurfaceBlemishes; + property PearlType : string read FPearlType write FPearlType stored HasPearlType; + property PearlUniformity : string read FPearlUniformity write FPearlUniformity stored HasPearlUniformity; + property PhoneNumber : string read FPhoneNumber write FPhoneNumber stored HasPhoneNumber; + property PhotoFlashType : MerchantItemAttributes_PhotoFlashTypeArray read FPhotoFlashType write FPhotoFlashType; + property PictureFormat : MerchantItemAttributes_PictureFormatArray read FPictureFormat write FPictureFormat; + property Platform : MerchantItemAttributes_PlatformArray read FPlatform write FPlatform; + property PriceRating : nonNegativeInteger read FPriceRating write FPriceRating stored HasPriceRating; + property ProcessorCount : nonNegativeInteger read FProcessorCount write FProcessorCount stored HasProcessorCount; + property ProductGroup : string read FProductGroup write FProductGroup stored HasProductGroup; + property PromotionalTag : string read FPromotionalTag write FPromotionalTag stored HasPromotionalTag; + property POBoxShippingExcluded : string read FPOBoxShippingExcluded write FPOBoxShippingExcluded stored HasPOBoxShippingExcluded; + property PublicationDate : string read FPublicationDate write FPublicationDate stored HasPublicationDate; + property Publisher : string read FPublisher write FPublisher stored HasPublisher; + property PurchasingChannel : MerchantItemAttributes_PurchasingChannelArray read FPurchasingChannel write FPurchasingChannel; + property ReadingLevel : string read FReadingLevel write FReadingLevel stored HasReadingLevel; + property RecorderTrackCount : nonNegativeInteger read FRecorderTrackCount write FRecorderTrackCount stored HasRecorderTrackCount; + property RegionCode : string read FRegionCode write FRegionCode stored HasRegionCode; + property RegionOfOrigin : string read FRegionOfOrigin write FRegionOfOrigin stored HasRegionOfOrigin; + property ReleaseDate : string read FReleaseDate write FReleaseDate stored HasReleaseDate; + property ReturnMethod : MerchantItemAttributes_ReturnMethodArray read FReturnMethod write FReturnMethod; + property RemovableMemory : string read FRemovableMemory write FRemovableMemory stored HasRemovableMemory; + property ResolutionModes : string read FResolutionModes write FResolutionModes stored HasResolutionModes; + property ReturnPolicy : string read FReturnPolicy write FReturnPolicy stored HasReturnPolicy; + property RingSize : string read FRingSize write FRingSize stored HasRingSize; + property SafetyWarning : string read FSafetyWarning write FSafetyWarning stored HasSafetyWarning; + property SalesRestriction : string read FSalesRestriction write FSalesRestriction stored HasSalesRestriction; + property SecondaryCacheSize : NonNegativeIntegerWithUnits read FSecondaryCacheSize write FSecondaryCacheSize stored HasSecondaryCacheSize; + property SettingType : string read FSettingType write FSettingType stored HasSettingType; + property Size : string read FSize write FSize stored HasSize; + property SKU : string read FSKU write FSKU stored HasSKU; + property SoldInStores : string read FSoldInStores write FSoldInStores stored HasSoldInStores; + property SizePerPearl : string read FSizePerPearl write FSizePerPearl stored HasSizePerPearl; + property SkillLevel : string read FSkillLevel write FSkillLevel stored HasSkillLevel; + property SoundCardDescription : string read FSoundCardDescription write FSoundCardDescription stored HasSoundCardDescription; + property SpeakerCount : nonNegativeInteger read FSpeakerCount write FSpeakerCount stored HasSpeakerCount; + property SpeakerDescription : string read FSpeakerDescription write FSpeakerDescription stored HasSpeakerDescription; + property SpecialFeatures : MerchantItemAttributes_SpecialFeaturesArray read FSpecialFeatures write FSpecialFeatures; + property StoneClarity : string read FStoneClarity write FStoneClarity stored HasStoneClarity; + property StoneColor : string read FStoneColor write FStoneColor stored HasStoneColor; + property StoneCut : string read FStoneCut write FStoneCut stored HasStoneCut; + property StoneShape : string read FStoneShape write FStoneShape stored HasStoneShape; + property StoneWeight : DecimalWithUnits read FStoneWeight write FStoneWeight stored HasStoneWeight; + property Studio : string read FStudio write FStudio stored HasStudio; + property SubscriptionLength : NonNegativeIntegerWithUnits read FSubscriptionLength write FSubscriptionLength stored HasSubscriptionLength; + property SupportedImageType : MerchantItemAttributes_SupportedImageTypeArray read FSupportedImageType write FSupportedImageType; + property SystemBusSpeed : DecimalWithUnits read FSystemBusSpeed write FSystemBusSpeed stored HasSystemBusSpeed; + property SystemMemorySizeMax : DecimalWithUnits read FSystemMemorySizeMax write FSystemMemorySizeMax stored HasSystemMemorySizeMax; + property SystemMemorySize : DecimalWithUnits read FSystemMemorySize write FSystemMemorySize stored HasSystemMemorySize; + property SystemMemoryType : string read FSystemMemoryType write FSystemMemoryType stored HasSystemMemoryType; + property TellingPageIndicator : string read FTellingPageIndicator write FTellingPageIndicator stored HasTellingPageIndicator; + property TheatricalReleaseDate : string read FTheatricalReleaseDate write FTheatricalReleaseDate stored HasTheatricalReleaseDate; + property Title : string read FTitle write FTitle stored HasTitle; + property TotalDiamondWeight : DecimalWithUnits read FTotalDiamondWeight write FTotalDiamondWeight stored HasTotalDiamondWeight; + property TotalExternalBaysFree : nonNegativeInteger read FTotalExternalBaysFree write FTotalExternalBaysFree stored HasTotalExternalBaysFree; + property TotalFirewirePorts : nonNegativeInteger read FTotalFirewirePorts write FTotalFirewirePorts stored HasTotalFirewirePorts; + property TotalGemWeight : DecimalWithUnits read FTotalGemWeight write FTotalGemWeight stored HasTotalGemWeight; + property TotalInternalBaysFree : nonNegativeInteger read FTotalInternalBaysFree write FTotalInternalBaysFree stored HasTotalInternalBaysFree; + property TotalMetalWeight : DecimalWithUnits read FTotalMetalWeight write FTotalMetalWeight stored HasTotalMetalWeight; + property TotalNTSCPALPorts : nonNegativeInteger read FTotalNTSCPALPorts write FTotalNTSCPALPorts stored HasTotalNTSCPALPorts; + property TotalParallelPorts : nonNegativeInteger read FTotalParallelPorts write FTotalParallelPorts stored HasTotalParallelPorts; + property TotalPCCardSlots : nonNegativeInteger read FTotalPCCardSlots write FTotalPCCardSlots stored HasTotalPCCardSlots; + property TotalPCISlotsFree : nonNegativeInteger read FTotalPCISlotsFree write FTotalPCISlotsFree stored HasTotalPCISlotsFree; + property TotalSerialPorts : nonNegativeInteger read FTotalSerialPorts write FTotalSerialPorts stored HasTotalSerialPorts; + property TotalSVideoOutPorts : nonNegativeInteger read FTotalSVideoOutPorts write FTotalSVideoOutPorts stored HasTotalSVideoOutPorts; + property TotalUSB2Ports : nonNegativeInteger read FTotalUSB2Ports write FTotalUSB2Ports stored HasTotalUSB2Ports; + property TotalUSBPorts : nonNegativeInteger read FTotalUSBPorts write FTotalUSBPorts stored HasTotalUSBPorts; + property TotalVGAOutPorts : nonNegativeInteger read FTotalVGAOutPorts write FTotalVGAOutPorts stored HasTotalVGAOutPorts; + property UPC : string read FUPC write FUPC stored HasUPC; + property VariationDenomination : string read FVariationDenomination write FVariationDenomination stored HasVariationDenomination; + property VariationDescription : string read FVariationDescription write FVariationDescription stored HasVariationDescription; + property VendorRebate : MerchantItemAttributes_VendorRebate_Type read FVendorRebate write FVendorRebate stored HasVendorRebate; + property Warranty : string read FWarranty write FWarranty stored HasWarranty; + property WatchMovementType : string read FWatchMovementType write FWatchMovementType stored HasWatchMovementType; + property WebsiteBuyability : string read FWebsiteBuyability write FWebsiteBuyability stored HasWebsiteBuyability; + property WaterResistanceDepth : DecimalWithUnits read FWaterResistanceDepth write FWaterResistanceDepth stored HasWaterResistanceDepth; + property WirelessMicrophoneFrequency : nonNegativeInteger read FWirelessMicrophoneFrequency write FWirelessMicrophoneFrequency stored HasWirelessMicrophoneFrequency; + end; + + OfferSummary_Type = class(TBaseComplexRemotable) + private + FLowestNewPrice : Price; + FLowestUsedPrice : Price; + FLowestCollectiblePrice : Price; + FLowestRefurbishedPrice : Price; + FTotalNew : string; + FTotalUsed : string; + FTotalCollectible : string; + FTotalRefurbished : string; + private + function HasLowestNewPrice() : Boolean; + function HasLowestUsedPrice() : Boolean; + function HasLowestCollectiblePrice() : Boolean; + function HasLowestRefurbishedPrice() : Boolean; + function HasTotalNew() : Boolean; + function HasTotalUsed() : Boolean; + function HasTotalCollectible() : Boolean; + function HasTotalRefurbished() : Boolean; + public + destructor Destroy();override; + published + property LowestNewPrice : Price read FLowestNewPrice write FLowestNewPrice stored HasLowestNewPrice; + property LowestUsedPrice : Price read FLowestUsedPrice write FLowestUsedPrice stored HasLowestUsedPrice; + property LowestCollectiblePrice : Price read FLowestCollectiblePrice write FLowestCollectiblePrice stored HasLowestCollectiblePrice; + property LowestRefurbishedPrice : Price read FLowestRefurbishedPrice write FLowestRefurbishedPrice stored HasLowestRefurbishedPrice; + property TotalNew : string read FTotalNew write FTotalNew stored HasTotalNew; + property TotalUsed : string read FTotalUsed write FTotalUsed stored HasTotalUsed; + property TotalCollectible : string read FTotalCollectible write FTotalCollectible stored HasTotalCollectible; + property TotalRefurbished : string read FTotalRefurbished write FTotalRefurbished stored HasTotalRefurbished; + end; + + Offers_Type = class(TBaseComplexRemotable) + private + FTotalOffers : nonNegativeInteger; + FTotalOfferPages : nonNegativeInteger; + FOffer : Offers_OfferArray; + private + function HasTotalOffers() : Boolean; + function HasTotalOfferPages() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property TotalOffers : nonNegativeInteger read FTotalOffers write FTotalOffers stored HasTotalOffers; + property TotalOfferPages : nonNegativeInteger read FTotalOfferPages write FTotalOfferPages stored HasTotalOfferPages; + property Offer : Offers_OfferArray read FOffer write FOffer; + end; + + VariationSummary_Type = class(TBaseComplexRemotable) + private + FLowestPrice : Price; + FHighestPrice : Price; + FLowestSalePrice : Price; + FHighestSalePrice : Price; + FSingleMerchantId : string; + private + function HasLowestPrice() : Boolean; + function HasHighestPrice() : Boolean; + function HasLowestSalePrice() : Boolean; + function HasHighestSalePrice() : Boolean; + function HasSingleMerchantId() : Boolean; + public + destructor Destroy();override; + published + property LowestPrice : Price read FLowestPrice write FLowestPrice stored HasLowestPrice; + property HighestPrice : Price read FHighestPrice write FHighestPrice stored HasHighestPrice; + property LowestSalePrice : Price read FLowestSalePrice write FLowestSalePrice stored HasLowestSalePrice; + property HighestSalePrice : Price read FHighestSalePrice write FHighestSalePrice stored HasHighestSalePrice; + property SingleMerchantId : string read FSingleMerchantId write FSingleMerchantId stored HasSingleMerchantId; + end; + + Variations_Type = class(TBaseComplexRemotable) + private + FTotalVariations : nonNegativeInteger; + FTotalVariationPages : nonNegativeInteger; + FVariationDimensions : VariationDimensions_Type; + F_Item : Variations__ItemArray; + private + function HasTotalVariations() : Boolean; + function HasTotalVariationPages() : Boolean; + function HasVariationDimensions() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property TotalVariations : nonNegativeInteger read FTotalVariations write FTotalVariations stored HasTotalVariations; + property TotalVariationPages : nonNegativeInteger read FTotalVariationPages write FTotalVariationPages stored HasTotalVariationPages; + property VariationDimensions : VariationDimensions_Type read FVariationDimensions write FVariationDimensions stored HasVariationDimensions; + property _Item : Variations__ItemArray read F_Item write F_Item; + end; + + SearchInside_Type = class(TBaseComplexRemotable) + private + FTotalExcerpts : nonNegativeInteger; + FExcerpt : SearchInside_Excerpt_Type; + private + function HasTotalExcerpts() : Boolean; + function HasExcerpt() : Boolean; + public + destructor Destroy();override; + published + property TotalExcerpts : nonNegativeInteger read FTotalExcerpts write FTotalExcerpts stored HasTotalExcerpts; + property Excerpt : SearchInside_Excerpt_Type read FExcerpt write FExcerpt stored HasExcerpt; + end; + + Item_AlternateVersions_Type_AlternateVersion_Type = class(TBaseComplexRemotable) + private + FASIN : string; + FTitle : string; + FBinding : string; + private + function HasTitle() : Boolean; + function HasBinding() : Boolean; + published + property ASIN : string read FASIN write FASIN; + property Title : string read FTitle write FTitle stored HasTitle; + property Binding : string read FBinding write FBinding stored HasBinding; + end; + + Offer_Type = class(TBaseComplexRemotable) + private + FMerchant : Merchant_Type; + FSeller : Seller_Type; + FOfferAttributes : OfferAttributes_Type; + FOfferListing : Offer_OfferListingArray; + FLoyaltyPoints : LoyaltyPoints_Type; + FPromotions : Promotions_Type; + private + function HasMerchant() : Boolean; + function HasSeller() : Boolean; + function HasOfferAttributes() : Boolean; + function HasLoyaltyPoints() : Boolean; + function HasPromotions() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property Merchant : Merchant_Type read FMerchant write FMerchant stored HasMerchant; + property Seller : Seller_Type read FSeller write FSeller stored HasSeller; + property OfferAttributes : OfferAttributes_Type read FOfferAttributes write FOfferAttributes stored HasOfferAttributes; + property OfferListing : Offer_OfferListingArray read FOfferListing write FOfferListing; + property LoyaltyPoints : LoyaltyPoints_Type read FLoyaltyPoints write FLoyaltyPoints stored HasLoyaltyPoints; + property Promotions : Promotions_Type read FPromotions write FPromotions stored HasPromotions; + end; + + Merchant_Type = class(TBaseComplexRemotable) + private + FMerchantId : string; + FName : string; + FGlancePage : string; + FAverageFeedbackRating : Extended; + FTotalFeedback : nonNegativeInteger; + FTotalFeedbackPages : nonNegativeInteger; + private + function HasName() : Boolean; + function HasGlancePage() : Boolean; + function HasAverageFeedbackRating() : Boolean; + function HasTotalFeedback() : Boolean; + function HasTotalFeedbackPages() : Boolean; + published + property MerchantId : string read FMerchantId write FMerchantId; + property Name : string read FName write FName stored HasName; + property GlancePage : string read FGlancePage write FGlancePage stored HasGlancePage; + property AverageFeedbackRating : Extended read FAverageFeedbackRating write FAverageFeedbackRating stored HasAverageFeedbackRating; + property TotalFeedback : nonNegativeInteger read FTotalFeedback write FTotalFeedback stored HasTotalFeedback; + property TotalFeedbackPages : nonNegativeInteger read FTotalFeedbackPages write FTotalFeedbackPages stored HasTotalFeedbackPages; + end; + + OfferAttributes_Type = class(TBaseComplexRemotable) + private + FCondition : string; + FSubCondition : string; + FConditionNote : string; + FWillShipExpedited : boolean; + FWillShipInternational : boolean; + private + function HasCondition() : Boolean; + function HasSubCondition() : Boolean; + function HasConditionNote() : Boolean; + function HasWillShipExpedited() : Boolean; + function HasWillShipInternational() : Boolean; + published + property Condition : string read FCondition write FCondition stored HasCondition; + property SubCondition : string read FSubCondition write FSubCondition stored HasSubCondition; + property ConditionNote : string read FConditionNote write FConditionNote stored HasConditionNote; + property WillShipExpedited : boolean read FWillShipExpedited write FWillShipExpedited stored HasWillShipExpedited; + property WillShipInternational : boolean read FWillShipInternational write FWillShipInternational stored HasWillShipInternational; + end; + + OfferListing_Type = class(TBaseComplexRemotable) + private + FOfferListingId : string; + FExchangeId : string; + FPrice : Price; + FSalePrice : Price; + FAmountSaved : Price; + FPercentageSaved : nonNegativeInteger; + FAvailability : string; + FAvailabilityAttributes : OfferListing_AvailabilityAttributes_Type; + FQuantity : integer; + FISPUStoreAddress : Address; + FISPUStoreHours : string; + FIsEligibleForSuperSaverShipping : boolean; + FSalesRestriction : string; + FShippingCharge : OfferListing_ShippingChargeArray; + private + function HasOfferListingId() : Boolean; + function HasExchangeId() : Boolean; + function HasPrice() : Boolean; + function HasSalePrice() : Boolean; + function HasAmountSaved() : Boolean; + function HasPercentageSaved() : Boolean; + function HasAvailability() : Boolean; + function HasAvailabilityAttributes() : Boolean; + function HasQuantity() : Boolean; + function HasISPUStoreAddress() : Boolean; + function HasISPUStoreHours() : Boolean; + function HasIsEligibleForSuperSaverShipping() : Boolean; + function HasSalesRestriction() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property OfferListingId : string read FOfferListingId write FOfferListingId stored HasOfferListingId; + property ExchangeId : string read FExchangeId write FExchangeId stored HasExchangeId; + property Price : Price read FPrice write FPrice stored HasPrice; + property SalePrice : Price read FSalePrice write FSalePrice stored HasSalePrice; + property AmountSaved : Price read FAmountSaved write FAmountSaved stored HasAmountSaved; + property PercentageSaved : nonNegativeInteger read FPercentageSaved write FPercentageSaved stored HasPercentageSaved; + property Availability : string read FAvailability write FAvailability stored HasAvailability; + property AvailabilityAttributes : OfferListing_AvailabilityAttributes_Type read FAvailabilityAttributes write FAvailabilityAttributes stored HasAvailabilityAttributes; + property Quantity : integer read FQuantity write FQuantity stored HasQuantity; + property ISPUStoreAddress : Address read FISPUStoreAddress write FISPUStoreAddress stored HasISPUStoreAddress; + property ISPUStoreHours : string read FISPUStoreHours write FISPUStoreHours stored HasISPUStoreHours; + property IsEligibleForSuperSaverShipping : boolean read FIsEligibleForSuperSaverShipping write FIsEligibleForSuperSaverShipping stored HasIsEligibleForSuperSaverShipping; + property SalesRestriction : string read FSalesRestriction write FSalesRestriction stored HasSalesRestriction; + property ShippingCharge : OfferListing_ShippingChargeArray read FShippingCharge write FShippingCharge; + end; + + LoyaltyPoints_Type = class(TBaseComplexRemotable) + private + FPoints : nonNegativeInteger; + FTypicalRedemptionValue : Price; + private + function HasPoints() : Boolean; + function HasTypicalRedemptionValue() : Boolean; + public + destructor Destroy();override; + published + property Points : nonNegativeInteger read FPoints write FPoints stored HasPoints; + property TypicalRedemptionValue : Price read FTypicalRedemptionValue write FTypicalRedemptionValue stored HasTypicalRedemptionValue; + end; + + OfferListing_AvailabilityAttributes_Type = class(TBaseComplexRemotable) + private + FAvailabilityType : string; + FIsPreorder : boolean; + FMinimumHours : integer; + FMaximumHours : integer; + private + function HasAvailabilityType() : Boolean; + function HasIsPreorder() : Boolean; + function HasMinimumHours() : Boolean; + function HasMaximumHours() : Boolean; + published + property AvailabilityType : string read FAvailabilityType write FAvailabilityType stored HasAvailabilityType; + property IsPreorder : boolean read FIsPreorder write FIsPreorder stored HasIsPreorder; + property MinimumHours : integer read FMinimumHours write FMinimumHours stored HasMinimumHours; + property MaximumHours : integer read FMaximumHours write FMaximumHours stored HasMaximumHours; + end; + + Address = class(TBaseComplexRemotable) + private + FName : string; + FAddress1 : string; + FAddress2 : string; + FAddress3 : string; + FCity : string; + FState : string; + FPostalCode : string; + FCountry : string; + private + function HasName() : Boolean; + function HasAddress1() : Boolean; + function HasAddress2() : Boolean; + function HasAddress3() : Boolean; + function HasCity() : Boolean; + function HasState() : Boolean; + function HasPostalCode() : Boolean; + function HasCountry() : Boolean; + published + property Name : string read FName write FName stored HasName; + property Address1 : string read FAddress1 write FAddress1 stored HasAddress1; + property Address2 : string read FAddress2 write FAddress2 stored HasAddress2; + property Address3 : string read FAddress3 write FAddress3 stored HasAddress3; + property City : string read FCity write FCity stored HasCity; + property State : string read FState write FState stored HasState; + property PostalCode : string read FPostalCode write FPostalCode stored HasPostalCode; + property Country : string read FCountry write FCountry stored HasCountry; + end; + + OfferListing_ShippingCharge_Type = class(TBaseComplexRemotable) + private + FShippingType : string; + FShippingPrice : Price; + public + destructor Destroy();override; + published + property ShippingType : string read FShippingType write FShippingType; + property ShippingPrice : Price read FShippingPrice write FShippingPrice; + end; + + EditorialReview_Type = class(TBaseComplexRemotable) + private + FSource : string; + FContent : string; + private + function HasSource() : Boolean; + function HasContent() : Boolean; + published + property Source : string read FSource write FSource stored HasSource; + property Content : string read FContent write FContent stored HasContent; + end; + + Collections_Collection_Type_CollectionSummary_Type = class(TBaseComplexRemotable) + private + FLowestListPrice : Price; + FHighestListPrice : Price; + FLowestSalePrice : Price; + FHighestSalePrice : Price; + private + function HasLowestListPrice() : Boolean; + function HasHighestListPrice() : Boolean; + function HasLowestSalePrice() : Boolean; + function HasHighestSalePrice() : Boolean; + public + destructor Destroy();override; + published + property LowestListPrice : Price read FLowestListPrice write FLowestListPrice stored HasLowestListPrice; + property HighestListPrice : Price read FHighestListPrice write FHighestListPrice stored HasHighestListPrice; + property LowestSalePrice : Price read FLowestSalePrice write FLowestSalePrice stored HasLowestSalePrice; + property HighestSalePrice : Price read FHighestSalePrice write FHighestSalePrice stored HasHighestSalePrice; + end; + + Collections_Collection_Type_CollectionParent_Type = class(TBaseComplexRemotable) + private + FASIN : string; + FTitle : string; + private + function HasASIN() : Boolean; + function HasTitle() : Boolean; + published + property ASIN : string read FASIN write FASIN stored HasASIN; + property Title : string read FTitle write FTitle stored HasTitle; + end; + + Collections_Collection_Type_CollectionItem_Type = class(TBaseComplexRemotable) + private + FASIN : string; + FTitle : string; + private + function HasASIN() : Boolean; + function HasTitle() : Boolean; + published + property ASIN : string read FASIN write FASIN stored HasASIN; + property Title : string read FTitle write FTitle stored HasTitle; + end; + + Collections_Collection_Type = class(TBaseComplexRemotable) + private + FCollectionSummary : Collections_Collection_Type_CollectionSummary_Type; + FCollectionParent : Collections_Collection_Type_CollectionParent_Type; + FCollectionItem : Collections_Collection_Type_CollectionItemArray; + private + function HasCollectionSummary() : Boolean; + function HasCollectionParent() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property CollectionSummary : Collections_Collection_Type_CollectionSummary_Type read FCollectionSummary write FCollectionSummary stored HasCollectionSummary; + property CollectionParent : Collections_Collection_Type_CollectionParent_Type read FCollectionParent write FCollectionParent stored HasCollectionParent; + property CollectionItem : Collections_Collection_Type_CollectionItemArray read FCollectionItem write FCollectionItem; + end; + + Review_Type = class(TBaseComplexRemotable) + private + FASIN : string; + FRating : Extended; + FHelpfulVotes : nonNegativeInteger; + FCustomerId : string; + FReviewer : Reviewer_Type; + FTotalVotes : nonNegativeInteger; + FDate : string; + FSummary : string; + FContent : string; + private + function HasASIN() : Boolean; + function HasRating() : Boolean; + function HasHelpfulVotes() : Boolean; + function HasCustomerId() : Boolean; + function HasReviewer() : Boolean; + function HasTotalVotes() : Boolean; + function HasDate() : Boolean; + function HasSummary() : Boolean; + function HasContent() : Boolean; + public + destructor Destroy();override; + published + property ASIN : string read FASIN write FASIN stored HasASIN; + property Rating : Extended read FRating write FRating stored HasRating; + property HelpfulVotes : nonNegativeInteger read FHelpfulVotes write FHelpfulVotes stored HasHelpfulVotes; + property CustomerId : string read FCustomerId write FCustomerId stored HasCustomerId; + property Reviewer : Reviewer_Type read FReviewer write FReviewer stored HasReviewer; + property TotalVotes : nonNegativeInteger read FTotalVotes write FTotalVotes stored HasTotalVotes; + property Date : string read FDate write FDate stored HasDate; + property Summary : string read FSummary write FSummary stored HasSummary; + property Content : string read FContent write FContent stored HasContent; + end; + + Reviewer_Type = class(TBaseComplexRemotable) + private + FCustomerId : string; + FName : string; + FNickname : string; + FLocation : string; + private + function HasCustomerId() : Boolean; + function HasName() : Boolean; + function HasNickname() : Boolean; + function HasLocation() : Boolean; + published + property CustomerId : string read FCustomerId write FCustomerId stored HasCustomerId; + property Name : string read FName write FName stored HasName; + property Nickname : string read FNickname write FNickname stored HasNickname; + property Location : string read FLocation write FLocation stored HasLocation; + end; + + Tracks_Disc_Type_Track_Type = class(TComplexStringContentRemotable) + private + FNumber : positiveInteger; + published + property Number : positiveInteger read FNumber write FNumber; + end; + + Tracks_Disc_Type = class(TBaseComplexRemotable) + private + FTrack : Tracks_Disc_Type_TrackArray; + FNumber : positiveInteger; + public + constructor Create();override; + destructor Destroy();override; + published + property Track : Tracks_Disc_Type_TrackArray read FTrack write FTrack; + property Number : positiveInteger read FNumber write FNumber; + end; + + SimilarProducts_SimilarProduct_Type = class(TBaseComplexRemotable) + private + FASIN : string; + FTitle : string; + private + function HasASIN() : Boolean; + function HasTitle() : Boolean; + published + property ASIN : string read FASIN write FASIN stored HasASIN; + property Title : string read FTitle write FTitle stored HasTitle; + end; + + TopSellers_TopSeller_Type = class(TBaseComplexRemotable) + private + FASIN : string; + FTitle : string; + private + function HasASIN() : Boolean; + function HasTitle() : Boolean; + published + property ASIN : string read FASIN write FASIN stored HasASIN; + property Title : string read FTitle write FTitle stored HasTitle; + end; + + NewReleases_NewRelease_Type = class(TBaseComplexRemotable) + private + FASIN : string; + FTitle : string; + private + function HasASIN() : Boolean; + function HasTitle() : Boolean; + published + property ASIN : string read FASIN write FASIN stored HasASIN; + property Title : string read FTitle write FTitle stored HasTitle; + end; + + SimilarViewedProducts_SimilarViewedProduct_Type = class(TBaseComplexRemotable) + private + FASIN : string; + FTitle : string; + private + function HasASIN() : Boolean; + function HasTitle() : Boolean; + published + property ASIN : string read FASIN write FASIN stored HasASIN; + property Title : string read FTitle write FTitle stored HasTitle; + end; + + OtherCategoriesSimilarProducts_OtherCategoriesSimilarProduct_Type = class(TBaseComplexRemotable) + private + FASIN : string; + FTitle : string; + private + function HasASIN() : Boolean; + function HasTitle() : Boolean; + published + property ASIN : string read FASIN write FASIN stored HasASIN; + property Title : string read FTitle write FTitle stored HasTitle; + end; + + Accessories_Accessory_Type = class(TBaseComplexRemotable) + private + FASIN : string; + FTitle : string; + private + function HasASIN() : Boolean; + function HasTitle() : Boolean; + published + property ASIN : string read FASIN write FASIN stored HasASIN; + property Title : string read FTitle write FTitle stored HasTitle; + end; + + Promotion_Type = class(TBaseComplexRemotable) + private + FSummary : Promotion_Summary_Type; + FDetails : Promotion_Details_Type; + private + function HasSummary() : Boolean; + function HasDetails() : Boolean; + public + destructor Destroy();override; + published + property Summary : Promotion_Summary_Type read FSummary write FSummary stored HasSummary; + property Details : Promotion_Details_Type read FDetails write FDetails stored HasDetails; + end; + + Promotion_Summary_Type = class(TBaseComplexRemotable) + private + FPromotionId : string; + FCategory : string; + FStartDate : string; + FEndDate : string; + FEligibilityRequirementDescription : string; + FBenefitDescription : string; + FTermsAndConditions : string; + private + function HasCategory() : Boolean; + function HasStartDate() : Boolean; + function HasEndDate() : Boolean; + function HasEligibilityRequirementDescription() : Boolean; + function HasBenefitDescription() : Boolean; + function HasTermsAndConditions() : Boolean; + published + property PromotionId : string read FPromotionId write FPromotionId; + property Category : string read FCategory write FCategory stored HasCategory; + property StartDate : string read FStartDate write FStartDate stored HasStartDate; + property EndDate : string read FEndDate write FEndDate stored HasEndDate; + property EligibilityRequirementDescription : string read FEligibilityRequirementDescription write FEligibilityRequirementDescription stored HasEligibilityRequirementDescription; + property BenefitDescription : string read FBenefitDescription write FBenefitDescription stored HasBenefitDescription; + property TermsAndConditions : string read FTermsAndConditions write FTermsAndConditions stored HasTermsAndConditions; + end; + + PromotionItemApplicability = class(TBaseComplexRemotable) + private + FASIN : string; + FIsInBenefitSet : boolean; + FIsInEligibilityRequirementSet : boolean; + published + property ASIN : string read FASIN write FASIN; + property IsInBenefitSet : boolean read FIsInBenefitSet write FIsInBenefitSet; + property IsInEligibilityRequirementSet : boolean read FIsInEligibilityRequirementSet write FIsInEligibilityRequirementSet; + end; + + Promotion_Details_Type = class(TBaseComplexRemotable) + private + FMerchantId : string; + FOwningMerchantId : string; + FPromotionId : string; + FPromotionCategory : string; + FMerchantPromotionId : string; + FGroupClaimCode : string; + FCouponCombinationType : string; + FStartDate : string; + FEndDate : string; + FTermsAndConditions : string; + FEligibilityRequirements : PromotionEligibilityRequirements; + FBenefits : PromotionBenefits; + FItemApplicability : PromotionItemApplicability; + private + function HasMerchantPromotionId() : Boolean; + function HasGroupClaimCode() : Boolean; + function HasCouponCombinationType() : Boolean; + function HasStartDate() : Boolean; + function HasEndDate() : Boolean; + function HasTermsAndConditions() : Boolean; + function HasEligibilityRequirements() : Boolean; + function HasBenefits() : Boolean; + function HasItemApplicability() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property MerchantId : string read FMerchantId write FMerchantId; + property OwningMerchantId : string read FOwningMerchantId write FOwningMerchantId; + property PromotionId : string read FPromotionId write FPromotionId; + property PromotionCategory : string read FPromotionCategory write FPromotionCategory; + property MerchantPromotionId : string read FMerchantPromotionId write FMerchantPromotionId stored HasMerchantPromotionId; + property GroupClaimCode : string read FGroupClaimCode write FGroupClaimCode stored HasGroupClaimCode; + property CouponCombinationType : string read FCouponCombinationType write FCouponCombinationType stored HasCouponCombinationType; + property StartDate : string read FStartDate write FStartDate stored HasStartDate; + property EndDate : string read FEndDate write FEndDate stored HasEndDate; + property TermsAndConditions : string read FTermsAndConditions write FTermsAndConditions stored HasTermsAndConditions; + property EligibilityRequirements : PromotionEligibilityRequirements read FEligibilityRequirements write FEligibilityRequirements stored HasEligibilityRequirements; + property Benefits : PromotionBenefits read FBenefits write FBenefits stored HasBenefits; + property ItemApplicability : PromotionItemApplicability read FItemApplicability write FItemApplicability stored HasItemApplicability; + end; + + PromotionEligibilityRequirement = class(TBaseComplexRemotable) + private + FEligibilityRequirementType : string; + FQuantity : integer; + FCurrencyAmount : Price; + private + function HasQuantity() : Boolean; + function HasCurrencyAmount() : Boolean; + public + destructor Destroy();override; + published + property EligibilityRequirementType : string read FEligibilityRequirementType write FEligibilityRequirementType; + property Quantity : integer read FQuantity write FQuantity stored HasQuantity; + property CurrencyAmount : Price read FCurrencyAmount write FCurrencyAmount stored HasCurrencyAmount; + end; + + PromotionBenefit = class(TBaseComplexRemotable) + private + FBenefitType : string; + FComponentType : string; + FQuantity : integer; + FPercentOff : Double; + FFixedAmount : Price; + FCeiling : Price; + private + function HasQuantity() : Boolean; + function HasPercentOff() : Boolean; + function HasFixedAmount() : Boolean; + function HasCeiling() : Boolean; + public + destructor Destroy();override; + published + property BenefitType : string read FBenefitType write FBenefitType; + property ComponentType : string read FComponentType write FComponentType; + property Quantity : integer read FQuantity write FQuantity stored HasQuantity; + property PercentOff : Double read FPercentOff write FPercentOff stored HasPercentOff; + property FixedAmount : Price read FFixedAmount write FFixedAmount stored HasFixedAmount; + property Ceiling : Price read FCeiling write FCeiling stored HasCeiling; + end; + + BrowseNode_Type = class(TBaseComplexRemotable) + private + FBrowseNodeId : string; + FName : string; + FIsCategoryRoot : boolean; + FChildren : BrowseNode_Children_Type; + FAncestors : BrowseNode_Ancestors_Type; + FTopSellers : TopSellers_Type; + FNewReleases : NewReleases_Type; + private + function HasBrowseNodeId() : Boolean; + function HasName() : Boolean; + function HasIsCategoryRoot() : Boolean; + function HasChildren() : Boolean; + function HasAncestors() : Boolean; + function HasTopSellers() : Boolean; + function HasNewReleases() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property BrowseNodeId : string read FBrowseNodeId write FBrowseNodeId stored HasBrowseNodeId; + property Name : string read FName write FName stored HasName; + property IsCategoryRoot : boolean read FIsCategoryRoot write FIsCategoryRoot stored HasIsCategoryRoot; + property Children : BrowseNode_Children_Type read FChildren write FChildren stored HasChildren; + property Ancestors : BrowseNode_Ancestors_Type read FAncestors write FAncestors stored HasAncestors; + property TopSellers : TopSellers_Type read FTopSellers write FTopSellers stored HasTopSellers; + property NewReleases : NewReleases_Type read FNewReleases write FNewReleases stored HasNewReleases; + end; + + ListmaniaLists_ListmaniaList_Type = class(TBaseComplexRemotable) + private + FListId : string; + FListName : string; + private + function HasListName() : Boolean; + published + property ListId : string read FListId write FListId; + property ListName : string read FListName write FListName stored HasListName; + end; + + SearchInside_Excerpt_Type = class(TBaseComplexRemotable) + private + FChecksum : string; + FPageType : string; + FPageNumber : string; + FSequenceNumber : string; + FText : string; + private + function HasChecksum() : Boolean; + function HasPageType() : Boolean; + function HasPageNumber() : Boolean; + function HasSequenceNumber() : Boolean; + function HasText() : Boolean; + published + property Checksum : string read FChecksum write FChecksum stored HasChecksum; + property PageType : string read FPageType write FPageType stored HasPageType; + property PageNumber : string read FPageNumber write FPageNumber stored HasPageNumber; + property SequenceNumber : string read FSequenceNumber write FSequenceNumber stored HasSequenceNumber; + property Text : string read FText write FText stored HasText; + end; + + CartItem = class(TBaseComplexRemotable) + private + FCartItemId : string; + FASIN : string; + FExchangeId : string; + FMerchantId : string; + FSellerId : string; + FSellerNickname : string; + FQuantity : string; + FTitle : string; + FProductGroup : string; + FListOwner : string; + FListType : string; + FPrice : Price; + FItemTotal : Price; + private + function HasASIN() : Boolean; + function HasExchangeId() : Boolean; + function HasMerchantId() : Boolean; + function HasSellerId() : Boolean; + function HasSellerNickname() : Boolean; + function HasTitle() : Boolean; + function HasProductGroup() : Boolean; + function HasListOwner() : Boolean; + function HasListType() : Boolean; + function HasPrice() : Boolean; + function HasItemTotal() : Boolean; + public + destructor Destroy();override; + published + property CartItemId : string read FCartItemId write FCartItemId; + property ASIN : string read FASIN write FASIN stored HasASIN; + property ExchangeId : string read FExchangeId write FExchangeId stored HasExchangeId; + property MerchantId : string read FMerchantId write FMerchantId stored HasMerchantId; + property SellerId : string read FSellerId write FSellerId stored HasSellerId; + property SellerNickname : string read FSellerNickname write FSellerNickname stored HasSellerNickname; + property Quantity : string read FQuantity write FQuantity; + property Title : string read FTitle write FTitle stored HasTitle; + property ProductGroup : string read FProductGroup write FProductGroup stored HasProductGroup; + property ListOwner : string read FListOwner write FListOwner stored HasListOwner; + property ListType : string read FListType write FListType stored HasListType; + property Price : Price read FPrice write FPrice stored HasPrice; + property ItemTotal : Price read FItemTotal write FItemTotal stored HasItemTotal; + end; + + Transaction_Totals_Type = class(TBaseComplexRemotable) + private + FTotal : Price; + FSubtotal : Price; + FTax : Price; + FShippingCharge : Price; + FPromotion : Price; + public + destructor Destroy();override; + published + property Total : Price read FTotal write FTotal; + property Subtotal : Price read FSubtotal write FSubtotal; + property Tax : Price read FTax write FTax; + property ShippingCharge : Price read FShippingCharge write FShippingCharge; + property Promotion : Price read FPromotion write FPromotion; + end; + + TransactionItem_Type = class(TBaseComplexRemotable) + private + FTransactionItemId : string; + FQuantity : string; + FUnitPrice : Price; + FTotalPrice : Price; + FASIN : string; + FChildTransactionItems : TransactionItem_ChildTransactionItems_Type; + private + function HasASIN() : Boolean; + function HasChildTransactionItems() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property TransactionItemId : string read FTransactionItemId write FTransactionItemId; + property Quantity : string read FQuantity write FQuantity; + property UnitPrice : Price read FUnitPrice write FUnitPrice; + property TotalPrice : Price read FTotalPrice write FTotalPrice; + property ASIN : string read FASIN write FASIN stored HasASIN; + property ChildTransactionItems : TransactionItem_ChildTransactionItems_Type read FChildTransactionItems write FChildTransactionItems stored HasChildTransactionItems; + end; + + Transaction_Shipments_Type_Shipment_Type_Packages_Type_Package_Type = class(TBaseComplexRemotable) + private + FTrackingNumber : string; + FCarrierName : string; + published + property TrackingNumber : string read FTrackingNumber write FTrackingNumber; + property CarrierName : string read FCarrierName write FCarrierName; + end; + + Transaction_Shipments_Type_Shipment_Type = class(TBaseComplexRemotable) + private + FCondition : string; + FDeliveryMethod : string; + FShipmentItems : Transaction_Shipments_Type_Shipment_Type_ShipmentItems_Type; + FPackages : Transaction_Shipments_Type_Shipment_Type_Packages_Type; + private + function HasShipmentItems() : Boolean; + function HasPackages() : Boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property Condition : string read FCondition write FCondition; + property DeliveryMethod : string read FDeliveryMethod write FDeliveryMethod; + property ShipmentItems : Transaction_Shipments_Type_Shipment_Type_ShipmentItems_Type read FShipmentItems write FShipmentItems stored HasShipmentItems; + property Packages : Transaction_Shipments_Type_Shipment_Type_Packages_Type read FPackages write FPackages stored HasPackages; + end; + + Seller_Location_Type = class(TBaseComplexRemotable) + private + FUserDefinedLocation : string; + FCity : string; + FState : string; + FCountry : string; + private + function HasUserDefinedLocation() : Boolean; + function HasCity() : Boolean; + function HasState() : Boolean; + function HasCountry() : Boolean; + published + property UserDefinedLocation : string read FUserDefinedLocation write FUserDefinedLocation stored HasUserDefinedLocation; + property City : string read FCity write FCity stored HasCity; + property State : string read FState write FState stored HasState; + property Country : string read FCountry write FCountry stored HasCountry; + end; + + Seller_SellerFeedbackSummary_Type_FeedbackDateRange_Type_SellerFeedbackRating_Type = class(TBaseComplexRemotable) + private + FCount : nonNegativeInteger; + FPercentage : nonNegativeInteger; + F_Type : string; + private + function HasCount() : Boolean; + function HasPercentage() : Boolean; + published + property Count : nonNegativeInteger read FCount write FCount stored HasCount; + property Percentage : nonNegativeInteger read FPercentage write FPercentage stored HasPercentage; + property _Type : string read F_Type write F_Type; + end; + + Seller_SellerFeedbackSummary_Type_FeedbackDateRange_Type = class(TBaseComplexRemotable) + private + FSellerFeedbackRating : Seller_SellerFeedbackSummary_Type_FeedbackDateRange_Type_SellerFeedbackRatingArray; + FPeriod : string; + public + constructor Create();override; + destructor Destroy();override; + published + property SellerFeedbackRating : Seller_SellerFeedbackSummary_Type_FeedbackDateRange_Type_SellerFeedbackRatingArray read FSellerFeedbackRating write FSellerFeedbackRating; + property Period : string read FPeriod write FPeriod; + end; + + SellerFeedback_Feedback_Type = class(TBaseComplexRemotable) + private + FRating : nonNegativeInteger; + FComment : string; + FDate : string; + FRatedBy : string; + private + function HasRating() : Boolean; + function HasComment() : Boolean; + function HasDate() : Boolean; + function HasRatedBy() : Boolean; + published + property Rating : nonNegativeInteger read FRating write FRating stored HasRating; + property Comment : string read FComment write FComment stored HasComment; + property Date : string read FDate write FDate stored HasDate; + property RatedBy : string read FRatedBy write FRatedBy stored HasRatedBy; + end; + + DecimalWithUnits = class(TComplexFloatExtendedContentRemotable) + private + FUnits : string; + published + property Units : string read FUnits write FUnits; + end; + + NonNegativeIntegerWithUnits = class(TComplexInt32UContentRemotable) + private + FUnits : string; + published + property Units : string read FUnits write FUnits; + end; + + ItemAttributes_Creator_Type = class(TComplexStringContentRemotable) + private + FRole : string; + published + property Role : string read FRole write FRole; + end; + + StringWithUnits = class(TComplexStringContentRemotable) + private + FUnits : string; + published + property Units : string read FUnits write FUnits; + end; + + ItemAttributes_ItemDimensions_Type = class(TBaseComplexRemotable) + private + FHeight : DecimalWithUnits; + FLength : DecimalWithUnits; + FWeight : DecimalWithUnits; + FWidth : DecimalWithUnits; + private + function HasHeight() : Boolean; + function HasLength() : Boolean; + function HasWeight() : Boolean; + function HasWidth() : Boolean; + public + destructor Destroy();override; + published + property Height : DecimalWithUnits read FHeight write FHeight stored HasHeight; + property Length : DecimalWithUnits read FLength write FLength stored HasLength; + property Weight : DecimalWithUnits read FWeight write FWeight stored HasWeight; + property Width : DecimalWithUnits read FWidth write FWidth stored HasWidth; + end; + + ItemAttributes_Languages_Type_Language_Type = class(TBaseComplexRemotable) + private + FName : string; + F_Type : string; + FAudioFormat : string; + private + function Has_Type() : Boolean; + function HasAudioFormat() : Boolean; + published + property Name : string read FName write FName; + property _Type : string read F_Type write F_Type stored Has_Type; + property AudioFormat : string read FAudioFormat write FAudioFormat stored HasAudioFormat; + end; + + ItemAttributes_PackageDimensions_Type = class(TBaseComplexRemotable) + private + FHeight : DecimalWithUnits; + FLength : DecimalWithUnits; + FWeight : DecimalWithUnits; + FWidth : DecimalWithUnits; + private + function HasHeight() : Boolean; + function HasLength() : Boolean; + function HasWeight() : Boolean; + function HasWidth() : Boolean; + public + destructor Destroy();override; + published + property Height : DecimalWithUnits read FHeight write FHeight stored HasHeight; + property Length : DecimalWithUnits read FLength write FLength stored HasLength; + property Weight : DecimalWithUnits read FWeight write FWeight stored HasWeight; + property Width : DecimalWithUnits read FWidth write FWidth stored HasWidth; + end; + + MerchantItemAttributes_Creator_Type = class(TComplexStringContentRemotable) + private + FRole : string; + published + property Role : string read FRole write FRole; + end; + + MerchantItemAttributes_ItemDimensions_Type = class(TBaseComplexRemotable) + private + FHeight : DecimalWithUnits; + FLength : DecimalWithUnits; + FWeight : DecimalWithUnits; + FWidth : DecimalWithUnits; + private + function HasHeight() : Boolean; + function HasLength() : Boolean; + function HasWeight() : Boolean; + function HasWidth() : Boolean; + public + destructor Destroy();override; + published + property Height : DecimalWithUnits read FHeight write FHeight stored HasHeight; + property Length : DecimalWithUnits read FLength write FLength stored HasLength; + property Weight : DecimalWithUnits read FWeight write FWeight stored HasWeight; + property Width : DecimalWithUnits read FWidth write FWidth stored HasWidth; + end; + + MerchantItemAttributes_Languages_Type_Language_Type = class(TBaseComplexRemotable) + private + FName : string; + F_Type : string; + FAudioFormat : string; + private + function HasAudioFormat() : Boolean; + published + property Name : string read FName write FName; + property _Type : string read F_Type write F_Type; + property AudioFormat : string read FAudioFormat write FAudioFormat stored HasAudioFormat; + end; + + MerchantItemAttributes_PackageDimensions_Type = class(TBaseComplexRemotable) + private + FHeight : DecimalWithUnits; + FLength : DecimalWithUnits; + FWeight : DecimalWithUnits; + FWidth : DecimalWithUnits; + private + function HasHeight() : Boolean; + function HasLength() : Boolean; + function HasWeight() : Boolean; + function HasWidth() : Boolean; + public + destructor Destroy();override; + published + property Height : DecimalWithUnits read FHeight write FHeight stored HasHeight; + property Length : DecimalWithUnits read FLength write FLength stored HasLength; + property Weight : DecimalWithUnits read FWeight write FWeight stored HasWeight; + property Width : DecimalWithUnits read FWidth write FWidth stored HasWidth; + end; + + MerchantItemAttributes_VendorRebate_Type = class(TBaseComplexRemotable) + private + F_Type : string; + FStartDate : string; + FEndDate : string; + private + function Has_Type() : Boolean; + function HasStartDate() : Boolean; + function HasEndDate() : Boolean; + published + property _Type : string read F_Type write F_Type stored Has_Type; + property StartDate : string read FStartDate write FStartDate stored HasStartDate; + property EndDate : string read FEndDate write FEndDate stored HasEndDate; + end; + + Help_RequestArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): HelpRequest; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : HelpRequest Read GetItem;Default; + end; + + HelpResponse_InformationArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): Information_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : Information_Type Read GetItem;Default; + end; + + ItemSearch_RequestArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): ItemSearchRequest; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : ItemSearchRequest Read GetItem;Default; + end; + + ItemSearchResponse_ItemsArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): Items_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : Items_Type Read GetItem;Default; + end; + + ItemLookup_RequestArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): ItemLookupRequest; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : ItemLookupRequest Read GetItem;Default; + end; + + ItemLookupResponse_ItemsArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): Items_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : Items_Type Read GetItem;Default; + end; + + BrowseNodeLookup_RequestArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): BrowseNodeLookupRequest; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : BrowseNodeLookupRequest Read GetItem;Default; + end; + + BrowseNodeLookupResponse_BrowseNodesArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): BrowseNodes_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : BrowseNodes_Type Read GetItem;Default; + end; + + ListSearch_RequestArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): ListSearchRequest; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : ListSearchRequest Read GetItem;Default; + end; + + ListSearchResponse_ListsArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): Lists_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : Lists_Type Read GetItem;Default; + end; + + ListLookup_RequestArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): ListLookupRequest; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : ListLookupRequest Read GetItem;Default; + end; + + ListLookupResponse_ListsArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): Lists_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : Lists_Type Read GetItem;Default; + end; + + CustomerContentSearch_RequestArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): CustomerContentSearchRequest; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : CustomerContentSearchRequest Read GetItem;Default; + end; + + CustomerContentSearchResponse_CustomersArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): Customers_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : Customers_Type Read GetItem;Default; + end; + + CustomerContentLookup_RequestArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): CustomerContentLookupRequest; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : CustomerContentLookupRequest Read GetItem;Default; + end; + + CustomerContentLookupResponse_CustomersArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): Customers_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : Customers_Type Read GetItem;Default; + end; + + SimilarityLookup_RequestArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): SimilarityLookupRequest; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : SimilarityLookupRequest Read GetItem;Default; + end; + + SimilarityLookupResponse_ItemsArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): Items_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : Items_Type Read GetItem;Default; + end; + + SellerLookup_RequestArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): SellerLookupRequest; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : SellerLookupRequest Read GetItem;Default; + end; + + SellerLookupResponse_SellersArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): Sellers_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : Sellers_Type Read GetItem;Default; + end; + + CartGet_RequestArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): CartGetRequest; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : CartGetRequest Read GetItem;Default; + end; + + CartGetResponse_CartArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): Cart_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : Cart_Type Read GetItem;Default; + end; + + CartAdd_RequestArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): CartAddRequest; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : CartAddRequest Read GetItem;Default; + end; + + CartAddResponse_CartArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): Cart_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : Cart_Type Read GetItem;Default; + end; + + CartCreate_RequestArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): CartCreateRequest; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : CartCreateRequest Read GetItem;Default; + end; + + CartCreateResponse_CartArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): Cart_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : Cart_Type Read GetItem;Default; + end; + + CartModify_RequestArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): CartModifyRequest; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : CartModifyRequest Read GetItem;Default; + end; + + CartModifyResponse_CartArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): Cart_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : Cart_Type Read GetItem;Default; + end; + + CartClear_RequestArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): CartClearRequest; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : CartClearRequest Read GetItem;Default; + end; + + CartClearResponse_CartArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): Cart_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : Cart_Type Read GetItem;Default; + end; + + TransactionLookup_RequestArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): TransactionLookupRequest; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : TransactionLookupRequest Read GetItem;Default; + end; + + TransactionLookupResponse_TransactionsArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): Transactions_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : Transactions_Type Read GetItem;Default; + end; + + SellerListingSearch_RequestArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): SellerListingSearchRequest; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : SellerListingSearchRequest Read GetItem;Default; + end; + + SellerListingSearchResponse_SellerListingsArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): SellerListings_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : SellerListings_Type Read GetItem;Default; + end; + + SellerListingLookup_RequestArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): SellerListingLookupRequest; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : SellerListingLookupRequest Read GetItem;Default; + end; + + SellerListingLookupResponse_SellerListingsArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): SellerListings_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : SellerListings_Type Read GetItem;Default; + end; + + Bin_BinParameterArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): Bin_BinParameter_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : Bin_BinParameter_Type Read GetItem;Default; + end; + + SearchBinSet_BinArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): Bin_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : Bin_Type Read GetItem;Default; + end; + + SearchBinSets_Type = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): SearchBinSet_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : SearchBinSet_Type Read GetItem;Default; + end; + + HelpRequest_ResponseGroupArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + ItemSearchRequest_AudienceRatingArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of AudienceRating_Type; + private + function GetItem(AIndex: Integer): AudienceRating_Type; + procedure SetItem(AIndex: Integer; const AValue: AudienceRating_Type); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : AudienceRating_Type read GetItem write SetItem; default; + end; + + ItemSearchRequest_ResponseGroupArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + ItemLookupRequest_ItemIdArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + ItemLookupRequest_ResponseGroupArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + ListSearchRequest_ResponseGroupArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + ListLookupRequest_ResponseGroupArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + CustomerContentSearchRequest_ResponseGroupArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + CustomerContentLookupRequest_ResponseGroupArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + SimilarityLookupRequest_ItemIdArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + SimilarityLookupRequest_ResponseGroupArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + SellerLookupRequest_ResponseGroupArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + SellerLookupRequest_SellerIdArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + CartGetRequest_ResponseGroupArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + CartAddRequest_Items_Type = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): CartAddRequest_Items_Type_Item_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : CartAddRequest_Items_Type_Item_Type Read GetItem;Default; + end; + + CartAddRequest_ResponseGroupArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + CartCreateRequest_Items_Type = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): CartCreateRequest_Items_Type_Item_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : CartCreateRequest_Items_Type_Item_Type Read GetItem;Default; + end; + + CartCreateRequest_ResponseGroupArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + CartModifyRequest_Items_Type = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): CartModifyRequest_Items_Type_Item_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : CartModifyRequest_Items_Type_Item_Type Read GetItem;Default; + end; + + CartModifyRequest_ResponseGroupArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + CartClearRequest_ResponseGroupArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + TransactionLookupRequest_ResponseGroupArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + TransactionLookupRequest_TransactionIdArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + SellerListingSearchRequest_ResponseGroupArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + SellerListingLookupRequest_ResponseGroupArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + BrowseNodeLookupRequest_BrowseNodeIdArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + BrowseNodeLookupRequest_ResponseGroupArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + HTTPHeaders_Type = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): HTTPHeaders_Header_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : HTTPHeaders_Header_Type Read GetItem;Default; + end; + + Arguments_Type = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): Arguments_Argument_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : Arguments_Argument_Type Read GetItem;Default; + end; + + Errors_Type = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): Errors_Error_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : Errors_Error_Type Read GetItem;Default; + end; + + Information_OperationInformationArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): OperationInformation_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : OperationInformation_Type Read GetItem;Default; + end; + + Information_ResponseGroupInformationArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): ResponseGroupInformation_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : ResponseGroupInformation_Type Read GetItem;Default; + end; + + SearchResultsMap_Type = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): SearchResultsMap_SearchIndex_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : SearchResultsMap_SearchIndex_Type Read GetItem;Default; + end; + + Items__ItemArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): Item_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : Item_Type Read GetItem;Default; + end; + + Lists_ListArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): List_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : List_Type Read GetItem;Default; + end; + + Customers_CustomerArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): Customer_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : Customer_Type Read GetItem;Default; + end; + + SimilarProducts_Type = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): SimilarProducts_SimilarProduct_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : SimilarProducts_SimilarProduct_Type Read GetItem;Default; + end; + + TopSellers_Type = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): TopSellers_TopSeller_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : TopSellers_TopSeller_Type Read GetItem;Default; + end; + + NewReleases_Type = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): NewReleases_NewRelease_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : NewReleases_NewRelease_Type Read GetItem;Default; + end; + + SimilarViewedProducts_Type = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): SimilarViewedProducts_SimilarViewedProduct_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : SimilarViewedProducts_SimilarViewedProduct_Type Read GetItem;Default; + end; + + OtherCategoriesSimilarProducts_Type = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): OtherCategoriesSimilarProducts_OtherCategoriesSimilarProduct_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : OtherCategoriesSimilarProducts_OtherCategoriesSimilarProduct_Type Read GetItem;Default; + end; + + Transactions_TransactionArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): Transaction_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : Transaction_Type Read GetItem;Default; + end; + + Sellers_SellerArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): Seller_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : Seller_Type Read GetItem;Default; + end; + + SellerListings_SellerListingArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): SellerListing_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : SellerListing_Type Read GetItem;Default; + end; + + OperationInformation_RequiredParameters_Type = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + OperationInformation_AvailableParameters_Type = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + OperationInformation_DefaultResponseGroups_Type = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + OperationInformation_AvailableResponseGroups_Type = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + ResponseGroupInformation_ValidOperations_Type = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + ResponseGroupInformation_Elements_Type = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + List_ListItemArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): ListItem_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : ListItem_Type Read GetItem;Default; + end; + + Customer_CustomerReviewsArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): CustomerReviews_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : CustomerReviews_Type Read GetItem;Default; + end; + + SearchResultsMap_SearchIndex_Type_ASINArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + Item_ImageSets_Type_ImageSetArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): ImageSet_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : ImageSet_Type Read GetItem;Default; + end; + + Collections_Type = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): Collections_Collection_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : Collections_Collection_Type Read GetItem;Default; + end; + + Item_Subjects_Type = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + EditorialReviews_Type = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): EditorialReview_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : EditorialReview_Type Read GetItem;Default; + end; + + Accessories_Type = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): Accessories_Accessory_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : Accessories_Accessory_Type Read GetItem;Default; + end; + + Tracks_Type = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): Tracks_Disc_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : Tracks_Disc_Type Read GetItem;Default; + end; + + ListmaniaLists_Type = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): ListmaniaLists_ListmaniaList_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : ListmaniaLists_ListmaniaList_Type Read GetItem;Default; + end; + + Item_AlternateVersions_Type = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): Item_AlternateVersions_Type_AlternateVersion_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : Item_AlternateVersions_Type_AlternateVersion_Type Read GetItem;Default; + end; + + _Item_ImageSetsArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): Item_ImageSets_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : Item_ImageSets_Type Read GetItem;Default; + end; + + Offers_OfferArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): Offer_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : Offer_Type Read GetItem;Default; + end; + + Promotions_Type = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): Promotion_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : Promotion_Type Read GetItem;Default; + end; + + Offer_OfferListingArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): OfferListing_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : OfferListing_Type Read GetItem;Default; + end; + + OfferListing_ShippingChargeArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): OfferListing_ShippingCharge_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : OfferListing_ShippingCharge_Type Read GetItem;Default; + end; + + VariationDimensions_Type = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + Variations__ItemArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): Item_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : Item_Type Read GetItem;Default; + end; + + Collections_Collection_Type_CollectionItemArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): Collections_Collection_Type_CollectionItem_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : Collections_Collection_Type_CollectionItem_Type Read GetItem;Default; + end; + + CustomerReviews_ReviewArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): Review_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : Review_Type Read GetItem;Default; + end; + + Tracks_Disc_Type_TrackArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): Tracks_Disc_Type_Track_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : Tracks_Disc_Type_Track_Type Read GetItem;Default; + end; + + PromotionEligibilityRequirements = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): PromotionEligibilityRequirement; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : PromotionEligibilityRequirement Read GetItem;Default; + end; + + PromotionBenefits = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): PromotionBenefit; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : PromotionBenefit Read GetItem;Default; + end; + + BrowseNodes_BrowseNodeArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): BrowseNode_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : BrowseNode_Type Read GetItem;Default; + end; + + BrowseNode_Children_Type = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): BrowseNode_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : BrowseNode_Type Read GetItem;Default; + end; + + BrowseNode_Ancestors_Type = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): BrowseNode_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : BrowseNode_Type Read GetItem;Default; + end; + + CartItems_CartItemArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): CartItem; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : CartItem Read GetItem;Default; + end; + + SavedForLaterItems_SavedForLaterItemArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): CartItem; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : CartItem Read GetItem;Default; + end; + + Transaction_TransactionItems_Type = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): TransactionItem_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : TransactionItem_Type Read GetItem;Default; + end; + + Transaction_Shipments_Type_Shipment_Type_ShipmentItems_Type = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + Transaction_Shipments_Type_Shipment_Type_Packages_Type = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): Transaction_Shipments_Type_Shipment_Type_Packages_Type_Package_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : Transaction_Shipments_Type_Shipment_Type_Packages_Type_Package_Type Read GetItem;Default; + end; + + Transaction_Shipments_Type = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): Transaction_Shipments_Type_Shipment_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : Transaction_Shipments_Type_Shipment_Type Read GetItem;Default; + end; + + TransactionItem_ChildTransactionItems_Type = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): TransactionItem_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : TransactionItem_Type Read GetItem;Default; + end; + + Seller_SellerFeedbackSummary_Type_FeedbackDateRange_Type_SellerFeedbackRatingArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): Seller_SellerFeedbackSummary_Type_FeedbackDateRange_Type_SellerFeedbackRating_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : Seller_SellerFeedbackSummary_Type_FeedbackDateRange_Type_SellerFeedbackRating_Type Read GetItem;Default; + end; + + Seller_SellerFeedbackSummary_Type = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): Seller_SellerFeedbackSummary_Type_FeedbackDateRange_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : Seller_SellerFeedbackSummary_Type_FeedbackDateRange_Type Read GetItem;Default; + end; + + SellerFeedback_Type = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): SellerFeedback_Feedback_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : SellerFeedback_Feedback_Type Read GetItem;Default; + end; + + ItemAttributes_Languages_Type = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): ItemAttributes_Languages_Type_Language_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : ItemAttributes_Languages_Type_Language_Type Read GetItem;Default; + end; + + ItemAttributes_ActorArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + ItemAttributes_ArtistArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + ItemAttributes_AudioFormatArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + ItemAttributes_AuthorArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + ItemAttributes_CameraManualFeaturesArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + ItemAttributes_CompatibleDevicesArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + ItemAttributes_CreatorArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): ItemAttributes_Creator_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : ItemAttributes_Creator_Type Read GetItem;Default; + end; + + ItemAttributes_DataLinkProtocolArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + ItemAttributes_DirectorArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + ItemAttributes_FeatureArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + ItemAttributes_FormatArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + ItemAttributes_FormFactorArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + ItemAttributes_PhotoFlashTypeArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + ItemAttributes_PictureFormatArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + ItemAttributes_PlatformArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + ItemAttributes_ReturnMethodArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + ItemAttributes_SpecialFeaturesArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + ItemAttributes_SupportedImageTypeArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + MerchantItemAttributes_Languages_Type = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): MerchantItemAttributes_Languages_Type_Language_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : MerchantItemAttributes_Languages_Type_Language_Type Read GetItem;Default; + end; + + MerchantItemAttributes_ActorArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + MerchantItemAttributes_ArtistArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + MerchantItemAttributes_AudioFormatArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + MerchantItemAttributes_AuthorArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + MerchantItemAttributes_CameraManualFeaturesArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + MerchantItemAttributes_CreatorArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): MerchantItemAttributes_Creator_Type; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : MerchantItemAttributes_Creator_Type Read GetItem;Default; + end; + + MerchantItemAttributes_DirectorArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + MerchantItemAttributes_FeatureArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + MerchantItemAttributes_FormatArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + MerchantItemAttributes_PhotoFlashTypeArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + MerchantItemAttributes_PictureFormatArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + MerchantItemAttributes_PlatformArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + MerchantItemAttributes_PurchasingChannelArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + MerchantItemAttributes_ReturnMethodArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + MerchantItemAttributes_SpecialFeaturesArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + MerchantItemAttributes_SupportedImageTypeArray = class(TBaseSimpleTypeArrayRemotable) + private + FData : array of string; + private + function GetItem(AIndex: Integer): string; + procedure SetItem(AIndex: Integer; const AValue: string); + protected + function GetLength():Integer;override; + procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override; + procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override; + public + class function GetItemTypeInfo():PTypeInfo;override; + procedure SetLength(const ANewSize : Integer);override; + property Item[AIndex:Integer] : string read GetItem write SetItem; default; + end; + + AWSECommerceServicePortType = interface(IInvokable) + ['{44FE21A3-034C-4AC2-81F3-73F0DD856713}'] + function Help( + Const HelpParam : Help_Type + ):HelpResponse_Type; + function ItemSearch( + Const ItemSearchParam : ItemSearch_Type + ):ItemSearchResponse_Type; + function ItemLookup( + Const ItemLookupParam : ItemLookup_Type + ):ItemLookupResponse_Type; + function BrowseNodeLookup( + Const BrowseNodeLookupParam : BrowseNodeLookup_Type + ):BrowseNodeLookupResponse_Type; + function ListSearch( + Const ListSearchParam : ListSearch_Type + ):ListSearchResponse_Type; + function ListLookup( + Const ListLookupParam : ListLookup_Type + ):ListLookupResponse_Type; + function CustomerContentSearch( + Const CustomerContentSearchParam : CustomerContentSearch_Type + ):CustomerContentSearchResponse_Type; + function CustomerContentLookup( + Const CustomerContentLookupParam : CustomerContentLookup_Type + ):CustomerContentLookupResponse_Type; + function SimilarityLookup( + Const SimilarityLookupParam : SimilarityLookup_Type + ):SimilarityLookupResponse_Type; + function SellerLookup( + Const SellerLookupParam : SellerLookup_Type + ):SellerLookupResponse_Type; + function CartGet( + Const CartGetParam : CartGet_Type + ):CartGetResponse_Type; + function CartAdd( + Const CartAddParam : CartAdd_Type + ):CartAddResponse_Type; + function CartCreate( + Const CartCreateParam : CartCreate_Type + ):CartCreateResponse_Type; + function CartModify( + Const CartModifyParam : CartModify_Type + ):CartModifyResponse_Type; + function CartClear( + Const CartClearParam : CartClear_Type + ):CartClearResponse_Type; + function TransactionLookup( + Const TransactionLookupParam : TransactionLookup_Type + ):TransactionLookupResponse_Type; + function SellerListingSearch( + Const SellerListingSearchParam : SellerListingSearch_Type + ):SellerListingSearchResponse_Type; + function SellerListingLookup( + Const SellerListingLookupParam : SellerListingLookup_Type + ):SellerListingLookupResponse_Type; + function MultiOperation( + Const MultiOperationParam : MultiOperationType + ):MultiOperationResponse; + end; + + procedure Register_AWSECommerceService_ServiceMetadata(); + +Implementation +uses metadata_repository; + +{ HelpRequest } + +constructor HelpRequest.Create(); +begin + inherited Create(); + FResponseGroup := HelpRequest_ResponseGroupArray.Create(); +end; + +destructor HelpRequest.Destroy(); +begin + inherited Destroy(); +end; + +function HelpRequest.HasAbout() : Boolean; +begin + Result := True; +end; + +function HelpRequest.HasHelpType() : Boolean; +begin + Result := True; +end; + +{ Help_Type } + +constructor Help_Type.Create(); +begin + inherited Create(); + FRequest := Help_RequestArray.Create(); +end; + +destructor Help_Type.Destroy(); +begin + if Assigned(FShared) then + FreeAndNil(FShared); + inherited Destroy(); +end; + +function Help_Type.HasMarketplaceDomain() : Boolean; +begin + Result := True; +end; + +function Help_Type.HasAWSAccessKeyId() : Boolean; +begin + Result := True; +end; + +function Help_Type.HasSubscriptionId() : Boolean; +begin + Result := True; +end; + +function Help_Type.HasAssociateTag() : Boolean; +begin + Result := True; +end; + +function Help_Type.HasValidate() : Boolean; +begin + Result := True; +end; + +function Help_Type.HasShared() : Boolean; +begin + Result := True; +end; + +{ OperationRequest_Type } + +constructor OperationRequest_Type.Create(); +begin + inherited Create(); + FHTTPHeaders := HTTPHeaders_Type.Create(); + FArguments := Arguments_Type.Create(); + FErrors := Errors_Type.Create(); +end; + +destructor OperationRequest_Type.Destroy(); +begin + inherited Destroy(); +end; + +function OperationRequest_Type.HasHTTPHeaders() : Boolean; +begin + Result := True; +end; + +function OperationRequest_Type.HasRequestId() : Boolean; +begin + Result := True; +end; + +function OperationRequest_Type.HasArguments() : Boolean; +begin + Result := True; +end; + +function OperationRequest_Type.HasErrors() : Boolean; +begin + Result := True; +end; + +function OperationRequest_Type.HasRequestProcessingTime() : Boolean; +begin + Result := True; +end; + +{ Information_Type } + +constructor Information_Type.Create(); +begin + inherited Create(); + FOperationInformation := Information_OperationInformationArray.Create(); + FResponseGroupInformation := Information_ResponseGroupInformationArray.Create(); +end; + +destructor Information_Type.Destroy(); +begin + if Assigned(FRequest) then + FreeAndNil(FRequest); + inherited Destroy(); +end; + +function Information_Type.HasRequest() : Boolean; +begin + Result := True; +end; + +{ HelpResponse_Type } + +constructor HelpResponse_Type.Create(); +begin + inherited Create(); + FInformation := HelpResponse_InformationArray.Create(); +end; + +destructor HelpResponse_Type.Destroy(); +begin + if Assigned(FOperationRequest) then + FreeAndNil(FOperationRequest); + inherited Destroy(); +end; + +function HelpResponse_Type.HasOperationRequest() : Boolean; +begin + Result := True; +end; + +{ ItemSearchRequest } + +constructor ItemSearchRequest.Create(); +begin + inherited Create(); + FAudienceRating := ItemSearchRequest_AudienceRatingArray.Create(); + FResponseGroup := ItemSearchRequest_ResponseGroupArray.Create(); +end; + +destructor ItemSearchRequest.Destroy(); +begin + inherited Destroy(); +end; + +function ItemSearchRequest.HasActor() : Boolean; +begin + Result := True; +end; + +function ItemSearchRequest.HasArtist() : Boolean; +begin + Result := True; +end; + +function ItemSearchRequest.HasAvailability() : Boolean; +begin + Result := True; +end; + +function ItemSearchRequest.HasAuthor() : Boolean; +begin + Result := True; +end; + +function ItemSearchRequest.HasBrand() : Boolean; +begin + Result := True; +end; + +function ItemSearchRequest.HasBrowseNode() : Boolean; +begin + Result := True; +end; + +function ItemSearchRequest.HasCity() : Boolean; +begin + Result := True; +end; + +function ItemSearchRequest.HasComposer() : Boolean; +begin + Result := True; +end; + +function ItemSearchRequest.HasCondition() : Boolean; +begin + Result := True; +end; + +function ItemSearchRequest.HasConductor() : Boolean; +begin + Result := True; +end; + +function ItemSearchRequest.HasCount() : Boolean; +begin + Result := True; +end; + +function ItemSearchRequest.HasCuisine() : Boolean; +begin + Result := True; +end; + +function ItemSearchRequest.HasDeliveryMethod() : Boolean; +begin + Result := True; +end; + +function ItemSearchRequest.HasDirector() : Boolean; +begin + Result := True; +end; + +function ItemSearchRequest.HasFutureLaunchDate() : Boolean; +begin + Result := True; +end; + +function ItemSearchRequest.HasISPUPostalCode() : Boolean; +begin + Result := True; +end; + +function ItemSearchRequest.HasItemPage() : Boolean; +begin + Result := True; +end; + +function ItemSearchRequest.HasKeywords() : Boolean; +begin + Result := True; +end; + +function ItemSearchRequest.HasManufacturer() : Boolean; +begin + Result := True; +end; + +function ItemSearchRequest.HasMaximumPrice() : Boolean; +begin + Result := True; +end; + +function ItemSearchRequest.HasMerchantId() : Boolean; +begin + Result := True; +end; + +function ItemSearchRequest.HasMinimumPrice() : Boolean; +begin + Result := True; +end; + +function ItemSearchRequest.HasMusicLabel() : Boolean; +begin + Result := True; +end; + +function ItemSearchRequest.HasNeighborhood() : Boolean; +begin + Result := True; +end; + +function ItemSearchRequest.HasOrchestra() : Boolean; +begin + Result := True; +end; + +function ItemSearchRequest.HasPostalCode() : Boolean; +begin + Result := True; +end; + +function ItemSearchRequest.HasPower() : Boolean; +begin + Result := True; +end; + +function ItemSearchRequest.HasPublisher() : Boolean; +begin + Result := True; +end; + +function ItemSearchRequest.HasReviewSort() : Boolean; +begin + Result := True; +end; + +function ItemSearchRequest.HasSearchIndex() : Boolean; +begin + Result := True; +end; + +function ItemSearchRequest.HasSort() : Boolean; +begin + Result := True; +end; + +function ItemSearchRequest.HasState() : Boolean; +begin + Result := True; +end; + +function ItemSearchRequest.HasTextStream() : Boolean; +begin + Result := True; +end; + +function ItemSearchRequest.HasTitle() : Boolean; +begin + Result := True; +end; + +function ItemSearchRequest.HasReleaseDate() : Boolean; +begin + Result := True; +end; + +{ ItemSearch_Type } + +constructor ItemSearch_Type.Create(); +begin + inherited Create(); + FRequest := ItemSearch_RequestArray.Create(); +end; + +destructor ItemSearch_Type.Destroy(); +begin + if Assigned(FShared) then + FreeAndNil(FShared); + inherited Destroy(); +end; + +function ItemSearch_Type.HasMarketplaceDomain() : Boolean; +begin + Result := True; +end; + +function ItemSearch_Type.HasAWSAccessKeyId() : Boolean; +begin + Result := True; +end; + +function ItemSearch_Type.HasSubscriptionId() : Boolean; +begin + Result := True; +end; + +function ItemSearch_Type.HasAssociateTag() : Boolean; +begin + Result := True; +end; + +function ItemSearch_Type.HasXMLEscaping() : Boolean; +begin + Result := True; +end; + +function ItemSearch_Type.HasValidate() : Boolean; +begin + Result := True; +end; + +function ItemSearch_Type.HasShared() : Boolean; +begin + Result := True; +end; + +{ Items_Type } + +constructor Items_Type.Create(); +begin + inherited Create(); + FSearchResultsMap := SearchResultsMap_Type.Create(); + F_Item := Items__ItemArray.Create(); + FSearchBinSets := SearchBinSets_Type.Create(); +end; + +destructor Items_Type.Destroy(); +begin + if Assigned(FRequest) then + FreeAndNil(FRequest); + if Assigned(FCorrectedQuery) then + FreeAndNil(FCorrectedQuery); + inherited Destroy(); +end; + +function Items_Type.HasRequest() : Boolean; +begin + Result := True; +end; + +function Items_Type.HasCorrectedQuery() : Boolean; +begin + Result := True; +end; + +function Items_Type.HasQid() : Boolean; +begin + Result := True; +end; + +function Items_Type.HasTotalResults() : Boolean; +begin + Result := True; +end; + +function Items_Type.HasTotalPages() : Boolean; +begin + Result := True; +end; + +function Items_Type.HasSearchResultsMap() : Boolean; +begin + Result := True; +end; + +function Items_Type.HasSearchBinSets() : Boolean; +begin + Result := True; +end; + +{ ItemSearchResponse_Type } + +constructor ItemSearchResponse_Type.Create(); +begin + inherited Create(); + FItems := ItemSearchResponse_ItemsArray.Create(); +end; + +destructor ItemSearchResponse_Type.Destroy(); +begin + if Assigned(FOperationRequest) then + FreeAndNil(FOperationRequest); + inherited Destroy(); +end; + +function ItemSearchResponse_Type.HasOperationRequest() : Boolean; +begin + Result := True; +end; + +{ ItemLookupRequest } + +constructor ItemLookupRequest.Create(); +begin + inherited Create(); + FItemId := ItemLookupRequest_ItemIdArray.Create(); + FResponseGroup := ItemLookupRequest_ResponseGroupArray.Create(); +end; + +destructor ItemLookupRequest.Destroy(); +begin + inherited Destroy(); +end; + +function ItemLookupRequest.HasCondition() : Boolean; +begin + Result := True; +end; + +function ItemLookupRequest.HasDeliveryMethod() : Boolean; +begin + Result := True; +end; + +function ItemLookupRequest.HasFutureLaunchDate() : Boolean; +begin + Result := True; +end; + +function ItemLookupRequest.HasIdType() : Boolean; +begin + Result := True; +end; + +function ItemLookupRequest.HasISPUPostalCode() : Boolean; +begin + Result := True; +end; + +function ItemLookupRequest.HasMerchantId() : Boolean; +begin + Result := True; +end; + +function ItemLookupRequest.HasOfferPage() : Boolean; +begin + Result := True; +end; + +function ItemLookupRequest.HasReviewPage() : Boolean; +begin + Result := True; +end; + +function ItemLookupRequest.HasReviewSort() : Boolean; +begin + Result := True; +end; + +function ItemLookupRequest.HasSearchIndex() : Boolean; +begin + Result := True; +end; + +function ItemLookupRequest.HasSearchInsideKeywords() : Boolean; +begin + Result := True; +end; + +function ItemLookupRequest.HasVariationPage() : Boolean; +begin + Result := True; +end; + +{ ItemLookup_Type } + +constructor ItemLookup_Type.Create(); +begin + inherited Create(); + FRequest := ItemLookup_RequestArray.Create(); +end; + +destructor ItemLookup_Type.Destroy(); +begin + if Assigned(FShared) then + FreeAndNil(FShared); + inherited Destroy(); +end; + +function ItemLookup_Type.HasMarketplaceDomain() : Boolean; +begin + Result := True; +end; + +function ItemLookup_Type.HasAWSAccessKeyId() : Boolean; +begin + Result := True; +end; + +function ItemLookup_Type.HasSubscriptionId() : Boolean; +begin + Result := True; +end; + +function ItemLookup_Type.HasAssociateTag() : Boolean; +begin + Result := True; +end; + +function ItemLookup_Type.HasValidate() : Boolean; +begin + Result := True; +end; + +function ItemLookup_Type.HasXMLEscaping() : Boolean; +begin + Result := True; +end; + +function ItemLookup_Type.HasShared() : Boolean; +begin + Result := True; +end; + +{ ItemLookupResponse_Type } + +constructor ItemLookupResponse_Type.Create(); +begin + inherited Create(); + FItems := ItemLookupResponse_ItemsArray.Create(); +end; + +destructor ItemLookupResponse_Type.Destroy(); +begin + if Assigned(FOperationRequest) then + FreeAndNil(FOperationRequest); + inherited Destroy(); +end; + +function ItemLookupResponse_Type.HasOperationRequest() : Boolean; +begin + Result := True; +end; + +{ BrowseNodeLookupRequest } + +constructor BrowseNodeLookupRequest.Create(); +begin + inherited Create(); + FBrowseNodeId := BrowseNodeLookupRequest_BrowseNodeIdArray.Create(); + FResponseGroup := BrowseNodeLookupRequest_ResponseGroupArray.Create(); +end; + +destructor BrowseNodeLookupRequest.Destroy(); +begin + inherited Destroy(); +end; + +{ BrowseNodeLookup_Type } + +constructor BrowseNodeLookup_Type.Create(); +begin + inherited Create(); + FRequest := BrowseNodeLookup_RequestArray.Create(); +end; + +destructor BrowseNodeLookup_Type.Destroy(); +begin + if Assigned(FShared) then + FreeAndNil(FShared); + inherited Destroy(); +end; + +function BrowseNodeLookup_Type.HasMarketplaceDomain() : Boolean; +begin + Result := True; +end; + +function BrowseNodeLookup_Type.HasAWSAccessKeyId() : Boolean; +begin + Result := True; +end; + +function BrowseNodeLookup_Type.HasSubscriptionId() : Boolean; +begin + Result := True; +end; + +function BrowseNodeLookup_Type.HasAssociateTag() : Boolean; +begin + Result := True; +end; + +function BrowseNodeLookup_Type.HasValidate() : Boolean; +begin + Result := True; +end; + +function BrowseNodeLookup_Type.HasXMLEscaping() : Boolean; +begin + Result := True; +end; + +function BrowseNodeLookup_Type.HasShared() : Boolean; +begin + Result := True; +end; + +{ BrowseNodes_Type } + +constructor BrowseNodes_Type.Create(); +begin + inherited Create(); + FBrowseNode := BrowseNodes_BrowseNodeArray.Create(); +end; + +destructor BrowseNodes_Type.Destroy(); +begin + if Assigned(FRequest) then + FreeAndNil(FRequest); + inherited Destroy(); +end; + +function BrowseNodes_Type.HasRequest() : Boolean; +begin + Result := True; +end; + +{ BrowseNodeLookupResponse_Type } + +constructor BrowseNodeLookupResponse_Type.Create(); +begin + inherited Create(); + FBrowseNodes := BrowseNodeLookupResponse_BrowseNodesArray.Create(); +end; + +destructor BrowseNodeLookupResponse_Type.Destroy(); +begin + if Assigned(FOperationRequest) then + FreeAndNil(FOperationRequest); + inherited Destroy(); +end; + +function BrowseNodeLookupResponse_Type.HasOperationRequest() : Boolean; +begin + Result := True; +end; + +{ ListSearchRequest } + +constructor ListSearchRequest.Create(); +begin + inherited Create(); + FResponseGroup := ListSearchRequest_ResponseGroupArray.Create(); +end; + +destructor ListSearchRequest.Destroy(); +begin + inherited Destroy(); +end; + +function ListSearchRequest.HasCity() : Boolean; +begin + Result := True; +end; + +function ListSearchRequest.HasEmail() : Boolean; +begin + Result := True; +end; + +function ListSearchRequest.HasFirstName() : Boolean; +begin + Result := True; +end; + +function ListSearchRequest.HasLastName() : Boolean; +begin + Result := True; +end; + +function ListSearchRequest.HasListPage() : Boolean; +begin + Result := True; +end; + +function ListSearchRequest.HasName() : Boolean; +begin + Result := True; +end; + +function ListSearchRequest.HasState() : Boolean; +begin + Result := True; +end; + +{ ListSearch_Type } + +constructor ListSearch_Type.Create(); +begin + inherited Create(); + FRequest := ListSearch_RequestArray.Create(); +end; + +destructor ListSearch_Type.Destroy(); +begin + if Assigned(FShared) then + FreeAndNil(FShared); + inherited Destroy(); +end; + +function ListSearch_Type.HasMarketplaceDomain() : Boolean; +begin + Result := True; +end; + +function ListSearch_Type.HasAWSAccessKeyId() : Boolean; +begin + Result := True; +end; + +function ListSearch_Type.HasSubscriptionId() : Boolean; +begin + Result := True; +end; + +function ListSearch_Type.HasAssociateTag() : Boolean; +begin + Result := True; +end; + +function ListSearch_Type.HasValidate() : Boolean; +begin + Result := True; +end; + +function ListSearch_Type.HasXMLEscaping() : Boolean; +begin + Result := True; +end; + +function ListSearch_Type.HasShared() : Boolean; +begin + Result := True; +end; + +{ Lists_Type } + +constructor Lists_Type.Create(); +begin + inherited Create(); + FList := Lists_ListArray.Create(); +end; + +destructor Lists_Type.Destroy(); +begin + if Assigned(FRequest) then + FreeAndNil(FRequest); + inherited Destroy(); +end; + +function Lists_Type.HasRequest() : Boolean; +begin + Result := True; +end; + +function Lists_Type.HasTotalResults() : Boolean; +begin + Result := True; +end; + +function Lists_Type.HasTotalPages() : Boolean; +begin + Result := True; +end; + +{ ListSearchResponse_Type } + +constructor ListSearchResponse_Type.Create(); +begin + inherited Create(); + FLists := ListSearchResponse_ListsArray.Create(); +end; + +destructor ListSearchResponse_Type.Destroy(); +begin + if Assigned(FOperationRequest) then + FreeAndNil(FOperationRequest); + inherited Destroy(); +end; + +function ListSearchResponse_Type.HasOperationRequest() : Boolean; +begin + Result := True; +end; + +{ ListLookupRequest } + +constructor ListLookupRequest.Create(); +begin + inherited Create(); + FResponseGroup := ListLookupRequest_ResponseGroupArray.Create(); +end; + +destructor ListLookupRequest.Destroy(); +begin + inherited Destroy(); +end; + +function ListLookupRequest.HasCondition() : Boolean; +begin + Result := True; +end; + +function ListLookupRequest.HasDeliveryMethod() : Boolean; +begin + Result := True; +end; + +function ListLookupRequest.HasISPUPostalCode() : Boolean; +begin + Result := True; +end; + +function ListLookupRequest.HasListId() : Boolean; +begin + Result := True; +end; + +function ListLookupRequest.HasListType() : Boolean; +begin + Result := True; +end; + +function ListLookupRequest.HasMerchantId() : Boolean; +begin + Result := True; +end; + +function ListLookupRequest.HasProductGroup() : Boolean; +begin + Result := True; +end; + +function ListLookupRequest.HasProductPage() : Boolean; +begin + Result := True; +end; + +function ListLookupRequest.HasReviewSort() : Boolean; +begin + Result := True; +end; + +function ListLookupRequest.HasSort() : Boolean; +begin + Result := True; +end; + +{ ListLookup_Type } + +constructor ListLookup_Type.Create(); +begin + inherited Create(); + FRequest := ListLookup_RequestArray.Create(); +end; + +destructor ListLookup_Type.Destroy(); +begin + if Assigned(FShared) then + FreeAndNil(FShared); + inherited Destroy(); +end; + +function ListLookup_Type.HasMarketplaceDomain() : Boolean; +begin + Result := True; +end; + +function ListLookup_Type.HasAWSAccessKeyId() : Boolean; +begin + Result := True; +end; + +function ListLookup_Type.HasSubscriptionId() : Boolean; +begin + Result := True; +end; + +function ListLookup_Type.HasAssociateTag() : Boolean; +begin + Result := True; +end; + +function ListLookup_Type.HasValidate() : Boolean; +begin + Result := True; +end; + +function ListLookup_Type.HasXMLEscaping() : Boolean; +begin + Result := True; +end; + +function ListLookup_Type.HasShared() : Boolean; +begin + Result := True; +end; + +{ ListLookupResponse_Type } + +constructor ListLookupResponse_Type.Create(); +begin + inherited Create(); + FLists := ListLookupResponse_ListsArray.Create(); +end; + +destructor ListLookupResponse_Type.Destroy(); +begin + if Assigned(FOperationRequest) then + FreeAndNil(FOperationRequest); + inherited Destroy(); +end; + +function ListLookupResponse_Type.HasOperationRequest() : Boolean; +begin + Result := True; +end; + +{ CustomerContentSearchRequest } + +constructor CustomerContentSearchRequest.Create(); +begin + inherited Create(); + FResponseGroup := CustomerContentSearchRequest_ResponseGroupArray.Create(); +end; + +destructor CustomerContentSearchRequest.Destroy(); +begin + inherited Destroy(); +end; + +function CustomerContentSearchRequest.HasCustomerPage() : Boolean; +begin + Result := True; +end; + +function CustomerContentSearchRequest.HasEmail() : Boolean; +begin + Result := True; +end; + +function CustomerContentSearchRequest.HasName() : Boolean; +begin + Result := True; +end; + +{ CustomerContentSearch_Type } + +constructor CustomerContentSearch_Type.Create(); +begin + inherited Create(); + FRequest := CustomerContentSearch_RequestArray.Create(); +end; + +destructor CustomerContentSearch_Type.Destroy(); +begin + if Assigned(FShared) then + FreeAndNil(FShared); + inherited Destroy(); +end; + +function CustomerContentSearch_Type.HasMarketplaceDomain() : Boolean; +begin + Result := True; +end; + +function CustomerContentSearch_Type.HasAWSAccessKeyId() : Boolean; +begin + Result := True; +end; + +function CustomerContentSearch_Type.HasSubscriptionId() : Boolean; +begin + Result := True; +end; + +function CustomerContentSearch_Type.HasAssociateTag() : Boolean; +begin + Result := True; +end; + +function CustomerContentSearch_Type.HasValidate() : Boolean; +begin + Result := True; +end; + +function CustomerContentSearch_Type.HasXMLEscaping() : Boolean; +begin + Result := True; +end; + +function CustomerContentSearch_Type.HasShared() : Boolean; +begin + Result := True; +end; + +{ Customers_Type } + +constructor Customers_Type.Create(); +begin + inherited Create(); + FCustomer := Customers_CustomerArray.Create(); +end; + +destructor Customers_Type.Destroy(); +begin + if Assigned(FRequest) then + FreeAndNil(FRequest); + inherited Destroy(); +end; + +function Customers_Type.HasRequest() : Boolean; +begin + Result := True; +end; + +function Customers_Type.HasTotalResults() : Boolean; +begin + Result := True; +end; + +function Customers_Type.HasTotalPages() : Boolean; +begin + Result := True; +end; + +{ CustomerContentSearchResponse_Type } + +constructor CustomerContentSearchResponse_Type.Create(); +begin + inherited Create(); + FCustomers := CustomerContentSearchResponse_CustomersArray.Create(); +end; + +destructor CustomerContentSearchResponse_Type.Destroy(); +begin + if Assigned(FOperationRequest) then + FreeAndNil(FOperationRequest); + inherited Destroy(); +end; + +function CustomerContentSearchResponse_Type.HasOperationRequest() : Boolean; +begin + Result := True; +end; + +{ CustomerContentLookupRequest } + +constructor CustomerContentLookupRequest.Create(); +begin + inherited Create(); + FResponseGroup := CustomerContentLookupRequest_ResponseGroupArray.Create(); +end; + +destructor CustomerContentLookupRequest.Destroy(); +begin + inherited Destroy(); +end; + +function CustomerContentLookupRequest.HasCustomerId() : Boolean; +begin + Result := True; +end; + +function CustomerContentLookupRequest.HasReviewPage() : Boolean; +begin + Result := True; +end; + +{ CustomerContentLookup_Type } + +constructor CustomerContentLookup_Type.Create(); +begin + inherited Create(); + FRequest := CustomerContentLookup_RequestArray.Create(); +end; + +destructor CustomerContentLookup_Type.Destroy(); +begin + if Assigned(FShared) then + FreeAndNil(FShared); + inherited Destroy(); +end; + +function CustomerContentLookup_Type.HasMarketplaceDomain() : Boolean; +begin + Result := True; +end; + +function CustomerContentLookup_Type.HasAWSAccessKeyId() : Boolean; +begin + Result := True; +end; + +function CustomerContentLookup_Type.HasSubscriptionId() : Boolean; +begin + Result := True; +end; + +function CustomerContentLookup_Type.HasAssociateTag() : Boolean; +begin + Result := True; +end; + +function CustomerContentLookup_Type.HasValidate() : Boolean; +begin + Result := True; +end; + +function CustomerContentLookup_Type.HasXMLEscaping() : Boolean; +begin + Result := True; +end; + +function CustomerContentLookup_Type.HasShared() : Boolean; +begin + Result := True; +end; + +{ CustomerContentLookupResponse_Type } + +constructor CustomerContentLookupResponse_Type.Create(); +begin + inherited Create(); + FCustomers := CustomerContentLookupResponse_CustomersArray.Create(); +end; + +destructor CustomerContentLookupResponse_Type.Destroy(); +begin + if Assigned(FOperationRequest) then + FreeAndNil(FOperationRequest); + inherited Destroy(); +end; + +function CustomerContentLookupResponse_Type.HasOperationRequest() : Boolean; +begin + Result := True; +end; + +{ SimilarityLookupRequest } + +constructor SimilarityLookupRequest.Create(); +begin + inherited Create(); + FItemId := SimilarityLookupRequest_ItemIdArray.Create(); + FResponseGroup := SimilarityLookupRequest_ResponseGroupArray.Create(); +end; + +destructor SimilarityLookupRequest.Destroy(); +begin + inherited Destroy(); +end; + +function SimilarityLookupRequest.HasCondition() : Boolean; +begin + Result := True; +end; + +function SimilarityLookupRequest.HasDeliveryMethod() : Boolean; +begin + Result := True; +end; + +function SimilarityLookupRequest.HasISPUPostalCode() : Boolean; +begin + Result := True; +end; + +function SimilarityLookupRequest.HasMerchantId() : Boolean; +begin + Result := True; +end; + +function SimilarityLookupRequest.HasReviewSort() : Boolean; +begin + Result := True; +end; + +function SimilarityLookupRequest.HasSimilarityType() : Boolean; +begin + Result := True; +end; + +{ SimilarityLookup_Type } + +constructor SimilarityLookup_Type.Create(); +begin + inherited Create(); + FRequest := SimilarityLookup_RequestArray.Create(); +end; + +destructor SimilarityLookup_Type.Destroy(); +begin + if Assigned(FShared) then + FreeAndNil(FShared); + inherited Destroy(); +end; + +function SimilarityLookup_Type.HasMarketplaceDomain() : Boolean; +begin + Result := True; +end; + +function SimilarityLookup_Type.HasAWSAccessKeyId() : Boolean; +begin + Result := True; +end; + +function SimilarityLookup_Type.HasSubscriptionId() : Boolean; +begin + Result := True; +end; + +function SimilarityLookup_Type.HasAssociateTag() : Boolean; +begin + Result := True; +end; + +function SimilarityLookup_Type.HasValidate() : Boolean; +begin + Result := True; +end; + +function SimilarityLookup_Type.HasXMLEscaping() : Boolean; +begin + Result := True; +end; + +function SimilarityLookup_Type.HasShared() : Boolean; +begin + Result := True; +end; + +{ SimilarityLookupResponse_Type } + +constructor SimilarityLookupResponse_Type.Create(); +begin + inherited Create(); + FItems := SimilarityLookupResponse_ItemsArray.Create(); +end; + +destructor SimilarityLookupResponse_Type.Destroy(); +begin + if Assigned(FOperationRequest) then + FreeAndNil(FOperationRequest); + inherited Destroy(); +end; + +function SimilarityLookupResponse_Type.HasOperationRequest() : Boolean; +begin + Result := True; +end; + +{ SellerLookupRequest } + +constructor SellerLookupRequest.Create(); +begin + inherited Create(); + FResponseGroup := SellerLookupRequest_ResponseGroupArray.Create(); + FSellerId := SellerLookupRequest_SellerIdArray.Create(); +end; + +destructor SellerLookupRequest.Destroy(); +begin + inherited Destroy(); +end; + +function SellerLookupRequest.HasFeedbackPage() : Boolean; +begin + Result := True; +end; + +{ SellerLookup_Type } + +constructor SellerLookup_Type.Create(); +begin + inherited Create(); + FRequest := SellerLookup_RequestArray.Create(); +end; + +destructor SellerLookup_Type.Destroy(); +begin + if Assigned(FShared) then + FreeAndNil(FShared); + inherited Destroy(); +end; + +function SellerLookup_Type.HasMarketplaceDomain() : Boolean; +begin + Result := True; +end; + +function SellerLookup_Type.HasAWSAccessKeyId() : Boolean; +begin + Result := True; +end; + +function SellerLookup_Type.HasSubscriptionId() : Boolean; +begin + Result := True; +end; + +function SellerLookup_Type.HasAssociateTag() : Boolean; +begin + Result := True; +end; + +function SellerLookup_Type.HasValidate() : Boolean; +begin + Result := True; +end; + +function SellerLookup_Type.HasXMLEscaping() : Boolean; +begin + Result := True; +end; + +function SellerLookup_Type.HasShared() : Boolean; +begin + Result := True; +end; + +{ Sellers_Type } + +constructor Sellers_Type.Create(); +begin + inherited Create(); + FSeller := Sellers_SellerArray.Create(); +end; + +destructor Sellers_Type.Destroy(); +begin + if Assigned(FRequest) then + FreeAndNil(FRequest); + inherited Destroy(); +end; + +function Sellers_Type.HasRequest() : Boolean; +begin + Result := True; +end; + +function Sellers_Type.HasTotalResults() : Boolean; +begin + Result := True; +end; + +function Sellers_Type.HasTotalPages() : Boolean; +begin + Result := True; +end; + +{ SellerLookupResponse_Type } + +constructor SellerLookupResponse_Type.Create(); +begin + inherited Create(); + FSellers := SellerLookupResponse_SellersArray.Create(); +end; + +destructor SellerLookupResponse_Type.Destroy(); +begin + if Assigned(FOperationRequest) then + FreeAndNil(FOperationRequest); + inherited Destroy(); +end; + +function SellerLookupResponse_Type.HasOperationRequest() : Boolean; +begin + Result := True; +end; + +{ CartGetRequest } + +constructor CartGetRequest.Create(); +begin + inherited Create(); + FResponseGroup := CartGetRequest_ResponseGroupArray.Create(); +end; + +destructor CartGetRequest.Destroy(); +begin + inherited Destroy(); +end; + +function CartGetRequest.HasCartId() : Boolean; +begin + Result := True; +end; + +function CartGetRequest.HasHMAC() : Boolean; +begin + Result := True; +end; + +function CartGetRequest.HasMergeCart() : Boolean; +begin + Result := True; +end; + +{ CartGet_Type } + +constructor CartGet_Type.Create(); +begin + inherited Create(); + FRequest := CartGet_RequestArray.Create(); +end; + +destructor CartGet_Type.Destroy(); +begin + if Assigned(FShared) then + FreeAndNil(FShared); + inherited Destroy(); +end; + +function CartGet_Type.HasMarketplaceDomain() : Boolean; +begin + Result := True; +end; + +function CartGet_Type.HasAWSAccessKeyId() : Boolean; +begin + Result := True; +end; + +function CartGet_Type.HasSubscriptionId() : Boolean; +begin + Result := True; +end; + +function CartGet_Type.HasAssociateTag() : Boolean; +begin + Result := True; +end; + +function CartGet_Type.HasValidate() : Boolean; +begin + Result := True; +end; + +function CartGet_Type.HasXMLEscaping() : Boolean; +begin + Result := True; +end; + +function CartGet_Type.HasShared() : Boolean; +begin + Result := True; +end; + +{ Cart_Type } + +constructor Cart_Type.Create(); +begin + inherited Create(); + FSimilarProducts := SimilarProducts_Type.Create(); + FTopSellers := TopSellers_Type.Create(); + FNewReleases := NewReleases_Type.Create(); + FSimilarViewedProducts := SimilarViewedProducts_Type.Create(); + FOtherCategoriesSimilarProducts := OtherCategoriesSimilarProducts_Type.Create(); +end; + +destructor Cart_Type.Destroy(); +begin + if Assigned(FRequest) then + FreeAndNil(FRequest); + if Assigned(FSubTotal) then + FreeAndNil(FSubTotal); + if Assigned(FCartItems) then + FreeAndNil(FCartItems); + if Assigned(FSavedForLaterItems) then + FreeAndNil(FSavedForLaterItems); + inherited Destroy(); +end; + +function Cart_Type.HasRequest() : Boolean; +begin + Result := True; +end; + +function Cart_Type.HasPurchaseURL() : Boolean; +begin + Result := True; +end; + +function Cart_Type.HasSubTotal() : Boolean; +begin + Result := True; +end; + +function Cart_Type.HasCartItems() : Boolean; +begin + Result := True; +end; + +function Cart_Type.HasSavedForLaterItems() : Boolean; +begin + Result := True; +end; + +function Cart_Type.HasSimilarProducts() : Boolean; +begin + Result := True; +end; + +function Cart_Type.HasTopSellers() : Boolean; +begin + Result := True; +end; + +function Cart_Type.HasNewReleases() : Boolean; +begin + Result := True; +end; + +function Cart_Type.HasSimilarViewedProducts() : Boolean; +begin + Result := True; +end; + +function Cart_Type.HasOtherCategoriesSimilarProducts() : Boolean; +begin + Result := True; +end; + +{ CartGetResponse_Type } + +constructor CartGetResponse_Type.Create(); +begin + inherited Create(); + FCart := CartGetResponse_CartArray.Create(); +end; + +destructor CartGetResponse_Type.Destroy(); +begin + if Assigned(FOperationRequest) then + FreeAndNil(FOperationRequest); + inherited Destroy(); +end; + +function CartGetResponse_Type.HasOperationRequest() : Boolean; +begin + Result := True; +end; + +{ CartAddRequest } + +constructor CartAddRequest.Create(); +begin + inherited Create(); + FItems := CartAddRequest_Items_Type.Create(); + FResponseGroup := CartAddRequest_ResponseGroupArray.Create(); +end; + +destructor CartAddRequest.Destroy(); +begin + inherited Destroy(); +end; + +function CartAddRequest.HasCartId() : Boolean; +begin + Result := True; +end; + +function CartAddRequest.HasHMAC() : Boolean; +begin + Result := True; +end; + +function CartAddRequest.HasMergeCart() : Boolean; +begin + Result := True; +end; + +function CartAddRequest.HasItems() : Boolean; +begin + Result := True; +end; + +{ CartAdd_Type } + +constructor CartAdd_Type.Create(); +begin + inherited Create(); + FRequest := CartAdd_RequestArray.Create(); +end; + +destructor CartAdd_Type.Destroy(); +begin + if Assigned(FShared) then + FreeAndNil(FShared); + inherited Destroy(); +end; + +function CartAdd_Type.HasMarketplaceDomain() : Boolean; +begin + Result := True; +end; + +function CartAdd_Type.HasAWSAccessKeyId() : Boolean; +begin + Result := True; +end; + +function CartAdd_Type.HasSubscriptionId() : Boolean; +begin + Result := True; +end; + +function CartAdd_Type.HasAssociateTag() : Boolean; +begin + Result := True; +end; + +function CartAdd_Type.HasValidate() : Boolean; +begin + Result := True; +end; + +function CartAdd_Type.HasXMLEscaping() : Boolean; +begin + Result := True; +end; + +function CartAdd_Type.HasShared() : Boolean; +begin + Result := True; +end; + +{ CartAddResponse_Type } + +constructor CartAddResponse_Type.Create(); +begin + inherited Create(); + FCart := CartAddResponse_CartArray.Create(); +end; + +destructor CartAddResponse_Type.Destroy(); +begin + if Assigned(FOperationRequest) then + FreeAndNil(FOperationRequest); + inherited Destroy(); +end; + +function CartAddResponse_Type.HasOperationRequest() : Boolean; +begin + Result := True; +end; + +{ CartCreateRequest } + +constructor CartCreateRequest.Create(); +begin + inherited Create(); + FItems := CartCreateRequest_Items_Type.Create(); + FResponseGroup := CartCreateRequest_ResponseGroupArray.Create(); +end; + +destructor CartCreateRequest.Destroy(); +begin + inherited Destroy(); +end; + +function CartCreateRequest.HasMergeCart() : Boolean; +begin + Result := True; +end; + +function CartCreateRequest.HasItems() : Boolean; +begin + Result := True; +end; + +{ CartCreate_Type } + +constructor CartCreate_Type.Create(); +begin + inherited Create(); + FRequest := CartCreate_RequestArray.Create(); +end; + +destructor CartCreate_Type.Destroy(); +begin + if Assigned(FShared) then + FreeAndNil(FShared); + inherited Destroy(); +end; + +function CartCreate_Type.HasMarketplaceDomain() : Boolean; +begin + Result := True; +end; + +function CartCreate_Type.HasAWSAccessKeyId() : Boolean; +begin + Result := True; +end; + +function CartCreate_Type.HasSubscriptionId() : Boolean; +begin + Result := True; +end; + +function CartCreate_Type.HasAssociateTag() : Boolean; +begin + Result := True; +end; + +function CartCreate_Type.HasValidate() : Boolean; +begin + Result := True; +end; + +function CartCreate_Type.HasXMLEscaping() : Boolean; +begin + Result := True; +end; + +function CartCreate_Type.HasShared() : Boolean; +begin + Result := True; +end; + +{ CartCreateResponse_Type } + +constructor CartCreateResponse_Type.Create(); +begin + inherited Create(); + FCart := CartCreateResponse_CartArray.Create(); +end; + +destructor CartCreateResponse_Type.Destroy(); +begin + if Assigned(FOperationRequest) then + FreeAndNil(FOperationRequest); + inherited Destroy(); +end; + +function CartCreateResponse_Type.HasOperationRequest() : Boolean; +begin + Result := True; +end; + +{ CartModifyRequest } + +constructor CartModifyRequest.Create(); +begin + inherited Create(); + FItems := CartModifyRequest_Items_Type.Create(); + FResponseGroup := CartModifyRequest_ResponseGroupArray.Create(); +end; + +destructor CartModifyRequest.Destroy(); +begin + inherited Destroy(); +end; + +function CartModifyRequest.HasCartId() : Boolean; +begin + Result := True; +end; + +function CartModifyRequest.HasHMAC() : Boolean; +begin + Result := True; +end; + +function CartModifyRequest.HasMergeCart() : Boolean; +begin + Result := True; +end; + +function CartModifyRequest.HasItems() : Boolean; +begin + Result := True; +end; + +{ CartModify_Type } + +constructor CartModify_Type.Create(); +begin + inherited Create(); + FRequest := CartModify_RequestArray.Create(); +end; + +destructor CartModify_Type.Destroy(); +begin + if Assigned(FShared) then + FreeAndNil(FShared); + inherited Destroy(); +end; + +function CartModify_Type.HasMarketplaceDomain() : Boolean; +begin + Result := True; +end; + +function CartModify_Type.HasAWSAccessKeyId() : Boolean; +begin + Result := True; +end; + +function CartModify_Type.HasSubscriptionId() : Boolean; +begin + Result := True; +end; + +function CartModify_Type.HasAssociateTag() : Boolean; +begin + Result := True; +end; + +function CartModify_Type.HasValidate() : Boolean; +begin + Result := True; +end; + +function CartModify_Type.HasXMLEscaping() : Boolean; +begin + Result := True; +end; + +function CartModify_Type.HasShared() : Boolean; +begin + Result := True; +end; + +{ CartModifyResponse_Type } + +constructor CartModifyResponse_Type.Create(); +begin + inherited Create(); + FCart := CartModifyResponse_CartArray.Create(); +end; + +destructor CartModifyResponse_Type.Destroy(); +begin + if Assigned(FOperationRequest) then + FreeAndNil(FOperationRequest); + inherited Destroy(); +end; + +function CartModifyResponse_Type.HasOperationRequest() : Boolean; +begin + Result := True; +end; + +{ CartClearRequest } + +constructor CartClearRequest.Create(); +begin + inherited Create(); + FResponseGroup := CartClearRequest_ResponseGroupArray.Create(); +end; + +destructor CartClearRequest.Destroy(); +begin + inherited Destroy(); +end; + +function CartClearRequest.HasCartId() : Boolean; +begin + Result := True; +end; + +function CartClearRequest.HasHMAC() : Boolean; +begin + Result := True; +end; + +function CartClearRequest.HasMergeCart() : Boolean; +begin + Result := True; +end; + +{ CartClear_Type } + +constructor CartClear_Type.Create(); +begin + inherited Create(); + FRequest := CartClear_RequestArray.Create(); +end; + +destructor CartClear_Type.Destroy(); +begin + if Assigned(FShared) then + FreeAndNil(FShared); + inherited Destroy(); +end; + +function CartClear_Type.HasMarketplaceDomain() : Boolean; +begin + Result := True; +end; + +function CartClear_Type.HasAWSAccessKeyId() : Boolean; +begin + Result := True; +end; + +function CartClear_Type.HasSubscriptionId() : Boolean; +begin + Result := True; +end; + +function CartClear_Type.HasAssociateTag() : Boolean; +begin + Result := True; +end; + +function CartClear_Type.HasValidate() : Boolean; +begin + Result := True; +end; + +function CartClear_Type.HasXMLEscaping() : Boolean; +begin + Result := True; +end; + +function CartClear_Type.HasShared() : Boolean; +begin + Result := True; +end; + +{ CartClearResponse_Type } + +constructor CartClearResponse_Type.Create(); +begin + inherited Create(); + FCart := CartClearResponse_CartArray.Create(); +end; + +destructor CartClearResponse_Type.Destroy(); +begin + if Assigned(FOperationRequest) then + FreeAndNil(FOperationRequest); + inherited Destroy(); +end; + +function CartClearResponse_Type.HasOperationRequest() : Boolean; +begin + Result := True; +end; + +{ TransactionLookupRequest } + +constructor TransactionLookupRequest.Create(); +begin + inherited Create(); + FResponseGroup := TransactionLookupRequest_ResponseGroupArray.Create(); + FTransactionId := TransactionLookupRequest_TransactionIdArray.Create(); +end; + +destructor TransactionLookupRequest.Destroy(); +begin + inherited Destroy(); +end; + +{ TransactionLookup_Type } + +constructor TransactionLookup_Type.Create(); +begin + inherited Create(); + FRequest := TransactionLookup_RequestArray.Create(); +end; + +destructor TransactionLookup_Type.Destroy(); +begin + if Assigned(FShared) then + FreeAndNil(FShared); + inherited Destroy(); +end; + +function TransactionLookup_Type.HasMarketplaceDomain() : Boolean; +begin + Result := True; +end; + +function TransactionLookup_Type.HasAWSAccessKeyId() : Boolean; +begin + Result := True; +end; + +function TransactionLookup_Type.HasSubscriptionId() : Boolean; +begin + Result := True; +end; + +function TransactionLookup_Type.HasAssociateTag() : Boolean; +begin + Result := True; +end; + +function TransactionLookup_Type.HasValidate() : Boolean; +begin + Result := True; +end; + +function TransactionLookup_Type.HasXMLEscaping() : Boolean; +begin + Result := True; +end; + +function TransactionLookup_Type.HasShared() : Boolean; +begin + Result := True; +end; + +{ Transactions_Type } + +constructor Transactions_Type.Create(); +begin + inherited Create(); + FTransaction := Transactions_TransactionArray.Create(); +end; + +destructor Transactions_Type.Destroy(); +begin + if Assigned(FRequest) then + FreeAndNil(FRequest); + inherited Destroy(); +end; + +function Transactions_Type.HasRequest() : Boolean; +begin + Result := True; +end; + +function Transactions_Type.HasTotalResults() : Boolean; +begin + Result := True; +end; + +function Transactions_Type.HasTotalPages() : Boolean; +begin + Result := True; +end; + +{ TransactionLookupResponse_Type } + +constructor TransactionLookupResponse_Type.Create(); +begin + inherited Create(); + FTransactions := TransactionLookupResponse_TransactionsArray.Create(); +end; + +destructor TransactionLookupResponse_Type.Destroy(); +begin + if Assigned(FOperationRequest) then + FreeAndNil(FOperationRequest); + inherited Destroy(); +end; + +function TransactionLookupResponse_Type.HasOperationRequest() : Boolean; +begin + Result := True; +end; + +{ SellerListingSearchRequest } + +constructor SellerListingSearchRequest.Create(); +begin + inherited Create(); + FResponseGroup := SellerListingSearchRequest_ResponseGroupArray.Create(); +end; + +destructor SellerListingSearchRequest.Destroy(); +begin + inherited Destroy(); +end; + +function SellerListingSearchRequest.HasKeywords() : Boolean; +begin + Result := True; +end; + +function SellerListingSearchRequest.HasListingPage() : Boolean; +begin + Result := True; +end; + +function SellerListingSearchRequest.HasOfferStatus() : Boolean; +begin + Result := True; +end; + +function SellerListingSearchRequest.HasSort() : Boolean; +begin + Result := True; +end; + +function SellerListingSearchRequest.HasTitle() : Boolean; +begin + Result := True; +end; + +{ SellerListingSearch_Type } + +constructor SellerListingSearch_Type.Create(); +begin + inherited Create(); + FRequest := SellerListingSearch_RequestArray.Create(); +end; + +destructor SellerListingSearch_Type.Destroy(); +begin + if Assigned(FShared) then + FreeAndNil(FShared); + inherited Destroy(); +end; + +function SellerListingSearch_Type.HasMarketplaceDomain() : Boolean; +begin + Result := True; +end; + +function SellerListingSearch_Type.HasAWSAccessKeyId() : Boolean; +begin + Result := True; +end; + +function SellerListingSearch_Type.HasSubscriptionId() : Boolean; +begin + Result := True; +end; + +function SellerListingSearch_Type.HasAssociateTag() : Boolean; +begin + Result := True; +end; + +function SellerListingSearch_Type.HasValidate() : Boolean; +begin + Result := True; +end; + +function SellerListingSearch_Type.HasXMLEscaping() : Boolean; +begin + Result := True; +end; + +function SellerListingSearch_Type.HasShared() : Boolean; +begin + Result := True; +end; + +{ SellerListings_Type } + +constructor SellerListings_Type.Create(); +begin + inherited Create(); + FSellerListing := SellerListings_SellerListingArray.Create(); +end; + +destructor SellerListings_Type.Destroy(); +begin + if Assigned(FRequest) then + FreeAndNil(FRequest); + inherited Destroy(); +end; + +function SellerListings_Type.HasRequest() : Boolean; +begin + Result := True; +end; + +function SellerListings_Type.HasTotalResults() : Boolean; +begin + Result := True; +end; + +function SellerListings_Type.HasTotalPages() : Boolean; +begin + Result := True; +end; + +{ SellerListingSearchResponse_Type } + +constructor SellerListingSearchResponse_Type.Create(); +begin + inherited Create(); + FSellerListings := SellerListingSearchResponse_SellerListingsArray.Create(); +end; + +destructor SellerListingSearchResponse_Type.Destroy(); +begin + if Assigned(FOperationRequest) then + FreeAndNil(FOperationRequest); + inherited Destroy(); +end; + +function SellerListingSearchResponse_Type.HasOperationRequest() : Boolean; +begin + Result := True; +end; + +{ SellerListingLookupRequest } + +constructor SellerListingLookupRequest.Create(); +begin + inherited Create(); + FResponseGroup := SellerListingLookupRequest_ResponseGroupArray.Create(); +end; + +destructor SellerListingLookupRequest.Destroy(); +begin + inherited Destroy(); +end; + +function SellerListingLookupRequest.HasSellerId() : Boolean; +begin + Result := True; +end; + +{ SellerListingLookup_Type } + +constructor SellerListingLookup_Type.Create(); +begin + inherited Create(); + FRequest := SellerListingLookup_RequestArray.Create(); +end; + +destructor SellerListingLookup_Type.Destroy(); +begin + if Assigned(FShared) then + FreeAndNil(FShared); + inherited Destroy(); +end; + +function SellerListingLookup_Type.HasMarketplaceDomain() : Boolean; +begin + Result := True; +end; + +function SellerListingLookup_Type.HasAWSAccessKeyId() : Boolean; +begin + Result := True; +end; + +function SellerListingLookup_Type.HasSubscriptionId() : Boolean; +begin + Result := True; +end; + +function SellerListingLookup_Type.HasAssociateTag() : Boolean; +begin + Result := True; +end; + +function SellerListingLookup_Type.HasValidate() : Boolean; +begin + Result := True; +end; + +function SellerListingLookup_Type.HasXMLEscaping() : Boolean; +begin + Result := True; +end; + +function SellerListingLookup_Type.HasShared() : Boolean; +begin + Result := True; +end; + +{ SellerListingLookupResponse_Type } + +constructor SellerListingLookupResponse_Type.Create(); +begin + inherited Create(); + FSellerListings := SellerListingLookupResponse_SellerListingsArray.Create(); +end; + +destructor SellerListingLookupResponse_Type.Destroy(); +begin + if Assigned(FOperationRequest) then + FreeAndNil(FOperationRequest); + inherited Destroy(); +end; + +function SellerListingLookupResponse_Type.HasOperationRequest() : Boolean; +begin + Result := True; +end; + +{ MultiOperationType } + +destructor MultiOperationType.Destroy(); +begin + if Assigned(FHelp) then + FreeAndNil(FHelp); + if Assigned(FItemSearch) then + FreeAndNil(FItemSearch); + if Assigned(FItemLookup) then + FreeAndNil(FItemLookup); + if Assigned(FListSearch) then + FreeAndNil(FListSearch); + if Assigned(FListLookup) then + FreeAndNil(FListLookup); + if Assigned(FCustomerContentSearch) then + FreeAndNil(FCustomerContentSearch); + if Assigned(FCustomerContentLookup) then + FreeAndNil(FCustomerContentLookup); + if Assigned(FSimilarityLookup) then + FreeAndNil(FSimilarityLookup); + if Assigned(FSellerLookup) then + FreeAndNil(FSellerLookup); + if Assigned(FCartGet) then + FreeAndNil(FCartGet); + if Assigned(FCartAdd) then + FreeAndNil(FCartAdd); + if Assigned(FCartCreate) then + FreeAndNil(FCartCreate); + if Assigned(FCartModify) then + FreeAndNil(FCartModify); + if Assigned(FCartClear) then + FreeAndNil(FCartClear); + if Assigned(FTransactionLookup) then + FreeAndNil(FTransactionLookup); + if Assigned(FSellerListingSearch) then + FreeAndNil(FSellerListingSearch); + if Assigned(FSellerListingLookup) then + FreeAndNil(FSellerListingLookup); + if Assigned(FBrowseNodeLookup) then + FreeAndNil(FBrowseNodeLookup); + inherited Destroy(); +end; + +function MultiOperationType.HasHelp() : Boolean; +begin + Result := True; +end; + +function MultiOperationType.HasItemSearch() : Boolean; +begin + Result := True; +end; + +function MultiOperationType.HasItemLookup() : Boolean; +begin + Result := True; +end; + +function MultiOperationType.HasListSearch() : Boolean; +begin + Result := True; +end; + +function MultiOperationType.HasListLookup() : Boolean; +begin + Result := True; +end; + +function MultiOperationType.HasCustomerContentSearch() : Boolean; +begin + Result := True; +end; + +function MultiOperationType.HasCustomerContentLookup() : Boolean; +begin + Result := True; +end; + +function MultiOperationType.HasSimilarityLookup() : Boolean; +begin + Result := True; +end; + +function MultiOperationType.HasSellerLookup() : Boolean; +begin + Result := True; +end; + +function MultiOperationType.HasCartGet() : Boolean; +begin + Result := True; +end; + +function MultiOperationType.HasCartAdd() : Boolean; +begin + Result := True; +end; + +function MultiOperationType.HasCartCreate() : Boolean; +begin + Result := True; +end; + +function MultiOperationType.HasCartModify() : Boolean; +begin + Result := True; +end; + +function MultiOperationType.HasCartClear() : Boolean; +begin + Result := True; +end; + +function MultiOperationType.HasTransactionLookup() : Boolean; +begin + Result := True; +end; + +function MultiOperationType.HasSellerListingSearch() : Boolean; +begin + Result := True; +end; + +function MultiOperationType.HasSellerListingLookup() : Boolean; +begin + Result := True; +end; + +function MultiOperationType.HasBrowseNodeLookup() : Boolean; +begin + Result := True; +end; + +{ MultiOperationResponse } + +destructor MultiOperationResponse.Destroy(); +begin + if Assigned(FOperationRequest) then + FreeAndNil(FOperationRequest); + if Assigned(FHelpResponse) then + FreeAndNil(FHelpResponse); + if Assigned(FItemSearchResponse) then + FreeAndNil(FItemSearchResponse); + if Assigned(FItemLookupResponse) then + FreeAndNil(FItemLookupResponse); + if Assigned(FListSearchResponse) then + FreeAndNil(FListSearchResponse); + if Assigned(FListLookupResponse) then + FreeAndNil(FListLookupResponse); + if Assigned(FCustomerContentSearchResponse) then + FreeAndNil(FCustomerContentSearchResponse); + if Assigned(FCustomerContentLookupResponse) then + FreeAndNil(FCustomerContentLookupResponse); + if Assigned(FSimilarityLookupResponse) then + FreeAndNil(FSimilarityLookupResponse); + if Assigned(FSellerLookupResponse) then + FreeAndNil(FSellerLookupResponse); + if Assigned(FCartGetResponse) then + FreeAndNil(FCartGetResponse); + if Assigned(FCartAddResponse) then + FreeAndNil(FCartAddResponse); + if Assigned(FCartCreateResponse) then + FreeAndNil(FCartCreateResponse); + if Assigned(FCartModifyResponse) then + FreeAndNil(FCartModifyResponse); + if Assigned(FCartClearResponse) then + FreeAndNil(FCartClearResponse); + if Assigned(FTransactionLookupResponse) then + FreeAndNil(FTransactionLookupResponse); + if Assigned(FSellerListingSearchResponse) then + FreeAndNil(FSellerListingSearchResponse); + if Assigned(FSellerListingLookupResponse) then + FreeAndNil(FSellerListingLookupResponse); + if Assigned(FBrowseNodeLookupResponse) then + FreeAndNil(FBrowseNodeLookupResponse); + inherited Destroy(); +end; + +function MultiOperationResponse.HasOperationRequest() : Boolean; +begin + Result := True; +end; + +function MultiOperationResponse.HasHelpResponse() : Boolean; +begin + Result := True; +end; + +function MultiOperationResponse.HasItemSearchResponse() : Boolean; +begin + Result := True; +end; + +function MultiOperationResponse.HasItemLookupResponse() : Boolean; +begin + Result := True; +end; + +function MultiOperationResponse.HasListSearchResponse() : Boolean; +begin + Result := True; +end; + +function MultiOperationResponse.HasListLookupResponse() : Boolean; +begin + Result := True; +end; + +function MultiOperationResponse.HasCustomerContentSearchResponse() : Boolean; +begin + Result := True; +end; + +function MultiOperationResponse.HasCustomerContentLookupResponse() : Boolean; +begin + Result := True; +end; + +function MultiOperationResponse.HasSimilarityLookupResponse() : Boolean; +begin + Result := True; +end; + +function MultiOperationResponse.HasSellerLookupResponse() : Boolean; +begin + Result := True; +end; + +function MultiOperationResponse.HasCartGetResponse() : Boolean; +begin + Result := True; +end; + +function MultiOperationResponse.HasCartAddResponse() : Boolean; +begin + Result := True; +end; + +function MultiOperationResponse.HasCartCreateResponse() : Boolean; +begin + Result := True; +end; + +function MultiOperationResponse.HasCartModifyResponse() : Boolean; +begin + Result := True; +end; + +function MultiOperationResponse.HasCartClearResponse() : Boolean; +begin + Result := True; +end; + +function MultiOperationResponse.HasTransactionLookupResponse() : Boolean; +begin + Result := True; +end; + +function MultiOperationResponse.HasSellerListingSearchResponse() : Boolean; +begin + Result := True; +end; + +function MultiOperationResponse.HasSellerListingLookupResponse() : Boolean; +begin + Result := True; +end; + +function MultiOperationResponse.HasBrowseNodeLookupResponse() : Boolean; +begin + Result := True; +end; + +{ Bin_Type } + +constructor Bin_Type.Create(); +begin + inherited Create(); + FBinParameter := Bin_BinParameterArray.Create(); +end; + +destructor Bin_Type.Destroy(); +begin + inherited Destroy(); +end; + +{ SearchBinSet_Type } + +constructor SearchBinSet_Type.Create(); +begin + inherited Create(); + FBin := SearchBinSet_BinArray.Create(); +end; + +destructor SearchBinSet_Type.Destroy(); +begin + inherited Destroy(); +end; + +{ CartAddRequest_Items_Type_Item_Type } + +function CartAddRequest_Items_Type_Item_Type.HasASIN() : Boolean; +begin + Result := True; +end; + +function CartAddRequest_Items_Type_Item_Type.HasOfferListingId() : Boolean; +begin + Result := True; +end; + +function CartAddRequest_Items_Type_Item_Type.HasQuantity() : Boolean; +begin + Result := True; +end; + +function CartAddRequest_Items_Type_Item_Type.HasAssociateTag() : Boolean; +begin + Result := True; +end; + +function CartAddRequest_Items_Type_Item_Type.HasListItemId() : Boolean; +begin + Result := True; +end; + +{ CartCreateRequest_Items_Type_Item_Type } + +function CartCreateRequest_Items_Type_Item_Type.HasASIN() : Boolean; +begin + Result := True; +end; + +function CartCreateRequest_Items_Type_Item_Type.HasOfferListingId() : Boolean; +begin + Result := True; +end; + +function CartCreateRequest_Items_Type_Item_Type.HasQuantity() : Boolean; +begin + Result := True; +end; + +function CartCreateRequest_Items_Type_Item_Type.HasAssociateTag() : Boolean; +begin + Result := True; +end; + +function CartCreateRequest_Items_Type_Item_Type.HasListItemId() : Boolean; +begin + Result := True; +end; + +{ CartModifyRequest_Items_Type_Item_Type } + +function CartModifyRequest_Items_Type_Item_Type.HasAction() : Boolean; +begin + Result := True; +end; + +function CartModifyRequest_Items_Type_Item_Type.HasCartItemId() : Boolean; +begin + Result := True; +end; + +function CartModifyRequest_Items_Type_Item_Type.HasQuantity() : Boolean; +begin + Result := True; +end; + +{ Request_Type } + +constructor Request_Type.Create(); +begin + inherited Create(); + FErrors := Errors_Type.Create(); +end; + +destructor Request_Type.Destroy(); +begin + if Assigned(FHelpRequest) then + FreeAndNil(FHelpRequest); + if Assigned(FBrowseNodeLookupRequest) then + FreeAndNil(FBrowseNodeLookupRequest); + if Assigned(FItemSearchRequest) then + FreeAndNil(FItemSearchRequest); + if Assigned(FItemLookupRequest) then + FreeAndNil(FItemLookupRequest); + if Assigned(FListSearchRequest) then + FreeAndNil(FListSearchRequest); + if Assigned(FListLookupRequest) then + FreeAndNil(FListLookupRequest); + if Assigned(FCustomerContentSearchRequest) then + FreeAndNil(FCustomerContentSearchRequest); + if Assigned(FCustomerContentLookupRequest) then + FreeAndNil(FCustomerContentLookupRequest); + if Assigned(FSimilarityLookupRequest) then + FreeAndNil(FSimilarityLookupRequest); + if Assigned(FCartGetRequest) then + FreeAndNil(FCartGetRequest); + if Assigned(FCartAddRequest) then + FreeAndNil(FCartAddRequest); + if Assigned(FCartCreateRequest) then + FreeAndNil(FCartCreateRequest); + if Assigned(FCartModifyRequest) then + FreeAndNil(FCartModifyRequest); + if Assigned(FCartClearRequest) then + FreeAndNil(FCartClearRequest); + if Assigned(FTransactionLookupRequest) then + FreeAndNil(FTransactionLookupRequest); + if Assigned(FSellerListingSearchRequest) then + FreeAndNil(FSellerListingSearchRequest); + if Assigned(FSellerListingLookupRequest) then + FreeAndNil(FSellerListingLookupRequest); + if Assigned(FSellerLookupRequest) then + FreeAndNil(FSellerLookupRequest); + inherited Destroy(); +end; + +function Request_Type.HasIsValid() : Boolean; +begin + Result := True; +end; + +function Request_Type.HasHelpRequest() : Boolean; +begin + Result := True; +end; + +function Request_Type.HasBrowseNodeLookupRequest() : Boolean; +begin + Result := True; +end; + +function Request_Type.HasItemSearchRequest() : Boolean; +begin + Result := True; +end; + +function Request_Type.HasItemLookupRequest() : Boolean; +begin + Result := True; +end; + +function Request_Type.HasListSearchRequest() : Boolean; +begin + Result := True; +end; + +function Request_Type.HasListLookupRequest() : Boolean; +begin + Result := True; +end; + +function Request_Type.HasCustomerContentSearchRequest() : Boolean; +begin + Result := True; +end; + +function Request_Type.HasCustomerContentLookupRequest() : Boolean; +begin + Result := True; +end; + +function Request_Type.HasSimilarityLookupRequest() : Boolean; +begin + Result := True; +end; + +function Request_Type.HasCartGetRequest() : Boolean; +begin + Result := True; +end; + +function Request_Type.HasCartAddRequest() : Boolean; +begin + Result := True; +end; + +function Request_Type.HasCartCreateRequest() : Boolean; +begin + Result := True; +end; + +function Request_Type.HasCartModifyRequest() : Boolean; +begin + Result := True; +end; + +function Request_Type.HasCartClearRequest() : Boolean; +begin + Result := True; +end; + +function Request_Type.HasTransactionLookupRequest() : Boolean; +begin + Result := True; +end; + +function Request_Type.HasSellerListingSearchRequest() : Boolean; +begin + Result := True; +end; + +function Request_Type.HasSellerListingLookupRequest() : Boolean; +begin + Result := True; +end; + +function Request_Type.HasSellerLookupRequest() : Boolean; +begin + Result := True; +end; + +function Request_Type.HasErrors() : Boolean; +begin + Result := True; +end; + +{ OperationInformation_Type } + +constructor OperationInformation_Type.Create(); +begin + inherited Create(); + FRequiredParameters := OperationInformation_RequiredParameters_Type.Create(); + FAvailableParameters := OperationInformation_AvailableParameters_Type.Create(); + FDefaultResponseGroups := OperationInformation_DefaultResponseGroups_Type.Create(); + FAvailableResponseGroups := OperationInformation_AvailableResponseGroups_Type.Create(); +end; + +destructor OperationInformation_Type.Destroy(); +begin + inherited Destroy(); +end; + +function OperationInformation_Type.HasName() : Boolean; +begin + Result := True; +end; + +function OperationInformation_Type.HasDescription() : Boolean; +begin + Result := True; +end; + +function OperationInformation_Type.HasRequiredParameters() : Boolean; +begin + Result := True; +end; + +function OperationInformation_Type.HasAvailableParameters() : Boolean; +begin + Result := True; +end; + +function OperationInformation_Type.HasDefaultResponseGroups() : Boolean; +begin + Result := True; +end; + +function OperationInformation_Type.HasAvailableResponseGroups() : Boolean; +begin + Result := True; +end; + +{ ResponseGroupInformation_Type } + +constructor ResponseGroupInformation_Type.Create(); +begin + inherited Create(); + FValidOperations := ResponseGroupInformation_ValidOperations_Type.Create(); + FElements := ResponseGroupInformation_Elements_Type.Create(); +end; + +destructor ResponseGroupInformation_Type.Destroy(); +begin + inherited Destroy(); +end; + +function ResponseGroupInformation_Type.HasName() : Boolean; +begin + Result := True; +end; + +function ResponseGroupInformation_Type.HasCreationDate() : Boolean; +begin + Result := True; +end; + +function ResponseGroupInformation_Type.HasValidOperations() : Boolean; +begin + Result := True; +end; + +function ResponseGroupInformation_Type.HasElements() : Boolean; +begin + Result := True; +end; + +{ CorrectedQuery_Type } + +function CorrectedQuery_Type.HasKeywords() : Boolean; +begin + Result := True; +end; + +function CorrectedQuery_Type.HasMessage() : Boolean; +begin + Result := True; +end; + +{ Item_Type } + +constructor Item_Type.Create(); +begin + inherited Create(); + FErrors := Errors_Type.Create(); + FImageSets := _Item_ImageSetsArray.Create(); + FCollections := Collections_Type.Create(); + FSubjects := Item_Subjects_Type.Create(); + FEditorialReviews := EditorialReviews_Type.Create(); + FSimilarProducts := SimilarProducts_Type.Create(); + FAccessories := Accessories_Type.Create(); + FTracks := Tracks_Type.Create(); + FListmaniaLists := ListmaniaLists_Type.Create(); + FAlternateVersions := Item_AlternateVersions_Type.Create(); +end; + +destructor Item_Type.Destroy(); +begin + if Assigned(FSmallImage) then + FreeAndNil(FSmallImage); + if Assigned(FMediumImage) then + FreeAndNil(FMediumImage); + if Assigned(FLargeImage) then + FreeAndNil(FLargeImage); + if Assigned(FItemAttributes) then + FreeAndNil(FItemAttributes); + if Assigned(FMerchantItemAttributes) then + FreeAndNil(FMerchantItemAttributes); + if Assigned(FOfferSummary) then + FreeAndNil(FOfferSummary); + if Assigned(FOffers) then + FreeAndNil(FOffers); + if Assigned(FVariationSummary) then + FreeAndNil(FVariationSummary); + if Assigned(FVariations) then + FreeAndNil(FVariations); + if Assigned(FCustomerReviews) then + FreeAndNil(FCustomerReviews); + if Assigned(FBrowseNodes) then + FreeAndNil(FBrowseNodes); + if Assigned(FSearchInside) then + FreeAndNil(FSearchInside); + inherited Destroy(); +end; + +function Item_Type.HasParentASIN() : Boolean; +begin + Result := True; +end; + +function Item_Type.HasErrors() : Boolean; +begin + Result := True; +end; + +function Item_Type.HasDetailPageURL() : Boolean; +begin + Result := True; +end; + +function Item_Type.HasSalesRank() : Boolean; +begin + Result := True; +end; + +function Item_Type.HasSmallImage() : Boolean; +begin + Result := True; +end; + +function Item_Type.HasMediumImage() : Boolean; +begin + Result := True; +end; + +function Item_Type.HasLargeImage() : Boolean; +begin + Result := True; +end; + +function Item_Type.HasItemAttributes() : Boolean; +begin + Result := True; +end; + +function Item_Type.HasMerchantItemAttributes() : Boolean; +begin + Result := True; +end; + +function Item_Type.HasCollections() : Boolean; +begin + Result := True; +end; + +function Item_Type.HasSubjects() : Boolean; +begin + Result := True; +end; + +function Item_Type.HasOfferSummary() : Boolean; +begin + Result := True; +end; + +function Item_Type.HasOffers() : Boolean; +begin + Result := True; +end; + +function Item_Type.HasVariationSummary() : Boolean; +begin + Result := True; +end; + +function Item_Type.HasVariations() : Boolean; +begin + Result := True; +end; + +function Item_Type.HasCustomerReviews() : Boolean; +begin + Result := True; +end; + +function Item_Type.HasEditorialReviews() : Boolean; +begin + Result := True; +end; + +function Item_Type.HasSimilarProducts() : Boolean; +begin + Result := True; +end; + +function Item_Type.HasAccessories() : Boolean; +begin + Result := True; +end; + +function Item_Type.HasTracks() : Boolean; +begin + Result := True; +end; + +function Item_Type.HasBrowseNodes() : Boolean; +begin + Result := True; +end; + +function Item_Type.HasListmaniaLists() : Boolean; +begin + Result := True; +end; + +function Item_Type.HasSearchInside() : Boolean; +begin + Result := True; +end; + +function Item_Type.HasAlternateVersions() : Boolean; +begin + Result := True; +end; + +{ List_Type } + +constructor List_Type.Create(); +begin + inherited Create(); + FListItem := List_ListItemArray.Create(); +end; + +destructor List_Type.Destroy(); +begin + if Assigned(FImage) then + FreeAndNil(FImage); + inherited Destroy(); +end; + +function List_Type.HasListURL() : Boolean; +begin + Result := True; +end; + +function List_Type.HasRegistryNumber() : Boolean; +begin + Result := True; +end; + +function List_Type.HasListName() : Boolean; +begin + Result := True; +end; + +function List_Type.HasListType() : Boolean; +begin + Result := True; +end; + +function List_Type.HasTotalItems() : Boolean; +begin + Result := True; +end; + +function List_Type.HasTotalPages() : Boolean; +begin + Result := True; +end; + +function List_Type.HasDateCreated() : Boolean; +begin + Result := True; +end; + +function List_Type.HasOccasionDate() : Boolean; +begin + Result := True; +end; + +function List_Type.HasCustomerName() : Boolean; +begin + Result := True; +end; + +function List_Type.HasPartnerName() : Boolean; +begin + Result := True; +end; + +function List_Type.HasAdditionalName() : Boolean; +begin + Result := True; +end; + +function List_Type.HasComment() : Boolean; +begin + Result := True; +end; + +function List_Type.HasImage() : Boolean; +begin + Result := True; +end; + +function List_Type.HasAverageRating() : Boolean; +begin + Result := True; +end; + +function List_Type.HasTotalVotes() : Boolean; +begin + Result := True; +end; + +function List_Type.HasTotalTimesRead() : Boolean; +begin + Result := True; +end; + +{ Customer_Type } + +constructor Customer_Type.Create(); +begin + inherited Create(); + FCustomerReviews := Customer_CustomerReviewsArray.Create(); +end; + +destructor Customer_Type.Destroy(); +begin + if Assigned(FLocation) then + FreeAndNil(FLocation); + inherited Destroy(); +end; + +function Customer_Type.HasNickname() : Boolean; +begin + Result := True; +end; + +function Customer_Type.HasBirthday() : Boolean; +begin + Result := True; +end; + +function Customer_Type.HasWishListId() : Boolean; +begin + Result := True; +end; + +function Customer_Type.HasLocation() : Boolean; +begin + Result := True; +end; + +{ Price } + +function Price.HasAmount() : Boolean; +begin + Result := True; +end; + +function Price.HasCurrencyCode() : Boolean; +begin + Result := True; +end; + +{ CartItems_Type } + +constructor CartItems_Type.Create(); +begin + inherited Create(); + FCartItem := CartItems_CartItemArray.Create(); +end; + +destructor CartItems_Type.Destroy(); +begin + if Assigned(FSubTotal) then + FreeAndNil(FSubTotal); + inherited Destroy(); +end; + +function CartItems_Type.HasSubTotal() : Boolean; +begin + Result := True; +end; + +{ SavedForLaterItems_Type } + +constructor SavedForLaterItems_Type.Create(); +begin + inherited Create(); + FSavedForLaterItem := SavedForLaterItems_SavedForLaterItemArray.Create(); +end; + +destructor SavedForLaterItems_Type.Destroy(); +begin + if Assigned(FSubTotal) then + FreeAndNil(FSubTotal); + inherited Destroy(); +end; + +function SavedForLaterItems_Type.HasSubTotal() : Boolean; +begin + Result := True; +end; + +{ Transaction_Type } + +constructor Transaction_Type.Create(); +begin + inherited Create(); + FTransactionItems := Transaction_TransactionItems_Type.Create(); + FShipments := Transaction_Shipments_Type.Create(); +end; + +destructor Transaction_Type.Destroy(); +begin + if Assigned(FTotals) then + FreeAndNil(FTotals); + inherited Destroy(); +end; + +function Transaction_Type.HasSellerName() : Boolean; +begin + Result := True; +end; + +function Transaction_Type.HasPayingCustomerId() : Boolean; +begin + Result := True; +end; + +function Transaction_Type.HasOrderingCustomerId() : Boolean; +begin + Result := True; +end; + +function Transaction_Type.HasTotals() : Boolean; +begin + Result := True; +end; + +function Transaction_Type.HasTransactionItems() : Boolean; +begin + Result := True; +end; + +function Transaction_Type.HasShipments() : Boolean; +begin + Result := True; +end; + +{ Seller_Type } + +constructor Seller_Type.Create(); +begin + inherited Create(); + FSellerFeedbackSummary := Seller_SellerFeedbackSummary_Type.Create(); + FSellerFeedback := SellerFeedback_Type.Create(); +end; + +destructor Seller_Type.Destroy(); +begin + if Assigned(FLocation) then + FreeAndNil(FLocation); + inherited Destroy(); +end; + +function Seller_Type.HasSellerName() : Boolean; +begin + Result := True; +end; + +function Seller_Type.HasSellerLegalName() : Boolean; +begin + Result := True; +end; + +function Seller_Type.HasNickname() : Boolean; +begin + Result := True; +end; + +function Seller_Type.HasGlancePage() : Boolean; +begin + Result := True; +end; + +function Seller_Type.HasAbout() : Boolean; +begin + Result := True; +end; + +function Seller_Type.HasMoreAbout() : Boolean; +begin + Result := True; +end; + +function Seller_Type.HasLocation() : Boolean; +begin + Result := True; +end; + +function Seller_Type.HasAverageFeedbackRating() : Boolean; +begin + Result := True; +end; + +function Seller_Type.HasTotalFeedback() : Boolean; +begin + Result := True; +end; + +function Seller_Type.HasTotalFeedbackPages() : Boolean; +begin + Result := True; +end; + +function Seller_Type.HasSellerFeedbackSummary() : Boolean; +begin + Result := True; +end; + +function Seller_Type.HasSellerFeedback() : Boolean; +begin + Result := True; +end; + +{ SellerListing_Type } + +destructor SellerListing_Type.Destroy(); +begin + if Assigned(FPrice) then + FreeAndNil(FPrice); + if Assigned(FSeller) then + FreeAndNil(FSeller); + inherited Destroy(); +end; + +function SellerListing_Type.HasExchangeId() : Boolean; +begin + Result := True; +end; + +function SellerListing_Type.HasListingId() : Boolean; +begin + Result := True; +end; + +function SellerListing_Type.HasASIN() : Boolean; +begin + Result := True; +end; + +function SellerListing_Type.HasSKU() : Boolean; +begin + Result := True; +end; + +function SellerListing_Type.HasUPC() : Boolean; +begin + Result := True; +end; + +function SellerListing_Type.HasEAN() : Boolean; +begin + Result := True; +end; + +function SellerListing_Type.HasWillShipExpedited() : Boolean; +begin + Result := True; +end; + +function SellerListing_Type.HasWillShipInternational() : Boolean; +begin + Result := True; +end; + +function SellerListing_Type.HasTitle() : Boolean; +begin + Result := True; +end; + +function SellerListing_Type.HasPrice() : Boolean; +begin + Result := True; +end; + +function SellerListing_Type.HasStartDate() : Boolean; +begin + Result := True; +end; + +function SellerListing_Type.HasEndDate() : Boolean; +begin + Result := True; +end; + +function SellerListing_Type.HasStatus() : Boolean; +begin + Result := True; +end; + +function SellerListing_Type.HasQuantity() : Boolean; +begin + Result := True; +end; + +function SellerListing_Type.HasCondition() : Boolean; +begin + Result := True; +end; + +function SellerListing_Type.HasSubCondition() : Boolean; +begin + Result := True; +end; + +function SellerListing_Type.HasSeller() : Boolean; +begin + Result := True; +end; + +{ Image } + +destructor Image.Destroy(); +begin + if Assigned(FHeight) then + FreeAndNil(FHeight); + if Assigned(FWidth) then + FreeAndNil(FWidth); + inherited Destroy(); +end; + +function Image.HasIsVerified() : Boolean; +begin + Result := True; +end; + +{ ListItem_Type } + +destructor ListItem_Type.Destroy(); +begin + if Assigned(F_Item) then + FreeAndNil(F_Item); + inherited Destroy(); +end; + +function ListItem_Type.HasListItemId() : Boolean; +begin + Result := True; +end; + +function ListItem_Type.HasDateAdded() : Boolean; +begin + Result := True; +end; + +function ListItem_Type.HasComment() : Boolean; +begin + Result := True; +end; + +function ListItem_Type.HasQuantityDesired() : Boolean; +begin + Result := True; +end; + +function ListItem_Type.HasQuantityReceived() : Boolean; +begin + Result := True; +end; + +function ListItem_Type.Has_Item() : Boolean; +begin + Result := True; +end; + +{ Customer_Location_Type } + +function Customer_Location_Type.HasUserDefinedLocation() : Boolean; +begin + Result := True; +end; + +function Customer_Location_Type.HasCity() : Boolean; +begin + Result := True; +end; + +function Customer_Location_Type.HasState() : Boolean; +begin + Result := True; +end; + +function Customer_Location_Type.HasCountry() : Boolean; +begin + Result := True; +end; + +{ CustomerReviews_Type } + +constructor CustomerReviews_Type.Create(); +begin + inherited Create(); + FReview := CustomerReviews_ReviewArray.Create(); +end; + +destructor CustomerReviews_Type.Destroy(); +begin + inherited Destroy(); +end; + +function CustomerReviews_Type.HasAverageRating() : Boolean; +begin + Result := True; +end; + +function CustomerReviews_Type.HasTotalReviews() : Boolean; +begin + Result := True; +end; + +function CustomerReviews_Type.HasTotalReviewPages() : Boolean; +begin + Result := True; +end; + +{ SearchResultsMap_SearchIndex_Type } + +constructor SearchResultsMap_SearchIndex_Type.Create(); +begin + inherited Create(); + FASIN := SearchResultsMap_SearchIndex_Type_ASINArray.Create(); +end; + +destructor SearchResultsMap_SearchIndex_Type.Destroy(); +begin + if Assigned(FCorrectedQuery) then + FreeAndNil(FCorrectedQuery); + inherited Destroy(); +end; + +function SearchResultsMap_SearchIndex_Type.HasResults() : Boolean; +begin + Result := True; +end; + +function SearchResultsMap_SearchIndex_Type.HasPages() : Boolean; +begin + Result := True; +end; + +function SearchResultsMap_SearchIndex_Type.HasCorrectedQuery() : Boolean; +begin + Result := True; +end; + +{ ImageSet_Type } + +destructor ImageSet_Type.Destroy(); +begin + if Assigned(FSwatchImage) then + FreeAndNil(FSwatchImage); + if Assigned(FSmallImage) then + FreeAndNil(FSmallImage); + if Assigned(FMediumImage) then + FreeAndNil(FMediumImage); + if Assigned(FLargeImage) then + FreeAndNil(FLargeImage); + inherited Destroy(); +end; + +function ImageSet_Type.HasSwatchImage() : Boolean; +begin + Result := True; +end; + +function ImageSet_Type.HasSmallImage() : Boolean; +begin + Result := True; +end; + +function ImageSet_Type.HasMediumImage() : Boolean; +begin + Result := True; +end; + +function ImageSet_Type.HasLargeImage() : Boolean; +begin + Result := True; +end; + +{ Item_ImageSets_Type } + +constructor Item_ImageSets_Type.Create(); +begin + inherited Create(); + FImageSet := Item_ImageSets_Type_ImageSetArray.Create(); +end; + +destructor Item_ImageSets_Type.Destroy(); +begin + inherited Destroy(); +end; + +function Item_ImageSets_Type.HasMerchantId() : Boolean; +begin + Result := True; +end; + +{ ItemAttributes_Type } + +constructor ItemAttributes_Type.Create(); +begin + inherited Create(); + FActor := ItemAttributes_ActorArray.Create(); + FArtist := ItemAttributes_ArtistArray.Create(); + FAudioFormat := ItemAttributes_AudioFormatArray.Create(); + FAuthor := ItemAttributes_AuthorArray.Create(); + FCameraManualFeatures := ItemAttributes_CameraManualFeaturesArray.Create(); + FCompatibleDevices := ItemAttributes_CompatibleDevicesArray.Create(); + FCreator := ItemAttributes_CreatorArray.Create(); + FDataLinkProtocol := ItemAttributes_DataLinkProtocolArray.Create(); + FDirector := ItemAttributes_DirectorArray.Create(); + FFeature := ItemAttributes_FeatureArray.Create(); + FFormat := ItemAttributes_FormatArray.Create(); + FFormFactor := ItemAttributes_FormFactorArray.Create(); + FLanguages := ItemAttributes_Languages_Type.Create(); + FPhotoFlashType := ItemAttributes_PhotoFlashTypeArray.Create(); + FPictureFormat := ItemAttributes_PictureFormatArray.Create(); + FPlatform := ItemAttributes_PlatformArray.Create(); + FReturnMethod := ItemAttributes_ReturnMethodArray.Create(); + FSpecialFeatures := ItemAttributes_SpecialFeaturesArray.Create(); + FSupportedImageType := ItemAttributes_SupportedImageTypeArray.Create(); +end; + +destructor ItemAttributes_Type.Destroy(); +begin + if Assigned(FAddress) then + FreeAndNil(FAddress); + if Assigned(FAmazonMaximumAge) then + FreeAndNil(FAmazonMaximumAge); + if Assigned(FAmazonMinimumAge) then + FreeAndNil(FAmazonMinimumAge); + if Assigned(FBatteries) then + FreeAndNil(FBatteries); + if Assigned(FCaseDiameter) then + FreeAndNil(FCaseDiameter); + if Assigned(FCaseThickness) then + FreeAndNil(FCaseThickness); + if Assigned(FContinuousShootingSpeed) then + FreeAndNil(FContinuousShootingSpeed); + if Assigned(FCPUSpeed) then + FreeAndNil(FCPUSpeed); + if Assigned(FDelayBetweenShots) then + FreeAndNil(FDelayBetweenShots); + if Assigned(FDigitalZoom) then + FreeAndNil(FDigitalZoom); + if Assigned(FDisplaySize) then + FreeAndNil(FDisplaySize); + if Assigned(FFirstIssueLeadTime) then + FreeAndNil(FFirstIssueLeadTime); + if Assigned(FGraphicsMemorySize) then + FreeAndNil(FGraphicsMemorySize); + if Assigned(FHardDiskSize) then + FreeAndNil(FHardDiskSize); + if Assigned(FISOEquivalent) then + FreeAndNil(FISOEquivalent); + if Assigned(FItemDimensions) then + FreeAndNil(FItemDimensions); + if Assigned(FListPrice) then + FreeAndNil(FListPrice); + if Assigned(FManufacturerMaximumAge) then + FreeAndNil(FManufacturerMaximumAge); + if Assigned(FManufacturerMinimumAge) then + FreeAndNil(FManufacturerMinimumAge); + if Assigned(FMaximumAperture) then + FreeAndNil(FMaximumAperture); + if Assigned(FMaximumFocalLength) then + FreeAndNil(FMaximumFocalLength); + if Assigned(FMaximumHighResolutionImages) then + FreeAndNil(FMaximumHighResolutionImages); + if Assigned(FMaximumHorizontalResolution) then + FreeAndNil(FMaximumHorizontalResolution); + if Assigned(FMaximumResolution) then + FreeAndNil(FMaximumResolution); + if Assigned(FMaximumShutterSpeed) then + FreeAndNil(FMaximumShutterSpeed); + if Assigned(FMaximumVerticalResolution) then + FreeAndNil(FMaximumVerticalResolution); + if Assigned(FMaximumWeightRecommendation) then + FreeAndNil(FMaximumWeightRecommendation); + if Assigned(FMinimumFocalLength) then + FreeAndNil(FMinimumFocalLength); + if Assigned(FMinimumShutterSpeed) then + FreeAndNil(FMinimumShutterSpeed); + if Assigned(FMonitorSize) then + FreeAndNil(FMonitorSize); + if Assigned(FMonitorViewableDiagonalSize) then + FreeAndNil(FMonitorViewableDiagonalSize); + if Assigned(FOpticalSensorResolution) then + FreeAndNil(FOpticalSensorResolution); + if Assigned(FOpticalZoom) then + FreeAndNil(FOpticalZoom); + if Assigned(FPackageDimensions) then + FreeAndNil(FPackageDimensions); + if Assigned(FRunningTime) then + FreeAndNil(FRunningTime); + if Assigned(FSecondaryCacheSize) then + FreeAndNil(FSecondaryCacheSize); + if Assigned(FStoneWeight) then + FreeAndNil(FStoneWeight); + if Assigned(FSubscriptionLength) then + FreeAndNil(FSubscriptionLength); + if Assigned(FSystemBusSpeed) then + FreeAndNil(FSystemBusSpeed); + if Assigned(FSystemMemorySizeMax) then + FreeAndNil(FSystemMemorySizeMax); + if Assigned(FSystemMemorySize) then + FreeAndNil(FSystemMemorySize); + if Assigned(FTotalDiamondWeight) then + FreeAndNil(FTotalDiamondWeight); + if Assigned(FTotalGemWeight) then + FreeAndNil(FTotalGemWeight); + if Assigned(FTotalMetalWeight) then + FreeAndNil(FTotalMetalWeight); + if Assigned(FWaterResistanceDepth) then + FreeAndNil(FWaterResistanceDepth); + if Assigned(FWEEETaxValue) then + FreeAndNil(FWEEETaxValue); + inherited Destroy(); +end; + +function ItemAttributes_Type.HasAddress() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasAmazonMaximumAge() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasAmazonMinimumAge() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasAnalogVideoFormat() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasApertureModes() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasAspectRatio() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasAssemblyInstructions() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasAssemblyRequired() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasAudienceRating() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasBackFinding() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasBandMaterialType() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasBatteriesIncluded() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasBatteriesRequired() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasBatteries() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasBatteryDescription() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasBatteryType() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasBezelMaterialType() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasBinding() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasBrand() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasCalendarType() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasCaseDiameter() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasCaseMaterialType() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasCaseThickness() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasCaseType() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasCatalogNumber() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasCDRWDescription() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasChainType() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasCEROAgeRating() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasClaspType() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasClothingSize() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasClubType() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasColor() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasCompatibility() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasComputerHardwareType() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasComputerPlatform() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasConnectivity() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasContinuousShootingSpeed() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasCountry() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasCPUManufacturer() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasCPUSpeed() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasCPUType() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasCuisine() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasDeliveryOption() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasDelayBetweenShots() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasDepartment() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasDeweyDecimalNumber() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasDialColor() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasDialWindowMaterialType() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasDigitalZoom() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasDisplayColorSupport() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasDisplaySize() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasDrumSetPieceQuantity() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasDVDLayers() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasDVDRWDescription() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasDVDSides() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasDPCI() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasEAN() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasEdition() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasESRBAgeRating() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasExternalDisplaySupportDescription() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasFabricType() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasFaxNumber() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasFilmColorType() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasFirstIssueLeadTime() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasFloppyDiskDriveDescription() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasGemType() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasGenre() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasGraphicsCardInterface() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasGraphicsDescription() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasGraphicsMemorySize() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasGuitarAttribute() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasGuitarBridgeSystem() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasGuitarPickThickness() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasGuitarPickupConfiguration() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasHandOrientation() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasHardDiskCount() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasHardDiskSize() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasHardDiskInterface() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasHardwarePlatform() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasHasAutoFocus() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasHasBurstMode() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasHasInCameraEditing() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasHasRedEyeReduction() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasHasSelfTimer() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasHasTripodMount() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasHasVideoOut() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasHasViewfinder() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasHazardousMaterialType() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasHoursOfOperation() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasIncludedSoftware() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasIncludesMp3Player() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasIngredients() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasInstrumentKey() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasIsAdultProduct() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasIsAutographed() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasISBN() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasIsFragile() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasIsLabCreated() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasIsMemorabilia() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasISOEquivalent() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasIsPreannounce() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasIssuesPerYear() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasItemDimensions() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasKeyboardDescription() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.Has_Label() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasLanguages() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasLegalDisclaimer() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasLensType() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasLineVoltage() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasListPrice() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasMacroFocusRange() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasMagazineType() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasMalletHardness() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasManufacturer() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasManufacturerLaborWarrantyDescription() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasManufacturerMaximumAge() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasManufacturerMinimumAge() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasManufacturerPartsWarrantyDescription() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasMaterialType() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasMaximumAperture() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasMaximumColorDepth() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasMaximumFocalLength() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasMaximumHighResolutionImages() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasMaximumHorizontalResolution() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasMaximumLowResolutionImages() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasMaximumResolution() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasMaximumShutterSpeed() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasMaximumVerticalResolution() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasMaximumWeightRecommendation() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasMediaType() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasMemorySlotsAvailable() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasMetalStamp() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasMetalType() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasMiniMovieDescription() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasMinimumFocalLength() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasMinimumShutterSpeed() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasModel() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasModelYear() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasModemDescription() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasMonitorSize() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasMonitorViewableDiagonalSize() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasMouseDescription() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasMPN() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasMusicalStyle() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasNativeResolution() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasNeighborhood() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasNetworkInterfaceDescription() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasNotebookDisplayTechnology() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasNotebookPointingDeviceDescription() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasNumberOfDiscs() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasNumberOfIssues() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasNumberOfItems() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasNumberOfKeys() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasNumberOfPages() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasNumberOfPearls() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasNumberOfRapidFireShots() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasNumberOfStones() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasNumberOfStrings() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasNumberOfTracks() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasOperatingSystem() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasOpticalSensorResolution() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasOpticalZoom() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasOriginalReleaseDate() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasOutputWattage() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasPackageDimensions() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasPackageQuantity() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasPearlLustre() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasPearlMinimumColor() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasPearlShape() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasPearlStringingMethod() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasPearlSurfaceBlemishes() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasPearlType() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasPearlUniformity() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasPhoneNumber() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasPriceRating() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasProcessorCount() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasProductGroup() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasProductSiteLaunchDate() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasProductTypeName() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasProductTypeSubcategory() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasPromotionalTag() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasPublicationDate() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasPublisher() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasPOBoxShippingExcluded() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasReadingLevel() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasRecorderTrackCount() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasRegionCode() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasRegionOfOrigin() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasReturnPolicy() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasReleaseDate() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasRemovableMemory() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasRemovableStorage() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasRequiredVoltageRange() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasResolutionModes() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasRingSize() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasRunningTime() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasScentName() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasSecondaryCacheSize() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasSettingType() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasShaftMaterialType() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasSize() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasSizePerPearl() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasSkillLevel() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasSKU() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasSoldInStores() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasSoundCardDescription() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasSpeakerCount() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasSpeakerDescription() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasStoneClarity() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasStoneColor() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasStoneCut() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasStoneShape() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasStoneWeight() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasStudio() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasStyle() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasSubscriptionLength() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasSupportedMediaSize() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasSystemBusSpeed() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasSystemMemorySizeMax() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasSystemMemorySize() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasSystemMemoryType() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasTellingPageIndicator() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasTheatricalReleaseDate() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasTitle() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasTotalDiamondWeight() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasTotalExternalBaysFree() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasTotalFirewirePorts() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasTotalGemWeight() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasTotalInternalBaysFree() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasTotalMetalWeight() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasTotalNTSCPALPorts() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasTotalParallelPorts() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasTotalPCCardSlots() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasTotalPCISlotsFree() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasTotalSerialPorts() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasTotalSVideoOutPorts() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasTotalUSB2Ports() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasTotalUSBPorts() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasTotalVGAOutPorts() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasUPC() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasVariationDenomination() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasVariationDescription() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasWarranty() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasWatchMovementType() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasWaterResistanceDepth() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasWEEETaxValue() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Type.HasWirelessMicrophoneFrequency() : Boolean; +begin + Result := True; +end; + +{ MerchantItemAttributes_Type } + +constructor MerchantItemAttributes_Type.Create(); +begin + inherited Create(); + FActor := MerchantItemAttributes_ActorArray.Create(); + FArtist := MerchantItemAttributes_ArtistArray.Create(); + FAudioFormat := MerchantItemAttributes_AudioFormatArray.Create(); + FAuthor := MerchantItemAttributes_AuthorArray.Create(); + FCameraManualFeatures := MerchantItemAttributes_CameraManualFeaturesArray.Create(); + FCreator := MerchantItemAttributes_CreatorArray.Create(); + FDirector := MerchantItemAttributes_DirectorArray.Create(); + FFeature := MerchantItemAttributes_FeatureArray.Create(); + FFormat := MerchantItemAttributes_FormatArray.Create(); + FLanguages := MerchantItemAttributes_Languages_Type.Create(); + FPhotoFlashType := MerchantItemAttributes_PhotoFlashTypeArray.Create(); + FPictureFormat := MerchantItemAttributes_PictureFormatArray.Create(); + FPlatform := MerchantItemAttributes_PlatformArray.Create(); + FPurchasingChannel := MerchantItemAttributes_PurchasingChannelArray.Create(); + FReturnMethod := MerchantItemAttributes_ReturnMethodArray.Create(); + FSpecialFeatures := MerchantItemAttributes_SpecialFeaturesArray.Create(); + FSupportedImageType := MerchantItemAttributes_SupportedImageTypeArray.Create(); +end; + +destructor MerchantItemAttributes_Type.Destroy(); +begin + if Assigned(FAddress) then + FreeAndNil(FAddress); + if Assigned(FAmazonMaximumAge) then + FreeAndNil(FAmazonMaximumAge); + if Assigned(FAmazonMinimumAge) then + FreeAndNil(FAmazonMinimumAge); + if Assigned(FBatteries) then + FreeAndNil(FBatteries); + if Assigned(FCaseDiameter) then + FreeAndNil(FCaseDiameter); + if Assigned(FCaseThickness) then + FreeAndNil(FCaseThickness); + if Assigned(FContinuousShootingSpeed) then + FreeAndNil(FContinuousShootingSpeed); + if Assigned(FCPUSpeed) then + FreeAndNil(FCPUSpeed); + if Assigned(FDelayBetweenShots) then + FreeAndNil(FDelayBetweenShots); + if Assigned(FDigitalZoom) then + FreeAndNil(FDigitalZoom); + if Assigned(FDisplaySize) then + FreeAndNil(FDisplaySize); + if Assigned(FFirstIssueLeadTime) then + FreeAndNil(FFirstIssueLeadTime); + if Assigned(FFixedShippingCharge) then + FreeAndNil(FFixedShippingCharge); + if Assigned(FGraphicsMemorySize) then + FreeAndNil(FGraphicsMemorySize); + if Assigned(FHardDiskSize) then + FreeAndNil(FHardDiskSize); + if Assigned(FISOEquivalent) then + FreeAndNil(FISOEquivalent); + if Assigned(FItemDimensions) then + FreeAndNil(FItemDimensions); + if Assigned(FListPrice) then + FreeAndNil(FListPrice); + if Assigned(FManufacturerMaximumAge) then + FreeAndNil(FManufacturerMaximumAge); + if Assigned(FManufacturerMinimumAge) then + FreeAndNil(FManufacturerMinimumAge); + if Assigned(FMaximumAperture) then + FreeAndNil(FMaximumAperture); + if Assigned(FMaximumFocalLength) then + FreeAndNil(FMaximumFocalLength); + if Assigned(FMaximumHighResolutionImages) then + FreeAndNil(FMaximumHighResolutionImages); + if Assigned(FMaximumHorizontalResolution) then + FreeAndNil(FMaximumHorizontalResolution); + if Assigned(FMaximumResolution) then + FreeAndNil(FMaximumResolution); + if Assigned(FMaximumShutterSpeed) then + FreeAndNil(FMaximumShutterSpeed); + if Assigned(FMaximumVerticalResolution) then + FreeAndNil(FMaximumVerticalResolution); + if Assigned(FMaximumWeightRecommendation) then + FreeAndNil(FMaximumWeightRecommendation); + if Assigned(FMinimumFocalLength) then + FreeAndNil(FMinimumFocalLength); + if Assigned(FMinimumShutterSpeed) then + FreeAndNil(FMinimumShutterSpeed); + if Assigned(FMonitorSize) then + FreeAndNil(FMonitorSize); + if Assigned(FMonitorViewableDiagonalSize) then + FreeAndNil(FMonitorViewableDiagonalSize); + if Assigned(FOpticalZoom) then + FreeAndNil(FOpticalZoom); + if Assigned(FPackageDimensions) then + FreeAndNil(FPackageDimensions); + if Assigned(FSecondaryCacheSize) then + FreeAndNil(FSecondaryCacheSize); + if Assigned(FStoneWeight) then + FreeAndNil(FStoneWeight); + if Assigned(FSubscriptionLength) then + FreeAndNil(FSubscriptionLength); + if Assigned(FSystemBusSpeed) then + FreeAndNil(FSystemBusSpeed); + if Assigned(FSystemMemorySizeMax) then + FreeAndNil(FSystemMemorySizeMax); + if Assigned(FSystemMemorySize) then + FreeAndNil(FSystemMemorySize); + if Assigned(FTotalDiamondWeight) then + FreeAndNil(FTotalDiamondWeight); + if Assigned(FTotalGemWeight) then + FreeAndNil(FTotalGemWeight); + if Assigned(FTotalMetalWeight) then + FreeAndNil(FTotalMetalWeight); + if Assigned(FVendorRebate) then + FreeAndNil(FVendorRebate); + if Assigned(FWaterResistanceDepth) then + FreeAndNil(FWaterResistanceDepth); + inherited Destroy(); +end; + +function MerchantItemAttributes_Type.HasAddress() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasAmazonMaximumAge() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasAmazonMinimumAge() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasApertureModes() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasAspectRatio() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasAssemblyInstructions() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasAssemblyRequired() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasAudienceRating() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasBackFinding() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasBandMaterialType() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasBatteriesIncluded() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasBatteriesRequired() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasBatteries() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasBatteryDescription() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasBatteryType() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasBezelMaterialType() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasBinding() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasBrand() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasCalendarType() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasCaseDiameter() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasCaseMaterialType() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasCaseThickness() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasCaseType() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasCatalogNumber() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasCDRWDescription() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasChainType() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasClaspType() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasClothingSize() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasColor() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasCompatibility() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasComputerHardwareType() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasComputerPlatform() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasConnectivity() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasContinuousShootingSpeed() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasCountry() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasCountryOfOrigin() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasCPUManufacturer() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasCPUSpeed() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasCPUType() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasCuisine() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasCustomizable() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasDelayBetweenShots() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasDeliveryOption() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasDepartment() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasDescription() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasDeweyDecimalNumber() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasDialColor() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasDialWindowMaterialType() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasDigitalZoom() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasDisplaySize() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasDrumSetPieceQuantity() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasDVDLayers() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasDVDRWDescription() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasDVDSides() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasDPCI() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasEAN() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasEdition() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasESRBAgeRating() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasExternalDisplaySupportDescription() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasFabricType() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasFaxNumber() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasFirstIssueLeadTime() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasFloppyDiskDriveDescription() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasFixedShippingCharge() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasGemType() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasGraphicsCardInterface() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasGraphicsDescription() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasGraphicsMemorySize() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasGuitarAttribute() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasGuitarBridgeSystem() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasGuitarPickThickness() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasGuitarPickupConfiguration() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasHardDiskCount() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasHardDiskSize() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasHasAutoFocus() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasHasBurstMode() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasHasInCameraEditing() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasHasRedEyeReduction() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasHasSelfTimer() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasHasTripodMount() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasHasVideoOut() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasHasViewfinder() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasHazardousMaterialType() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasHoursOfOperation() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasIncludedSoftware() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasIncludesMp3Player() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasIndications() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasIngredients() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasInstrumentKey() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasIsAutographed() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasISBN() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasIsFragile() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasIsLabCreated() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasIsMemorabilia() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasISOEquivalent() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasIssuesPerYear() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasItemDimensions() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasKeyboardDescription() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.Has_Label() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasLanguages() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasLegalDisclaimer() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasLineVoltage() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasListPrice() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasMacroFocusRange() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasMagazineType() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasMalletHardness() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasManufacturer() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasManufacturerLaborWarrantyDescription() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasManufacturerMaximumAge() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasManufacturerMinimumAge() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasManufacturerPartsWarrantyDescription() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasMaterialType() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasMaximumAperture() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasMaximumColorDepth() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasMaximumFocalLength() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasMaximumHighResolutionImages() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasMaximumHorizontalResolution() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasMaximumLowResolutionImages() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasMaximumResolution() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasMaximumShutterSpeed() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasMaximumVerticalResolution() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasMaximumWeightRecommendation() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasMemorySlotsAvailable() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasMetalStamp() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasMetalType() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasMiniMovieDescription() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasMinimumFocalLength() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasMinimumShutterSpeed() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasModel() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasModelYear() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasModemDescription() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasMonitorSize() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasMonitorViewableDiagonalSize() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasMouseDescription() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasMPN() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasMusicalStyle() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasNativeResolution() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasNeighborhood() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasNetworkInterfaceDescription() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasNotebookDisplayTechnology() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasNotebookPointingDeviceDescription() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasNumberOfDiscs() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasNumberOfIssues() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasNumberOfItems() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasNumberOfKeys() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasNumberOfPages() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasNumberOfPearls() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasNumberOfRapidFireShots() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasNumberOfStones() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasNumberOfStrings() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasNumberOfTracks() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasOpticalZoom() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasOriginalReleaseDate() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasOutputWattage() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasPackageDimensions() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasPearlLustre() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasPearlMinimumColor() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasPearlShape() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasPearlStringingMethod() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasPearlSurfaceBlemishes() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasPearlType() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasPearlUniformity() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasPhoneNumber() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasPriceRating() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasProcessorCount() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasProductGroup() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasPromotionalTag() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasPOBoxShippingExcluded() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasPublicationDate() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasPublisher() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasReadingLevel() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasRecorderTrackCount() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasRegionCode() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasRegionOfOrigin() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasReleaseDate() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasRemovableMemory() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasResolutionModes() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasReturnPolicy() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasRingSize() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasSafetyWarning() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasSalesRestriction() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasSecondaryCacheSize() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasSettingType() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasSize() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasSKU() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasSoldInStores() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasSizePerPearl() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasSkillLevel() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasSoundCardDescription() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasSpeakerCount() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasSpeakerDescription() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasStoneClarity() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasStoneColor() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasStoneCut() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasStoneShape() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasStoneWeight() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasStudio() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasSubscriptionLength() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasSystemBusSpeed() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasSystemMemorySizeMax() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasSystemMemorySize() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasSystemMemoryType() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasTellingPageIndicator() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasTheatricalReleaseDate() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasTitle() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasTotalDiamondWeight() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasTotalExternalBaysFree() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasTotalFirewirePorts() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasTotalGemWeight() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasTotalInternalBaysFree() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasTotalMetalWeight() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasTotalNTSCPALPorts() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasTotalParallelPorts() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasTotalPCCardSlots() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasTotalPCISlotsFree() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasTotalSerialPorts() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasTotalSVideoOutPorts() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasTotalUSB2Ports() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasTotalUSBPorts() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasTotalVGAOutPorts() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasUPC() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasVariationDenomination() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasVariationDescription() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasVendorRebate() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasWarranty() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasWatchMovementType() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasWebsiteBuyability() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasWaterResistanceDepth() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_Type.HasWirelessMicrophoneFrequency() : Boolean; +begin + Result := True; +end; + +{ OfferSummary_Type } + +destructor OfferSummary_Type.Destroy(); +begin + if Assigned(FLowestNewPrice) then + FreeAndNil(FLowestNewPrice); + if Assigned(FLowestUsedPrice) then + FreeAndNil(FLowestUsedPrice); + if Assigned(FLowestCollectiblePrice) then + FreeAndNil(FLowestCollectiblePrice); + if Assigned(FLowestRefurbishedPrice) then + FreeAndNil(FLowestRefurbishedPrice); + inherited Destroy(); +end; + +function OfferSummary_Type.HasLowestNewPrice() : Boolean; +begin + Result := True; +end; + +function OfferSummary_Type.HasLowestUsedPrice() : Boolean; +begin + Result := True; +end; + +function OfferSummary_Type.HasLowestCollectiblePrice() : Boolean; +begin + Result := True; +end; + +function OfferSummary_Type.HasLowestRefurbishedPrice() : Boolean; +begin + Result := True; +end; + +function OfferSummary_Type.HasTotalNew() : Boolean; +begin + Result := True; +end; + +function OfferSummary_Type.HasTotalUsed() : Boolean; +begin + Result := True; +end; + +function OfferSummary_Type.HasTotalCollectible() : Boolean; +begin + Result := True; +end; + +function OfferSummary_Type.HasTotalRefurbished() : Boolean; +begin + Result := True; +end; + +{ Offers_Type } + +constructor Offers_Type.Create(); +begin + inherited Create(); + FOffer := Offers_OfferArray.Create(); +end; + +destructor Offers_Type.Destroy(); +begin + inherited Destroy(); +end; + +function Offers_Type.HasTotalOffers() : Boolean; +begin + Result := True; +end; + +function Offers_Type.HasTotalOfferPages() : Boolean; +begin + Result := True; +end; + +{ VariationSummary_Type } + +destructor VariationSummary_Type.Destroy(); +begin + if Assigned(FLowestPrice) then + FreeAndNil(FLowestPrice); + if Assigned(FHighestPrice) then + FreeAndNil(FHighestPrice); + if Assigned(FLowestSalePrice) then + FreeAndNil(FLowestSalePrice); + if Assigned(FHighestSalePrice) then + FreeAndNil(FHighestSalePrice); + inherited Destroy(); +end; + +function VariationSummary_Type.HasLowestPrice() : Boolean; +begin + Result := True; +end; + +function VariationSummary_Type.HasHighestPrice() : Boolean; +begin + Result := True; +end; + +function VariationSummary_Type.HasLowestSalePrice() : Boolean; +begin + Result := True; +end; + +function VariationSummary_Type.HasHighestSalePrice() : Boolean; +begin + Result := True; +end; + +function VariationSummary_Type.HasSingleMerchantId() : Boolean; +begin + Result := True; +end; + +{ Variations_Type } + +constructor Variations_Type.Create(); +begin + inherited Create(); + FVariationDimensions := VariationDimensions_Type.Create(); + F_Item := Variations__ItemArray.Create(); +end; + +destructor Variations_Type.Destroy(); +begin + inherited Destroy(); +end; + +function Variations_Type.HasTotalVariations() : Boolean; +begin + Result := True; +end; + +function Variations_Type.HasTotalVariationPages() : Boolean; +begin + Result := True; +end; + +function Variations_Type.HasVariationDimensions() : Boolean; +begin + Result := True; +end; + +{ SearchInside_Type } + +destructor SearchInside_Type.Destroy(); +begin + if Assigned(FExcerpt) then + FreeAndNil(FExcerpt); + inherited Destroy(); +end; + +function SearchInside_Type.HasTotalExcerpts() : Boolean; +begin + Result := True; +end; + +function SearchInside_Type.HasExcerpt() : Boolean; +begin + Result := True; +end; + +{ Item_AlternateVersions_Type_AlternateVersion_Type } + +function Item_AlternateVersions_Type_AlternateVersion_Type.HasTitle() : Boolean; +begin + Result := True; +end; + +function Item_AlternateVersions_Type_AlternateVersion_Type.HasBinding() : Boolean; +begin + Result := True; +end; + +{ Offer_Type } + +constructor Offer_Type.Create(); +begin + inherited Create(); + FOfferListing := Offer_OfferListingArray.Create(); + FPromotions := Promotions_Type.Create(); +end; + +destructor Offer_Type.Destroy(); +begin + if Assigned(FMerchant) then + FreeAndNil(FMerchant); + if Assigned(FSeller) then + FreeAndNil(FSeller); + if Assigned(FOfferAttributes) then + FreeAndNil(FOfferAttributes); + if Assigned(FLoyaltyPoints) then + FreeAndNil(FLoyaltyPoints); + inherited Destroy(); +end; + +function Offer_Type.HasMerchant() : Boolean; +begin + Result := True; +end; + +function Offer_Type.HasSeller() : Boolean; +begin + Result := True; +end; + +function Offer_Type.HasOfferAttributes() : Boolean; +begin + Result := True; +end; + +function Offer_Type.HasLoyaltyPoints() : Boolean; +begin + Result := True; +end; + +function Offer_Type.HasPromotions() : Boolean; +begin + Result := True; +end; + +{ Merchant_Type } + +function Merchant_Type.HasName() : Boolean; +begin + Result := True; +end; + +function Merchant_Type.HasGlancePage() : Boolean; +begin + Result := True; +end; + +function Merchant_Type.HasAverageFeedbackRating() : Boolean; +begin + Result := True; +end; + +function Merchant_Type.HasTotalFeedback() : Boolean; +begin + Result := True; +end; + +function Merchant_Type.HasTotalFeedbackPages() : Boolean; +begin + Result := True; +end; + +{ OfferAttributes_Type } + +function OfferAttributes_Type.HasCondition() : Boolean; +begin + Result := True; +end; + +function OfferAttributes_Type.HasSubCondition() : Boolean; +begin + Result := True; +end; + +function OfferAttributes_Type.HasConditionNote() : Boolean; +begin + Result := True; +end; + +function OfferAttributes_Type.HasWillShipExpedited() : Boolean; +begin + Result := True; +end; + +function OfferAttributes_Type.HasWillShipInternational() : Boolean; +begin + Result := True; +end; + +{ OfferListing_Type } + +constructor OfferListing_Type.Create(); +begin + inherited Create(); + FShippingCharge := OfferListing_ShippingChargeArray.Create(); +end; + +destructor OfferListing_Type.Destroy(); +begin + if Assigned(FPrice) then + FreeAndNil(FPrice); + if Assigned(FSalePrice) then + FreeAndNil(FSalePrice); + if Assigned(FAmountSaved) then + FreeAndNil(FAmountSaved); + if Assigned(FAvailabilityAttributes) then + FreeAndNil(FAvailabilityAttributes); + if Assigned(FISPUStoreAddress) then + FreeAndNil(FISPUStoreAddress); + inherited Destroy(); +end; + +function OfferListing_Type.HasOfferListingId() : Boolean; +begin + Result := True; +end; + +function OfferListing_Type.HasExchangeId() : Boolean; +begin + Result := True; +end; + +function OfferListing_Type.HasPrice() : Boolean; +begin + Result := True; +end; + +function OfferListing_Type.HasSalePrice() : Boolean; +begin + Result := True; +end; + +function OfferListing_Type.HasAmountSaved() : Boolean; +begin + Result := True; +end; + +function OfferListing_Type.HasPercentageSaved() : Boolean; +begin + Result := True; +end; + +function OfferListing_Type.HasAvailability() : Boolean; +begin + Result := True; +end; + +function OfferListing_Type.HasAvailabilityAttributes() : Boolean; +begin + Result := True; +end; + +function OfferListing_Type.HasQuantity() : Boolean; +begin + Result := True; +end; + +function OfferListing_Type.HasISPUStoreAddress() : Boolean; +begin + Result := True; +end; + +function OfferListing_Type.HasISPUStoreHours() : Boolean; +begin + Result := True; +end; + +function OfferListing_Type.HasIsEligibleForSuperSaverShipping() : Boolean; +begin + Result := True; +end; + +function OfferListing_Type.HasSalesRestriction() : Boolean; +begin + Result := True; +end; + +{ LoyaltyPoints_Type } + +destructor LoyaltyPoints_Type.Destroy(); +begin + if Assigned(FTypicalRedemptionValue) then + FreeAndNil(FTypicalRedemptionValue); + inherited Destroy(); +end; + +function LoyaltyPoints_Type.HasPoints() : Boolean; +begin + Result := True; +end; + +function LoyaltyPoints_Type.HasTypicalRedemptionValue() : Boolean; +begin + Result := True; +end; + +{ OfferListing_AvailabilityAttributes_Type } + +function OfferListing_AvailabilityAttributes_Type.HasAvailabilityType() : Boolean; +begin + Result := True; +end; + +function OfferListing_AvailabilityAttributes_Type.HasIsPreorder() : Boolean; +begin + Result := True; +end; + +function OfferListing_AvailabilityAttributes_Type.HasMinimumHours() : Boolean; +begin + Result := True; +end; + +function OfferListing_AvailabilityAttributes_Type.HasMaximumHours() : Boolean; +begin + Result := True; +end; + +{ Address } + +function Address.HasName() : Boolean; +begin + Result := True; +end; + +function Address.HasAddress1() : Boolean; +begin + Result := True; +end; + +function Address.HasAddress2() : Boolean; +begin + Result := True; +end; + +function Address.HasAddress3() : Boolean; +begin + Result := True; +end; + +function Address.HasCity() : Boolean; +begin + Result := True; +end; + +function Address.HasState() : Boolean; +begin + Result := True; +end; + +function Address.HasPostalCode() : Boolean; +begin + Result := True; +end; + +function Address.HasCountry() : Boolean; +begin + Result := True; +end; + +{ OfferListing_ShippingCharge_Type } + +destructor OfferListing_ShippingCharge_Type.Destroy(); +begin + if Assigned(FShippingPrice) then + FreeAndNil(FShippingPrice); + inherited Destroy(); +end; + +{ EditorialReview_Type } + +function EditorialReview_Type.HasSource() : Boolean; +begin + Result := True; +end; + +function EditorialReview_Type.HasContent() : Boolean; +begin + Result := True; +end; + +{ Collections_Collection_Type_CollectionSummary_Type } + +destructor Collections_Collection_Type_CollectionSummary_Type.Destroy(); +begin + if Assigned(FLowestListPrice) then + FreeAndNil(FLowestListPrice); + if Assigned(FHighestListPrice) then + FreeAndNil(FHighestListPrice); + if Assigned(FLowestSalePrice) then + FreeAndNil(FLowestSalePrice); + if Assigned(FHighestSalePrice) then + FreeAndNil(FHighestSalePrice); + inherited Destroy(); +end; + +function Collections_Collection_Type_CollectionSummary_Type.HasLowestListPrice() : Boolean; +begin + Result := True; +end; + +function Collections_Collection_Type_CollectionSummary_Type.HasHighestListPrice() : Boolean; +begin + Result := True; +end; + +function Collections_Collection_Type_CollectionSummary_Type.HasLowestSalePrice() : Boolean; +begin + Result := True; +end; + +function Collections_Collection_Type_CollectionSummary_Type.HasHighestSalePrice() : Boolean; +begin + Result := True; +end; + +{ Collections_Collection_Type_CollectionParent_Type } + +function Collections_Collection_Type_CollectionParent_Type.HasASIN() : Boolean; +begin + Result := True; +end; + +function Collections_Collection_Type_CollectionParent_Type.HasTitle() : Boolean; +begin + Result := True; +end; + +{ Collections_Collection_Type_CollectionItem_Type } + +function Collections_Collection_Type_CollectionItem_Type.HasASIN() : Boolean; +begin + Result := True; +end; + +function Collections_Collection_Type_CollectionItem_Type.HasTitle() : Boolean; +begin + Result := True; +end; + +{ Collections_Collection_Type } + +constructor Collections_Collection_Type.Create(); +begin + inherited Create(); + FCollectionItem := Collections_Collection_Type_CollectionItemArray.Create(); +end; + +destructor Collections_Collection_Type.Destroy(); +begin + if Assigned(FCollectionSummary) then + FreeAndNil(FCollectionSummary); + if Assigned(FCollectionParent) then + FreeAndNil(FCollectionParent); + inherited Destroy(); +end; + +function Collections_Collection_Type.HasCollectionSummary() : Boolean; +begin + Result := True; +end; + +function Collections_Collection_Type.HasCollectionParent() : Boolean; +begin + Result := True; +end; + +{ Review_Type } + +destructor Review_Type.Destroy(); +begin + if Assigned(FReviewer) then + FreeAndNil(FReviewer); + inherited Destroy(); +end; + +function Review_Type.HasASIN() : Boolean; +begin + Result := True; +end; + +function Review_Type.HasRating() : Boolean; +begin + Result := True; +end; + +function Review_Type.HasHelpfulVotes() : Boolean; +begin + Result := True; +end; + +function Review_Type.HasCustomerId() : Boolean; +begin + Result := True; +end; + +function Review_Type.HasReviewer() : Boolean; +begin + Result := True; +end; + +function Review_Type.HasTotalVotes() : Boolean; +begin + Result := True; +end; + +function Review_Type.HasDate() : Boolean; +begin + Result := True; +end; + +function Review_Type.HasSummary() : Boolean; +begin + Result := True; +end; + +function Review_Type.HasContent() : Boolean; +begin + Result := True; +end; + +{ Reviewer_Type } + +function Reviewer_Type.HasCustomerId() : Boolean; +begin + Result := True; +end; + +function Reviewer_Type.HasName() : Boolean; +begin + Result := True; +end; + +function Reviewer_Type.HasNickname() : Boolean; +begin + Result := True; +end; + +function Reviewer_Type.HasLocation() : Boolean; +begin + Result := True; +end; + +{ Tracks_Disc_Type } + +constructor Tracks_Disc_Type.Create(); +begin + inherited Create(); + FTrack := Tracks_Disc_Type_TrackArray.Create(); +end; + +destructor Tracks_Disc_Type.Destroy(); +begin + inherited Destroy(); +end; + +{ SimilarProducts_SimilarProduct_Type } + +function SimilarProducts_SimilarProduct_Type.HasASIN() : Boolean; +begin + Result := True; +end; + +function SimilarProducts_SimilarProduct_Type.HasTitle() : Boolean; +begin + Result := True; +end; + +{ TopSellers_TopSeller_Type } + +function TopSellers_TopSeller_Type.HasASIN() : Boolean; +begin + Result := True; +end; + +function TopSellers_TopSeller_Type.HasTitle() : Boolean; +begin + Result := True; +end; + +{ NewReleases_NewRelease_Type } + +function NewReleases_NewRelease_Type.HasASIN() : Boolean; +begin + Result := True; +end; + +function NewReleases_NewRelease_Type.HasTitle() : Boolean; +begin + Result := True; +end; + +{ SimilarViewedProducts_SimilarViewedProduct_Type } + +function SimilarViewedProducts_SimilarViewedProduct_Type.HasASIN() : Boolean; +begin + Result := True; +end; + +function SimilarViewedProducts_SimilarViewedProduct_Type.HasTitle() : Boolean; +begin + Result := True; +end; + +{ OtherCategoriesSimilarProducts_OtherCategoriesSimilarProduct_Type } + +function OtherCategoriesSimilarProducts_OtherCategoriesSimilarProduct_Type.HasASIN() : Boolean; +begin + Result := True; +end; + +function OtherCategoriesSimilarProducts_OtherCategoriesSimilarProduct_Type.HasTitle() : Boolean; +begin + Result := True; +end; + +{ Accessories_Accessory_Type } + +function Accessories_Accessory_Type.HasASIN() : Boolean; +begin + Result := True; +end; + +function Accessories_Accessory_Type.HasTitle() : Boolean; +begin + Result := True; +end; + +{ Promotion_Type } + +destructor Promotion_Type.Destroy(); +begin + if Assigned(FSummary) then + FreeAndNil(FSummary); + if Assigned(FDetails) then + FreeAndNil(FDetails); + inherited Destroy(); +end; + +function Promotion_Type.HasSummary() : Boolean; +begin + Result := True; +end; + +function Promotion_Type.HasDetails() : Boolean; +begin + Result := True; +end; + +{ Promotion_Summary_Type } + +function Promotion_Summary_Type.HasCategory() : Boolean; +begin + Result := True; +end; + +function Promotion_Summary_Type.HasStartDate() : Boolean; +begin + Result := True; +end; + +function Promotion_Summary_Type.HasEndDate() : Boolean; +begin + Result := True; +end; + +function Promotion_Summary_Type.HasEligibilityRequirementDescription() : Boolean; +begin + Result := True; +end; + +function Promotion_Summary_Type.HasBenefitDescription() : Boolean; +begin + Result := True; +end; + +function Promotion_Summary_Type.HasTermsAndConditions() : Boolean; +begin + Result := True; +end; + +{ Promotion_Details_Type } + +constructor Promotion_Details_Type.Create(); +begin + inherited Create(); + FEligibilityRequirements := PromotionEligibilityRequirements.Create(); + FBenefits := PromotionBenefits.Create(); +end; + +destructor Promotion_Details_Type.Destroy(); +begin + if Assigned(FItemApplicability) then + FreeAndNil(FItemApplicability); + inherited Destroy(); +end; + +function Promotion_Details_Type.HasMerchantPromotionId() : Boolean; +begin + Result := True; +end; + +function Promotion_Details_Type.HasGroupClaimCode() : Boolean; +begin + Result := True; +end; + +function Promotion_Details_Type.HasCouponCombinationType() : Boolean; +begin + Result := True; +end; + +function Promotion_Details_Type.HasStartDate() : Boolean; +begin + Result := True; +end; + +function Promotion_Details_Type.HasEndDate() : Boolean; +begin + Result := True; +end; + +function Promotion_Details_Type.HasTermsAndConditions() : Boolean; +begin + Result := True; +end; + +function Promotion_Details_Type.HasEligibilityRequirements() : Boolean; +begin + Result := True; +end; + +function Promotion_Details_Type.HasBenefits() : Boolean; +begin + Result := True; +end; + +function Promotion_Details_Type.HasItemApplicability() : Boolean; +begin + Result := True; +end; + +{ PromotionEligibilityRequirement } + +destructor PromotionEligibilityRequirement.Destroy(); +begin + if Assigned(FCurrencyAmount) then + FreeAndNil(FCurrencyAmount); + inherited Destroy(); +end; + +function PromotionEligibilityRequirement.HasQuantity() : Boolean; +begin + Result := True; +end; + +function PromotionEligibilityRequirement.HasCurrencyAmount() : Boolean; +begin + Result := True; +end; + +{ PromotionBenefit } + +destructor PromotionBenefit.Destroy(); +begin + if Assigned(FFixedAmount) then + FreeAndNil(FFixedAmount); + if Assigned(FCeiling) then + FreeAndNil(FCeiling); + inherited Destroy(); +end; + +function PromotionBenefit.HasQuantity() : Boolean; +begin + Result := True; +end; + +function PromotionBenefit.HasPercentOff() : Boolean; +begin + Result := True; +end; + +function PromotionBenefit.HasFixedAmount() : Boolean; +begin + Result := True; +end; + +function PromotionBenefit.HasCeiling() : Boolean; +begin + Result := True; +end; + +{ BrowseNode_Type } + +constructor BrowseNode_Type.Create(); +begin + inherited Create(); + FChildren := BrowseNode_Children_Type.Create(); + FAncestors := BrowseNode_Ancestors_Type.Create(); + FTopSellers := TopSellers_Type.Create(); + FNewReleases := NewReleases_Type.Create(); +end; + +destructor BrowseNode_Type.Destroy(); +begin + inherited Destroy(); +end; + +function BrowseNode_Type.HasBrowseNodeId() : Boolean; +begin + Result := True; +end; + +function BrowseNode_Type.HasName() : Boolean; +begin + Result := True; +end; + +function BrowseNode_Type.HasIsCategoryRoot() : Boolean; +begin + Result := True; +end; + +function BrowseNode_Type.HasChildren() : Boolean; +begin + Result := True; +end; + +function BrowseNode_Type.HasAncestors() : Boolean; +begin + Result := True; +end; + +function BrowseNode_Type.HasTopSellers() : Boolean; +begin + Result := True; +end; + +function BrowseNode_Type.HasNewReleases() : Boolean; +begin + Result := True; +end; + +{ ListmaniaLists_ListmaniaList_Type } + +function ListmaniaLists_ListmaniaList_Type.HasListName() : Boolean; +begin + Result := True; +end; + +{ SearchInside_Excerpt_Type } + +function SearchInside_Excerpt_Type.HasChecksum() : Boolean; +begin + Result := True; +end; + +function SearchInside_Excerpt_Type.HasPageType() : Boolean; +begin + Result := True; +end; + +function SearchInside_Excerpt_Type.HasPageNumber() : Boolean; +begin + Result := True; +end; + +function SearchInside_Excerpt_Type.HasSequenceNumber() : Boolean; +begin + Result := True; +end; + +function SearchInside_Excerpt_Type.HasText() : Boolean; +begin + Result := True; +end; + +{ CartItem } + +destructor CartItem.Destroy(); +begin + if Assigned(FPrice) then + FreeAndNil(FPrice); + if Assigned(FItemTotal) then + FreeAndNil(FItemTotal); + inherited Destroy(); +end; + +function CartItem.HasASIN() : Boolean; +begin + Result := True; +end; + +function CartItem.HasExchangeId() : Boolean; +begin + Result := True; +end; + +function CartItem.HasMerchantId() : Boolean; +begin + Result := True; +end; + +function CartItem.HasSellerId() : Boolean; +begin + Result := True; +end; + +function CartItem.HasSellerNickname() : Boolean; +begin + Result := True; +end; + +function CartItem.HasTitle() : Boolean; +begin + Result := True; +end; + +function CartItem.HasProductGroup() : Boolean; +begin + Result := True; +end; + +function CartItem.HasListOwner() : Boolean; +begin + Result := True; +end; + +function CartItem.HasListType() : Boolean; +begin + Result := True; +end; + +function CartItem.HasPrice() : Boolean; +begin + Result := True; +end; + +function CartItem.HasItemTotal() : Boolean; +begin + Result := True; +end; + +{ Transaction_Totals_Type } + +destructor Transaction_Totals_Type.Destroy(); +begin + if Assigned(FTotal) then + FreeAndNil(FTotal); + if Assigned(FSubtotal) then + FreeAndNil(FSubtotal); + if Assigned(FTax) then + FreeAndNil(FTax); + if Assigned(FShippingCharge) then + FreeAndNil(FShippingCharge); + if Assigned(FPromotion) then + FreeAndNil(FPromotion); + inherited Destroy(); +end; + +{ TransactionItem_Type } + +constructor TransactionItem_Type.Create(); +begin + inherited Create(); + FChildTransactionItems := TransactionItem_ChildTransactionItems_Type.Create(); +end; + +destructor TransactionItem_Type.Destroy(); +begin + if Assigned(FUnitPrice) then + FreeAndNil(FUnitPrice); + if Assigned(FTotalPrice) then + FreeAndNil(FTotalPrice); + inherited Destroy(); +end; + +function TransactionItem_Type.HasASIN() : Boolean; +begin + Result := True; +end; + +function TransactionItem_Type.HasChildTransactionItems() : Boolean; +begin + Result := True; +end; + +{ Transaction_Shipments_Type_Shipment_Type } + +constructor Transaction_Shipments_Type_Shipment_Type.Create(); +begin + inherited Create(); + FShipmentItems := Transaction_Shipments_Type_Shipment_Type_ShipmentItems_Type.Create(); + FPackages := Transaction_Shipments_Type_Shipment_Type_Packages_Type.Create(); +end; + +destructor Transaction_Shipments_Type_Shipment_Type.Destroy(); +begin + inherited Destroy(); +end; + +function Transaction_Shipments_Type_Shipment_Type.HasShipmentItems() : Boolean; +begin + Result := True; +end; + +function Transaction_Shipments_Type_Shipment_Type.HasPackages() : Boolean; +begin + Result := True; +end; + +{ Seller_Location_Type } + +function Seller_Location_Type.HasUserDefinedLocation() : Boolean; +begin + Result := True; +end; + +function Seller_Location_Type.HasCity() : Boolean; +begin + Result := True; +end; + +function Seller_Location_Type.HasState() : Boolean; +begin + Result := True; +end; + +function Seller_Location_Type.HasCountry() : Boolean; +begin + Result := True; +end; + +{ Seller_SellerFeedbackSummary_Type_FeedbackDateRange_Type_SellerFeedbackRating_Type } + +function Seller_SellerFeedbackSummary_Type_FeedbackDateRange_Type_SellerFeedbackRating_Type.HasCount() : Boolean; +begin + Result := True; +end; + +function Seller_SellerFeedbackSummary_Type_FeedbackDateRange_Type_SellerFeedbackRating_Type.HasPercentage() : Boolean; +begin + Result := True; +end; + +{ Seller_SellerFeedbackSummary_Type_FeedbackDateRange_Type } + +constructor Seller_SellerFeedbackSummary_Type_FeedbackDateRange_Type.Create(); +begin + inherited Create(); + FSellerFeedbackRating := Seller_SellerFeedbackSummary_Type_FeedbackDateRange_Type_SellerFeedbackRatingArray.Create(); +end; + +destructor Seller_SellerFeedbackSummary_Type_FeedbackDateRange_Type.Destroy(); +begin + inherited Destroy(); +end; + +{ SellerFeedback_Feedback_Type } + +function SellerFeedback_Feedback_Type.HasRating() : Boolean; +begin + Result := True; +end; + +function SellerFeedback_Feedback_Type.HasComment() : Boolean; +begin + Result := True; +end; + +function SellerFeedback_Feedback_Type.HasDate() : Boolean; +begin + Result := True; +end; + +function SellerFeedback_Feedback_Type.HasRatedBy() : Boolean; +begin + Result := True; +end; + +{ ItemAttributes_ItemDimensions_Type } + +destructor ItemAttributes_ItemDimensions_Type.Destroy(); +begin + if Assigned(FHeight) then + FreeAndNil(FHeight); + if Assigned(FLength) then + FreeAndNil(FLength); + if Assigned(FWeight) then + FreeAndNil(FWeight); + if Assigned(FWidth) then + FreeAndNil(FWidth); + inherited Destroy(); +end; + +function ItemAttributes_ItemDimensions_Type.HasHeight() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_ItemDimensions_Type.HasLength() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_ItemDimensions_Type.HasWeight() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_ItemDimensions_Type.HasWidth() : Boolean; +begin + Result := True; +end; + +{ ItemAttributes_Languages_Type_Language_Type } + +function ItemAttributes_Languages_Type_Language_Type.Has_Type() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_Languages_Type_Language_Type.HasAudioFormat() : Boolean; +begin + Result := True; +end; + +{ ItemAttributes_PackageDimensions_Type } + +destructor ItemAttributes_PackageDimensions_Type.Destroy(); +begin + if Assigned(FHeight) then + FreeAndNil(FHeight); + if Assigned(FLength) then + FreeAndNil(FLength); + if Assigned(FWeight) then + FreeAndNil(FWeight); + if Assigned(FWidth) then + FreeAndNil(FWidth); + inherited Destroy(); +end; + +function ItemAttributes_PackageDimensions_Type.HasHeight() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_PackageDimensions_Type.HasLength() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_PackageDimensions_Type.HasWeight() : Boolean; +begin + Result := True; +end; + +function ItemAttributes_PackageDimensions_Type.HasWidth() : Boolean; +begin + Result := True; +end; + +{ MerchantItemAttributes_ItemDimensions_Type } + +destructor MerchantItemAttributes_ItemDimensions_Type.Destroy(); +begin + if Assigned(FHeight) then + FreeAndNil(FHeight); + if Assigned(FLength) then + FreeAndNil(FLength); + if Assigned(FWeight) then + FreeAndNil(FWeight); + if Assigned(FWidth) then + FreeAndNil(FWidth); + inherited Destroy(); +end; + +function MerchantItemAttributes_ItemDimensions_Type.HasHeight() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_ItemDimensions_Type.HasLength() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_ItemDimensions_Type.HasWeight() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_ItemDimensions_Type.HasWidth() : Boolean; +begin + Result := True; +end; + +{ MerchantItemAttributes_Languages_Type_Language_Type } + +function MerchantItemAttributes_Languages_Type_Language_Type.HasAudioFormat() : Boolean; +begin + Result := True; +end; + +{ MerchantItemAttributes_PackageDimensions_Type } + +destructor MerchantItemAttributes_PackageDimensions_Type.Destroy(); +begin + if Assigned(FHeight) then + FreeAndNil(FHeight); + if Assigned(FLength) then + FreeAndNil(FLength); + if Assigned(FWeight) then + FreeAndNil(FWeight); + if Assigned(FWidth) then + FreeAndNil(FWidth); + inherited Destroy(); +end; + +function MerchantItemAttributes_PackageDimensions_Type.HasHeight() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_PackageDimensions_Type.HasLength() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_PackageDimensions_Type.HasWeight() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_PackageDimensions_Type.HasWidth() : Boolean; +begin + Result := True; +end; + +{ MerchantItemAttributes_VendorRebate_Type } + +function MerchantItemAttributes_VendorRebate_Type.Has_Type() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_VendorRebate_Type.HasStartDate() : Boolean; +begin + Result := True; +end; + +function MerchantItemAttributes_VendorRebate_Type.HasEndDate() : Boolean; +begin + Result := True; +end; + +{ Help_RequestArray } + +function Help_RequestArray.GetItem(AIndex: Integer): HelpRequest; +begin + Result := Inherited GetItem(AIndex) As HelpRequest; +end; + +class function Help_RequestArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= HelpRequest; +end; + +{ HelpResponse_InformationArray } + +function HelpResponse_InformationArray.GetItem(AIndex: Integer): Information_Type; +begin + Result := Inherited GetItem(AIndex) As Information_Type; +end; + +class function HelpResponse_InformationArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= Information_Type; +end; + +{ ItemSearch_RequestArray } + +function ItemSearch_RequestArray.GetItem(AIndex: Integer): ItemSearchRequest; +begin + Result := Inherited GetItem(AIndex) As ItemSearchRequest; +end; + +class function ItemSearch_RequestArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= ItemSearchRequest; +end; + +{ ItemSearchResponse_ItemsArray } + +function ItemSearchResponse_ItemsArray.GetItem(AIndex: Integer): Items_Type; +begin + Result := Inherited GetItem(AIndex) As Items_Type; +end; + +class function ItemSearchResponse_ItemsArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= Items_Type; +end; + +{ ItemLookup_RequestArray } + +function ItemLookup_RequestArray.GetItem(AIndex: Integer): ItemLookupRequest; +begin + Result := Inherited GetItem(AIndex) As ItemLookupRequest; +end; + +class function ItemLookup_RequestArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= ItemLookupRequest; +end; + +{ ItemLookupResponse_ItemsArray } + +function ItemLookupResponse_ItemsArray.GetItem(AIndex: Integer): Items_Type; +begin + Result := Inherited GetItem(AIndex) As Items_Type; +end; + +class function ItemLookupResponse_ItemsArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= Items_Type; +end; + +{ BrowseNodeLookup_RequestArray } + +function BrowseNodeLookup_RequestArray.GetItem(AIndex: Integer): BrowseNodeLookupRequest; +begin + Result := Inherited GetItem(AIndex) As BrowseNodeLookupRequest; +end; + +class function BrowseNodeLookup_RequestArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= BrowseNodeLookupRequest; +end; + +{ BrowseNodeLookupResponse_BrowseNodesArray } + +function BrowseNodeLookupResponse_BrowseNodesArray.GetItem(AIndex: Integer): BrowseNodes_Type; +begin + Result := Inherited GetItem(AIndex) As BrowseNodes_Type; +end; + +class function BrowseNodeLookupResponse_BrowseNodesArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= BrowseNodes_Type; +end; + +{ ListSearch_RequestArray } + +function ListSearch_RequestArray.GetItem(AIndex: Integer): ListSearchRequest; +begin + Result := Inherited GetItem(AIndex) As ListSearchRequest; +end; + +class function ListSearch_RequestArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= ListSearchRequest; +end; + +{ ListSearchResponse_ListsArray } + +function ListSearchResponse_ListsArray.GetItem(AIndex: Integer): Lists_Type; +begin + Result := Inherited GetItem(AIndex) As Lists_Type; +end; + +class function ListSearchResponse_ListsArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= Lists_Type; +end; + +{ ListLookup_RequestArray } + +function ListLookup_RequestArray.GetItem(AIndex: Integer): ListLookupRequest; +begin + Result := Inherited GetItem(AIndex) As ListLookupRequest; +end; + +class function ListLookup_RequestArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= ListLookupRequest; +end; + +{ ListLookupResponse_ListsArray } + +function ListLookupResponse_ListsArray.GetItem(AIndex: Integer): Lists_Type; +begin + Result := Inherited GetItem(AIndex) As Lists_Type; +end; + +class function ListLookupResponse_ListsArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= Lists_Type; +end; + +{ CustomerContentSearch_RequestArray } + +function CustomerContentSearch_RequestArray.GetItem(AIndex: Integer): CustomerContentSearchRequest; +begin + Result := Inherited GetItem(AIndex) As CustomerContentSearchRequest; +end; + +class function CustomerContentSearch_RequestArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= CustomerContentSearchRequest; +end; + +{ CustomerContentSearchResponse_CustomersArray } + +function CustomerContentSearchResponse_CustomersArray.GetItem(AIndex: Integer): Customers_Type; +begin + Result := Inherited GetItem(AIndex) As Customers_Type; +end; + +class function CustomerContentSearchResponse_CustomersArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= Customers_Type; +end; + +{ CustomerContentLookup_RequestArray } + +function CustomerContentLookup_RequestArray.GetItem(AIndex: Integer): CustomerContentLookupRequest; +begin + Result := Inherited GetItem(AIndex) As CustomerContentLookupRequest; +end; + +class function CustomerContentLookup_RequestArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= CustomerContentLookupRequest; +end; + +{ CustomerContentLookupResponse_CustomersArray } + +function CustomerContentLookupResponse_CustomersArray.GetItem(AIndex: Integer): Customers_Type; +begin + Result := Inherited GetItem(AIndex) As Customers_Type; +end; + +class function CustomerContentLookupResponse_CustomersArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= Customers_Type; +end; + +{ SimilarityLookup_RequestArray } + +function SimilarityLookup_RequestArray.GetItem(AIndex: Integer): SimilarityLookupRequest; +begin + Result := Inherited GetItem(AIndex) As SimilarityLookupRequest; +end; + +class function SimilarityLookup_RequestArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= SimilarityLookupRequest; +end; + +{ SimilarityLookupResponse_ItemsArray } + +function SimilarityLookupResponse_ItemsArray.GetItem(AIndex: Integer): Items_Type; +begin + Result := Inherited GetItem(AIndex) As Items_Type; +end; + +class function SimilarityLookupResponse_ItemsArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= Items_Type; +end; + +{ SellerLookup_RequestArray } + +function SellerLookup_RequestArray.GetItem(AIndex: Integer): SellerLookupRequest; +begin + Result := Inherited GetItem(AIndex) As SellerLookupRequest; +end; + +class function SellerLookup_RequestArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= SellerLookupRequest; +end; + +{ SellerLookupResponse_SellersArray } + +function SellerLookupResponse_SellersArray.GetItem(AIndex: Integer): Sellers_Type; +begin + Result := Inherited GetItem(AIndex) As Sellers_Type; +end; + +class function SellerLookupResponse_SellersArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= Sellers_Type; +end; + +{ CartGet_RequestArray } + +function CartGet_RequestArray.GetItem(AIndex: Integer): CartGetRequest; +begin + Result := Inherited GetItem(AIndex) As CartGetRequest; +end; + +class function CartGet_RequestArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= CartGetRequest; +end; + +{ CartGetResponse_CartArray } + +function CartGetResponse_CartArray.GetItem(AIndex: Integer): Cart_Type; +begin + Result := Inherited GetItem(AIndex) As Cart_Type; +end; + +class function CartGetResponse_CartArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= Cart_Type; +end; + +{ CartAdd_RequestArray } + +function CartAdd_RequestArray.GetItem(AIndex: Integer): CartAddRequest; +begin + Result := Inherited GetItem(AIndex) As CartAddRequest; +end; + +class function CartAdd_RequestArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= CartAddRequest; +end; + +{ CartAddResponse_CartArray } + +function CartAddResponse_CartArray.GetItem(AIndex: Integer): Cart_Type; +begin + Result := Inherited GetItem(AIndex) As Cart_Type; +end; + +class function CartAddResponse_CartArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= Cart_Type; +end; + +{ CartCreate_RequestArray } + +function CartCreate_RequestArray.GetItem(AIndex: Integer): CartCreateRequest; +begin + Result := Inherited GetItem(AIndex) As CartCreateRequest; +end; + +class function CartCreate_RequestArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= CartCreateRequest; +end; + +{ CartCreateResponse_CartArray } + +function CartCreateResponse_CartArray.GetItem(AIndex: Integer): Cart_Type; +begin + Result := Inherited GetItem(AIndex) As Cart_Type; +end; + +class function CartCreateResponse_CartArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= Cart_Type; +end; + +{ CartModify_RequestArray } + +function CartModify_RequestArray.GetItem(AIndex: Integer): CartModifyRequest; +begin + Result := Inherited GetItem(AIndex) As CartModifyRequest; +end; + +class function CartModify_RequestArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= CartModifyRequest; +end; + +{ CartModifyResponse_CartArray } + +function CartModifyResponse_CartArray.GetItem(AIndex: Integer): Cart_Type; +begin + Result := Inherited GetItem(AIndex) As Cart_Type; +end; + +class function CartModifyResponse_CartArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= Cart_Type; +end; + +{ CartClear_RequestArray } + +function CartClear_RequestArray.GetItem(AIndex: Integer): CartClearRequest; +begin + Result := Inherited GetItem(AIndex) As CartClearRequest; +end; + +class function CartClear_RequestArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= CartClearRequest; +end; + +{ CartClearResponse_CartArray } + +function CartClearResponse_CartArray.GetItem(AIndex: Integer): Cart_Type; +begin + Result := Inherited GetItem(AIndex) As Cart_Type; +end; + +class function CartClearResponse_CartArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= Cart_Type; +end; + +{ TransactionLookup_RequestArray } + +function TransactionLookup_RequestArray.GetItem(AIndex: Integer): TransactionLookupRequest; +begin + Result := Inherited GetItem(AIndex) As TransactionLookupRequest; +end; + +class function TransactionLookup_RequestArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= TransactionLookupRequest; +end; + +{ TransactionLookupResponse_TransactionsArray } + +function TransactionLookupResponse_TransactionsArray.GetItem(AIndex: Integer): Transactions_Type; +begin + Result := Inherited GetItem(AIndex) As Transactions_Type; +end; + +class function TransactionLookupResponse_TransactionsArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= Transactions_Type; +end; + +{ SellerListingSearch_RequestArray } + +function SellerListingSearch_RequestArray.GetItem(AIndex: Integer): SellerListingSearchRequest; +begin + Result := Inherited GetItem(AIndex) As SellerListingSearchRequest; +end; + +class function SellerListingSearch_RequestArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= SellerListingSearchRequest; +end; + +{ SellerListingSearchResponse_SellerListingsArray } + +function SellerListingSearchResponse_SellerListingsArray.GetItem(AIndex: Integer): SellerListings_Type; +begin + Result := Inherited GetItem(AIndex) As SellerListings_Type; +end; + +class function SellerListingSearchResponse_SellerListingsArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= SellerListings_Type; +end; + +{ SellerListingLookup_RequestArray } + +function SellerListingLookup_RequestArray.GetItem(AIndex: Integer): SellerListingLookupRequest; +begin + Result := Inherited GetItem(AIndex) As SellerListingLookupRequest; +end; + +class function SellerListingLookup_RequestArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= SellerListingLookupRequest; +end; + +{ SellerListingLookupResponse_SellerListingsArray } + +function SellerListingLookupResponse_SellerListingsArray.GetItem(AIndex: Integer): SellerListings_Type; +begin + Result := Inherited GetItem(AIndex) As SellerListings_Type; +end; + +class function SellerListingLookupResponse_SellerListingsArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= SellerListings_Type; +end; + +{ Bin_BinParameterArray } + +function Bin_BinParameterArray.GetItem(AIndex: Integer): Bin_BinParameter_Type; +begin + Result := Inherited GetItem(AIndex) As Bin_BinParameter_Type; +end; + +class function Bin_BinParameterArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= Bin_BinParameter_Type; +end; + +{ SearchBinSet_BinArray } + +function SearchBinSet_BinArray.GetItem(AIndex: Integer): Bin_Type; +begin + Result := Inherited GetItem(AIndex) As Bin_Type; +end; + +class function SearchBinSet_BinArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= Bin_Type; +end; + +{ SearchBinSets_Type } + +function SearchBinSets_Type.GetItem(AIndex: Integer): SearchBinSet_Type; +begin + Result := Inherited GetItem(AIndex) As SearchBinSet_Type; +end; + +class function SearchBinSets_Type.GetItemClass(): TBaseRemotableClass; +begin + Result:= SearchBinSet_Type; +end; + +{ HelpRequest_ResponseGroupArray } + +function HelpRequest_ResponseGroupArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure HelpRequest_ResponseGroupArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function HelpRequest_ResponseGroupArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure HelpRequest_ResponseGroupArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('ResponseGroup',TypeInfo(string),FData[AIndex]); +end; + +procedure HelpRequest_ResponseGroupArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'ResponseGroup'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function HelpRequest_ResponseGroupArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure HelpRequest_ResponseGroupArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ ItemSearchRequest_AudienceRatingArray } + +function ItemSearchRequest_AudienceRatingArray.GetItem(AIndex: Integer): AudienceRating_Type; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure ItemSearchRequest_AudienceRatingArray.SetItem(AIndex: Integer;const AValue: AudienceRating_Type); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function ItemSearchRequest_AudienceRatingArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure ItemSearchRequest_AudienceRatingArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('AudienceRating',TypeInfo(AudienceRating_Type),FData[AIndex]); +end; + +procedure ItemSearchRequest_AudienceRatingArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'AudienceRating'; + AStore.Get(TypeInfo(AudienceRating_Type),sName,FData[AIndex]); +end; + +class function ItemSearchRequest_AudienceRatingArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(AudienceRating_Type); +end; + +procedure ItemSearchRequest_AudienceRatingArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ ItemSearchRequest_ResponseGroupArray } + +function ItemSearchRequest_ResponseGroupArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure ItemSearchRequest_ResponseGroupArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function ItemSearchRequest_ResponseGroupArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure ItemSearchRequest_ResponseGroupArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('ResponseGroup',TypeInfo(string),FData[AIndex]); +end; + +procedure ItemSearchRequest_ResponseGroupArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'ResponseGroup'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function ItemSearchRequest_ResponseGroupArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure ItemSearchRequest_ResponseGroupArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ ItemLookupRequest_ItemIdArray } + +function ItemLookupRequest_ItemIdArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure ItemLookupRequest_ItemIdArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function ItemLookupRequest_ItemIdArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure ItemLookupRequest_ItemIdArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('ItemId',TypeInfo(string),FData[AIndex]); +end; + +procedure ItemLookupRequest_ItemIdArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'ItemId'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function ItemLookupRequest_ItemIdArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure ItemLookupRequest_ItemIdArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ ItemLookupRequest_ResponseGroupArray } + +function ItemLookupRequest_ResponseGroupArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure ItemLookupRequest_ResponseGroupArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function ItemLookupRequest_ResponseGroupArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure ItemLookupRequest_ResponseGroupArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('ResponseGroup',TypeInfo(string),FData[AIndex]); +end; + +procedure ItemLookupRequest_ResponseGroupArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'ResponseGroup'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function ItemLookupRequest_ResponseGroupArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure ItemLookupRequest_ResponseGroupArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ ListSearchRequest_ResponseGroupArray } + +function ListSearchRequest_ResponseGroupArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure ListSearchRequest_ResponseGroupArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function ListSearchRequest_ResponseGroupArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure ListSearchRequest_ResponseGroupArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('ResponseGroup',TypeInfo(string),FData[AIndex]); +end; + +procedure ListSearchRequest_ResponseGroupArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'ResponseGroup'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function ListSearchRequest_ResponseGroupArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure ListSearchRequest_ResponseGroupArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ ListLookupRequest_ResponseGroupArray } + +function ListLookupRequest_ResponseGroupArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure ListLookupRequest_ResponseGroupArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function ListLookupRequest_ResponseGroupArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure ListLookupRequest_ResponseGroupArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('ResponseGroup',TypeInfo(string),FData[AIndex]); +end; + +procedure ListLookupRequest_ResponseGroupArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'ResponseGroup'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function ListLookupRequest_ResponseGroupArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure ListLookupRequest_ResponseGroupArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ CustomerContentSearchRequest_ResponseGroupArray } + +function CustomerContentSearchRequest_ResponseGroupArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure CustomerContentSearchRequest_ResponseGroupArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function CustomerContentSearchRequest_ResponseGroupArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure CustomerContentSearchRequest_ResponseGroupArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('ResponseGroup',TypeInfo(string),FData[AIndex]); +end; + +procedure CustomerContentSearchRequest_ResponseGroupArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'ResponseGroup'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function CustomerContentSearchRequest_ResponseGroupArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure CustomerContentSearchRequest_ResponseGroupArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ CustomerContentLookupRequest_ResponseGroupArray } + +function CustomerContentLookupRequest_ResponseGroupArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure CustomerContentLookupRequest_ResponseGroupArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function CustomerContentLookupRequest_ResponseGroupArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure CustomerContentLookupRequest_ResponseGroupArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('ResponseGroup',TypeInfo(string),FData[AIndex]); +end; + +procedure CustomerContentLookupRequest_ResponseGroupArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'ResponseGroup'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function CustomerContentLookupRequest_ResponseGroupArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure CustomerContentLookupRequest_ResponseGroupArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ SimilarityLookupRequest_ItemIdArray } + +function SimilarityLookupRequest_ItemIdArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure SimilarityLookupRequest_ItemIdArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function SimilarityLookupRequest_ItemIdArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure SimilarityLookupRequest_ItemIdArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('ItemId',TypeInfo(string),FData[AIndex]); +end; + +procedure SimilarityLookupRequest_ItemIdArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'ItemId'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function SimilarityLookupRequest_ItemIdArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure SimilarityLookupRequest_ItemIdArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ SimilarityLookupRequest_ResponseGroupArray } + +function SimilarityLookupRequest_ResponseGroupArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure SimilarityLookupRequest_ResponseGroupArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function SimilarityLookupRequest_ResponseGroupArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure SimilarityLookupRequest_ResponseGroupArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('ResponseGroup',TypeInfo(string),FData[AIndex]); +end; + +procedure SimilarityLookupRequest_ResponseGroupArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'ResponseGroup'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function SimilarityLookupRequest_ResponseGroupArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure SimilarityLookupRequest_ResponseGroupArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ SellerLookupRequest_ResponseGroupArray } + +function SellerLookupRequest_ResponseGroupArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure SellerLookupRequest_ResponseGroupArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function SellerLookupRequest_ResponseGroupArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure SellerLookupRequest_ResponseGroupArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('ResponseGroup',TypeInfo(string),FData[AIndex]); +end; + +procedure SellerLookupRequest_ResponseGroupArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'ResponseGroup'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function SellerLookupRequest_ResponseGroupArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure SellerLookupRequest_ResponseGroupArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ SellerLookupRequest_SellerIdArray } + +function SellerLookupRequest_SellerIdArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure SellerLookupRequest_SellerIdArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function SellerLookupRequest_SellerIdArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure SellerLookupRequest_SellerIdArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('SellerId',TypeInfo(string),FData[AIndex]); +end; + +procedure SellerLookupRequest_SellerIdArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'SellerId'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function SellerLookupRequest_SellerIdArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure SellerLookupRequest_SellerIdArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ CartGetRequest_ResponseGroupArray } + +function CartGetRequest_ResponseGroupArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure CartGetRequest_ResponseGroupArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function CartGetRequest_ResponseGroupArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure CartGetRequest_ResponseGroupArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('ResponseGroup',TypeInfo(string),FData[AIndex]); +end; + +procedure CartGetRequest_ResponseGroupArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'ResponseGroup'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function CartGetRequest_ResponseGroupArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure CartGetRequest_ResponseGroupArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ CartAddRequest_Items_Type } + +function CartAddRequest_Items_Type.GetItem(AIndex: Integer): CartAddRequest_Items_Type_Item_Type; +begin + Result := Inherited GetItem(AIndex) As CartAddRequest_Items_Type_Item_Type; +end; + +class function CartAddRequest_Items_Type.GetItemClass(): TBaseRemotableClass; +begin + Result:= CartAddRequest_Items_Type_Item_Type; +end; + +{ CartAddRequest_ResponseGroupArray } + +function CartAddRequest_ResponseGroupArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure CartAddRequest_ResponseGroupArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function CartAddRequest_ResponseGroupArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure CartAddRequest_ResponseGroupArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('ResponseGroup',TypeInfo(string),FData[AIndex]); +end; + +procedure CartAddRequest_ResponseGroupArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'ResponseGroup'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function CartAddRequest_ResponseGroupArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure CartAddRequest_ResponseGroupArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ CartCreateRequest_Items_Type } + +function CartCreateRequest_Items_Type.GetItem(AIndex: Integer): CartCreateRequest_Items_Type_Item_Type; +begin + Result := Inherited GetItem(AIndex) As CartCreateRequest_Items_Type_Item_Type; +end; + +class function CartCreateRequest_Items_Type.GetItemClass(): TBaseRemotableClass; +begin + Result:= CartCreateRequest_Items_Type_Item_Type; +end; + +{ CartCreateRequest_ResponseGroupArray } + +function CartCreateRequest_ResponseGroupArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure CartCreateRequest_ResponseGroupArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function CartCreateRequest_ResponseGroupArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure CartCreateRequest_ResponseGroupArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('ResponseGroup',TypeInfo(string),FData[AIndex]); +end; + +procedure CartCreateRequest_ResponseGroupArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'ResponseGroup'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function CartCreateRequest_ResponseGroupArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure CartCreateRequest_ResponseGroupArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ CartModifyRequest_Items_Type } + +function CartModifyRequest_Items_Type.GetItem(AIndex: Integer): CartModifyRequest_Items_Type_Item_Type; +begin + Result := Inherited GetItem(AIndex) As CartModifyRequest_Items_Type_Item_Type; +end; + +class function CartModifyRequest_Items_Type.GetItemClass(): TBaseRemotableClass; +begin + Result:= CartModifyRequest_Items_Type_Item_Type; +end; + +{ CartModifyRequest_ResponseGroupArray } + +function CartModifyRequest_ResponseGroupArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure CartModifyRequest_ResponseGroupArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function CartModifyRequest_ResponseGroupArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure CartModifyRequest_ResponseGroupArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('ResponseGroup',TypeInfo(string),FData[AIndex]); +end; + +procedure CartModifyRequest_ResponseGroupArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'ResponseGroup'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function CartModifyRequest_ResponseGroupArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure CartModifyRequest_ResponseGroupArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ CartClearRequest_ResponseGroupArray } + +function CartClearRequest_ResponseGroupArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure CartClearRequest_ResponseGroupArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function CartClearRequest_ResponseGroupArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure CartClearRequest_ResponseGroupArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('ResponseGroup',TypeInfo(string),FData[AIndex]); +end; + +procedure CartClearRequest_ResponseGroupArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'ResponseGroup'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function CartClearRequest_ResponseGroupArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure CartClearRequest_ResponseGroupArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ TransactionLookupRequest_ResponseGroupArray } + +function TransactionLookupRequest_ResponseGroupArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure TransactionLookupRequest_ResponseGroupArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function TransactionLookupRequest_ResponseGroupArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure TransactionLookupRequest_ResponseGroupArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('ResponseGroup',TypeInfo(string),FData[AIndex]); +end; + +procedure TransactionLookupRequest_ResponseGroupArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'ResponseGroup'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function TransactionLookupRequest_ResponseGroupArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure TransactionLookupRequest_ResponseGroupArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ TransactionLookupRequest_TransactionIdArray } + +function TransactionLookupRequest_TransactionIdArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure TransactionLookupRequest_TransactionIdArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function TransactionLookupRequest_TransactionIdArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure TransactionLookupRequest_TransactionIdArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('TransactionId',TypeInfo(string),FData[AIndex]); +end; + +procedure TransactionLookupRequest_TransactionIdArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'TransactionId'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function TransactionLookupRequest_TransactionIdArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure TransactionLookupRequest_TransactionIdArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ SellerListingSearchRequest_ResponseGroupArray } + +function SellerListingSearchRequest_ResponseGroupArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure SellerListingSearchRequest_ResponseGroupArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function SellerListingSearchRequest_ResponseGroupArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure SellerListingSearchRequest_ResponseGroupArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('ResponseGroup',TypeInfo(string),FData[AIndex]); +end; + +procedure SellerListingSearchRequest_ResponseGroupArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'ResponseGroup'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function SellerListingSearchRequest_ResponseGroupArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure SellerListingSearchRequest_ResponseGroupArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ SellerListingLookupRequest_ResponseGroupArray } + +function SellerListingLookupRequest_ResponseGroupArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure SellerListingLookupRequest_ResponseGroupArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function SellerListingLookupRequest_ResponseGroupArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure SellerListingLookupRequest_ResponseGroupArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('ResponseGroup',TypeInfo(string),FData[AIndex]); +end; + +procedure SellerListingLookupRequest_ResponseGroupArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'ResponseGroup'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function SellerListingLookupRequest_ResponseGroupArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure SellerListingLookupRequest_ResponseGroupArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ BrowseNodeLookupRequest_BrowseNodeIdArray } + +function BrowseNodeLookupRequest_BrowseNodeIdArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure BrowseNodeLookupRequest_BrowseNodeIdArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function BrowseNodeLookupRequest_BrowseNodeIdArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure BrowseNodeLookupRequest_BrowseNodeIdArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('BrowseNodeId',TypeInfo(string),FData[AIndex]); +end; + +procedure BrowseNodeLookupRequest_BrowseNodeIdArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'BrowseNodeId'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function BrowseNodeLookupRequest_BrowseNodeIdArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure BrowseNodeLookupRequest_BrowseNodeIdArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ BrowseNodeLookupRequest_ResponseGroupArray } + +function BrowseNodeLookupRequest_ResponseGroupArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure BrowseNodeLookupRequest_ResponseGroupArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function BrowseNodeLookupRequest_ResponseGroupArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure BrowseNodeLookupRequest_ResponseGroupArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('ResponseGroup',TypeInfo(string),FData[AIndex]); +end; + +procedure BrowseNodeLookupRequest_ResponseGroupArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'ResponseGroup'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function BrowseNodeLookupRequest_ResponseGroupArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure BrowseNodeLookupRequest_ResponseGroupArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ HTTPHeaders_Type } + +function HTTPHeaders_Type.GetItem(AIndex: Integer): HTTPHeaders_Header_Type; +begin + Result := Inherited GetItem(AIndex) As HTTPHeaders_Header_Type; +end; + +class function HTTPHeaders_Type.GetItemClass(): TBaseRemotableClass; +begin + Result:= HTTPHeaders_Header_Type; +end; + +{ Arguments_Type } + +function Arguments_Type.GetItem(AIndex: Integer): Arguments_Argument_Type; +begin + Result := Inherited GetItem(AIndex) As Arguments_Argument_Type; +end; + +class function Arguments_Type.GetItemClass(): TBaseRemotableClass; +begin + Result:= Arguments_Argument_Type; +end; + +{ Errors_Type } + +function Errors_Type.GetItem(AIndex: Integer): Errors_Error_Type; +begin + Result := Inherited GetItem(AIndex) As Errors_Error_Type; +end; + +class function Errors_Type.GetItemClass(): TBaseRemotableClass; +begin + Result:= Errors_Error_Type; +end; + +{ Information_OperationInformationArray } + +function Information_OperationInformationArray.GetItem(AIndex: Integer): OperationInformation_Type; +begin + Result := Inherited GetItem(AIndex) As OperationInformation_Type; +end; + +class function Information_OperationInformationArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= OperationInformation_Type; +end; + +{ Information_ResponseGroupInformationArray } + +function Information_ResponseGroupInformationArray.GetItem(AIndex: Integer): ResponseGroupInformation_Type; +begin + Result := Inherited GetItem(AIndex) As ResponseGroupInformation_Type; +end; + +class function Information_ResponseGroupInformationArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= ResponseGroupInformation_Type; +end; + +{ SearchResultsMap_Type } + +function SearchResultsMap_Type.GetItem(AIndex: Integer): SearchResultsMap_SearchIndex_Type; +begin + Result := Inherited GetItem(AIndex) As SearchResultsMap_SearchIndex_Type; +end; + +class function SearchResultsMap_Type.GetItemClass(): TBaseRemotableClass; +begin + Result:= SearchResultsMap_SearchIndex_Type; +end; + +{ Items__ItemArray } + +function Items__ItemArray.GetItem(AIndex: Integer): Item_Type; +begin + Result := Inherited GetItem(AIndex) As Item_Type; +end; + +class function Items__ItemArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= Item_Type; +end; + +{ Lists_ListArray } + +function Lists_ListArray.GetItem(AIndex: Integer): List_Type; +begin + Result := Inherited GetItem(AIndex) As List_Type; +end; + +class function Lists_ListArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= List_Type; +end; + +{ Customers_CustomerArray } + +function Customers_CustomerArray.GetItem(AIndex: Integer): Customer_Type; +begin + Result := Inherited GetItem(AIndex) As Customer_Type; +end; + +class function Customers_CustomerArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= Customer_Type; +end; + +{ SimilarProducts_Type } + +function SimilarProducts_Type.GetItem(AIndex: Integer): SimilarProducts_SimilarProduct_Type; +begin + Result := Inherited GetItem(AIndex) As SimilarProducts_SimilarProduct_Type; +end; + +class function SimilarProducts_Type.GetItemClass(): TBaseRemotableClass; +begin + Result:= SimilarProducts_SimilarProduct_Type; +end; + +{ TopSellers_Type } + +function TopSellers_Type.GetItem(AIndex: Integer): TopSellers_TopSeller_Type; +begin + Result := Inherited GetItem(AIndex) As TopSellers_TopSeller_Type; +end; + +class function TopSellers_Type.GetItemClass(): TBaseRemotableClass; +begin + Result:= TopSellers_TopSeller_Type; +end; + +{ NewReleases_Type } + +function NewReleases_Type.GetItem(AIndex: Integer): NewReleases_NewRelease_Type; +begin + Result := Inherited GetItem(AIndex) As NewReleases_NewRelease_Type; +end; + +class function NewReleases_Type.GetItemClass(): TBaseRemotableClass; +begin + Result:= NewReleases_NewRelease_Type; +end; + +{ SimilarViewedProducts_Type } + +function SimilarViewedProducts_Type.GetItem(AIndex: Integer): SimilarViewedProducts_SimilarViewedProduct_Type; +begin + Result := Inherited GetItem(AIndex) As SimilarViewedProducts_SimilarViewedProduct_Type; +end; + +class function SimilarViewedProducts_Type.GetItemClass(): TBaseRemotableClass; +begin + Result:= SimilarViewedProducts_SimilarViewedProduct_Type; +end; + +{ OtherCategoriesSimilarProducts_Type } + +function OtherCategoriesSimilarProducts_Type.GetItem(AIndex: Integer): OtherCategoriesSimilarProducts_OtherCategoriesSimilarProduct_Type; +begin + Result := Inherited GetItem(AIndex) As OtherCategoriesSimilarProducts_OtherCategoriesSimilarProduct_Type; +end; + +class function OtherCategoriesSimilarProducts_Type.GetItemClass(): TBaseRemotableClass; +begin + Result:= OtherCategoriesSimilarProducts_OtherCategoriesSimilarProduct_Type; +end; + +{ Transactions_TransactionArray } + +function Transactions_TransactionArray.GetItem(AIndex: Integer): Transaction_Type; +begin + Result := Inherited GetItem(AIndex) As Transaction_Type; +end; + +class function Transactions_TransactionArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= Transaction_Type; +end; + +{ Sellers_SellerArray } + +function Sellers_SellerArray.GetItem(AIndex: Integer): Seller_Type; +begin + Result := Inherited GetItem(AIndex) As Seller_Type; +end; + +class function Sellers_SellerArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= Seller_Type; +end; + +{ SellerListings_SellerListingArray } + +function SellerListings_SellerListingArray.GetItem(AIndex: Integer): SellerListing_Type; +begin + Result := Inherited GetItem(AIndex) As SellerListing_Type; +end; + +class function SellerListings_SellerListingArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= SellerListing_Type; +end; + +{ OperationInformation_RequiredParameters_Type } + +function OperationInformation_RequiredParameters_Type.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure OperationInformation_RequiredParameters_Type.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function OperationInformation_RequiredParameters_Type.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure OperationInformation_RequiredParameters_Type.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('Parameter',TypeInfo(string),FData[AIndex]); +end; + +procedure OperationInformation_RequiredParameters_Type.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'Parameter'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function OperationInformation_RequiredParameters_Type.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure OperationInformation_RequiredParameters_Type.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ OperationInformation_AvailableParameters_Type } + +function OperationInformation_AvailableParameters_Type.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure OperationInformation_AvailableParameters_Type.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function OperationInformation_AvailableParameters_Type.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure OperationInformation_AvailableParameters_Type.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('Parameter',TypeInfo(string),FData[AIndex]); +end; + +procedure OperationInformation_AvailableParameters_Type.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'Parameter'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function OperationInformation_AvailableParameters_Type.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure OperationInformation_AvailableParameters_Type.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ OperationInformation_DefaultResponseGroups_Type } + +function OperationInformation_DefaultResponseGroups_Type.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure OperationInformation_DefaultResponseGroups_Type.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function OperationInformation_DefaultResponseGroups_Type.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure OperationInformation_DefaultResponseGroups_Type.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('ResponseGroup',TypeInfo(string),FData[AIndex]); +end; + +procedure OperationInformation_DefaultResponseGroups_Type.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'ResponseGroup'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function OperationInformation_DefaultResponseGroups_Type.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure OperationInformation_DefaultResponseGroups_Type.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ OperationInformation_AvailableResponseGroups_Type } + +function OperationInformation_AvailableResponseGroups_Type.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure OperationInformation_AvailableResponseGroups_Type.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function OperationInformation_AvailableResponseGroups_Type.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure OperationInformation_AvailableResponseGroups_Type.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('ResponseGroup',TypeInfo(string),FData[AIndex]); +end; + +procedure OperationInformation_AvailableResponseGroups_Type.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'ResponseGroup'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function OperationInformation_AvailableResponseGroups_Type.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure OperationInformation_AvailableResponseGroups_Type.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ ResponseGroupInformation_ValidOperations_Type } + +function ResponseGroupInformation_ValidOperations_Type.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure ResponseGroupInformation_ValidOperations_Type.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function ResponseGroupInformation_ValidOperations_Type.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure ResponseGroupInformation_ValidOperations_Type.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('Operation',TypeInfo(string),FData[AIndex]); +end; + +procedure ResponseGroupInformation_ValidOperations_Type.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'Operation'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function ResponseGroupInformation_ValidOperations_Type.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure ResponseGroupInformation_ValidOperations_Type.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ ResponseGroupInformation_Elements_Type } + +function ResponseGroupInformation_Elements_Type.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure ResponseGroupInformation_Elements_Type.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function ResponseGroupInformation_Elements_Type.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure ResponseGroupInformation_Elements_Type.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('Element',TypeInfo(string),FData[AIndex]); +end; + +procedure ResponseGroupInformation_Elements_Type.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'Element'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function ResponseGroupInformation_Elements_Type.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure ResponseGroupInformation_Elements_Type.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ List_ListItemArray } + +function List_ListItemArray.GetItem(AIndex: Integer): ListItem_Type; +begin + Result := Inherited GetItem(AIndex) As ListItem_Type; +end; + +class function List_ListItemArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= ListItem_Type; +end; + +{ Customer_CustomerReviewsArray } + +function Customer_CustomerReviewsArray.GetItem(AIndex: Integer): CustomerReviews_Type; +begin + Result := Inherited GetItem(AIndex) As CustomerReviews_Type; +end; + +class function Customer_CustomerReviewsArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= CustomerReviews_Type; +end; + +{ SearchResultsMap_SearchIndex_Type_ASINArray } + +function SearchResultsMap_SearchIndex_Type_ASINArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure SearchResultsMap_SearchIndex_Type_ASINArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function SearchResultsMap_SearchIndex_Type_ASINArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure SearchResultsMap_SearchIndex_Type_ASINArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('ASIN',TypeInfo(string),FData[AIndex]); +end; + +procedure SearchResultsMap_SearchIndex_Type_ASINArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'ASIN'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function SearchResultsMap_SearchIndex_Type_ASINArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure SearchResultsMap_SearchIndex_Type_ASINArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ Item_ImageSets_Type_ImageSetArray } + +function Item_ImageSets_Type_ImageSetArray.GetItem(AIndex: Integer): ImageSet_Type; +begin + Result := Inherited GetItem(AIndex) As ImageSet_Type; +end; + +class function Item_ImageSets_Type_ImageSetArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= ImageSet_Type; +end; + +{ Collections_Type } + +function Collections_Type.GetItem(AIndex: Integer): Collections_Collection_Type; +begin + Result := Inherited GetItem(AIndex) As Collections_Collection_Type; +end; + +class function Collections_Type.GetItemClass(): TBaseRemotableClass; +begin + Result:= Collections_Collection_Type; +end; + +{ Item_Subjects_Type } + +function Item_Subjects_Type.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure Item_Subjects_Type.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function Item_Subjects_Type.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure Item_Subjects_Type.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('Subject',TypeInfo(string),FData[AIndex]); +end; + +procedure Item_Subjects_Type.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'Subject'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function Item_Subjects_Type.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure Item_Subjects_Type.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ EditorialReviews_Type } + +function EditorialReviews_Type.GetItem(AIndex: Integer): EditorialReview_Type; +begin + Result := Inherited GetItem(AIndex) As EditorialReview_Type; +end; + +class function EditorialReviews_Type.GetItemClass(): TBaseRemotableClass; +begin + Result:= EditorialReview_Type; +end; + +{ Accessories_Type } + +function Accessories_Type.GetItem(AIndex: Integer): Accessories_Accessory_Type; +begin + Result := Inherited GetItem(AIndex) As Accessories_Accessory_Type; +end; + +class function Accessories_Type.GetItemClass(): TBaseRemotableClass; +begin + Result:= Accessories_Accessory_Type; +end; + +{ Tracks_Type } + +function Tracks_Type.GetItem(AIndex: Integer): Tracks_Disc_Type; +begin + Result := Inherited GetItem(AIndex) As Tracks_Disc_Type; +end; + +class function Tracks_Type.GetItemClass(): TBaseRemotableClass; +begin + Result:= Tracks_Disc_Type; +end; + +{ ListmaniaLists_Type } + +function ListmaniaLists_Type.GetItem(AIndex: Integer): ListmaniaLists_ListmaniaList_Type; +begin + Result := Inherited GetItem(AIndex) As ListmaniaLists_ListmaniaList_Type; +end; + +class function ListmaniaLists_Type.GetItemClass(): TBaseRemotableClass; +begin + Result:= ListmaniaLists_ListmaniaList_Type; +end; + +{ Item_AlternateVersions_Type } + +function Item_AlternateVersions_Type.GetItem(AIndex: Integer): Item_AlternateVersions_Type_AlternateVersion_Type; +begin + Result := Inherited GetItem(AIndex) As Item_AlternateVersions_Type_AlternateVersion_Type; +end; + +class function Item_AlternateVersions_Type.GetItemClass(): TBaseRemotableClass; +begin + Result:= Item_AlternateVersions_Type_AlternateVersion_Type; +end; + +{ _Item_ImageSetsArray } + +function _Item_ImageSetsArray.GetItem(AIndex: Integer): Item_ImageSets_Type; +begin + Result := Inherited GetItem(AIndex) As Item_ImageSets_Type; +end; + +class function _Item_ImageSetsArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= Item_ImageSets_Type; +end; + +{ Offers_OfferArray } + +function Offers_OfferArray.GetItem(AIndex: Integer): Offer_Type; +begin + Result := Inherited GetItem(AIndex) As Offer_Type; +end; + +class function Offers_OfferArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= Offer_Type; +end; + +{ Promotions_Type } + +function Promotions_Type.GetItem(AIndex: Integer): Promotion_Type; +begin + Result := Inherited GetItem(AIndex) As Promotion_Type; +end; + +class function Promotions_Type.GetItemClass(): TBaseRemotableClass; +begin + Result:= Promotion_Type; +end; + +{ Offer_OfferListingArray } + +function Offer_OfferListingArray.GetItem(AIndex: Integer): OfferListing_Type; +begin + Result := Inherited GetItem(AIndex) As OfferListing_Type; +end; + +class function Offer_OfferListingArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= OfferListing_Type; +end; + +{ OfferListing_ShippingChargeArray } + +function OfferListing_ShippingChargeArray.GetItem(AIndex: Integer): OfferListing_ShippingCharge_Type; +begin + Result := Inherited GetItem(AIndex) As OfferListing_ShippingCharge_Type; +end; + +class function OfferListing_ShippingChargeArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= OfferListing_ShippingCharge_Type; +end; + +{ VariationDimensions_Type } + +function VariationDimensions_Type.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure VariationDimensions_Type.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function VariationDimensions_Type.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure VariationDimensions_Type.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('VariationDimension',TypeInfo(string),FData[AIndex]); +end; + +procedure VariationDimensions_Type.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'VariationDimension'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function VariationDimensions_Type.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure VariationDimensions_Type.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ Variations__ItemArray } + +function Variations__ItemArray.GetItem(AIndex: Integer): Item_Type; +begin + Result := Inherited GetItem(AIndex) As Item_Type; +end; + +class function Variations__ItemArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= Item_Type; +end; + +{ Collections_Collection_Type_CollectionItemArray } + +function Collections_Collection_Type_CollectionItemArray.GetItem(AIndex: Integer): Collections_Collection_Type_CollectionItem_Type; +begin + Result := Inherited GetItem(AIndex) As Collections_Collection_Type_CollectionItem_Type; +end; + +class function Collections_Collection_Type_CollectionItemArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= Collections_Collection_Type_CollectionItem_Type; +end; + +{ CustomerReviews_ReviewArray } + +function CustomerReviews_ReviewArray.GetItem(AIndex: Integer): Review_Type; +begin + Result := Inherited GetItem(AIndex) As Review_Type; +end; + +class function CustomerReviews_ReviewArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= Review_Type; +end; + +{ Tracks_Disc_Type_TrackArray } + +function Tracks_Disc_Type_TrackArray.GetItem(AIndex: Integer): Tracks_Disc_Type_Track_Type; +begin + Result := Inherited GetItem(AIndex) As Tracks_Disc_Type_Track_Type; +end; + +class function Tracks_Disc_Type_TrackArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= Tracks_Disc_Type_Track_Type; +end; + +{ PromotionEligibilityRequirements } + +function PromotionEligibilityRequirements.GetItem(AIndex: Integer): PromotionEligibilityRequirement; +begin + Result := Inherited GetItem(AIndex) As PromotionEligibilityRequirement; +end; + +class function PromotionEligibilityRequirements.GetItemClass(): TBaseRemotableClass; +begin + Result:= PromotionEligibilityRequirement; +end; + +{ PromotionBenefits } + +function PromotionBenefits.GetItem(AIndex: Integer): PromotionBenefit; +begin + Result := Inherited GetItem(AIndex) As PromotionBenefit; +end; + +class function PromotionBenefits.GetItemClass(): TBaseRemotableClass; +begin + Result:= PromotionBenefit; +end; + +{ BrowseNodes_BrowseNodeArray } + +function BrowseNodes_BrowseNodeArray.GetItem(AIndex: Integer): BrowseNode_Type; +begin + Result := Inherited GetItem(AIndex) As BrowseNode_Type; +end; + +class function BrowseNodes_BrowseNodeArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= BrowseNode_Type; +end; + +{ BrowseNode_Children_Type } + +function BrowseNode_Children_Type.GetItem(AIndex: Integer): BrowseNode_Type; +begin + Result := Inherited GetItem(AIndex) As BrowseNode_Type; +end; + +class function BrowseNode_Children_Type.GetItemClass(): TBaseRemotableClass; +begin + Result:= BrowseNode_Type; +end; + +{ BrowseNode_Ancestors_Type } + +function BrowseNode_Ancestors_Type.GetItem(AIndex: Integer): BrowseNode_Type; +begin + Result := Inherited GetItem(AIndex) As BrowseNode_Type; +end; + +class function BrowseNode_Ancestors_Type.GetItemClass(): TBaseRemotableClass; +begin + Result:= BrowseNode_Type; +end; + +{ CartItems_CartItemArray } + +function CartItems_CartItemArray.GetItem(AIndex: Integer): CartItem; +begin + Result := Inherited GetItem(AIndex) As CartItem; +end; + +class function CartItems_CartItemArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= CartItem; +end; + +{ SavedForLaterItems_SavedForLaterItemArray } + +function SavedForLaterItems_SavedForLaterItemArray.GetItem(AIndex: Integer): CartItem; +begin + Result := Inherited GetItem(AIndex) As CartItem; +end; + +class function SavedForLaterItems_SavedForLaterItemArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= CartItem; +end; + +{ Transaction_TransactionItems_Type } + +function Transaction_TransactionItems_Type.GetItem(AIndex: Integer): TransactionItem_Type; +begin + Result := Inherited GetItem(AIndex) As TransactionItem_Type; +end; + +class function Transaction_TransactionItems_Type.GetItemClass(): TBaseRemotableClass; +begin + Result:= TransactionItem_Type; +end; + +{ Transaction_Shipments_Type_Shipment_Type_ShipmentItems_Type } + +function Transaction_Shipments_Type_Shipment_Type_ShipmentItems_Type.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure Transaction_Shipments_Type_Shipment_Type_ShipmentItems_Type.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function Transaction_Shipments_Type_Shipment_Type_ShipmentItems_Type.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure Transaction_Shipments_Type_Shipment_Type_ShipmentItems_Type.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('TransactionItemId',TypeInfo(string),FData[AIndex]); +end; + +procedure Transaction_Shipments_Type_Shipment_Type_ShipmentItems_Type.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'TransactionItemId'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function Transaction_Shipments_Type_Shipment_Type_ShipmentItems_Type.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure Transaction_Shipments_Type_Shipment_Type_ShipmentItems_Type.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ Transaction_Shipments_Type_Shipment_Type_Packages_Type } + +function Transaction_Shipments_Type_Shipment_Type_Packages_Type.GetItem(AIndex: Integer): Transaction_Shipments_Type_Shipment_Type_Packages_Type_Package_Type; +begin + Result := Inherited GetItem(AIndex) As Transaction_Shipments_Type_Shipment_Type_Packages_Type_Package_Type; +end; + +class function Transaction_Shipments_Type_Shipment_Type_Packages_Type.GetItemClass(): TBaseRemotableClass; +begin + Result:= Transaction_Shipments_Type_Shipment_Type_Packages_Type_Package_Type; +end; + +{ Transaction_Shipments_Type } + +function Transaction_Shipments_Type.GetItem(AIndex: Integer): Transaction_Shipments_Type_Shipment_Type; +begin + Result := Inherited GetItem(AIndex) As Transaction_Shipments_Type_Shipment_Type; +end; + +class function Transaction_Shipments_Type.GetItemClass(): TBaseRemotableClass; +begin + Result:= Transaction_Shipments_Type_Shipment_Type; +end; + +{ TransactionItem_ChildTransactionItems_Type } + +function TransactionItem_ChildTransactionItems_Type.GetItem(AIndex: Integer): TransactionItem_Type; +begin + Result := Inherited GetItem(AIndex) As TransactionItem_Type; +end; + +class function TransactionItem_ChildTransactionItems_Type.GetItemClass(): TBaseRemotableClass; +begin + Result:= TransactionItem_Type; +end; + +{ Seller_SellerFeedbackSummary_Type_FeedbackDateRange_Type_SellerFeedbackRatingArray } + +function Seller_SellerFeedbackSummary_Type_FeedbackDateRange_Type_SellerFeedbackRatingArray.GetItem(AIndex: Integer): Seller_SellerFeedbackSummary_Type_FeedbackDateRange_Type_SellerFeedbackRating_Type; +begin + Result := Inherited GetItem(AIndex) As Seller_SellerFeedbackSummary_Type_FeedbackDateRange_Type_SellerFeedbackRating_Type; +end; + +class function Seller_SellerFeedbackSummary_Type_FeedbackDateRange_Type_SellerFeedbackRatingArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= Seller_SellerFeedbackSummary_Type_FeedbackDateRange_Type_SellerFeedbackRating_Type; +end; + +{ Seller_SellerFeedbackSummary_Type } + +function Seller_SellerFeedbackSummary_Type.GetItem(AIndex: Integer): Seller_SellerFeedbackSummary_Type_FeedbackDateRange_Type; +begin + Result := Inherited GetItem(AIndex) As Seller_SellerFeedbackSummary_Type_FeedbackDateRange_Type; +end; + +class function Seller_SellerFeedbackSummary_Type.GetItemClass(): TBaseRemotableClass; +begin + Result:= Seller_SellerFeedbackSummary_Type_FeedbackDateRange_Type; +end; + +{ SellerFeedback_Type } + +function SellerFeedback_Type.GetItem(AIndex: Integer): SellerFeedback_Feedback_Type; +begin + Result := Inherited GetItem(AIndex) As SellerFeedback_Feedback_Type; +end; + +class function SellerFeedback_Type.GetItemClass(): TBaseRemotableClass; +begin + Result:= SellerFeedback_Feedback_Type; +end; + +{ ItemAttributes_Languages_Type } + +function ItemAttributes_Languages_Type.GetItem(AIndex: Integer): ItemAttributes_Languages_Type_Language_Type; +begin + Result := Inherited GetItem(AIndex) As ItemAttributes_Languages_Type_Language_Type; +end; + +class function ItemAttributes_Languages_Type.GetItemClass(): TBaseRemotableClass; +begin + Result:= ItemAttributes_Languages_Type_Language_Type; +end; + +{ ItemAttributes_ActorArray } + +function ItemAttributes_ActorArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure ItemAttributes_ActorArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function ItemAttributes_ActorArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure ItemAttributes_ActorArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('Actor',TypeInfo(string),FData[AIndex]); +end; + +procedure ItemAttributes_ActorArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'Actor'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function ItemAttributes_ActorArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure ItemAttributes_ActorArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ ItemAttributes_ArtistArray } + +function ItemAttributes_ArtistArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure ItemAttributes_ArtistArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function ItemAttributes_ArtistArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure ItemAttributes_ArtistArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('Artist',TypeInfo(string),FData[AIndex]); +end; + +procedure ItemAttributes_ArtistArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'Artist'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function ItemAttributes_ArtistArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure ItemAttributes_ArtistArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ ItemAttributes_AudioFormatArray } + +function ItemAttributes_AudioFormatArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure ItemAttributes_AudioFormatArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function ItemAttributes_AudioFormatArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure ItemAttributes_AudioFormatArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('AudioFormat',TypeInfo(string),FData[AIndex]); +end; + +procedure ItemAttributes_AudioFormatArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'AudioFormat'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function ItemAttributes_AudioFormatArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure ItemAttributes_AudioFormatArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ ItemAttributes_AuthorArray } + +function ItemAttributes_AuthorArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure ItemAttributes_AuthorArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function ItemAttributes_AuthorArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure ItemAttributes_AuthorArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('Author',TypeInfo(string),FData[AIndex]); +end; + +procedure ItemAttributes_AuthorArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'Author'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function ItemAttributes_AuthorArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure ItemAttributes_AuthorArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ ItemAttributes_CameraManualFeaturesArray } + +function ItemAttributes_CameraManualFeaturesArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure ItemAttributes_CameraManualFeaturesArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function ItemAttributes_CameraManualFeaturesArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure ItemAttributes_CameraManualFeaturesArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('CameraManualFeatures',TypeInfo(string),FData[AIndex]); +end; + +procedure ItemAttributes_CameraManualFeaturesArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'CameraManualFeatures'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function ItemAttributes_CameraManualFeaturesArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure ItemAttributes_CameraManualFeaturesArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ ItemAttributes_CompatibleDevicesArray } + +function ItemAttributes_CompatibleDevicesArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure ItemAttributes_CompatibleDevicesArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function ItemAttributes_CompatibleDevicesArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure ItemAttributes_CompatibleDevicesArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('CompatibleDevices',TypeInfo(string),FData[AIndex]); +end; + +procedure ItemAttributes_CompatibleDevicesArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'CompatibleDevices'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function ItemAttributes_CompatibleDevicesArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure ItemAttributes_CompatibleDevicesArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ ItemAttributes_CreatorArray } + +function ItemAttributes_CreatorArray.GetItem(AIndex: Integer): ItemAttributes_Creator_Type; +begin + Result := Inherited GetItem(AIndex) As ItemAttributes_Creator_Type; +end; + +class function ItemAttributes_CreatorArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= ItemAttributes_Creator_Type; +end; + +{ ItemAttributes_DataLinkProtocolArray } + +function ItemAttributes_DataLinkProtocolArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure ItemAttributes_DataLinkProtocolArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function ItemAttributes_DataLinkProtocolArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure ItemAttributes_DataLinkProtocolArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('DataLinkProtocol',TypeInfo(string),FData[AIndex]); +end; + +procedure ItemAttributes_DataLinkProtocolArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'DataLinkProtocol'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function ItemAttributes_DataLinkProtocolArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure ItemAttributes_DataLinkProtocolArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ ItemAttributes_DirectorArray } + +function ItemAttributes_DirectorArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure ItemAttributes_DirectorArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function ItemAttributes_DirectorArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure ItemAttributes_DirectorArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('Director',TypeInfo(string),FData[AIndex]); +end; + +procedure ItemAttributes_DirectorArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'Director'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function ItemAttributes_DirectorArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure ItemAttributes_DirectorArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ ItemAttributes_FeatureArray } + +function ItemAttributes_FeatureArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure ItemAttributes_FeatureArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function ItemAttributes_FeatureArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure ItemAttributes_FeatureArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('Feature',TypeInfo(string),FData[AIndex]); +end; + +procedure ItemAttributes_FeatureArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'Feature'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function ItemAttributes_FeatureArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure ItemAttributes_FeatureArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ ItemAttributes_FormatArray } + +function ItemAttributes_FormatArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure ItemAttributes_FormatArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function ItemAttributes_FormatArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure ItemAttributes_FormatArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('Format',TypeInfo(string),FData[AIndex]); +end; + +procedure ItemAttributes_FormatArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'Format'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function ItemAttributes_FormatArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure ItemAttributes_FormatArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ ItemAttributes_FormFactorArray } + +function ItemAttributes_FormFactorArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure ItemAttributes_FormFactorArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function ItemAttributes_FormFactorArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure ItemAttributes_FormFactorArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('FormFactor',TypeInfo(string),FData[AIndex]); +end; + +procedure ItemAttributes_FormFactorArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'FormFactor'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function ItemAttributes_FormFactorArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure ItemAttributes_FormFactorArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ ItemAttributes_PhotoFlashTypeArray } + +function ItemAttributes_PhotoFlashTypeArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure ItemAttributes_PhotoFlashTypeArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function ItemAttributes_PhotoFlashTypeArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure ItemAttributes_PhotoFlashTypeArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('PhotoFlashType',TypeInfo(string),FData[AIndex]); +end; + +procedure ItemAttributes_PhotoFlashTypeArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'PhotoFlashType'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function ItemAttributes_PhotoFlashTypeArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure ItemAttributes_PhotoFlashTypeArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ ItemAttributes_PictureFormatArray } + +function ItemAttributes_PictureFormatArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure ItemAttributes_PictureFormatArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function ItemAttributes_PictureFormatArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure ItemAttributes_PictureFormatArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('PictureFormat',TypeInfo(string),FData[AIndex]); +end; + +procedure ItemAttributes_PictureFormatArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'PictureFormat'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function ItemAttributes_PictureFormatArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure ItemAttributes_PictureFormatArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ ItemAttributes_PlatformArray } + +function ItemAttributes_PlatformArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure ItemAttributes_PlatformArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function ItemAttributes_PlatformArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure ItemAttributes_PlatformArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('Platform',TypeInfo(string),FData[AIndex]); +end; + +procedure ItemAttributes_PlatformArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'Platform'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function ItemAttributes_PlatformArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure ItemAttributes_PlatformArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ ItemAttributes_ReturnMethodArray } + +function ItemAttributes_ReturnMethodArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure ItemAttributes_ReturnMethodArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function ItemAttributes_ReturnMethodArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure ItemAttributes_ReturnMethodArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('ReturnMethod',TypeInfo(string),FData[AIndex]); +end; + +procedure ItemAttributes_ReturnMethodArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'ReturnMethod'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function ItemAttributes_ReturnMethodArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure ItemAttributes_ReturnMethodArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ ItemAttributes_SpecialFeaturesArray } + +function ItemAttributes_SpecialFeaturesArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure ItemAttributes_SpecialFeaturesArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function ItemAttributes_SpecialFeaturesArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure ItemAttributes_SpecialFeaturesArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('SpecialFeatures',TypeInfo(string),FData[AIndex]); +end; + +procedure ItemAttributes_SpecialFeaturesArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'SpecialFeatures'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function ItemAttributes_SpecialFeaturesArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure ItemAttributes_SpecialFeaturesArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ ItemAttributes_SupportedImageTypeArray } + +function ItemAttributes_SupportedImageTypeArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure ItemAttributes_SupportedImageTypeArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function ItemAttributes_SupportedImageTypeArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure ItemAttributes_SupportedImageTypeArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('SupportedImageType',TypeInfo(string),FData[AIndex]); +end; + +procedure ItemAttributes_SupportedImageTypeArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'SupportedImageType'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function ItemAttributes_SupportedImageTypeArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure ItemAttributes_SupportedImageTypeArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ MerchantItemAttributes_Languages_Type } + +function MerchantItemAttributes_Languages_Type.GetItem(AIndex: Integer): MerchantItemAttributes_Languages_Type_Language_Type; +begin + Result := Inherited GetItem(AIndex) As MerchantItemAttributes_Languages_Type_Language_Type; +end; + +class function MerchantItemAttributes_Languages_Type.GetItemClass(): TBaseRemotableClass; +begin + Result:= MerchantItemAttributes_Languages_Type_Language_Type; +end; + +{ MerchantItemAttributes_ActorArray } + +function MerchantItemAttributes_ActorArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure MerchantItemAttributes_ActorArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function MerchantItemAttributes_ActorArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure MerchantItemAttributes_ActorArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('Actor',TypeInfo(string),FData[AIndex]); +end; + +procedure MerchantItemAttributes_ActorArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'Actor'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function MerchantItemAttributes_ActorArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure MerchantItemAttributes_ActorArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ MerchantItemAttributes_ArtistArray } + +function MerchantItemAttributes_ArtistArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure MerchantItemAttributes_ArtistArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function MerchantItemAttributes_ArtistArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure MerchantItemAttributes_ArtistArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('Artist',TypeInfo(string),FData[AIndex]); +end; + +procedure MerchantItemAttributes_ArtistArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'Artist'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function MerchantItemAttributes_ArtistArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure MerchantItemAttributes_ArtistArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ MerchantItemAttributes_AudioFormatArray } + +function MerchantItemAttributes_AudioFormatArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure MerchantItemAttributes_AudioFormatArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function MerchantItemAttributes_AudioFormatArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure MerchantItemAttributes_AudioFormatArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('AudioFormat',TypeInfo(string),FData[AIndex]); +end; + +procedure MerchantItemAttributes_AudioFormatArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'AudioFormat'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function MerchantItemAttributes_AudioFormatArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure MerchantItemAttributes_AudioFormatArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ MerchantItemAttributes_AuthorArray } + +function MerchantItemAttributes_AuthorArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure MerchantItemAttributes_AuthorArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function MerchantItemAttributes_AuthorArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure MerchantItemAttributes_AuthorArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('Author',TypeInfo(string),FData[AIndex]); +end; + +procedure MerchantItemAttributes_AuthorArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'Author'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function MerchantItemAttributes_AuthorArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure MerchantItemAttributes_AuthorArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ MerchantItemAttributes_CameraManualFeaturesArray } + +function MerchantItemAttributes_CameraManualFeaturesArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure MerchantItemAttributes_CameraManualFeaturesArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function MerchantItemAttributes_CameraManualFeaturesArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure MerchantItemAttributes_CameraManualFeaturesArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('CameraManualFeatures',TypeInfo(string),FData[AIndex]); +end; + +procedure MerchantItemAttributes_CameraManualFeaturesArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'CameraManualFeatures'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function MerchantItemAttributes_CameraManualFeaturesArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure MerchantItemAttributes_CameraManualFeaturesArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ MerchantItemAttributes_CreatorArray } + +function MerchantItemAttributes_CreatorArray.GetItem(AIndex: Integer): MerchantItemAttributes_Creator_Type; +begin + Result := Inherited GetItem(AIndex) As MerchantItemAttributes_Creator_Type; +end; + +class function MerchantItemAttributes_CreatorArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= MerchantItemAttributes_Creator_Type; +end; + +{ MerchantItemAttributes_DirectorArray } + +function MerchantItemAttributes_DirectorArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure MerchantItemAttributes_DirectorArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function MerchantItemAttributes_DirectorArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure MerchantItemAttributes_DirectorArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('Director',TypeInfo(string),FData[AIndex]); +end; + +procedure MerchantItemAttributes_DirectorArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'Director'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function MerchantItemAttributes_DirectorArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure MerchantItemAttributes_DirectorArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ MerchantItemAttributes_FeatureArray } + +function MerchantItemAttributes_FeatureArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure MerchantItemAttributes_FeatureArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function MerchantItemAttributes_FeatureArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure MerchantItemAttributes_FeatureArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('Feature',TypeInfo(string),FData[AIndex]); +end; + +procedure MerchantItemAttributes_FeatureArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'Feature'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function MerchantItemAttributes_FeatureArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure MerchantItemAttributes_FeatureArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ MerchantItemAttributes_FormatArray } + +function MerchantItemAttributes_FormatArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure MerchantItemAttributes_FormatArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function MerchantItemAttributes_FormatArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure MerchantItemAttributes_FormatArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('Format',TypeInfo(string),FData[AIndex]); +end; + +procedure MerchantItemAttributes_FormatArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'Format'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function MerchantItemAttributes_FormatArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure MerchantItemAttributes_FormatArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ MerchantItemAttributes_PhotoFlashTypeArray } + +function MerchantItemAttributes_PhotoFlashTypeArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure MerchantItemAttributes_PhotoFlashTypeArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function MerchantItemAttributes_PhotoFlashTypeArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure MerchantItemAttributes_PhotoFlashTypeArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('PhotoFlashType',TypeInfo(string),FData[AIndex]); +end; + +procedure MerchantItemAttributes_PhotoFlashTypeArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'PhotoFlashType'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function MerchantItemAttributes_PhotoFlashTypeArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure MerchantItemAttributes_PhotoFlashTypeArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ MerchantItemAttributes_PictureFormatArray } + +function MerchantItemAttributes_PictureFormatArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure MerchantItemAttributes_PictureFormatArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function MerchantItemAttributes_PictureFormatArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure MerchantItemAttributes_PictureFormatArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('PictureFormat',TypeInfo(string),FData[AIndex]); +end; + +procedure MerchantItemAttributes_PictureFormatArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'PictureFormat'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function MerchantItemAttributes_PictureFormatArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure MerchantItemAttributes_PictureFormatArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ MerchantItemAttributes_PlatformArray } + +function MerchantItemAttributes_PlatformArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure MerchantItemAttributes_PlatformArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function MerchantItemAttributes_PlatformArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure MerchantItemAttributes_PlatformArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('Platform',TypeInfo(string),FData[AIndex]); +end; + +procedure MerchantItemAttributes_PlatformArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'Platform'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function MerchantItemAttributes_PlatformArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure MerchantItemAttributes_PlatformArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ MerchantItemAttributes_PurchasingChannelArray } + +function MerchantItemAttributes_PurchasingChannelArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure MerchantItemAttributes_PurchasingChannelArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function MerchantItemAttributes_PurchasingChannelArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure MerchantItemAttributes_PurchasingChannelArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('PurchasingChannel',TypeInfo(string),FData[AIndex]); +end; + +procedure MerchantItemAttributes_PurchasingChannelArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'PurchasingChannel'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function MerchantItemAttributes_PurchasingChannelArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure MerchantItemAttributes_PurchasingChannelArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ MerchantItemAttributes_ReturnMethodArray } + +function MerchantItemAttributes_ReturnMethodArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure MerchantItemAttributes_ReturnMethodArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function MerchantItemAttributes_ReturnMethodArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure MerchantItemAttributes_ReturnMethodArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('ReturnMethod',TypeInfo(string),FData[AIndex]); +end; + +procedure MerchantItemAttributes_ReturnMethodArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'ReturnMethod'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function MerchantItemAttributes_ReturnMethodArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure MerchantItemAttributes_ReturnMethodArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ MerchantItemAttributes_SpecialFeaturesArray } + +function MerchantItemAttributes_SpecialFeaturesArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure MerchantItemAttributes_SpecialFeaturesArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function MerchantItemAttributes_SpecialFeaturesArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure MerchantItemAttributes_SpecialFeaturesArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('SpecialFeatures',TypeInfo(string),FData[AIndex]); +end; + +procedure MerchantItemAttributes_SpecialFeaturesArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'SpecialFeatures'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function MerchantItemAttributes_SpecialFeaturesArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure MerchantItemAttributes_SpecialFeaturesArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + +{ MerchantItemAttributes_SupportedImageTypeArray } + +function MerchantItemAttributes_SupportedImageTypeArray.GetItem(AIndex: Integer): string; +begin + CheckIndex(AIndex); + Result := FData[AIndex]; +end; + +procedure MerchantItemAttributes_SupportedImageTypeArray.SetItem(AIndex: Integer;const AValue: string); +begin + CheckIndex(AIndex); + FData[AIndex] := AValue; +end; + +function MerchantItemAttributes_SupportedImageTypeArray.GetLength(): Integer; +begin + Result := System.Length(FData); +end; + +procedure MerchantItemAttributes_SupportedImageTypeArray.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer); +begin + AStore.Put('SupportedImageType',TypeInfo(string),FData[AIndex]); +end; + +procedure MerchantItemAttributes_SupportedImageTypeArray.LoadItem(AStore: IFormatterBase;const AIndex: Integer); +var + sName : string; +begin + sName := 'SupportedImageType'; + AStore.Get(TypeInfo(string),sName,FData[AIndex]); +end; + +class function MerchantItemAttributes_SupportedImageTypeArray.GetItemTypeInfo(): PTypeInfo; +begin + Result := TypeInfo(string); +end; + +procedure MerchantItemAttributes_SupportedImageTypeArray.SetLength(const ANewSize: Integer); +var + i : Integer; +begin + if ( ANewSize < 0 ) then + i := 0 + else + i := ANewSize; + System.SetLength(FData,i); +end; + + +procedure Register_AWSECommerceService_ServiceMetadata(); +var + mm : IModuleMetadataMngr; +begin + mm := GetModuleMetadataMngr(); + mm.SetRepositoryNameSpace(sUNIT_NAME, sNAME_SPACE); + mm.SetServiceCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'TRANSPORT_Address', + 'http://soap.amazon.com/onca/soap?Service=AWSECommerceService' + ); + mm.SetServiceCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'FORMAT_Style', + 'document' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'Help', + 'TRANSPORT_soapAction', + 'http://soap.amazon.com' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'Help', + 'FORMAT_Input_EncodingStyle', + 'literal' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'Help', + 'FORMAT_OutputEncodingStyle', + 'literal' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'ItemSearch', + 'TRANSPORT_soapAction', + 'http://soap.amazon.com' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'ItemSearch', + 'FORMAT_Input_EncodingStyle', + 'literal' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'ItemSearch', + 'FORMAT_OutputEncodingStyle', + 'literal' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'ItemLookup', + 'TRANSPORT_soapAction', + 'http://soap.amazon.com' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'ItemLookup', + 'FORMAT_Input_EncodingStyle', + 'literal' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'ItemLookup', + 'FORMAT_OutputEncodingStyle', + 'literal' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'BrowseNodeLookup', + 'TRANSPORT_soapAction', + 'http://soap.amazon.com' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'BrowseNodeLookup', + 'FORMAT_Input_EncodingStyle', + 'literal' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'BrowseNodeLookup', + 'FORMAT_OutputEncodingStyle', + 'literal' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'ListSearch', + 'TRANSPORT_soapAction', + 'http://soap.amazon.com' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'ListSearch', + 'FORMAT_Input_EncodingStyle', + 'literal' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'ListSearch', + 'FORMAT_OutputEncodingStyle', + 'literal' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'ListLookup', + 'TRANSPORT_soapAction', + 'http://soap.amazon.com' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'ListLookup', + 'FORMAT_Input_EncodingStyle', + 'literal' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'ListLookup', + 'FORMAT_OutputEncodingStyle', + 'literal' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'CustomerContentSearch', + 'TRANSPORT_soapAction', + 'http://soap.amazon.com' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'CustomerContentSearch', + 'FORMAT_Input_EncodingStyle', + 'literal' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'CustomerContentSearch', + 'FORMAT_OutputEncodingStyle', + 'literal' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'CustomerContentLookup', + 'TRANSPORT_soapAction', + 'http://soap.amazon.com' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'CustomerContentLookup', + 'FORMAT_Input_EncodingStyle', + 'literal' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'CustomerContentLookup', + 'FORMAT_OutputEncodingStyle', + 'literal' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'SimilarityLookup', + 'TRANSPORT_soapAction', + 'http://soap.amazon.com' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'SimilarityLookup', + 'FORMAT_Input_EncodingStyle', + 'literal' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'SimilarityLookup', + 'FORMAT_OutputEncodingStyle', + 'literal' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'SellerLookup', + 'TRANSPORT_soapAction', + 'http://soap.amazon.com' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'SellerLookup', + 'FORMAT_Input_EncodingStyle', + 'literal' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'SellerLookup', + 'FORMAT_OutputEncodingStyle', + 'literal' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'CartGet', + 'TRANSPORT_soapAction', + 'http://soap.amazon.com' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'CartGet', + 'FORMAT_Input_EncodingStyle', + 'literal' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'CartGet', + 'FORMAT_OutputEncodingStyle', + 'literal' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'CartAdd', + 'TRANSPORT_soapAction', + 'http://soap.amazon.com' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'CartAdd', + 'FORMAT_Input_EncodingStyle', + 'literal' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'CartAdd', + 'FORMAT_OutputEncodingStyle', + 'literal' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'CartCreate', + 'TRANSPORT_soapAction', + 'http://soap.amazon.com' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'CartCreate', + 'FORMAT_Input_EncodingStyle', + 'literal' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'CartCreate', + 'FORMAT_OutputEncodingStyle', + 'literal' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'CartModify', + 'TRANSPORT_soapAction', + 'http://soap.amazon.com' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'CartModify', + 'FORMAT_Input_EncodingStyle', + 'literal' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'CartModify', + 'FORMAT_OutputEncodingStyle', + 'literal' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'CartClear', + 'TRANSPORT_soapAction', + 'http://soap.amazon.com' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'CartClear', + 'FORMAT_Input_EncodingStyle', + 'literal' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'CartClear', + 'FORMAT_OutputEncodingStyle', + 'literal' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'TransactionLookup', + 'TRANSPORT_soapAction', + 'http://soap.amazon.com' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'TransactionLookup', + 'FORMAT_Input_EncodingStyle', + 'literal' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'TransactionLookup', + 'FORMAT_OutputEncodingStyle', + 'literal' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'SellerListingSearch', + 'TRANSPORT_soapAction', + 'http://soap.amazon.com' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'SellerListingSearch', + 'FORMAT_Input_EncodingStyle', + 'literal' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'SellerListingSearch', + 'FORMAT_OutputEncodingStyle', + 'literal' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'SellerListingLookup', + 'TRANSPORT_soapAction', + 'http://soap.amazon.com' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'SellerListingLookup', + 'FORMAT_Input_EncodingStyle', + 'literal' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'SellerListingLookup', + 'FORMAT_OutputEncodingStyle', + 'literal' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'MultiOperation', + 'TRANSPORT_soapAction', + 'http://soap.amazon.com' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'MultiOperation', + 'FORMAT_Input_EncodingStyle', + 'literal' + ); + mm.SetOperationCustomData( + sUNIT_NAME, + 'AWSECommerceServicePortType', + 'MultiOperation', + 'FORMAT_OutputEncodingStyle', + 'literal' + ); +end; + + +initialization + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(HelpRequest_HelpType_Type),'HelpRequest_HelpType_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ItemSearchRequest_Availability_Type),'ItemSearchRequest_Availability_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(AudienceRating_Type),'AudienceRating'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(AudienceRating_Type)].RegisterExternalPropertyName('AudienceRatingPG_13','PG-13'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(AudienceRating_Type)].RegisterExternalPropertyName('AudienceRatingNC_17','NC-17'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(AudienceRating_Type)].RegisterExternalPropertyName('AudienceRating_6','6'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(AudienceRating_Type)].RegisterExternalPropertyName('AudienceRating_12','12'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(AudienceRating_Type)].RegisterExternalPropertyName('AudienceRating_16','16'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(AudienceRating_Type)].RegisterExternalPropertyName('AudienceRating_18','18'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Condition_Type),'Condition'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(DeliveryMethod_Type),'DeliveryMethod'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ItemLookupRequest_IdType_Type),'ItemLookupRequest_IdType_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ListSearchRequest_ListType_Type),'ListSearchRequest_ListType_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ListLookupRequest_ListType_Type),'ListLookupRequest_ListType_Type'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(ListLookupRequest_ListType_Type)].RegisterExternalPropertyName('ListLookupRequest_ListType_TypeWishList','WishList'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(ListLookupRequest_ListType_Type)].RegisterExternalPropertyName('ListLookupRequest_ListType_TypeWeddingRegistry','WeddingRegistry'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SimilarityLookupRequest_SimilarityType_Type),'SimilarityLookupRequest_SimilarityType_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CartModifyRequest_Items_Type_Item_Type_Action_Type),'CartModifyRequest_Items_Type_Item_Type_Action_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SellerListingSearchRequest_OfferStatus_Type),'SellerListingSearchRequest_OfferStatus_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SellerListingLookupRequest_IdType_Type),'SellerListingLookupRequest_IdType_Type'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(SellerListingLookupRequest_IdType_Type)].RegisterExternalPropertyName('SellerListingLookupRequest_IdType_TypeASIN','ASIN'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(SellerListingLookupRequest_IdType_Type)].RegisterExternalPropertyName('SellerListingLookupRequest_IdType_TypeSKU','SKU'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(List_ListType_Type),'List_ListType_Type'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(List_ListType_Type)].RegisterExternalPropertyName('List_ListType_TypeWishList','WishList'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(List_ListType_Type)].RegisterExternalPropertyName('List_ListType_TypeWeddingRegistry','WeddingRegistry'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(List_ListType_Type)].RegisterExternalPropertyName('List_ListType_TypeBabyRegistry','BabyRegistry'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(List_ListType_Type)].RegisterExternalPropertyName('List_ListType_TypeListmania','Listmania'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(HelpRequest),'HelpRequest'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Help_Type),'Help'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(OperationRequest_Type),'OperationRequest'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Information_Type),'Information'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(HelpResponse_Type),'HelpResponse'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ItemSearchRequest),'ItemSearchRequest'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ItemSearch_Type),'ItemSearch'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Items_Type),'Items'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ItemSearchResponse_Type),'ItemSearchResponse'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ItemLookupRequest),'ItemLookupRequest'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ItemLookup_Type),'ItemLookup'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ItemLookupResponse_Type),'ItemLookupResponse'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(BrowseNodeLookupRequest),'BrowseNodeLookupRequest'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(BrowseNodeLookup_Type),'BrowseNodeLookup'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(BrowseNodes_Type),'BrowseNodes'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(BrowseNodeLookupResponse_Type),'BrowseNodeLookupResponse'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ListSearchRequest),'ListSearchRequest'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ListSearch_Type),'ListSearch'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Lists_Type),'Lists'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ListSearchResponse_Type),'ListSearchResponse'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ListLookupRequest),'ListLookupRequest'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ListLookup_Type),'ListLookup'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ListLookupResponse_Type),'ListLookupResponse'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CustomerContentSearchRequest),'CustomerContentSearchRequest'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CustomerContentSearch_Type),'CustomerContentSearch'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Customers_Type),'Customers'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CustomerContentSearchResponse_Type),'CustomerContentSearchResponse'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CustomerContentLookupRequest),'CustomerContentLookupRequest'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CustomerContentLookup_Type),'CustomerContentLookup'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CustomerContentLookupResponse_Type),'CustomerContentLookupResponse'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SimilarityLookupRequest),'SimilarityLookupRequest'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SimilarityLookup_Type),'SimilarityLookup'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SimilarityLookupResponse_Type),'SimilarityLookupResponse'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SellerLookupRequest),'SellerLookupRequest'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SellerLookup_Type),'SellerLookup'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Sellers_Type),'Sellers'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SellerLookupResponse_Type),'SellerLookupResponse'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CartGetRequest),'CartGetRequest'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CartGet_Type),'CartGet'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Cart_Type),'Cart'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CartGetResponse_Type),'CartGetResponse'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CartAddRequest),'CartAddRequest'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CartAdd_Type),'CartAdd'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CartAddResponse_Type),'CartAddResponse'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CartCreateRequest),'CartCreateRequest'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CartCreate_Type),'CartCreate'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CartCreateResponse_Type),'CartCreateResponse'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CartModifyRequest),'CartModifyRequest'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CartModify_Type),'CartModify'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CartModifyResponse_Type),'CartModifyResponse'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CartClearRequest),'CartClearRequest'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CartClear_Type),'CartClear'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CartClearResponse_Type),'CartClearResponse'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(TransactionLookupRequest),'TransactionLookupRequest'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(TransactionLookup_Type),'TransactionLookup'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Transactions_Type),'Transactions'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(TransactionLookupResponse_Type),'TransactionLookupResponse'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SellerListingSearchRequest),'SellerListingSearchRequest'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SellerListingSearch_Type),'SellerListingSearch'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SellerListings_Type),'SellerListings'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SellerListingSearchResponse_Type),'SellerListingSearchResponse'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SellerListingLookupRequest),'SellerListingLookupRequest'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SellerListingLookup_Type),'SellerListingLookup'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SellerListingLookupResponse_Type),'SellerListingLookupResponse'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(MultiOperationType),'MultiOperation'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(MultiOperationResponse),'MultiOperationResponse'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Bin_BinParameter_Type),'Bin_BinParameter_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Bin_Type),'Bin'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SearchBinSet_Type),'SearchBinSet'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CartAddRequest_Items_Type_Item_Type),'CartAddRequest_Items_Type_Item_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CartCreateRequest_Items_Type_Item_Type),'CartCreateRequest_Items_Type_Item_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CartModifyRequest_Items_Type_Item_Type),'CartModifyRequest_Items_Type_Item_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Request_Type),'Request'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Arguments_Argument_Type),'Arguments_Argument_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(HTTPHeaders_Header_Type),'HTTPHeaders_Header_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Errors_Error_Type),'Errors_Error_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(OperationInformation_Type),'OperationInformation'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ResponseGroupInformation_Type),'ResponseGroupInformation'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CorrectedQuery_Type),'CorrectedQuery'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Item_Type),'Item'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(List_Type),'List'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Customer_Type),'Customer'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Price),'Price'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CartItems_Type),'CartItems'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SavedForLaterItems_Type),'SavedForLaterItems'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Transaction_Type),'Transaction'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Seller_Type),'Seller'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SellerListing_Type),'SellerListing'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Image),'Image'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ListItem_Type),'ListItem'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Customer_Location_Type),'Customer_Location_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CustomerReviews_Type),'CustomerReviews'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SearchResultsMap_SearchIndex_Type),'SearchResultsMap_SearchIndex_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ImageSet_Type),'ImageSet'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Item_ImageSets_Type),'Item_ImageSets_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ItemAttributes_Type),'ItemAttributes'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(MerchantItemAttributes_Type),'MerchantItemAttributes'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(OfferSummary_Type),'OfferSummary'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Offers_Type),'Offers'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(VariationSummary_Type),'VariationSummary'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Variations_Type),'Variations'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SearchInside_Type),'SearchInside'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Item_AlternateVersions_Type_AlternateVersion_Type),'Item_AlternateVersions_Type_AlternateVersion_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Offer_Type),'Offer'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Merchant_Type),'Merchant'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(OfferAttributes_Type),'OfferAttributes'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(OfferListing_Type),'OfferListing'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(LoyaltyPoints_Type),'LoyaltyPoints'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(OfferListing_AvailabilityAttributes_Type),'OfferListing_AvailabilityAttributes_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Address),'Address'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(OfferListing_ShippingCharge_Type),'OfferListing_ShippingCharge_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(EditorialReview_Type),'EditorialReview'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Collections_Collection_Type_CollectionSummary_Type),'Collections_Collection_Type_CollectionSummary_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Collections_Collection_Type_CollectionParent_Type),'Collections_Collection_Type_CollectionParent_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Collections_Collection_Type_CollectionItem_Type),'Collections_Collection_Type_CollectionItem_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Collections_Collection_Type),'Collections_Collection_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Review_Type),'Review'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Reviewer_Type),'Reviewer'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Tracks_Disc_Type_Track_Type),'Tracks_Disc_Type_Track_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Tracks_Disc_Type),'Tracks_Disc_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SimilarProducts_SimilarProduct_Type),'SimilarProducts_SimilarProduct_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(TopSellers_TopSeller_Type),'TopSellers_TopSeller_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(NewReleases_NewRelease_Type),'NewReleases_NewRelease_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SimilarViewedProducts_SimilarViewedProduct_Type),'SimilarViewedProducts_SimilarViewedProduct_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(OtherCategoriesSimilarProducts_OtherCategoriesSimilarProduct_Type),'OtherCategoriesSimilarProducts_OtherCategoriesSimilarProduct_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Accessories_Accessory_Type),'Accessories_Accessory_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Promotion_Type),'Promotion'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Promotion_Summary_Type),'Promotion_Summary_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(PromotionItemApplicability),'PromotionItemApplicability'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Promotion_Details_Type),'Promotion_Details_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(PromotionEligibilityRequirement),'PromotionEligibilityRequirement'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(PromotionBenefit),'PromotionBenefit'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(BrowseNode_Type),'BrowseNode'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ListmaniaLists_ListmaniaList_Type),'ListmaniaLists_ListmaniaList_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SearchInside_Excerpt_Type),'SearchInside_Excerpt_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CartItem),'CartItem'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Transaction_Totals_Type),'Transaction_Totals_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(TransactionItem_Type),'TransactionItem'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Transaction_Shipments_Type_Shipment_Type_Packages_Type_Package_Type),'Transaction_Shipments_Type_Shipment_Type_Packages_Type_Package_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Transaction_Shipments_Type_Shipment_Type),'Transaction_Shipments_Type_Shipment_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Seller_Location_Type),'Seller_Location_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Seller_SellerFeedbackSummary_Type_FeedbackDateRange_Type_SellerFeedbackRating_Type),'Seller_SellerFeedbackSummary_Type_FeedbackDateRange_Type_SellerFeedbackRating_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Seller_SellerFeedbackSummary_Type_FeedbackDateRange_Type),'Seller_SellerFeedbackSummary_Type_FeedbackDateRange_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SellerFeedback_Feedback_Type),'SellerFeedback_Feedback_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(DecimalWithUnits),'DecimalWithUnits'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(NonNegativeIntegerWithUnits),'NonNegativeIntegerWithUnits'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ItemAttributes_Creator_Type),'ItemAttributes_Creator_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(StringWithUnits),'StringWithUnits'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ItemAttributes_ItemDimensions_Type),'ItemAttributes_ItemDimensions_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ItemAttributes_Languages_Type_Language_Type),'ItemAttributes_Languages_Type_Language_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ItemAttributes_PackageDimensions_Type),'ItemAttributes_PackageDimensions_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(MerchantItemAttributes_Creator_Type),'MerchantItemAttributes_Creator_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(MerchantItemAttributes_ItemDimensions_Type),'MerchantItemAttributes_ItemDimensions_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(MerchantItemAttributes_Languages_Type_Language_Type),'MerchantItemAttributes_Languages_Type_Language_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(MerchantItemAttributes_PackageDimensions_Type),'MerchantItemAttributes_PackageDimensions_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(MerchantItemAttributes_VendorRebate_Type),'MerchantItemAttributes_VendorRebate_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Help_RequestArray),'Help_RequestArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(Help_RequestArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(HelpResponse_InformationArray),'HelpResponse_InformationArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(HelpResponse_InformationArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ItemSearch_RequestArray),'ItemSearch_RequestArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(ItemSearch_RequestArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ItemSearchResponse_ItemsArray),'ItemSearchResponse_ItemsArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(ItemSearchResponse_ItemsArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ItemLookup_RequestArray),'ItemLookup_RequestArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(ItemLookup_RequestArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ItemLookupResponse_ItemsArray),'ItemLookupResponse_ItemsArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(ItemLookupResponse_ItemsArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(BrowseNodeLookup_RequestArray),'BrowseNodeLookup_RequestArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(BrowseNodeLookup_RequestArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(BrowseNodeLookupResponse_BrowseNodesArray),'BrowseNodeLookupResponse_BrowseNodesArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(BrowseNodeLookupResponse_BrowseNodesArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ListSearch_RequestArray),'ListSearch_RequestArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(ListSearch_RequestArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ListSearchResponse_ListsArray),'ListSearchResponse_ListsArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(ListSearchResponse_ListsArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ListLookup_RequestArray),'ListLookup_RequestArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(ListLookup_RequestArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ListLookupResponse_ListsArray),'ListLookupResponse_ListsArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(ListLookupResponse_ListsArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CustomerContentSearch_RequestArray),'CustomerContentSearch_RequestArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(CustomerContentSearch_RequestArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CustomerContentSearchResponse_CustomersArray),'CustomerContentSearchResponse_CustomersArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(CustomerContentSearchResponse_CustomersArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CustomerContentLookup_RequestArray),'CustomerContentLookup_RequestArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(CustomerContentLookup_RequestArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CustomerContentLookupResponse_CustomersArray),'CustomerContentLookupResponse_CustomersArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(CustomerContentLookupResponse_CustomersArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SimilarityLookup_RequestArray),'SimilarityLookup_RequestArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(SimilarityLookup_RequestArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SimilarityLookupResponse_ItemsArray),'SimilarityLookupResponse_ItemsArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(SimilarityLookupResponse_ItemsArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SellerLookup_RequestArray),'SellerLookup_RequestArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(SellerLookup_RequestArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SellerLookupResponse_SellersArray),'SellerLookupResponse_SellersArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(SellerLookupResponse_SellersArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CartGet_RequestArray),'CartGet_RequestArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(CartGet_RequestArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CartGetResponse_CartArray),'CartGetResponse_CartArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(CartGetResponse_CartArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CartAdd_RequestArray),'CartAdd_RequestArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(CartAdd_RequestArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CartAddResponse_CartArray),'CartAddResponse_CartArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(CartAddResponse_CartArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CartCreate_RequestArray),'CartCreate_RequestArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(CartCreate_RequestArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CartCreateResponse_CartArray),'CartCreateResponse_CartArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(CartCreateResponse_CartArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CartModify_RequestArray),'CartModify_RequestArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(CartModify_RequestArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CartModifyResponse_CartArray),'CartModifyResponse_CartArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(CartModifyResponse_CartArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CartClear_RequestArray),'CartClear_RequestArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(CartClear_RequestArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CartClearResponse_CartArray),'CartClearResponse_CartArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(CartClearResponse_CartArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(TransactionLookup_RequestArray),'TransactionLookup_RequestArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(TransactionLookup_RequestArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(TransactionLookupResponse_TransactionsArray),'TransactionLookupResponse_TransactionsArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(TransactionLookupResponse_TransactionsArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SellerListingSearch_RequestArray),'SellerListingSearch_RequestArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(SellerListingSearch_RequestArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SellerListingSearchResponse_SellerListingsArray),'SellerListingSearchResponse_SellerListingsArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(SellerListingSearchResponse_SellerListingsArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SellerListingLookup_RequestArray),'SellerListingLookup_RequestArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(SellerListingLookup_RequestArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SellerListingLookupResponse_SellerListingsArray),'SellerListingLookupResponse_SellerListingsArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(SellerListingLookupResponse_SellerListingsArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Bin_BinParameterArray),'Bin_BinParameterArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(Bin_BinParameterArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SearchBinSet_BinArray),'SearchBinSet_BinArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(SearchBinSet_BinArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SearchBinSets_Type),'SearchBinSets'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(HelpRequest_ResponseGroupArray),'HelpRequest_ResponseGroupArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(HelpRequest_ResponseGroupArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ItemSearchRequest_AudienceRatingArray),'ItemSearchRequest_AudienceRatingArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(ItemSearchRequest_AudienceRatingArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ItemSearchRequest_ResponseGroupArray),'ItemSearchRequest_ResponseGroupArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(ItemSearchRequest_ResponseGroupArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ItemLookupRequest_ItemIdArray),'ItemLookupRequest_ItemIdArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(ItemLookupRequest_ItemIdArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ItemLookupRequest_ResponseGroupArray),'ItemLookupRequest_ResponseGroupArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(ItemLookupRequest_ResponseGroupArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ListSearchRequest_ResponseGroupArray),'ListSearchRequest_ResponseGroupArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(ListSearchRequest_ResponseGroupArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ListLookupRequest_ResponseGroupArray),'ListLookupRequest_ResponseGroupArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(ListLookupRequest_ResponseGroupArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CustomerContentSearchRequest_ResponseGroupArray),'CustomerContentSearchRequest_ResponseGroupArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(CustomerContentSearchRequest_ResponseGroupArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CustomerContentLookupRequest_ResponseGroupArray),'CustomerContentLookupRequest_ResponseGroupArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(CustomerContentLookupRequest_ResponseGroupArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SimilarityLookupRequest_ItemIdArray),'SimilarityLookupRequest_ItemIdArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(SimilarityLookupRequest_ItemIdArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SimilarityLookupRequest_ResponseGroupArray),'SimilarityLookupRequest_ResponseGroupArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(SimilarityLookupRequest_ResponseGroupArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SellerLookupRequest_ResponseGroupArray),'SellerLookupRequest_ResponseGroupArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(SellerLookupRequest_ResponseGroupArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SellerLookupRequest_SellerIdArray),'SellerLookupRequest_SellerIdArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(SellerLookupRequest_SellerIdArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CartGetRequest_ResponseGroupArray),'CartGetRequest_ResponseGroupArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(CartGetRequest_ResponseGroupArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CartAddRequest_Items_Type),'CartAddRequest_Items_Type'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(CartAddRequest_Items_Type)].RegisterExternalPropertyName(sARRAY_ITEM,'Item'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CartAddRequest_ResponseGroupArray),'CartAddRequest_ResponseGroupArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(CartAddRequest_ResponseGroupArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CartCreateRequest_Items_Type),'CartCreateRequest_Items_Type'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(CartCreateRequest_Items_Type)].RegisterExternalPropertyName(sARRAY_ITEM,'Item'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CartCreateRequest_ResponseGroupArray),'CartCreateRequest_ResponseGroupArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(CartCreateRequest_ResponseGroupArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CartModifyRequest_Items_Type),'CartModifyRequest_Items_Type'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(CartModifyRequest_Items_Type)].RegisterExternalPropertyName(sARRAY_ITEM,'Item'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CartModifyRequest_ResponseGroupArray),'CartModifyRequest_ResponseGroupArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(CartModifyRequest_ResponseGroupArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CartClearRequest_ResponseGroupArray),'CartClearRequest_ResponseGroupArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(CartClearRequest_ResponseGroupArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(TransactionLookupRequest_ResponseGroupArray),'TransactionLookupRequest_ResponseGroupArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(TransactionLookupRequest_ResponseGroupArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(TransactionLookupRequest_TransactionIdArray),'TransactionLookupRequest_TransactionIdArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(TransactionLookupRequest_TransactionIdArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SellerListingSearchRequest_ResponseGroupArray),'SellerListingSearchRequest_ResponseGroupArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(SellerListingSearchRequest_ResponseGroupArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SellerListingLookupRequest_ResponseGroupArray),'SellerListingLookupRequest_ResponseGroupArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(SellerListingLookupRequest_ResponseGroupArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(BrowseNodeLookupRequest_BrowseNodeIdArray),'BrowseNodeLookupRequest_BrowseNodeIdArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(BrowseNodeLookupRequest_BrowseNodeIdArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(BrowseNodeLookupRequest_ResponseGroupArray),'BrowseNodeLookupRequest_ResponseGroupArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(BrowseNodeLookupRequest_ResponseGroupArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(HTTPHeaders_Type),'HTTPHeaders'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Arguments_Type),'Arguments'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Errors_Type),'Errors'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Information_OperationInformationArray),'Information_OperationInformationArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(Information_OperationInformationArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Information_ResponseGroupInformationArray),'Information_ResponseGroupInformationArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(Information_ResponseGroupInformationArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SearchResultsMap_Type),'SearchResultsMap'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Items__ItemArray),'Items__ItemArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(Items__ItemArray)].RegisterExternalPropertyName(sARRAY_ITEM,'Item'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(Items__ItemArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Lists_ListArray),'Lists_ListArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(Lists_ListArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Customers_CustomerArray),'Customers_CustomerArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(Customers_CustomerArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SimilarProducts_Type),'SimilarProducts'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(TopSellers_Type),'TopSellers'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(NewReleases_Type),'NewReleases'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SimilarViewedProducts_Type),'SimilarViewedProducts'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(OtherCategoriesSimilarProducts_Type),'OtherCategoriesSimilarProducts'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Transactions_TransactionArray),'Transactions_TransactionArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(Transactions_TransactionArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Sellers_SellerArray),'Sellers_SellerArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(Sellers_SellerArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SellerListings_SellerListingArray),'SellerListings_SellerListingArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(SellerListings_SellerListingArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(OperationInformation_RequiredParameters_Type),'OperationInformation_RequiredParameters_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(OperationInformation_AvailableParameters_Type),'OperationInformation_AvailableParameters_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(OperationInformation_DefaultResponseGroups_Type),'OperationInformation_DefaultResponseGroups_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(OperationInformation_AvailableResponseGroups_Type),'OperationInformation_AvailableResponseGroups_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ResponseGroupInformation_ValidOperations_Type),'ResponseGroupInformation_ValidOperations_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ResponseGroupInformation_Elements_Type),'ResponseGroupInformation_Elements_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(List_ListItemArray),'List_ListItemArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(List_ListItemArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Customer_CustomerReviewsArray),'Customer_CustomerReviewsArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(Customer_CustomerReviewsArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SearchResultsMap_SearchIndex_Type_ASINArray),'SearchResultsMap_SearchIndex_Type_ASINArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(SearchResultsMap_SearchIndex_Type_ASINArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Item_ImageSets_Type_ImageSetArray),'Item_ImageSets_Type_ImageSetArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(Item_ImageSets_Type_ImageSetArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Collections_Type),'Collections'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Item_Subjects_Type),'Item_Subjects_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(EditorialReviews_Type),'EditorialReviews'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Accessories_Type),'Accessories'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Tracks_Type),'Tracks'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ListmaniaLists_Type),'ListmaniaLists'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Item_AlternateVersions_Type),'Item_AlternateVersions_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(_Item_ImageSetsArray),'_Item_ImageSetsArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(_Item_ImageSetsArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Offers_OfferArray),'Offers_OfferArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(Offers_OfferArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Promotions_Type),'Promotions'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Offer_OfferListingArray),'Offer_OfferListingArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(Offer_OfferListingArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(OfferListing_ShippingChargeArray),'OfferListing_ShippingChargeArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(OfferListing_ShippingChargeArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(VariationDimensions_Type),'VariationDimensions'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Variations__ItemArray),'Variations__ItemArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(Variations__ItemArray)].RegisterExternalPropertyName(sARRAY_ITEM,'Item'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(Variations__ItemArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Collections_Collection_Type_CollectionItemArray),'Collections_Collection_Type_CollectionItemArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(Collections_Collection_Type_CollectionItemArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CustomerReviews_ReviewArray),'CustomerReviews_ReviewArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(CustomerReviews_ReviewArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Tracks_Disc_Type_TrackArray),'Tracks_Disc_Type_TrackArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(Tracks_Disc_Type_TrackArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(PromotionEligibilityRequirements),'PromotionEligibilityRequirements'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(PromotionBenefits),'PromotionBenefits'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(BrowseNodes_BrowseNodeArray),'BrowseNodes_BrowseNodeArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(BrowseNodes_BrowseNodeArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(BrowseNode_Children_Type),'BrowseNode_Children_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(BrowseNode_Ancestors_Type),'BrowseNode_Ancestors_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(CartItems_CartItemArray),'CartItems_CartItemArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(CartItems_CartItemArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SavedForLaterItems_SavedForLaterItemArray),'SavedForLaterItems_SavedForLaterItemArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(SavedForLaterItems_SavedForLaterItemArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Transaction_TransactionItems_Type),'Transaction_TransactionItems_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Transaction_Shipments_Type_Shipment_Type_ShipmentItems_Type),'Transaction_Shipments_Type_Shipment_Type_ShipmentItems_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Transaction_Shipments_Type_Shipment_Type_Packages_Type),'Transaction_Shipments_Type_Shipment_Type_Packages_Type'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(Transaction_Shipments_Type_Shipment_Type_Packages_Type)].RegisterExternalPropertyName(sARRAY_ITEM,'Package'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Transaction_Shipments_Type),'Transaction_Shipments_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(TransactionItem_ChildTransactionItems_Type),'TransactionItem_ChildTransactionItems_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Seller_SellerFeedbackSummary_Type_FeedbackDateRange_Type_SellerFeedbackRatingArray),'Seller_SellerFeedbackSummary_Type_FeedbackDateRange_Type_SellerFeedbackRatingArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(Seller_SellerFeedbackSummary_Type_FeedbackDateRange_Type_SellerFeedbackRatingArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(Seller_SellerFeedbackSummary_Type),'Seller_SellerFeedbackSummary_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(SellerFeedback_Type),'SellerFeedback'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ItemAttributes_Languages_Type),'ItemAttributes_Languages_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ItemAttributes_ActorArray),'ItemAttributes_ActorArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(ItemAttributes_ActorArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ItemAttributes_ArtistArray),'ItemAttributes_ArtistArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(ItemAttributes_ArtistArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ItemAttributes_AudioFormatArray),'ItemAttributes_AudioFormatArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(ItemAttributes_AudioFormatArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ItemAttributes_AuthorArray),'ItemAttributes_AuthorArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(ItemAttributes_AuthorArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ItemAttributes_CameraManualFeaturesArray),'ItemAttributes_CameraManualFeaturesArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(ItemAttributes_CameraManualFeaturesArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ItemAttributes_CompatibleDevicesArray),'ItemAttributes_CompatibleDevicesArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(ItemAttributes_CompatibleDevicesArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ItemAttributes_CreatorArray),'ItemAttributes_CreatorArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(ItemAttributes_CreatorArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ItemAttributes_DataLinkProtocolArray),'ItemAttributes_DataLinkProtocolArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(ItemAttributes_DataLinkProtocolArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ItemAttributes_DirectorArray),'ItemAttributes_DirectorArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(ItemAttributes_DirectorArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ItemAttributes_FeatureArray),'ItemAttributes_FeatureArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(ItemAttributes_FeatureArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ItemAttributes_FormatArray),'ItemAttributes_FormatArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(ItemAttributes_FormatArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ItemAttributes_FormFactorArray),'ItemAttributes_FormFactorArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(ItemAttributes_FormFactorArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ItemAttributes_PhotoFlashTypeArray),'ItemAttributes_PhotoFlashTypeArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(ItemAttributes_PhotoFlashTypeArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ItemAttributes_PictureFormatArray),'ItemAttributes_PictureFormatArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(ItemAttributes_PictureFormatArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ItemAttributes_PlatformArray),'ItemAttributes_PlatformArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(ItemAttributes_PlatformArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ItemAttributes_ReturnMethodArray),'ItemAttributes_ReturnMethodArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(ItemAttributes_ReturnMethodArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ItemAttributes_SpecialFeaturesArray),'ItemAttributes_SpecialFeaturesArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(ItemAttributes_SpecialFeaturesArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(ItemAttributes_SupportedImageTypeArray),'ItemAttributes_SupportedImageTypeArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(ItemAttributes_SupportedImageTypeArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(MerchantItemAttributes_Languages_Type),'MerchantItemAttributes_Languages_Type'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(MerchantItemAttributes_ActorArray),'MerchantItemAttributes_ActorArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(MerchantItemAttributes_ActorArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(MerchantItemAttributes_ArtistArray),'MerchantItemAttributes_ArtistArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(MerchantItemAttributes_ArtistArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(MerchantItemAttributes_AudioFormatArray),'MerchantItemAttributes_AudioFormatArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(MerchantItemAttributes_AudioFormatArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(MerchantItemAttributes_AuthorArray),'MerchantItemAttributes_AuthorArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(MerchantItemAttributes_AuthorArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(MerchantItemAttributes_CameraManualFeaturesArray),'MerchantItemAttributes_CameraManualFeaturesArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(MerchantItemAttributes_CameraManualFeaturesArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(MerchantItemAttributes_CreatorArray),'MerchantItemAttributes_CreatorArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(MerchantItemAttributes_CreatorArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(MerchantItemAttributes_DirectorArray),'MerchantItemAttributes_DirectorArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(MerchantItemAttributes_DirectorArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(MerchantItemAttributes_FeatureArray),'MerchantItemAttributes_FeatureArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(MerchantItemAttributes_FeatureArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(MerchantItemAttributes_FormatArray),'MerchantItemAttributes_FormatArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(MerchantItemAttributes_FormatArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(MerchantItemAttributes_PhotoFlashTypeArray),'MerchantItemAttributes_PhotoFlashTypeArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(MerchantItemAttributes_PhotoFlashTypeArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(MerchantItemAttributes_PictureFormatArray),'MerchantItemAttributes_PictureFormatArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(MerchantItemAttributes_PictureFormatArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(MerchantItemAttributes_PlatformArray),'MerchantItemAttributes_PlatformArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(MerchantItemAttributes_PlatformArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(MerchantItemAttributes_PurchasingChannelArray),'MerchantItemAttributes_PurchasingChannelArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(MerchantItemAttributes_PurchasingChannelArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(MerchantItemAttributes_ReturnMethodArray),'MerchantItemAttributes_ReturnMethodArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(MerchantItemAttributes_ReturnMethodArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(MerchantItemAttributes_SpecialFeaturesArray),'MerchantItemAttributes_SpecialFeaturesArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(MerchantItemAttributes_SpecialFeaturesArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(MerchantItemAttributes_SupportedImageTypeArray),'MerchantItemAttributes_SupportedImageTypeArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(MerchantItemAttributes_SupportedImageTypeArray)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + + GetTypeRegistry().ItemByTypeInfo[TypeInfo(Items_Type)].RegisterExternalPropertyName('_Item','Item'); + SearchBinSet_Type.RegisterAttributeProperty('NarrowBy'); + Arguments_Argument_Type.RegisterAttributeProperty('Name'); + Arguments_Argument_Type.RegisterAttributeProperty('Value'); + HTTPHeaders_Header_Type.RegisterAttributeProperty('Name'); + HTTPHeaders_Header_Type.RegisterAttributeProperty('Value'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(ListItem_Type)].RegisterExternalPropertyName('_Item','Item'); + ImageSet_Type.RegisterAttributeProperty('Category'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(ItemAttributes_Type)].RegisterExternalPropertyName('_Label','Label'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(MerchantItemAttributes_Type)].RegisterExternalPropertyName('_Label','Label'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(Variations_Type)].RegisterExternalPropertyName('_Item','Item'); + Tracks_Disc_Type_Track_Type.RegisterAttributeProperty('Number'); + Tracks_Disc_Type.RegisterAttributeProperty('Number'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(Seller_SellerFeedbackSummary_Type_FeedbackDateRange_Type_SellerFeedbackRating_Type)].RegisterExternalPropertyName('_Type','Type'); + Seller_SellerFeedbackSummary_Type_FeedbackDateRange_Type_SellerFeedbackRating_Type.RegisterAttributeProperty('_Type'); + Seller_SellerFeedbackSummary_Type_FeedbackDateRange_Type.RegisterAttributeProperty('Period'); + DecimalWithUnits.RegisterAttributeProperty('Units'); + NonNegativeIntegerWithUnits.RegisterAttributeProperty('Units'); + ItemAttributes_Creator_Type.RegisterAttributeProperty('Role'); + StringWithUnits.RegisterAttributeProperty('Units'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(ItemAttributes_Languages_Type_Language_Type)].RegisterExternalPropertyName('_Type','Type'); + MerchantItemAttributes_Creator_Type.RegisterAttributeProperty('Role'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(MerchantItemAttributes_Languages_Type_Language_Type)].RegisterExternalPropertyName('_Type','Type'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(MerchantItemAttributes_VendorRebate_Type)].RegisterExternalPropertyName('_Type','Type'); + +End. diff --git a/wst/tags/0.4/samples/amazon/AWSECommerceService_proxy.pas b/wst/tags/0.4/samples/amazon/AWSECommerceService_proxy.pas new file mode 100644 index 000000000..f5231f3b9 --- /dev/null +++ b/wst/tags/0.4/samples/amazon/AWSECommerceService_proxy.pas @@ -0,0 +1,579 @@ +{ +This unit has been produced by ws_helper. + Input unit name : "AWSECommerceService". + This unit name : "AWSECommerceService_proxy". + Date : "6-5-07 19:37:08". +} + +Unit AWSECommerceService_proxy; +{$IFDEF FPC} {$mode objfpc}{$H+} {$ENDIF} +Interface + +Uses SysUtils, Classes, TypInfo, base_service_intf, service_intf, AWSECommerceService; + +Type + + + TAWSECommerceServicePortType_Proxy=class(TBaseProxy,AWSECommerceServicePortType) + Protected + class function GetServiceType() : PTypeInfo;override; + function Help( + Const HelpParam : Help_Type + ):HelpResponse_Type; + function ItemSearch( + Const ItemSearchParam : ItemSearch_Type + ):ItemSearchResponse_Type; + function ItemLookup( + Const ItemLookupParam : ItemLookup_Type + ):ItemLookupResponse_Type; + function BrowseNodeLookup( + Const BrowseNodeLookupParam : BrowseNodeLookup_Type + ):BrowseNodeLookupResponse_Type; + function ListSearch( + Const ListSearchParam : ListSearch_Type + ):ListSearchResponse_Type; + function ListLookup( + Const ListLookupParam : ListLookup_Type + ):ListLookupResponse_Type; + function CustomerContentSearch( + Const CustomerContentSearchParam : CustomerContentSearch_Type + ):CustomerContentSearchResponse_Type; + function CustomerContentLookup( + Const CustomerContentLookupParam : CustomerContentLookup_Type + ):CustomerContentLookupResponse_Type; + function SimilarityLookup( + Const SimilarityLookupParam : SimilarityLookup_Type + ):SimilarityLookupResponse_Type; + function SellerLookup( + Const SellerLookupParam : SellerLookup_Type + ):SellerLookupResponse_Type; + function CartGet( + Const CartGetParam : CartGet_Type + ):CartGetResponse_Type; + function CartAdd( + Const CartAddParam : CartAdd_Type + ):CartAddResponse_Type; + function CartCreate( + Const CartCreateParam : CartCreate_Type + ):CartCreateResponse_Type; + function CartModify( + Const CartModifyParam : CartModify_Type + ):CartModifyResponse_Type; + function CartClear( + Const CartClearParam : CartClear_Type + ):CartClearResponse_Type; + function TransactionLookup( + Const TransactionLookupParam : TransactionLookup_Type + ):TransactionLookupResponse_Type; + function SellerListingSearch( + Const SellerListingSearchParam : SellerListingSearch_Type + ):SellerListingSearchResponse_Type; + function SellerListingLookup( + Const SellerListingLookupParam : SellerListingLookup_Type + ):SellerListingLookupResponse_Type; + function MultiOperation( + Const MultiOperationParam : MultiOperationType + ):MultiOperationResponse; + End; + + Function wst_CreateInstance_AWSECommerceServicePortType(const AFormat : string = 'SOAP:'; const ATransport : string = 'HTTP:'):AWSECommerceServicePortType; + +Implementation +uses wst_resources_imp, metadata_repository; + + +Function wst_CreateInstance_AWSECommerceServicePortType(const AFormat : string; const ATransport : string):AWSECommerceServicePortType; +Begin + Result := TAWSECommerceServicePortType_Proxy.Create('AWSECommerceServicePortType',AFormat+GetServiceDefaultFormatProperties(TypeInfo(AWSECommerceServicePortType)),ATransport + 'address=' + GetServiceDefaultAddress(TypeInfo(AWSECommerceServicePortType))); +End; + +{ TAWSECommerceServicePortType_Proxy implementation } + +class function TAWSECommerceServicePortType_Proxy.GetServiceType() : PTypeInfo; +begin + result := TypeInfo(AWSECommerceServicePortType); +end; + +function TAWSECommerceServicePortType_Proxy.Help( + Const HelpParam : Help_Type +):HelpResponse_Type; +Var + locSerializer : IFormatterClient; + strPrmName : string; +Begin + locSerializer := GetSerializer(); + Try + locSerializer.BeginCall('Help', GetTarget(),(Self as ICallContext)); + locSerializer.Put('Help', TypeInfo(Help_Type), HelpParam); + locSerializer.EndCall(); + + MakeCall(); + + locSerializer.BeginCallRead((Self as ICallContext)); + TObject(Result) := Nil; + strPrmName := 'HelpResponse'; + locSerializer.Get(TypeInfo(HelpResponse_Type), strPrmName, Result); + + Finally + locSerializer.Clear(); + End; +End; + +function TAWSECommerceServicePortType_Proxy.ItemSearch( + Const ItemSearchParam : ItemSearch_Type +):ItemSearchResponse_Type; +Var + locSerializer : IFormatterClient; + strPrmName : string; +Begin + locSerializer := GetSerializer(); + Try + locSerializer.BeginCall('ItemSearch', GetTarget(),(Self as ICallContext)); + locSerializer.Put('ItemSearch', TypeInfo(ItemSearch_Type), ItemSearchParam); + locSerializer.EndCall(); + + MakeCall(); + + locSerializer.BeginCallRead((Self as ICallContext)); + TObject(Result) := Nil; + strPrmName := 'ItemSearchResponse'; + locSerializer.Get(TypeInfo(ItemSearchResponse_Type), strPrmName, Result); + + Finally + locSerializer.Clear(); + End; +End; + +function TAWSECommerceServicePortType_Proxy.ItemLookup( + Const ItemLookupParam : ItemLookup_Type +):ItemLookupResponse_Type; +Var + locSerializer : IFormatterClient; + strPrmName : string; +Begin + locSerializer := GetSerializer(); + Try + locSerializer.BeginCall('ItemLookup', GetTarget(),(Self as ICallContext)); + locSerializer.Put('ItemLookup', TypeInfo(ItemLookup_Type), ItemLookupParam); + locSerializer.EndCall(); + + MakeCall(); + + locSerializer.BeginCallRead((Self as ICallContext)); + TObject(Result) := Nil; + strPrmName := 'ItemLookupResponse'; + locSerializer.Get(TypeInfo(ItemLookupResponse_Type), strPrmName, Result); + + Finally + locSerializer.Clear(); + End; +End; + +function TAWSECommerceServicePortType_Proxy.BrowseNodeLookup( + Const BrowseNodeLookupParam : BrowseNodeLookup_Type +):BrowseNodeLookupResponse_Type; +Var + locSerializer : IFormatterClient; + strPrmName : string; +Begin + locSerializer := GetSerializer(); + Try + locSerializer.BeginCall('BrowseNodeLookup', GetTarget(),(Self as ICallContext)); + locSerializer.Put('BrowseNodeLookup', TypeInfo(BrowseNodeLookup_Type), BrowseNodeLookupParam); + locSerializer.EndCall(); + + MakeCall(); + + locSerializer.BeginCallRead((Self as ICallContext)); + TObject(Result) := Nil; + strPrmName := 'BrowseNodeLookupResponse'; + locSerializer.Get(TypeInfo(BrowseNodeLookupResponse_Type), strPrmName, Result); + + Finally + locSerializer.Clear(); + End; +End; + +function TAWSECommerceServicePortType_Proxy.ListSearch( + Const ListSearchParam : ListSearch_Type +):ListSearchResponse_Type; +Var + locSerializer : IFormatterClient; + strPrmName : string; +Begin + locSerializer := GetSerializer(); + Try + locSerializer.BeginCall('ListSearch', GetTarget(),(Self as ICallContext)); + locSerializer.Put('ListSearch', TypeInfo(ListSearch_Type), ListSearchParam); + locSerializer.EndCall(); + + MakeCall(); + + locSerializer.BeginCallRead((Self as ICallContext)); + TObject(Result) := Nil; + strPrmName := 'ListSearchResponse'; + locSerializer.Get(TypeInfo(ListSearchResponse_Type), strPrmName, Result); + + Finally + locSerializer.Clear(); + End; +End; + +function TAWSECommerceServicePortType_Proxy.ListLookup( + Const ListLookupParam : ListLookup_Type +):ListLookupResponse_Type; +Var + locSerializer : IFormatterClient; + strPrmName : string; +Begin + locSerializer := GetSerializer(); + Try + locSerializer.BeginCall('ListLookup', GetTarget(),(Self as ICallContext)); + locSerializer.Put('ListLookup', TypeInfo(ListLookup_Type), ListLookupParam); + locSerializer.EndCall(); + + MakeCall(); + + locSerializer.BeginCallRead((Self as ICallContext)); + TObject(Result) := Nil; + strPrmName := 'ListLookupResponse'; + locSerializer.Get(TypeInfo(ListLookupResponse_Type), strPrmName, Result); + + Finally + locSerializer.Clear(); + End; +End; + +function TAWSECommerceServicePortType_Proxy.CustomerContentSearch( + Const CustomerContentSearchParam : CustomerContentSearch_Type +):CustomerContentSearchResponse_Type; +Var + locSerializer : IFormatterClient; + strPrmName : string; +Begin + locSerializer := GetSerializer(); + Try + locSerializer.BeginCall('CustomerContentSearch', GetTarget(),(Self as ICallContext)); + locSerializer.Put('CustomerContentSearch', TypeInfo(CustomerContentSearch_Type), CustomerContentSearchParam); + locSerializer.EndCall(); + + MakeCall(); + + locSerializer.BeginCallRead((Self as ICallContext)); + TObject(Result) := Nil; + strPrmName := 'CustomerContentSearchResponse'; + locSerializer.Get(TypeInfo(CustomerContentSearchResponse_Type), strPrmName, Result); + + Finally + locSerializer.Clear(); + End; +End; + +function TAWSECommerceServicePortType_Proxy.CustomerContentLookup( + Const CustomerContentLookupParam : CustomerContentLookup_Type +):CustomerContentLookupResponse_Type; +Var + locSerializer : IFormatterClient; + strPrmName : string; +Begin + locSerializer := GetSerializer(); + Try + locSerializer.BeginCall('CustomerContentLookup', GetTarget(),(Self as ICallContext)); + locSerializer.Put('CustomerContentLookup', TypeInfo(CustomerContentLookup_Type), CustomerContentLookupParam); + locSerializer.EndCall(); + + MakeCall(); + + locSerializer.BeginCallRead((Self as ICallContext)); + TObject(Result) := Nil; + strPrmName := 'CustomerContentLookupResponse'; + locSerializer.Get(TypeInfo(CustomerContentLookupResponse_Type), strPrmName, Result); + + Finally + locSerializer.Clear(); + End; +End; + +function TAWSECommerceServicePortType_Proxy.SimilarityLookup( + Const SimilarityLookupParam : SimilarityLookup_Type +):SimilarityLookupResponse_Type; +Var + locSerializer : IFormatterClient; + strPrmName : string; +Begin + locSerializer := GetSerializer(); + Try + locSerializer.BeginCall('SimilarityLookup', GetTarget(),(Self as ICallContext)); + locSerializer.Put('SimilarityLookup', TypeInfo(SimilarityLookup_Type), SimilarityLookupParam); + locSerializer.EndCall(); + + MakeCall(); + + locSerializer.BeginCallRead((Self as ICallContext)); + TObject(Result) := Nil; + strPrmName := 'SimilarityLookupResponse'; + locSerializer.Get(TypeInfo(SimilarityLookupResponse_Type), strPrmName, Result); + + Finally + locSerializer.Clear(); + End; +End; + +function TAWSECommerceServicePortType_Proxy.SellerLookup( + Const SellerLookupParam : SellerLookup_Type +):SellerLookupResponse_Type; +Var + locSerializer : IFormatterClient; + strPrmName : string; +Begin + locSerializer := GetSerializer(); + Try + locSerializer.BeginCall('SellerLookup', GetTarget(),(Self as ICallContext)); + locSerializer.Put('SellerLookup', TypeInfo(SellerLookup_Type), SellerLookupParam); + locSerializer.EndCall(); + + MakeCall(); + + locSerializer.BeginCallRead((Self as ICallContext)); + TObject(Result) := Nil; + strPrmName := 'SellerLookupResponse'; + locSerializer.Get(TypeInfo(SellerLookupResponse_Type), strPrmName, Result); + + Finally + locSerializer.Clear(); + End; +End; + +function TAWSECommerceServicePortType_Proxy.CartGet( + Const CartGetParam : CartGet_Type +):CartGetResponse_Type; +Var + locSerializer : IFormatterClient; + strPrmName : string; +Begin + locSerializer := GetSerializer(); + Try + locSerializer.BeginCall('CartGet', GetTarget(),(Self as ICallContext)); + locSerializer.Put('CartGet', TypeInfo(CartGet_Type), CartGetParam); + locSerializer.EndCall(); + + MakeCall(); + + locSerializer.BeginCallRead((Self as ICallContext)); + TObject(Result) := Nil; + strPrmName := 'CartGetResponse'; + locSerializer.Get(TypeInfo(CartGetResponse_Type), strPrmName, Result); + + Finally + locSerializer.Clear(); + End; +End; + +function TAWSECommerceServicePortType_Proxy.CartAdd( + Const CartAddParam : CartAdd_Type +):CartAddResponse_Type; +Var + locSerializer : IFormatterClient; + strPrmName : string; +Begin + locSerializer := GetSerializer(); + Try + locSerializer.BeginCall('CartAdd', GetTarget(),(Self as ICallContext)); + locSerializer.Put('CartAdd', TypeInfo(CartAdd_Type), CartAddParam); + locSerializer.EndCall(); + + MakeCall(); + + locSerializer.BeginCallRead((Self as ICallContext)); + TObject(Result) := Nil; + strPrmName := 'CartAddResponse'; + locSerializer.Get(TypeInfo(CartAddResponse_Type), strPrmName, Result); + + Finally + locSerializer.Clear(); + End; +End; + +function TAWSECommerceServicePortType_Proxy.CartCreate( + Const CartCreateParam : CartCreate_Type +):CartCreateResponse_Type; +Var + locSerializer : IFormatterClient; + strPrmName : string; +Begin + locSerializer := GetSerializer(); + Try + locSerializer.BeginCall('CartCreate', GetTarget(),(Self as ICallContext)); + locSerializer.Put('CartCreate', TypeInfo(CartCreate_Type), CartCreateParam); + locSerializer.EndCall(); + + MakeCall(); + + locSerializer.BeginCallRead((Self as ICallContext)); + TObject(Result) := Nil; + strPrmName := 'CartCreateResponse'; + locSerializer.Get(TypeInfo(CartCreateResponse_Type), strPrmName, Result); + + Finally + locSerializer.Clear(); + End; +End; + +function TAWSECommerceServicePortType_Proxy.CartModify( + Const CartModifyParam : CartModify_Type +):CartModifyResponse_Type; +Var + locSerializer : IFormatterClient; + strPrmName : string; +Begin + locSerializer := GetSerializer(); + Try + locSerializer.BeginCall('CartModify', GetTarget(),(Self as ICallContext)); + locSerializer.Put('CartModify', TypeInfo(CartModify_Type), CartModifyParam); + locSerializer.EndCall(); + + MakeCall(); + + locSerializer.BeginCallRead((Self as ICallContext)); + TObject(Result) := Nil; + strPrmName := 'CartModifyResponse'; + locSerializer.Get(TypeInfo(CartModifyResponse_Type), strPrmName, Result); + + Finally + locSerializer.Clear(); + End; +End; + +function TAWSECommerceServicePortType_Proxy.CartClear( + Const CartClearParam : CartClear_Type +):CartClearResponse_Type; +Var + locSerializer : IFormatterClient; + strPrmName : string; +Begin + locSerializer := GetSerializer(); + Try + locSerializer.BeginCall('CartClear', GetTarget(),(Self as ICallContext)); + locSerializer.Put('CartClear', TypeInfo(CartClear_Type), CartClearParam); + locSerializer.EndCall(); + + MakeCall(); + + locSerializer.BeginCallRead((Self as ICallContext)); + TObject(Result) := Nil; + strPrmName := 'CartClearResponse'; + locSerializer.Get(TypeInfo(CartClearResponse_Type), strPrmName, Result); + + Finally + locSerializer.Clear(); + End; +End; + +function TAWSECommerceServicePortType_Proxy.TransactionLookup( + Const TransactionLookupParam : TransactionLookup_Type +):TransactionLookupResponse_Type; +Var + locSerializer : IFormatterClient; + strPrmName : string; +Begin + locSerializer := GetSerializer(); + Try + locSerializer.BeginCall('TransactionLookup', GetTarget(),(Self as ICallContext)); + locSerializer.Put('TransactionLookup', TypeInfo(TransactionLookup_Type), TransactionLookupParam); + locSerializer.EndCall(); + + MakeCall(); + + locSerializer.BeginCallRead((Self as ICallContext)); + TObject(Result) := Nil; + strPrmName := 'TransactionLookupResponse'; + locSerializer.Get(TypeInfo(TransactionLookupResponse_Type), strPrmName, Result); + + Finally + locSerializer.Clear(); + End; +End; + +function TAWSECommerceServicePortType_Proxy.SellerListingSearch( + Const SellerListingSearchParam : SellerListingSearch_Type +):SellerListingSearchResponse_Type; +Var + locSerializer : IFormatterClient; + strPrmName : string; +Begin + locSerializer := GetSerializer(); + Try + locSerializer.BeginCall('SellerListingSearch', GetTarget(),(Self as ICallContext)); + locSerializer.Put('SellerListingSearch', TypeInfo(SellerListingSearch_Type), SellerListingSearchParam); + locSerializer.EndCall(); + + MakeCall(); + + locSerializer.BeginCallRead((Self as ICallContext)); + TObject(Result) := Nil; + strPrmName := 'SellerListingSearchResponse'; + locSerializer.Get(TypeInfo(SellerListingSearchResponse_Type), strPrmName, Result); + + Finally + locSerializer.Clear(); + End; +End; + +function TAWSECommerceServicePortType_Proxy.SellerListingLookup( + Const SellerListingLookupParam : SellerListingLookup_Type +):SellerListingLookupResponse_Type; +Var + locSerializer : IFormatterClient; + strPrmName : string; +Begin + locSerializer := GetSerializer(); + Try + locSerializer.BeginCall('SellerListingLookup', GetTarget(),(Self as ICallContext)); + locSerializer.Put('SellerListingLookup', TypeInfo(SellerListingLookup_Type), SellerListingLookupParam); + locSerializer.EndCall(); + + MakeCall(); + + locSerializer.BeginCallRead((Self as ICallContext)); + TObject(Result) := Nil; + strPrmName := 'SellerListingLookupResponse'; + locSerializer.Get(TypeInfo(SellerListingLookupResponse_Type), strPrmName, Result); + + Finally + locSerializer.Clear(); + End; +End; + +function TAWSECommerceServicePortType_Proxy.MultiOperation( + Const MultiOperationParam : MultiOperationType +):MultiOperationResponse; +Var + locSerializer : IFormatterClient; + strPrmName : string; +Begin + locSerializer := GetSerializer(); + Try + locSerializer.BeginCall('MultiOperation', GetTarget(),(Self as ICallContext)); + locSerializer.Put('MultiOperation', TypeInfo(MultiOperationType), MultiOperationParam); + locSerializer.EndCall(); + + MakeCall(); + + locSerializer.BeginCallRead((Self as ICallContext)); + TObject(Result) := Nil; + strPrmName := 'MultiOperationResponse'; + locSerializer.Get(TypeInfo(MultiOperationResponse), strPrmName, Result); + + Finally + locSerializer.Clear(); + End; +End; + + +initialization + {$i AWSECommerceService.wst} + + {$IF DECLARED(Register_AWSECommerceService_ServiceMetadata)} + Register_AWSECommerceService_ServiceMetadata(); + {$IFEND} +End. diff --git a/wst/tags/0.4/samples/amazon/amazon_sample.lpi b/wst/tags/0.4/samples/amazon/amazon_sample.lpi new file mode 100644 index 000000000..3a3086dc4 --- /dev/null +++ b/wst/tags/0.4/samples/amazon/amazon_sample.lpi @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wst/tags/0.4/samples/amazon/amazon_sample.pas b/wst/tags/0.4/samples/amazon/amazon_sample.pas new file mode 100644 index 000000000..d6cd24be5 --- /dev/null +++ b/wst/tags/0.4/samples/amazon/amazon_sample.pas @@ -0,0 +1,97 @@ +program amazon_sample; + +{$mode objfpc}{$H+} + +uses + Classes, SysUtils, + soap_formatter, + synapse_http_protocol, + metadata_repository, + AWSECommerceService, AWSECommerceService_proxy; + +const sACCES_ID = ; + +function ReadEntry(const APromp : string):string ; +begin + Result := ''; + Write(APromp); + while True do begin + ReadLn(Result); + Result := Trim(Result); + if ( Length(Result) > 0 ) then + Break; + end; +end; + +var + locService : AWSECommerceServicePortType; + rqst : ItemSearch_Type; + rsps : ItemSearchResponse_Type; + rspsItem : Items_Type; + i, j, k : Integer; + itm : Item_Type; +begin + SYNAPSE_RegisterHTTP_Transport(); + WriteLn('Web Services Toolkit Amazon sample'); + WriteLn('This sample demonstrates the "ItemSearch" method of the Amazon web service'); + WriteLn(); + rqst := ItemSearch_Type.Create(); + try + locService := wst_CreateInstance_AWSECommerceServicePortType(); + rqst.AWSAccessKeyId := sACCES_ID; + while True do begin + rqst.Request.SetLength(1); + rqst.Request[0].SearchIndex := ReadEntry('Enter the Search Index : '); + rqst.Request[0].Availability := Available; + rqst.Request[0].Count := 10; + rqst.Request[0].MerchantId := 'Amazon'; + rqst.Request[0].ItemPage := 1; + rqst.Request[0].Keywords := ReadEntry('Enter the Keywords : '); + rsps := locService.ItemSearch(rqst); + if ( rsps.OperationRequest.Errors.Length > 0 ) then begin + WriteLn(Format('Errors ( %d ) : ',[rsps.OperationRequest.Errors.Length])); + for i := 0 to Pred(rsps.OperationRequest.Errors.Length) do begin + WriteLn(Format(' Error[%d] :',[i])); + WriteLn(' ' + rsps.OperationRequest.Errors[i].Code); + WriteLn(' ' + rsps.OperationRequest.Errors[i].Message); + end; + end else begin + WriteLn(Format('Response ( %d ) : ',[rsps.Items.Length])); + if Assigned(rsps) then begin + for i := 0 to Pred(rsps.Items.Length) do begin + rspsItem := rsps.Items[i]; + WriteLn(' TotalPages :' + IntToStr(rspsItem.TotalPages)); + WriteLn(' TotalResults :' + IntToStr(rspsItem.TotalResults)); + WriteLn(' Items :' + IntToStr(rspsItem._Item.Length)); + WriteLn(''); + for j := 0 to Pred(rspsItem._Item.Length) do begin + itm := rspsItem._Item[j];; + WriteLn(' ASIN :' + itm.ASIN); + WriteLn(' DetailPageURL :' + itm.DetailPageURL); + if Assigned(itm.ItemAttributes) then begin + WriteLn(' Title :' + itm.ItemAttributes.Title); + for k := 0 to Pred(itm.ItemAttributes.Author.Length) do begin + WriteLn(' Author[ ' + IntToStr(k) + ' ] ' + itm.ItemAttributes.Author.Item[k]); + end; + WriteLn(' Manufacturer :' + itm.ItemAttributes.Manufacturer); + WriteLn(' ProductGroup :' + itm.ItemAttributes.ProductGroup); + end; + WriteLn(''); + end; + end; + end else begin + WriteLn('Unexpected service response : Invalid response'); + end; + end; + WriteLn(); + WriteLn(); + if ( UpperCase(ReadEntry('Continue ( Y/N ) :'))[1] <> 'Y' ) then + Break; + end; + finally + FreeAndNil(rqst); + FreeAndNil(rsps); + end; + ReadLn; +end. + diff --git a/wst/tags/0.4/samples/amazon/parseWSDL.bat b/wst/tags/0.4/samples/amazon/parseWSDL.bat new file mode 100644 index 000000000..ea8488185 --- /dev/null +++ b/wst/tags/0.4/samples/amazon/parseWSDL.bat @@ -0,0 +1 @@ +..\..\ws_helper\ws_helper.exe -uA -p -o. AWSECommerceService.wsdl >parsing.res.txt \ No newline at end of file diff --git a/wst/tags/0.4/samples/apache_module/ReadMe.txt b/wst/tags/0.4/samples/apache_module/ReadMe.txt new file mode 100644 index 000000000..6bcd53303 --- /dev/null +++ b/wst/tags/0.4/samples/apache_module/ReadMe.txt @@ -0,0 +1,7 @@ +Appache module configuration : + +LoadModule wst_module modules/mod_wst.so + + + SetHandler wst-handler + \ No newline at end of file diff --git a/wst/tags/0.4/samples/apache_module/mod_wst.lpi b/wst/tags/0.4/samples/apache_module/mod_wst.lpi new file mode 100644 index 000000000..cd64debe2 --- /dev/null +++ b/wst/tags/0.4/samples/apache_module/mod_wst.lpi @@ -0,0 +1,211 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wst/tags/0.4/samples/apache_module/mod_wst.lpr b/wst/tags/0.4/samples/apache_module/mod_wst.lpr new file mode 100644 index 000000000..71d41d0c6 --- /dev/null +++ b/wst/tags/0.4/samples/apache_module/mod_wst.lpr @@ -0,0 +1,52 @@ +library mod_wst; + +{$mode objfpc}{$H+} + +{$IFDEF WIN32} + {$DEFINE WINDOWS} +{$ENDIF} + +uses + SysUtils, + httpd, apr, apriconv, aprutil, wst_apache_binding; + +var + wst_module: module; {$ifdef Unix} public name 'wst_module'; {$endif} + default_module_ptr: Pmodule; + +const + MODULE_NAME = 'mod_wst.so'; + +{$ifdef WINDOWS} +exports + wst_module name 'wst_module'; +{$endif} + + +function DefaultHandler(r: Prequest_rec): Integer; cdecl; +begin + if not SameText(r^.handler, 'wst-handler') then + begin + Result := DECLINED; + Exit; + end; + + Result := wst_RequestHandler(r); +end; + +procedure RegisterHooks(p: Papr_pool_t); cdecl; +begin + ap_hook_handler(@DefaultHandler, nil, nil, APR_HOOK_MIDDLE); +end; + +begin + default_module_ptr := @wst_module; + FillChar(default_module_ptr^, SizeOf(default_module_ptr^), 0); + STANDARD20_MODULE_STUFF(default_module_ptr^); + with wst_module do + begin + name := MODULE_NAME; + magic := MODULE_MAGIC_COOKIE; + register_hooks := @RegisterHooks; + end; +end. diff --git a/wst/tags/0.4/samples/apache_module/wst_apache_binding.pas b/wst/tags/0.4/samples/apache_module/wst_apache_binding.pas new file mode 100644 index 000000000..df35a0f8d --- /dev/null +++ b/wst/tags/0.4/samples/apache_module/wst_apache_binding.pas @@ -0,0 +1,318 @@ +//{$DEFINE WST_DBG} + +unit wst_apache_binding; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, + httpd, apr, apriconv, aprutil; + +const + sWST_ROOT = 'wst'; + sSEPARATOR = '/'; + sSERVICES_PREFIXE = 'services'; + sWSDL = 'WSDL'; + sHTTP_BINARY_CONTENT_TYPE = 'application/octet-stream'; + sCONTENT_TYPE = 'Content-Type'; + + function wst_RequestHandler(r: Prequest_rec): Integer; + +implementation +uses base_service_intf, + server_service_intf, server_service_imputils, + server_service_soap, server_binary_formatter, + metadata_repository, metadata_wsdl, DOM, XMLWrite, + + user_service_intf, user_service_intf_binder, user_service_intf_imp, + metadata_service, metadata_service_binder, metadata_service_imp; + +type + TRequestInfo = record + Root : string; + URI : string; + ContentType : string; + Buffer : string; + end; + + TResponseInfo = record + ContentText : string; + ContentType : string; + end; + + +procedure SaveStringToFile(const AStr,AFile:string;const AKeepExisting : Boolean); +begin + with TMemoryStream.Create() do try + if AKeepExisting and FileExists(AFile) then begin + LoadFromFile(AFile); + Position := Size; + end; + if ( Length(AStr) > 0 ) then + Write(AStr[1],Length(AStr)); + SaveToFile(AFile); + finally + Free(); + end; +end; + +function ReadBuffer(r : Prequest_rec; out rbuf : string ) : Integer; +var + argsbuffer : string; + rsize, len_read, rpos : Integer; + loc_length : Integer; +begin + rbuf := ''; + Result := ap_setup_client_block(r, REQUEST_CHUNKED_ERROR); + if ( Result <> OK ) then + Exit; + + if ( ap_should_client_block(r) <> 0 ) then begin + SetLength(argsbuffer,HUGE_STRING_LEN); + FillChar(argsbuffer[1],Length(argsbuffer),0); + rsize := 0; len_read := 0; rpos := 0; + loc_length := r^.remaining; + SetLength(rbuf, loc_length ); + + while True do begin + len_read := ap_get_client_block(r, @(argsbuffer[1]), Length(argsbuffer)); + if ( len_read <= 0 ) then + Exit; + if ( ( rpos + len_read ) > loc_length ) then + rsize := loc_length - rpos + else + rsize := len_read; + Move(argsbuffer[1],rbuf[ ( 1 + rpos ) ], rsize); + Inc(rpos,rsize); + end; + end; +end; + +function ExtractNextPathElement(var AFullPath : string):string; +var + i : SizeInt; +begin + Result := ''; + if ( Length(AFullPath) > 0 ) then begin + while ( Length(AFullPath) > 0 ) and ( AFullPath[1] = sSEPARATOR ) do begin + Delete(AFullPath,1,1); + end; + i := Pos(sSEPARATOR,AFullPath); + if ( i < 1 ) then begin + Result := AFullPath; + AFullPath := ''; + end else begin + Result := Copy(AFullPath,1,Pred(i)); + Delete(AFullPath,1,i); + end; + end; +end; + +function GetWSDL(const ARepName, ARootAddress: shortstring):string; +var + strm : TMemoryStream; + rep : PServiceRepository; + doc :TXMLDocument; + i : SizeInt; + s : string; +begin + Result := ''; + rep := nil; + doc := Nil; + i := GetModuleMetadataMngr().IndexOfName(ARepName); + if ( i < 0 ) then + Exit; + strm := TMemoryStream.Create(); + try + s := GetModuleMetadataMngr().GetRepositoryName(i); + GetModuleMetadataMngr().LoadRepositoryName(s,ARootAddress,rep); + strm.Clear(); + doc := TXMLDocument.Create(); + GenerateWSDL(rep,doc); + WriteXMLFile(doc,strm); + i := strm.Size; + if ( i > 0 ) then begin + SetLength(Result,i); + Move(strm.memory^,Result[1],i); + end; + finally + doc.Free(); + strm.Free(); + GetModuleMetadataMngr().ClearRepository(rep); + end; +end; + +function GenerateWSDLTable(): string; +var + r : IModuleMetadataMngr; + i : Integer; +begin + r := GetModuleMetadataMngr(); + Result := '' + + ''+ + ''+ + 'The Web Service Toolkit generated Metadata table'+ + ''+ + '' + + '

The following repositories has available. Click on the link to view the corresponding WSDL.

'+ + ''; + + for i := 0 to Pred(r.GetCount()) do + Result := Result + '' + + '' + + ''; + + Result := Result + + ''+ + '
' + + Format('',[sSEPARATOR+sWST_ROOT+sSEPARATOR+sSERVICES_PREFIXE+sSEPARATOR+sWSDL+sSEPARATOR+r.GetRepositoryName(i)])+ + r.GetRepositoryName(i) + + ''+ + '
'+ + ''+ + ''+ + ''; +end; + +procedure ProcessWSDLRequest( + const ARequestInfo : TRequestInfo; + out AResponseInfo : TResponseInfo +); +var + locRepName, strBuff, locPath : string; + i : Integer; +begin + FillChar(AResponseInfo,SizeOf(TResponseInfo),#0); + locPath := ARequestInfo.URI; + locRepName := ExtractNextPathElement(locPath); + if AnsiSameText(sWSDL,locRepName) then + locRepName := ExtractNextPathElement(locPath); + strBuff := GetWSDL(locRepName,ARequestInfo.Root); + i := Length(strBuff); + if ( i > 0 ) then begin + AResponseInfo.ContentType := 'text/xml'; + AResponseInfo.ContentText := strBuff; + Exit; + end; + AResponseInfo.ContentText := GenerateWSDLTable(); + AResponseInfo.ContentType := 'text/html'; +end; + +function ProcessServiceRequest( + const ARequestInfo : TRequestInfo; + out AResponseInfo : TResponseInfo +):Boolean; +var + trgt,ctntyp, loc_path : string; + rqst : IRequestBuffer; + inStream, outStream: TMemoryStream; + i : Integer; +begin + FillChar(AResponseInfo,SizeOf(TResponseInfo),#0); + loc_path := ARequestInfo.URI; + trgt := ExtractNextPathElement(loc_path); + Result := False; + if AnsiSameText(sWSDL,trgt) then + Exit; + Result := True; + inStream := nil; + outStream := nil; + try + inStream := TMemoryStream.Create(); + outStream := TMemoryStream.Create(); + + ctntyp := ARequestInfo.ContentType; + i := Length(ARequestInfo.Buffer); + if ( i > 0 ) then + inStream.Write(ARequestInfo.Buffer[1],i); + inStream.Position := 0; + if AnsiSameText(sBINARY_CONTENT_TYPE,ctntyp) then + AResponseInfo.ContentType := sHTTP_BINARY_CONTENT_TYPE + else + AResponseInfo.ContentType := ctntyp; + rqst := TRequestBuffer.Create(trgt,ctntyp,inStream,outStream); + HandleServiceRequest(rqst); + i := outStream.Size; + if ( i > 0 ) then begin + SetLength(AResponseInfo.ContentText,i); + Move(outStream.Memory^,AResponseInfo.ContentText[1],i); + end; + finally + outStream.Free(); + inStream.Free(); + {$IFDEF WST_DBG} + {SaveStringToFile('RequestInfo.ContentType=' + ARequestInfo.ContentType + LineEnding,'E:\Inoussa\Sources\lazarus\wst\v0.3\tests\apache_module\log.log',False); + SaveStringToFile('RequestInfo.Buffer=' + ARequestInfo.Buffer + LineEnding,'E:\Inoussa\Sources\lazarus\wst\v0.3\tests\apache_module\log.log',True); + SaveStringToFile('RequestInfo.URI=' + ARequestInfo.URI + LineEnding,'E:\Inoussa\Sources\lazarus\wst\v0.3\tests\apache_module\log.log',True); + SaveStringToFile('ResponseInfo.ContentType=' + AResponseInfo.ContentType + LineEnding,'E:\Inoussa\Sources\lazarus\wst\v0.3\tests\apache_module\log.log',True); + SaveStringToFile('ResponseInfo.ContentText=' + AResponseInfo.ContentText + LineEnding,'E:\Inoussa\Sources\lazarus\wst\v0.3\tests\apache_module\log.log',True); + } + {$ENDIF} + end; +end; + +function wst_RequestHandler(r: Prequest_rec): Integer; + + function FillRequestInfo(var ARequestInfo : TRequestInfo):Integer; + begin + ARequestInfo.ContentType := apr_table_get(r^.headers_in,sCONTENT_TYPE); + ARequestInfo.Root := ap_get_server_name(r) + sSEPARATOR + sWST_ROOT + sSEPARATOR; + ARequestInfo.URI := r^.uri; + Result := ReadBuffer(r,ARequestInfo.Buffer); + end; + +var + sInputBuffer : string; + iRet, iLen : Integer; + loc_RequestInfo : TRequestInfo; + loc_ResponseInfo : TResponseInfo; +begin + Result := FillRequestInfo(loc_RequestInfo); + if not AnsiSameText(sWST_ROOT,ExtractNextPathElement(loc_RequestInfo.URI)) then + Result := DECLINED; + if ( Result <> OK ) then + Exit; + + try + if AnsiSameText(sSERVICES_PREFIXE,ExtractNextPathElement(loc_RequestInfo.URI)) then begin + if not ProcessServiceRequest(loc_RequestInfo,loc_ResponseInfo) then + ProcessWSDLRequest(loc_RequestInfo,loc_ResponseInfo); + end else begin + ProcessWSDLRequest(loc_RequestInfo,loc_ResponseInfo); + end; + + ap_set_content_type(r, PCHAR(loc_ResponseInfo.ContentType)); + if AnsiSameText(sHTTP_BINARY_CONTENT_TYPE,loc_ResponseInfo.ContentType) then begin + ap_set_content_length(r,Length(loc_ResponseInfo.ContentText)); + ap_rwrite(@(loc_ResponseInfo.ContentText[1]),Length(loc_ResponseInfo.ContentText),r); + ap_rflush(r); + end else begin + ap_rputs(PCHAR(loc_ResponseInfo.ContentText), r); + end; + Result := OK; + Exit; + except + on e : Exception do begin + ap_set_content_type(r, 'text/html'); + ap_rputs(' Error' + LineEnding, r); + ap_rputs('',r); + ap_rprintf(r, '

"%s"

' + LineEnding, [PCHAR(e.Message)]); + Exit; + end; + end; +end; + +initialization + RegisterStdTypes(); + Server_service_RegisterBinaryFormat(); + Server_service_RegisterSoapFormat(); + + RegisterUserServiceImplementationFactory(); + Server_service_RegisterUserServiceService(); + + Server_service_RegisterWSTMetadataServiceService(); + RegisterWSTMetadataServiceImplementationFactory(); + +end. diff --git a/wst/tags/0.4/samples/delphi/user_client_console/user_client_console.cfg b/wst/tags/0.4/samples/delphi/user_client_console/user_client_console.cfg new file mode 100644 index 000000000..63eebd5c8 --- /dev/null +++ b/wst/tags/0.4/samples/delphi/user_client_console/user_client_console.cfg @@ -0,0 +1,43 @@ +-$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"..\..\;..\..\..\;C:\Program Files\Borland\Delphi7\plate_forme\synapse" +-O"..\..\;..\..\..\;C:\Program Files\Borland\Delphi7\plate_forme\synapse" +-I"..\..\;..\..\..\;C:\Program Files\Borland\Delphi7\plate_forme\synapse" +-R"..\..\;..\..\..\;C:\Program Files\Borland\Delphi7\plate_forme\synapse" +-w-UNSAFE_TYPE +-w-UNSAFE_CODE +-w-UNSAFE_CAST diff --git a/wst/tags/0.4/samples/delphi/user_client_console/user_client_console.dof b/wst/tags/0.4/samples/delphi/user_client_console/user_client_console.dof new file mode 100644 index 000000000..e3b2bbcd1 --- /dev/null +++ b/wst/tags/0.4/samples/delphi/user_client_console/user_client_console.dof @@ -0,0 +1,156 @@ +[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=..\..\;..\..\..\;C:\Program Files\Borland\Delphi7\plate_forme\synapse +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= +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\hlUnitAliases] +Count=1 +Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +[HistoryLists\hlSearchPath] +Count=4 +Item0=..\..\;..\..\..\;C:\Program Files\Borland\Delphi7\plate_forme\synapse +Item1=..\..\;..\..\..\ +Item2=..\..\ +Item3=..\ +[HistoryLists\hlUnitOutputDirectory] +Count=1 +Item0=obj diff --git a/wst/tags/0.4/samples/delphi/user_client_console/user_client_console.dpr b/wst/tags/0.4/samples/delphi/user_client_console/user_client_console.dpr new file mode 100644 index 000000000..7730c1345 --- /dev/null +++ b/wst/tags/0.4/samples/delphi/user_client_console/user_client_console.dpr @@ -0,0 +1,196 @@ +program user_client_console; + +{$APPTYPE CONSOLE} + +uses + Classes, SysUtils, TypInfo, + user_service_intf_proxy, + synapse_tcp_protocol, synapse_http_protocol, library_protocol, + binary_formatter, + user_service_intf; + +{$INCLUDE wst.inc} + +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); + end else begin + WriteLn(''); + 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; + +procedure HandleAdd(); + + 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('Adding a user :'); + 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); + 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; + +type TTransportType = ( ttLibrary, ttTCP, ttHTTP ); +procedure CreateProxy(const ATransportType :TTransportType); +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' + 'http:Address=http://127.0.0.1:8000/services/UserService' + ); +var + buff : string; +begin + buff := ADDRESS_MAP[ATransportType]; + if ( ATransportType = ttLibrary ) then + buff := StringReplace(buff,'\',PathDelim,[rfReplaceAll, rfIgnoreCase]); + UserServiceInst := TUserService_Proxy.Create( + 'UserService', + 'binary:', + buff + ); +end; + +function ReadTransportType():TTransportType; +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' : Result := ttLibrary; + 'T' : Result := ttTCP; + 'H' : Result := ttHTTP; + end; + Break; + end; + end; +end; + +var + strBuffer : string; + tt : TTransportType; +begin + SYNAPSE_RegisterTCP_Transport(); + SYNAPSE_RegisterHTTP_Transport(); + LIB_Register_Transport(); + WriteLn('Sample Application using Web Services Toolkit'); + CreateProxy(ReadTransportType()); + WriteLn('Menu :'); + WriteLn(' L : Show the user list'); + WriteLn(' A : Add a new user'); + WriteLn(' F : Find a new'); + WriteLn(' C : Change the communication protocol'); + 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(); + 'F' : HandleFindUser(); + 'C' : CreateProxy(ReadTransportType()); + 'X' : Break; + end; + WriteLn; + Write('Choose a item : '); + end; + end; +end. + + diff --git a/wst/tags/0.4/samples/extract_binder.bat b/wst/tags/0.4/samples/extract_binder.bat new file mode 100644 index 000000000..8965f88ac --- /dev/null +++ b/wst/tags/0.4/samples/extract_binder.bat @@ -0,0 +1 @@ +..\..\wst\ws_helper\ws_helper -b -o. "user_service_intf.wsdl" >extract_bind.res.txt \ No newline at end of file diff --git a/wst/tags/0.4/samples/extract_imp.bat b/wst/tags/0.4/samples/extract_imp.bat new file mode 100644 index 000000000..c54cefee6 --- /dev/null +++ b/wst/tags/0.4/samples/extract_imp.bat @@ -0,0 +1 @@ +..\..\wst\ws_helper\ws_helper -i -o. "user_service_intf.wsdl" >extract_imp.res.txt \ No newline at end of file diff --git a/wst/tags/0.4/samples/extract_intf.bat b/wst/tags/0.4/samples/extract_intf.bat new file mode 100644 index 000000000..627b7becb --- /dev/null +++ b/wst/tags/0.4/samples/extract_intf.bat @@ -0,0 +1 @@ +..\..\wst\ws_helper\ws_helper -uA -p -o. "user_service_intf.wsdl" >extract_intf.res.txt \ No newline at end of file diff --git a/wst/tags/0.4/samples/extract_proxy.bat b/wst/tags/0.4/samples/extract_proxy.bat new file mode 100644 index 000000000..695b698b5 --- /dev/null +++ b/wst/tags/0.4/samples/extract_proxy.bat @@ -0,0 +1 @@ +..\..\wst\ws_helper\ws_helper -p -o. "user_service_intf.wsdl" >extract_proxy.res.txt \ No newline at end of file diff --git a/wst/tags/0.4/samples/http_server/app_object.pas b/wst/tags/0.4/samples/http_server/app_object.pas new file mode 100644 index 000000000..7ee5642c8 --- /dev/null +++ b/wst/tags/0.4/samples/http_server/app_object.pas @@ -0,0 +1,309 @@ +{ + This file is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This file is provide under modified LGPL licence + ( the files COPYING.modifiedLGPL and COPYING.LGPL). + + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +} + +unit app_object; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, + IdCustomHTTPServer, + IdHTTPServer, IdContext, IdSocketHandle; + +type + + { TwstWebApplication } + + TwstWebApplication = class(TObject) + private + FHTTPServerObject: TIdHTTPServer; + FRootAddress : string; + private + function GenerateWSDLTable():string; + + procedure ProcessWSDLRequest( + AContext : TIdContext; + ARequestInfo : TIdHTTPRequestInfo; + AResponseInfo : TIdHTTPResponseInfo; + var APath : string + ); + procedure ProcessServiceRequest( + AContext : TIdContext; + ARequestInfo : TIdHTTPRequestInfo; + AResponseInfo : TIdHTTPResponseInfo; + var APath : string + ); + private + procedure Handler_CommandGet( + AContext : TIdContext; + ARequestInfo : TIdHTTPRequestInfo; + AResponseInfo : TIdHTTPResponseInfo + ); + public + constructor Create(); + destructor Destroy(); override; + procedure Display(const AMsg : string); + end; + + +implementation +uses base_service_intf, + server_service_intf, server_service_imputils, + server_service_soap, server_binary_formatter, + metadata_repository, metadata_wsdl, DOM, XMLWrite, + metadata_service, metadata_service_binder, metadata_service_imp, + + user_service_intf, user_service_intf_binder, user_service_intf_imp; + +const + sSEPARATOR = '/'; + sSERVICES_PREFIXE = 'services'; + sWSDL = 'WSDL'; + +function ExtractNextPathElement(var AFullPath : string):string; +var + i : SizeInt; +begin + Result := ''; + if ( Length(AFullPath) > 0 ) then begin + while ( Length(AFullPath) > 0 ) and ( AFullPath[1] = sSEPARATOR ) do begin + Delete(AFullPath,1,1); + end; + i := Pos(sSEPARATOR,AFullPath); + if ( i < 1 ) then begin + Result := AFullPath; + AFullPath := ''; + end else begin + Result := Copy(AFullPath,1,Pred(i)); + Delete(AFullPath,1,i); + end; + end; +end; + +function GetWSDL(const ARepName, ARootAddress: shortstring):string; +var + strm : TMemoryStream; + rep : PServiceRepository; + doc :TXMLDocument; + i : SizeInt; + s : string; +begin + Result := ''; + rep := nil; + doc := Nil; + i := GetModuleMetadataMngr().IndexOfName(ARepName); + if ( i < 0 ) then + Exit; + strm := TMemoryStream.Create(); + try + s := GetModuleMetadataMngr().GetRepositoryName(i); + GetModuleMetadataMngr().LoadRepositoryName(s,ARootAddress,rep); + //if ( GetModuleMetadataMngr().LoadRepositoryName(s,rep) > 0 ) then + //rep^.namespace := 'urn:wst'; + strm.Clear(); + doc := TXMLDocument.Create(); + GenerateWSDL(rep,doc); + WriteXMLFile(doc,strm); + i := strm.Size; + if ( i > 0 ) then begin + SetLength(Result,i); + Move(strm.memory^,Result[1],i); + end; + finally + doc.Free(); + strm.Free(); + GetModuleMetadataMngr().ClearRepository(rep); + end; +end; + + +{ TwstWebApplication } + +function TwstWebApplication.GenerateWSDLTable(): string; +var + r : IModuleMetadataMngr; + i : Integer; +begin + r := GetModuleMetadataMngr(); + Result := '' + + ''+ + ''+ + 'The Web Service Toolkit generated Metadata table'+ + ''+ + '' + + '

The following repositories has available. Click on the link to view the corresponding WSDL.

'+ + '' + + ''; + + for i := 0 to Pred(r.GetCount()) do + Result := Result + ''; + + Result := Result + + ''+ + '
' + + Format('',[sSEPARATOR+sSERVICES_PREFIXE+sSEPARATOR+sWSDL+sSEPARATOR+r.GetRepositoryName(i)])+ + r.GetRepositoryName(i) + + ''+ + '
'+ + ''+ + ''+ + ''; +end; + +procedure TwstWebApplication.ProcessWSDLRequest( + AContext : TIdContext; + ARequestInfo : TIdHTTPRequestInfo; + AResponseInfo : TIdHTTPResponseInfo; + var APath : string +); +var + locRepName, strBuff : string; + i : Integer; +begin + locRepName := ExtractNextPathElement(APath); + if AnsiSameText(sWSDL,locRepName) then + locRepName := ExtractNextPathElement(APath); + strBuff := GetWSDL(locRepName,FRootAddress); + i := Length(strBuff); + if ( i > 0 ) then begin + AResponseInfo.ContentType := 'text/xml'; + if not Assigned(AResponseInfo.ContentStream) then + AResponseInfo.ContentStream := TMemoryStream.Create(); + AResponseInfo.ContentStream.Write(strBuff[1],i); + Exit; + end; + AResponseInfo.ContentText := GenerateWSDLTable(); + AResponseInfo.ContentType := 'text/html'; +end; + +procedure TwstWebApplication.ProcessServiceRequest( + AContext : TIdContext; + ARequestInfo : TIdHTTPRequestInfo; + AResponseInfo : TIdHTTPResponseInfo; + var APath : string +); +var + trgt,ctntyp : string; + rqst : IRequestBuffer; + inStream: TMemoryStream; +begin + trgt := ExtractNextPathElement(APath); + if AnsiSameText(sWSDL,trgt) then begin + ProcessWSDLRequest(AContext,ARequestInfo,AResponseInfo,APath); + Exit; + end; + inStream := nil; + try + try + inStream := TMemoryStream.Create(); + AResponseInfo.ContentStream := TMemoryStream.Create(); + + ctntyp := ARequestInfo.ContentType; + inStream.CopyFrom(ARequestInfo.PostStream,0); + inStream.Position := 0; + AResponseInfo.ContentType := ctntyp; + rqst := TRequestBuffer.Create(trgt,ctntyp,inStream,AResponseInfo.ContentStream); + HandleServiceRequest(rqst); + finally + inStream.Free(); + end; + except + on e : Exception do begin + Display('ProcessData()>> Exception = '+e.Message); + raise; + end; + end; +end; + +procedure TwstWebApplication.Handler_CommandGet( + AContext : TIdContext; + ARequestInfo : TIdHTTPRequestInfo; + AResponseInfo : TIdHTTPResponseInfo +); +var + locPath, locPathPart, s : string; + j : SizeInt; +begin + if Assigned(ARequestInfo.PostStream) and ( ARequestInfo.PostStream.Size > 0 ) then begin + j := ARequestInfo.PostStream.Size; + SetLength(s,j); + ARequestInfo.PostStream.Read(s[1],j); + Display('----------- QUERY ----------------------'); + Display(s); + end; + locPath := ARequestInfo.Document; + locPathPart := ExtractNextPathElement(locPath); + if AnsiSameText(sSERVICES_PREFIXE,locPathPart) then begin + ProcessServiceRequest(AContext,ARequestInfo,AResponseInfo,locPath); + if Assigned(AResponseInfo.ContentStream) and ( AResponseInfo.ContentStream.Size > 0 ) then begin + j := AResponseInfo.ContentStream.Size; + SetLength(s,j); + AResponseInfo.ContentStream.Position := 0; + AResponseInfo.ContentStream.Read(s[1],j); + Display('--------- RESPONSE ------------------------'); + Display(s); + end; + Exit; + end; + + ProcessWSDLRequest(AContext,ARequestInfo,AResponseInfo,locPath); +end; + +constructor TwstWebApplication.Create(); +var + b : TIdSocketHandle; +begin + inherited Create(); + FHTTPServerObject := TIdHTTPServer.Create(); + b := FHTTPServerObject.Bindings.Add(); + b.IP:='127.0.0.1'; + b.port:=8000; + FRootAddress := 'http://127.0.0.1:8000/'; + + FHTTPServerObject.DefaultPort := 25000; + FHTTPServerObject.ServerSoftware := 'Web Service Toolkit Sample WebServer'; + FHTTPServerObject.Active := True; + FHTTPServerObject.OnCommandGet := @Handler_CommandGet; + + Server_service_RegisterUserServiceService(); + RegisterUserServiceImplementationFactory(); +end; + +destructor TwstWebApplication.Destroy(); +begin + FreeAndNil(FHTTPServerObject); + inherited Destroy(); +end; + +procedure TwstWebApplication.Display(const AMsg: string); +begin + WriteLn(AMsg); +end; + +initialization + RegisterStdTypes(); + Server_service_RegisterBinaryFormat(); + Server_service_RegisterSoapFormat(); + + Server_service_RegisterUserServiceService(); + RegisterUserServiceImplementationFactory(); + Register_user_service_intf_ServiceMetadata(); + + Server_service_RegisterWSTMetadataServiceService(); + RegisterWSTMetadataServiceImplementationFactory(); + + + +end. diff --git a/wst/tags/0.4/samples/http_server/http_server.lpi b/wst/tags/0.4/samples/http_server/http_server.lpi new file mode 100644 index 000000000..29137ed2d --- /dev/null +++ b/wst/tags/0.4/samples/http_server/http_server.lpi @@ -0,0 +1,187 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wst/tags/0.4/samples/http_server/http_server.pas b/wst/tags/0.4/samples/http_server/http_server.pas new file mode 100644 index 000000000..684a73ab8 --- /dev/null +++ b/wst/tags/0.4/samples/http_server/http_server.pas @@ -0,0 +1,27 @@ +program http_server; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Classes, SysUtils, + app_object, metadata_service, logger_extension; + + +var + AppObject : TwstWebApplication; +begin + 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; +end. diff --git a/wst/tags/0.4/samples/imp_helper.pas b/wst/tags/0.4/samples/imp_helper.pas new file mode 100644 index 000000000..623905370 --- /dev/null +++ b/wst/tags/0.4/samples/imp_helper.pas @@ -0,0 +1,77 @@ +unit imp_helper; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, + base_service_intf, + base_binary_formatter; + + + procedure SaveObjectToStream(AObject : TPersistent; AStream : TStream); + procedure LoadObjectFromStream(AObject : TPersistent; AStream : TStream); + + procedure SaveObjectToFile(AObject : TPersistent; const AFileName : string); + procedure LoadObjectFromFile(AObject : TPersistent; const AFileName : string); + +implementation +uses TypInfo; + +procedure SaveObjectToFile(AObject : TPersistent; const AFileName : string); +var + strm : TFileStream; +begin + if FileExists(AFileName) then + DeleteFile(AFileName); + strm := TFileStream.Create(AFileName,fmCreate); + try + SaveObjectToStream(AObject,strm); + finally + strm.Free(); + end; +end; + +procedure LoadObjectFromFile(AObject : TPersistent; const AFileName : string); +var + strm : TFileStream; +begin + if not FileExists(AFileName) then + raise Exception.CreateFmt('File not found : "%s"',[AFileName]); + strm := TFileStream.Create(AFileName,fmOpenRead); + try + LoadObjectFromStream(AObject,strm); + finally + strm.Free(); + end; +end; + +procedure SaveObjectToStream(AObject : TPersistent; AStream : TStream); +var + srlzr : IFormatterBase; +begin + srlzr := TBaseBinaryFormatter.Create(); + srlzr.BeginObject('root',TypeInfo(TPersistent)); + srlzr.Put('object',PTypeInfo(AObject.ClassInfo),AObject); + srlzr.EndScope(); + srlzr.SaveToStream(AStream); +end; + +procedure LoadObjectFromStream(AObject : TPersistent; AStream : TStream); +var + srlzr : IFormatterBase; + nme : string; +begin + srlzr := TBaseBinaryFormatter.Create(); + srlzr.LoadFromStream(AStream); + nme := 'root'; + srlzr.BeginObjectRead(nme,TypeInfo(TPersistent)); + nme := 'object'; + srlzr.Get(PTypeInfo(AObject.ClassInfo),nme,AObject); + srlzr.EndScopeRead(); +end; + + +end. + diff --git a/wst/tags/0.4/samples/library_server/lib_server.lpi b/wst/tags/0.4/samples/library_server/lib_server.lpi new file mode 100644 index 000000000..1efdfa697 --- /dev/null +++ b/wst/tags/0.4/samples/library_server/lib_server.lpi @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wst/tags/0.4/samples/library_server/lib_server.lpr b/wst/tags/0.4/samples/library_server/lib_server.lpr new file mode 100644 index 000000000..dcf34b31a --- /dev/null +++ b/wst/tags/0.4/samples/library_server/lib_server.lpr @@ -0,0 +1,44 @@ +{ + This file is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This file is provide under modified LGPL licence + ( the files COPYING.modifiedLGPL and COPYING.LGPL). + + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +} +library lib_server; + +{$mode objfpc}{$H+} + +uses + SysUtils, Classes, + + base_service_intf, + server_service_intf, + server_service_soap, server_binary_formatter, + metadata_repository, metadata_wsdl, + metadata_service, metadata_service_binder, metadata_service_imp, + library_base_intf, library_server_intf, + + user_service_intf_binder, user_service_intf_imp; + + + +exports + wstHandleRequest name WST_LIB_HANDLER; + +begin + RegisterStdTypes(); + Server_service_RegisterBinaryFormat(); + Server_service_RegisterSoapFormat(); + + RegisterUserServiceImplementationFactory(); + Server_service_RegisterUserServiceService(); + + Server_service_RegisterWSTMetadataServiceService(); + RegisterWSTMetadataServiceImplementationFactory(); +end. diff --git a/wst/tags/0.4/samples/logger_extension.pas b/wst/tags/0.4/samples/logger_extension.pas new file mode 100644 index 000000000..c5fc91108 --- /dev/null +++ b/wst/tags/0.4/samples/logger_extension.pas @@ -0,0 +1,81 @@ +{ + This file is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This file is provide under modified LGPL licence + ( the files COPYING.modifiedLGPL and COPYING.LGPL). + + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +} +unit logger_extension; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, base_service_intf, server_service_intf; + +type + + { TLoggerServiceExtension } + + TLoggerServiceExtension = class(TSimpleFactoryItem,IServiceExtension) + private + procedure TraceMessage(const AMsg : string); + protected + procedure ProcessMessage( + const AMessageStage : TMessageStage; + ACallContext : ICallContext; + AMsgData : IInterface + { The "AMsgData" parameter actual type depends on the message state + on correspond to : + - IRequestBuffer on "msBeforeDeserialize" and "msAfterSerialize" + - IFormatterResponse on "msAfterDeserialize", "msBeforeSerialize" + } + ); + end; + +implementation +uses TypInfo; + +{ TLoggerServiceExtension } + +procedure TLoggerServiceExtension.TraceMessage(const AMsg: string); +begin + WriteLn(AMsg); +end; + +procedure TLoggerServiceExtension.ProcessMessage( + const AMessageStage: TMessageStage; + ACallContext: ICallContext; + AMsgData: IInterface +); +var + s : string; + rqb : IRequestBuffer; + frmtr : IFormatterResponse; +begin + s := GetEnumName(TypeInfo(TMessageStage),Ord(AMessageStage)); + case AMessageStage of + msBeforeDeserialize, msAfterSerialize : + begin + rqb := AMsgData as IRequestBuffer; + s := Format('Called service : "%s"; Processing stage : "%s"',[rqb.GetTargetService(),s]); + end; + msAfterDeserialize, msBeforeSerialize : + begin + frmtr := AMsgData as IFormatterResponse; + s := Format('Called service : "%s"; Target Operation = "%s"; Processing stage : "%s"',[frmtr.GetCallTarget(),frmtr.GetCallProcedureName(),s]); + end; + end; + TraceMessage(s); +end; + +initialization + GetServiceExtensionRegistry().Register('TLoggerServiceExtension',TSimpleItemFactory.Create(TLoggerServiceExtension) as IItemFactory); + +end. diff --git a/wst/tags/0.4/samples/tcp_server/tcp_server.lpi b/wst/tags/0.4/samples/tcp_server/tcp_server.lpi new file mode 100644 index 000000000..0bf838514 --- /dev/null +++ b/wst/tags/0.4/samples/tcp_server/tcp_server.lpi @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wst/tags/0.4/samples/tcp_server/tcp_server.pas b/wst/tags/0.4/samples/tcp_server/tcp_server.pas new file mode 100644 index 000000000..72be78451 --- /dev/null +++ b/wst/tags/0.4/samples/tcp_server/tcp_server.pas @@ -0,0 +1,53 @@ +{ + This file is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This file is provide under modified LGPL licence + ( the files COPYING.modifiedLGPL and COPYING.LGPL). + + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +} +program tcp_server; + +{$INCLUDE wst.inc} + +uses +{$IFDEF FPC} + {$IFDEF UNIX} + {$DEFINE UseCThreads} + {$ENDIF} + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} +{$ENDIF} + Classes, SysUtils, + base_service_intf, server_service_soap, + base_binary_formatter, server_binary_formatter, + metadata_service, metadata_service_imp, metadata_service_binder, + synapse_tcp_server, + + user_service_intf, user_service_intf_binder, user_service_intf_imp , imp_helper; + + +var + listnerThread : TServerListnerThread; +begin + SetLogger(TConsoleLogger.Create()); + + Server_service_RegisterBinaryFormat(); + Server_service_RegisterSoapFormat(); + Server_service_RegisterWSTMetadataServiceService(); + RegisterWSTMetadataServiceImplementationFactory(); + + Server_service_RegisterUserServiceService(); + RegisterUserServiceImplementationFactory(); + + Logger().Log('WST sample TCP Server listning on "%s"',[sSERVER_PORT]); + Logger().Log('Hit to stop.'); + listnerThread := TServerListnerThread.Create(); + ReadLn; +end. + diff --git a/wst/tags/0.4/samples/user_client/umain.lfm b/wst/tags/0.4/samples/user_client/umain.lfm new file mode 100644 index 000000000..48382da97 --- /dev/null +++ b/wst/tags/0.4/samples/user_client/umain.lfm @@ -0,0 +1,124 @@ +object fMain: TfMain + Left = 379 + Height = 382 + Top = 283 + Width = 651 + HorzScrollBar.Page = 650 + VertScrollBar.Page = 381 + ActiveControl = Grid + Caption = 'fMain' + ClientHeight = 382 + ClientWidth = 651 + Position = poMainFormCenter + object Panel1: TPanel + Height = 182 + Top = 200 + Width = 651 + Align = alClient + BevelInner = bvLowered + Caption = 'Panel1' + ClientHeight = 182 + ClientWidth = 651 + TabOrder = 0 + object Grid: TTIGrid + Left = 2 + Height = 178 + Top = 2 + Width = 647 + Align = alClient + AutoFillColumns = True + BorderSpacing.CellAlignHorizontal = ccaRightBottom + BorderStyle = bsNone + Filter = [tkInteger, tkChar, tkEnumeration, tkFloat, tkSString, tkLString, tkAString, tkWString, tkVariant, tkWChar, tkBool, tkInt64, tkQWord] + FixedColor = clBtnFace + Flat = True + OnGetObject = GridGetObject + OnGetObjectCount = GridGetObjectCount + OnGetObjectName = GridGetObjectName + Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goDrawFocusSelected, goColSizing, goRowMoving, goColMoving, goColSpanning, goDblClickAutoSize, goFixedRowNumbering, goScrollKeepVisible] + ParentColor = False + PropertyOrder.Strings = ( + 'Name' + 'Category' + 'Preferences' + 'eMail' + ) + TabOrder = 0 + TabStop = True + end + end + object GroupBox1: TGroupBox + Height = 200 + Width = 651 + Align = alTop + ClientHeight = 178 + ClientWidth = 647 + TabOrder = 1 + object btnSearch: TButton + Left = 500 + Height = 35 + Top = -1 + Width = 131 + Action = actSearch + Anchors = [akTop, akRight] + BorderSpacing.InnerBorder = 4 + TabOrder = 0 + end + object btnAdd: TButton + Left = 500 + Height = 35 + Top = 42 + Width = 131 + Action = actNew + Anchors = [akTop, akRight] + BorderSpacing.InnerBorder = 4 + TabOrder = 1 + end + object btnAdd1: TButton + Left = 500 + Height = 35 + Top = 87 + Width = 131 + Action = actUpdate + Anchors = [akTop, akRight] + BorderSpacing.InnerBorder = 4 + TabOrder = 2 + end + object btnAdd2: TButton + Left = 500 + Height = 35 + Top = 132 + Width = 131 + Action = actDelete + Anchors = [akTop, akRight] + BorderSpacing.InnerBorder = 4 + TabOrder = 3 + end + end + object AL: TActionList + left = 99 + top = 56 + object actNew: TAction + Caption = 'Create User' + DisableIfNoHandler = True + OnExecute = actNewExecute + end + object actUpdate: TAction + Caption = 'Update User' + DisableIfNoHandler = True + OnExecute = actUpdateExecute + OnUpdate = actUpdateUpdate + end + object actDelete: TAction + Caption = 'Delete' + DisableIfNoHandler = True + OnExecute = actDeleteExecute + OnUpdate = actUpdateUpdate + end + object actSearch: TAction + Caption = 'Get List' + DisableIfNoHandler = True + OnExecute = actSearchExecute + end + end +end diff --git a/wst/tags/0.4/samples/user_client/umain.lrs b/wst/tags/0.4/samples/user_client/umain.lrs new file mode 100644 index 000000000..5bbad9fe0 --- /dev/null +++ b/wst/tags/0.4/samples/user_client/umain.lrs @@ -0,0 +1,44 @@ +{ Ceci est un fichier ressource généré automatiquement par Lazarus } + +LazarusResources.Add('TfMain','FORMDATA',[ + 'TPF0'#6'TfMain'#5'fMain'#4'Left'#3'{'#1#6'Height'#3'~'#1#3'Top'#3#27#1#5'Wid' + +'th'#3#139#2#18'HorzScrollBar.Page'#3#138#2#18'VertScrollBar.Page'#3'}'#1#13 + +'ActiveControl'#7#4'Grid'#7'Caption'#6#5'fMain'#12'ClientHeight'#3'~'#1#11'C' + +'lientWidth'#3#139#2#8'Position'#7#16'poMainFormCenter'#0#6'TPanel'#6'Panel1' + +#6'Height'#3#182#0#3'Top'#3#200#0#5'Width'#3#139#2#5'Align'#7#8'alClient'#10 + +'BevelInner'#7#9'bvLowered'#7'Caption'#6#6'Panel1'#12'ClientHeight'#3#182#0 + +#11'ClientWidth'#3#139#2#8'TabOrder'#2#0#0#7'TTIGrid'#4'Grid'#4'Left'#2#2#6 + +'Height'#3#178#0#3'Top'#2#2#5'Width'#3#135#2#5'Align'#7#8'alClient'#15'AutoF' + +'illColumns'#9'!BorderSpacing.CellAlignHorizontal'#7#14'ccaRightBottom'#11'B' + +'orderStyle'#7#6'bsNone'#6'Filter'#11#9'tkInteger'#6'tkChar'#13'tkEnumeratio' + +'n'#7'tkFloat'#9'tkSString'#9'tkLString'#9'tkAString'#9'tkWString'#9'tkVaria' + +'nt'#7'tkWChar'#6'tkBool'#7'tkInt64'#7'tkQWord'#0#10'FixedColor'#7#9'clBtnFa' + +'ce'#4'Flat'#9#11'OnGetObject'#7#13'GridGetObject'#16'OnGetObjectCount'#7#18 + +'GridGetObjectCount'#15'OnGetObjectName'#7#17'GridGetObjectName'#7'Options' + +#11#15'goFixedVertLine'#15'goFixedHorzLine'#10'goVertLine'#10'goHorzLine'#13 + +'goRangeSelect'#19'goDrawFocusSelected'#11'goColSizing'#11'goRowMoving'#11'g' + +'oColMoving'#13'goColSpanning'#18'goDblClickAutoSize'#19'goFixedRowNumbering' + +#19'goScrollKeepVisible'#0#11'ParentColor'#8#21'PropertyOrder.Strings'#1#6#4 + +'Name'#6#8'Category'#6#11'Preferences'#6#5'eMail'#0#8'TabOrder'#2#0#7'TabSto' + +'p'#9#0#0#0#9'TGroupBox'#9'GroupBox1'#6'Height'#3#200#0#5'Width'#3#139#2#5'A' + +'lign'#7#5'alTop'#12'ClientHeight'#3#178#0#11'ClientWidth'#3#135#2#8'TabOrde' + +'r'#2#1#0#7'TButton'#9'btnSearch'#4'Left'#3#244#1#6'Height'#2'#'#3'Top'#2#255 + +#5'Width'#3#131#0#6'Action'#7#9'actSearch'#7'Anchors'#11#5'akTop'#7'akRight' + +#0#25'BorderSpacing.InnerBorder'#2#4#8'TabOrder'#2#0#0#0#7'TButton'#6'btnAdd' + +#4'Left'#3#244#1#6'Height'#2'#'#3'Top'#2'*'#5'Width'#3#131#0#6'Action'#7#6'a' + +'ctNew'#7'Anchors'#11#5'akTop'#7'akRight'#0#25'BorderSpacing.InnerBorder'#2#4 + +#8'TabOrder'#2#1#0#0#7'TButton'#7'btnAdd1'#4'Left'#3#244#1#6'Height'#2'#'#3 + +'Top'#2'W'#5'Width'#3#131#0#6'Action'#7#9'actUpdate'#7'Anchors'#11#5'akTop'#7 + +'akRight'#0#25'BorderSpacing.InnerBorder'#2#4#8'TabOrder'#2#2#0#0#7'TButton' + +#7'btnAdd2'#4'Left'#3#244#1#6'Height'#2'#'#3'Top'#3#132#0#5'Width'#3#131#0#6 + +'Action'#7#9'actDelete'#7'Anchors'#11#5'akTop'#7'akRight'#0#25'BorderSpacing' + +'.InnerBorder'#2#4#8'TabOrder'#2#3#0#0#0#11'TActionList'#2'AL'#4'left'#2'c'#3 + +'top'#2'8'#0#7'TAction'#6'actNew'#7'Caption'#6#11'Create User'#18'DisableIfN' + +'oHandler'#9#9'OnExecute'#7#13'actNewExecute'#0#0#7'TAction'#9'actUpdate'#7 + +'Caption'#6#11'Update User'#18'DisableIfNoHandler'#9#9'OnExecute'#7#16'actUp' + +'dateExecute'#8'OnUpdate'#7#15'actUpdateUpdate'#0#0#7'TAction'#9'actDelete'#7 + +'Caption'#6#6'Delete'#18'DisableIfNoHandler'#9#9'OnExecute'#7#16'actDeleteEx' + +'ecute'#8'OnUpdate'#7#15'actUpdateUpdate'#0#0#7'TAction'#9'actSearch'#7'Capt' + +'ion'#6#8'Get List'#18'DisableIfNoHandler'#9#9'OnExecute'#7#16'actSearchExec' + +'ute'#0#0#0#0 +]); diff --git a/wst/tags/0.4/samples/user_client/umain.pas b/wst/tags/0.4/samples/user_client/umain.pas new file mode 100644 index 000000000..81b448301 --- /dev/null +++ b/wst/tags/0.4/samples/user_client/umain.pas @@ -0,0 +1,169 @@ +unit umain; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, RTTIGrids, + ExtCtrls, StdCtrls, user_service_intf, Buttons, ActnList; + +type + + { TfMain } + + TfMain = class(TForm) + actDelete: TAction; + actSearch: TAction; + actUpdate: TAction; + actNew: TAction; + AL: TActionList; + btnAdd1: TButton; + btnAdd2: TButton; + btnSearch: TButton; + btnAdd: TButton; + GroupBox1: TGroupBox; + Panel1: TPanel; + Grid: TTIGrid; + procedure actDeleteExecute(Sender: TObject); + procedure actNewExecute(Sender: TObject); + procedure actSearchExecute(Sender: TObject); + procedure actUpdateExecute(Sender: TObject); + procedure actUpdateUpdate(Sender: TObject); + procedure GridGetObject(Sender: TTICustomGrid; Index: integer; + var TIObject: TPersistent); + procedure GridGetObjectCount(Sender: TTICustomGrid; ListObject: TObject; + var ObjCount: integer); + procedure GridGetObjectName(Sender: TObject; Index: integer; + TIObject: TPersistent; var ObjName: string); + private + FUserService : UserService; + function CreateObj():UserService; + function GetObjectIndex() : Integer; + public + FUsers : TUserArray; + end; + +var + fMain: TfMain; + +implementation +uses user_service_intf_proxy, synapse_tcp_protocol, synapse_http_protocol, + soap_formatter, binary_formatter, user_edit_imp ; + +{ TfMain } + +procedure TfMain.GridGetObjectCount(Sender: TTICustomGrid; + ListObject: TObject; var ObjCount: integer); +begin + if ( FUsers = nil ) then + ObjCount := 0 + else + ObjCount := FUsers.Length; +end; + +procedure TfMain.GridGetObjectName(Sender: TObject; Index: integer; + TIObject: TPersistent; var ObjName: string); +begin + if ( TIObject <> nil ) then + ObjName := (TIObject as TUser).UserName; +end; + +function TfMain.CreateObj(): UserService; +begin + if ( FUserService = nil ) then begin + FUserService := TUserService_Proxy.Create( + 'UserService', + 'binary:', + 'TCP:Address=127.0.0.1;Port=1234;target=UserService' + ); + end; + Result := FUserService; +end; + +type TCrakGrid = class(TTIGrid); +function TfMain.GetObjectIndex(): Integer; +begin + Result := TCrakGrid(Grid).Row - 1; +end; + +procedure TfMain.GridGetObject(Sender: TTICustomGrid; Index: integer; + var TIObject: TPersistent); +begin + TIObject := FUsers[Index]; +end; + +procedure TfMain.actNewExecute(Sender: TObject); +var + obj : TUser; + f : TfUserEdit; +begin + obj := nil; + f := TfUserEdit.Create(Application); + try + obj := TUser.Create(); + if f.UpdateObject(obj) then begin + CreateObj().Add(obj); + end; + finally + FreeAndNil(obj); + f.Release(); + actSearch.Execute(); + end; +end; + +procedure TfMain.actSearchExecute(Sender: TObject); +begin + FreeAndNil(FUsers); + FUsers := CreateObj().GetList(); + Grid.ListObject := FUsers; + Grid.Invalidate(); +end; + +procedure TfMain.actDeleteExecute(Sender: TObject); +var + i : Integer; +begin + i := GetObjectIndex(); + if ( i >= 0 ) then begin + try + CreateObj().Delete(FUsers[i].UserName); + finally + actSearch.Execute(); + end; + end; +end; + +procedure TfMain.actUpdateExecute(Sender: TObject); +var + i : Integer; + obj : TUser; + f : TfUserEdit; +begin + i := GetObjectIndex(); + if ( i >= 0 ) then begin + obj := FUsers[i]; + f := TfUserEdit.Create(Application); + try + if f.UpdateObject(obj) then begin + CreateObj().Update(obj); + end; + finally + f.Release(); + actSearch.Execute(); + end; + end; +end; + +procedure TfMain.actUpdateUpdate(Sender: TObject); +begin + TAction(Sender).Enabled := ( GetObjectIndex() >= 0 ); +end; + +initialization + {$I umain.lrs} + + SYNAPSE_RegisterTCP_Transport(); + SYNAPSE_RegisterHTTP_Transport(); + +end. diff --git a/wst/tags/0.4/samples/user_client/user_client.lpi b/wst/tags/0.4/samples/user_client/user_client.lpi new file mode 100644 index 000000000..7f968b9b2 --- /dev/null +++ b/wst/tags/0.4/samples/user_client/user_client.lpi @@ -0,0 +1,362 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wst/tags/0.4/samples/user_client/user_client.lpr b/wst/tags/0.4/samples/user_client/user_client.lpr new file mode 100644 index 000000000..cf02b4360 --- /dev/null +++ b/wst/tags/0.4/samples/user_client/user_client.lpr @@ -0,0 +1,19 @@ +program user_client; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Interfaces, // this includes the LCL widgetset + Forms + , umain, RunTimeTypeInfoControls, user_edit_imp; + +begin + Application.Initialize; + Application.CreateForm(TfMain, fMain); + Application.CreateForm(TfUserEdit, fUserEdit); + Application.Run; +end. + diff --git a/wst/tags/0.4/samples/user_client/user_edit_imp.lfm b/wst/tags/0.4/samples/user_client/user_edit_imp.lfm new file mode 100644 index 000000000..44967982a --- /dev/null +++ b/wst/tags/0.4/samples/user_client/user_edit_imp.lfm @@ -0,0 +1,124 @@ +object fUserEdit: TfUserEdit + Left = 395 + Height = 241 + Top = 199 + Width = 400 + HorzScrollBar.Page = 399 + VertScrollBar.Page = 240 + ActiveControl = btnOk + BorderIcons = [biSystemMenu] + BorderStyle = bsDialog + Caption = 'User Edit' + ClientHeight = 241 + ClientWidth = 400 + Position = poMainFormCenter + object Panel1: TPanel + Height = 50 + Top = 191 + Width = 400 + Align = alBottom + ClientHeight = 50 + ClientWidth = 400 + TabOrder = 0 + object btnOk: TButton + Left = 224 + Height = 35 + Top = 6 + Width = 75 + BorderSpacing.InnerBorder = 4 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 0 + end + object Button2: TButton + Left = 312 + Height = 35 + Top = 6 + Width = 75 + BorderSpacing.InnerBorder = 4 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 1 + end + end + object Panel2: TPanel + Height = 191 + Width = 400 + Align = alClient + ClientHeight = 191 + ClientWidth = 400 + TabOrder = 1 + object Label1: TLabel + Left = 16 + Height = 18 + Top = 18 + Width = 36 + Caption = 'Name' + Color = clNone + ParentColor = False + end + object Label2: TLabel + Left = 16 + Height = 18 + Top = 53 + Width = 34 + Caption = 'e-Mail' + Color = clNone + ParentColor = False + end + object Label3: TLabel + Left = 16 + Height = 18 + Top = 88 + Width = 58 + Caption = 'Category' + Color = clNone + ParentColor = False + end + object Label4: TLabel + Left = 17 + Height = 18 + Top = 120 + Width = 72 + Caption = 'Preferences' + Color = clNone + ParentColor = False + end + object edtName: TTIEdit + Left = 80 + Height = 23 + Top = 16 + Width = 304 + Link.TIPropertyName = 'UserName' + TabOrder = 0 + end + object edteMail: TTIEdit + Left = 80 + Height = 23 + Top = 53 + Width = 304 + Link.TIPropertyName = 'eMail' + TabOrder = 1 + end + object edtCategory: TTIComboBox + Left = 80 + Height = 24 + Top = 88 + Width = 160 + Link.TIPropertyName = 'Category' + MaxLength = 0 + Style = csDropDownList + TabOrder = 2 + end + object edtPreferences: TTIEdit + Left = 17 + Height = 23 + Top = 146 + Width = 368 + Link.TIPropertyName = 'Preferences' + TabOrder = 3 + end + end +end diff --git a/wst/tags/0.4/samples/user_client/user_edit_imp.lrs b/wst/tags/0.4/samples/user_client/user_edit_imp.lrs new file mode 100644 index 000000000..4bca62865 --- /dev/null +++ b/wst/tags/0.4/samples/user_client/user_edit_imp.lrs @@ -0,0 +1,34 @@ +{ Ceci est un fichier ressource généré automatiquement par Lazarus } + +LazarusResources.Add('TfUserEdit','FORMDATA',[ + 'TPF0'#10'TfUserEdit'#9'fUserEdit'#4'Left'#3#139#1#6'Height'#3#241#0#3'Top'#3 + +#199#0#5'Width'#3#144#1#18'HorzScrollBar.Page'#3#143#1#18'VertScrollBar.Page' + +#3#240#0#13'ActiveControl'#7#5'btnOk'#11'BorderIcons'#11#12'biSystemMenu'#0 + +#11'BorderStyle'#7#8'bsDialog'#7'Caption'#6#9'User Edit'#12'ClientHeight'#3 + +#241#0#11'ClientWidth'#3#144#1#8'Position'#7#16'poMainFormCenter'#0#6'TPanel' + +#6'Panel1'#6'Height'#2'2'#3'Top'#3#191#0#5'Width'#3#144#1#5'Align'#7#8'alBot' + +'tom'#12'ClientHeight'#2'2'#11'ClientWidth'#3#144#1#8'TabOrder'#2#0#0#7'TBut' + +'ton'#5'btnOk'#4'Left'#3#224#0#6'Height'#2'#'#3'Top'#2#6#5'Width'#2'K'#25'Bo' + +'rderSpacing.InnerBorder'#2#4#7'Caption'#6#2'OK'#7'Default'#9#11'ModalResult' + +#2#1#8'TabOrder'#2#0#0#0#7'TButton'#7'Button2'#4'Left'#3'8'#1#6'Height'#2'#' + +#3'Top'#2#6#5'Width'#2'K'#25'BorderSpacing.InnerBorder'#2#4#6'Cancel'#9#7'Ca' + +'ption'#6#6'Cancel'#11'ModalResult'#2#2#8'TabOrder'#2#1#0#0#0#6'TPanel'#6'Pa' + +'nel2'#6'Height'#3#191#0#5'Width'#3#144#1#5'Align'#7#8'alClient'#12'ClientHe' + +'ight'#3#191#0#11'ClientWidth'#3#144#1#8'TabOrder'#2#1#0#6'TLabel'#6'Label1' + +#4'Left'#2#16#6'Height'#2#18#3'Top'#2#18#5'Width'#2'$'#7'Caption'#6#4'Name'#5 + +'Color'#7#6'clNone'#11'ParentColor'#8#0#0#6'TLabel'#6'Label2'#4'Left'#2#16#6 + +'Height'#2#18#3'Top'#2'5'#5'Width'#2'"'#7'Caption'#6#6'e-Mail'#5'Color'#7#6 + +'clNone'#11'ParentColor'#8#0#0#6'TLabel'#6'Label3'#4'Left'#2#16#6'Height'#2 + +#18#3'Top'#2'X'#5'Width'#2':'#7'Caption'#6#8'Category'#5'Color'#7#6'clNone' + +#11'ParentColor'#8#0#0#6'TLabel'#6'Label4'#4'Left'#2#17#6'Height'#2#18#3'Top' + +#2'x'#5'Width'#2'H'#7'Caption'#6#11'Preferences'#5'Color'#7#6'clNone'#11'Par' + +'entColor'#8#0#0#7'TTIEdit'#7'edtName'#4'Left'#2'P'#6'Height'#2#23#3'Top'#2 + +#16#5'Width'#3'0'#1#19'Link.TIPropertyName'#6#8'UserName'#8'TabOrder'#2#0#0#0 + +#7'TTIEdit'#8'edteMail'#4'Left'#2'P'#6'Height'#2#23#3'Top'#2'5'#5'Width'#3'0' + +#1#19'Link.TIPropertyName'#6#5'eMail'#8'TabOrder'#2#1#0#0#11'TTIComboBox'#11 + +'edtCategory'#4'Left'#2'P'#6'Height'#2#24#3'Top'#2'X'#5'Width'#3#160#0#19'Li' + +'nk.TIPropertyName'#6#8'Category'#9'MaxLength'#2#0#5'Style'#7#14'csDropDownL' + +'ist'#8'TabOrder'#2#2#0#0#7'TTIEdit'#14'edtPreferences'#4'Left'#2#17#6'Heigh' + +'t'#2#23#3'Top'#3#146#0#5'Width'#3'p'#1#19'Link.TIPropertyName'#6#11'Prefere' + +'nces'#8'TabOrder'#2#3#0#0#0#0 +]); diff --git a/wst/tags/0.4/samples/user_client/user_edit_imp.pas b/wst/tags/0.4/samples/user_client/user_edit_imp.pas new file mode 100644 index 000000000..6889aeaf5 --- /dev/null +++ b/wst/tags/0.4/samples/user_client/user_edit_imp.pas @@ -0,0 +1,73 @@ +unit user_edit_imp; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ExtCtrls, + Buttons, StdCtrls, RTTICtrls, user_service_intf; + +type + + { TfUserEdit } + + TfUserEdit = class(TForm) + btnOk: TButton; + Button2: TButton; + Label1: TLabel; + Label2: TLabel; + Label3: TLabel; + Label4: TLabel; + Panel1: TPanel; + Panel2: TPanel; + edtCategory: TTIComboBox; + edtName: TTIEdit; + edteMail: TTIEdit; + edtPreferences: TTIEdit; + private + FInfos: TUser; + public + constructor Create(AOwner : TComponent);override; + destructor Destroy();override; + property Infos : TUser read FInfos; + function UpdateObject( AUser : TUser ) : Boolean; + end; + +var + fUserEdit: TfUserEdit; + +implementation + +{ TfUserEdit } + +constructor TfUserEdit.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FInfos := TUser.Create(); + edtName.Link.TIObject := FInfos; + edteMail.Link.TIObject := FInfos; + edtPreferences.Link.TIObject := FInfos; + edtCategory.Link.TIObject := FInfos; +end; + +destructor TfUserEdit.Destroy(); +begin + FreeAndNil(FInfos); + inherited Destroy(); +end; + +function TfUserEdit.UpdateObject(AUser: TUser): Boolean; +begin + Infos.Assign(AUser); + Result := ( ShowModal() = mrOK ); + if Result then begin + AUser.Assign(Infos); + end; +end; + +initialization + {$I user_edit_imp.lrs} + +end. + diff --git a/wst/tags/0.4/samples/user_client_console/user_client_console.lpi b/wst/tags/0.4/samples/user_client_console/user_client_console.lpi new file mode 100644 index 000000000..0f36b95cd --- /dev/null +++ b/wst/tags/0.4/samples/user_client_console/user_client_console.lpi @@ -0,0 +1,233 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wst/tags/0.4/samples/user_client_console/user_client_console.pas b/wst/tags/0.4/samples/user_client_console/user_client_console.pas new file mode 100644 index 000000000..3864c335a --- /dev/null +++ b/wst/tags/0.4/samples/user_client_console/user_client_console.pas @@ -0,0 +1,193 @@ +program user_client_console; + +{$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; + +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); + end else begin + WriteLn(''); + 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; + +procedure HandleAdd(); + + 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('Adding a user :'); + 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); + 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; + +type TTransportType = ( ttLibrary, ttTCP, ttHTTP ); +procedure CreateProxy(const ATransportType :TTransportType); +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' + //'http:Address=http://127.0.0.1:8000/services/UserService' + ); +var + buff : string; +begin + buff := ADDRESS_MAP[ATransportType]; + if ( ATransportType = ttLibrary ) then + buff := StringReplace(buff,'\',DirectorySeparator,[rfReplaceAll, rfIgnoreCase]); + UserServiceInst := TUserService_Proxy.Create( + 'UserService', + 'binary:', + buff + ); +end; + +function ReadTransportType():TTransportType; +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' : Result := ttLibrary; + 'T' : Result := ttTCP; + 'H' : Result := ttHTTP; + end; + Break; + end; + end; +end; + +var + strBuffer : string; + tt : TTransportType; +begin + SYNAPSE_RegisterTCP_Transport(); + SYNAPSE_RegisterHTTP_Transport(); + LIB_Register_Transport(); + WriteLn('Sample Application using Web Services Toolkit'); + CreateProxy(ReadTransportType()); + WriteLn('Menu :'); + WriteLn(' L : Show the user list'); + WriteLn(' A : Add a new user'); + WriteLn(' F : Find a new'); + WriteLn(' C : Change the communication protocol'); + 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(); + 'F' : HandleFindUser(); + 'C' : CreateProxy(ReadTransportType()); + 'X' : Break; + end; + WriteLn(); + Write('Choose a item : '); + end; + end; +end. + diff --git a/wst/tags/0.4/samples/user_service_intf.pas b/wst/tags/0.4/samples/user_service_intf.pas new file mode 100644 index 000000000..0976bf384 --- /dev/null +++ b/wst/tags/0.4/samples/user_service_intf.pas @@ -0,0 +1,216 @@ +{ +This unit has been produced by ws_helper. + Input unit name : "user_service_intf". + This unit name : "user_service_intf". + Date : "05/05/2007 19:07". +} +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 + + TUser = class; + TUserArray = class; + + TUserCategory = ( + Normal + ,Admin + ); + + TUser = class(TBaseComplexRemotable) + private + FCategory : TUserCategory; + FUserName : string; + FeMail : string; + FPreferences : string; + published + property Category : TUserCategory 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; + end; + + TUserArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): TUser; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : TUser Read GetItem;Default; + end; + + UserService = interface(IInvokable) + ['{842D8408-E142-470F-9CDD-FAD0D8AEEB12}'] + function GetList():TUserArray; + procedure Add( + Const AUser : TUser + ); + procedure Update( + Const AUser : TUser + ); + function Find( + Const AName : string + ):TUser; + function Delete( + Const AName : string + ):boolean; + end; + + procedure Register_user_service_intf_ServiceMetadata(); + +Implementation +uses metadata_repository; + +{ TUserArray } + +function TUserArray.GetItem(AIndex: Integer): TUser; +begin + Result := Inherited GetItem(AIndex) As TUser; +end; + +class function TUserArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= TUser; +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', + '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', + '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', + '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', + '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', + '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; + + +initialization + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(TUserCategory),'TUserCategory'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(TUser),'TUser'); + GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(TUserArray),'TUserArray'); + GetTypeRegistry().ItemByTypeInfo[TypeInfo(TUserArray)].RegisterExternalPropertyName(sARRAY_ITEM,'item'); + + +End. diff --git a/wst/tags/0.4/samples/user_service_intf.wsdl b/wst/tags/0.4/samples/user_service_intf.wsdl new file mode 100644 index 000000000..733a84776 --- /dev/null +++ b/wst/tags/0.4/samples/user_service_intf.wsdl @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wst/tags/0.4/samples/user_service_intf_.pas b/wst/tags/0.4/samples/user_service_intf_.pas new file mode 100644 index 000000000..856f85d17 --- /dev/null +++ b/wst/tags/0.4/samples/user_service_intf_.pas @@ -0,0 +1,75 @@ +unit user_service_intf; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, base_service_intf; + +type + + TUserCategory = ( Normal, Admin ); + + { TUser } + + TUser = class(TBaseComplexRemotable) + private + FCategory: TUserCategory; + FeMail: string; + FName: string; + FPreferences: string; + published + property Category : TUserCategory read FCategory write FCategory; + property Name : string read FName write FName; + property eMail : string read FeMail write FeMail; + property Preferences : string read FPreferences write FPreferences; + end; + + { TUserArray } + + TUserArray = class(TBaseObjectArrayRemotable) + private + function GetUser(AIndex: Integer): TUser; + public + class function GetItemClass():TBaseRemotableClass;override; + Property Item[AIndex:Integer] : TUser Read GetUser;Default; + End; + + UserService = interface(IInvokable) + ['{101F2CA7-19FC-4A73-AA98-F13FCDA75EE1}'] + function GetList():TUserArray; + procedure Add(AUser : TUser); + function Find(const AName : string):TUser; + function Delete(const AName : string):Boolean; + end; + + procedure Register_user_service_intf_NameSpace(); + +implementation +uses metadata_repository; + +procedure Register_user_service_intf_NameSpace(); +begin + GetModuleMetadataMngr().SetRepositoryNameSpace('user_service_intf','urn:UserService'); +end; + + +{ TUserArray } + +function TUserArray.GetUser(AIndex: Integer): TUser; +begin + Result := GetItem(AIndex) as TUser; +end; + +class function TUserArray.GetItemClass(): TBaseRemotableClass; +begin + Result := TUser; +end; + +initialization + GetTypeRegistry().Register('urn:UserService',TypeInfo(TUserCategory),'TUserCategory'); + GetTypeRegistry().Register('urn:UserService',TypeInfo(TUser),'TUser'); + GetTypeRegistry().Register('urn:UserService',TypeInfo(TUserArray),'TUserArray'); + +end. diff --git a/wst/tags/0.4/samples/user_service_intf_binder.pas b/wst/tags/0.4/samples/user_service_intf_binder.pas new file mode 100644 index 000000000..dd85fa018 --- /dev/null +++ b/wst/tags/0.4/samples/user_service_intf_binder.pas @@ -0,0 +1,227 @@ +{ +This unit has been produced by ws_helper. + Input unit name : "user_service_intf". + This unit name : "user_service_intf_binder". + Date : "02/05/2007 20:07". +} +unit user_service_intf_binder; +{$mode objfpc}{$H+} +interface + +uses SysUtils, Classes, base_service_intf, server_service_intf, user_service_intf; + +type + + + TUserService_ServiceBinder=class(TBaseServiceBinder) + Protected + procedure GetListHandler(AFormatter:IFormatterResponse); + procedure AddHandler(AFormatter:IFormatterResponse); + procedure UpdateHandler(AFormatter:IFormatterResponse); + procedure FindHandler(AFormatter:IFormatterResponse); + procedure DeleteHandler(AFormatter:IFormatterResponse); + Public + constructor Create(); + End; + + TUserService_ServiceBinderFactory = class(TInterfacedObject,IItemFactory) + protected + function CreateInstance():IInterface; + End; + + procedure Server_service_RegisterUserServiceService(); + +Implementation +uses TypInfo, wst_resources_imp,metadata_repository; + +{ TUserService_ServiceBinder implementation } +procedure TUserService_ServiceBinder.GetListHandler(AFormatter:IFormatterResponse); +Var + cllCntrl : ICallControl; + tmpObj : UserService; + callCtx : ICallContext; + strPrmName : string; + procName,trgName : string; + returnVal : TUserArray; +Begin + callCtx := GetCallContext(); + If ( PTypeInfo(TypeInfo(TUserArray))^.Kind in [tkClass,tkInterface] ) Then + Pointer(returnVal) := Nil; + + + tmpObj := Self.GetFactory().CreateInstance() as UserService; + if Supports(tmpObj,ICallControl,cllCntrl) then + cllCntrl.SetCallContext(GetCallContext()); + + returnVal := tmpObj.GetList(); + If ( PTypeInfo(TypeInfo(TUserArray))^.Kind = tkClass ) And Assigned(Pointer(returnVal)) Then + callCtx.AddObjectToFree(TObject(returnVal)); + + procName := AFormatter.GetCallProcedureName(); + trgName := AFormatter.GetCallTarget(); + AFormatter.Clear(); + AFormatter.BeginCallResponse(procName,trgName); + AFormatter.Put('result',TypeInfo(TUserArray),returnVal); + AFormatter.EndCallResponse(); + + callCtx := Nil; +End; + +procedure TUserService_ServiceBinder.AddHandler(AFormatter:IFormatterResponse); +Var + cllCntrl : ICallControl; + tmpObj : UserService; + callCtx : ICallContext; + strPrmName : string; + procName,trgName : string; + AUser : TUser; +Begin + callCtx := GetCallContext(); + TObject(AUser) := Nil; + + strPrmName := 'AUser'; AFormatter.Get(TypeInfo(TUser),strPrmName,AUser); + If Assigned(Pointer(AUser)) Then + callCtx.AddObjectToFree(TObject(AUser)); + + tmpObj := Self.GetFactory().CreateInstance() as UserService; + if Supports(tmpObj,ICallControl,cllCntrl) then + cllCntrl.SetCallContext(GetCallContext()); + + tmpObj.Add(AUser); + + procName := AFormatter.GetCallProcedureName(); + trgName := AFormatter.GetCallTarget(); + AFormatter.Clear(); + AFormatter.BeginCallResponse(procName,trgName); + AFormatter.EndCallResponse(); + + callCtx := Nil; +End; + +procedure TUserService_ServiceBinder.UpdateHandler(AFormatter:IFormatterResponse); +Var + cllCntrl : ICallControl; + tmpObj : UserService; + callCtx : ICallContext; + strPrmName : string; + procName,trgName : string; + AUser : TUser; +Begin + callCtx := GetCallContext(); + TObject(AUser) := Nil; + + strPrmName := 'AUser'; AFormatter.Get(TypeInfo(TUser),strPrmName,AUser); + If Assigned(Pointer(AUser)) Then + callCtx.AddObjectToFree(TObject(AUser)); + + tmpObj := Self.GetFactory().CreateInstance() as UserService; + if Supports(tmpObj,ICallControl,cllCntrl) then + cllCntrl.SetCallContext(GetCallContext()); + + tmpObj.Update(AUser); + + procName := AFormatter.GetCallProcedureName(); + trgName := AFormatter.GetCallTarget(); + AFormatter.Clear(); + AFormatter.BeginCallResponse(procName,trgName); + AFormatter.EndCallResponse(); + + callCtx := Nil; +End; + +procedure TUserService_ServiceBinder.FindHandler(AFormatter:IFormatterResponse); +Var + cllCntrl : ICallControl; + tmpObj : UserService; + callCtx : ICallContext; + strPrmName : string; + procName,trgName : string; + AName : string; + returnVal : TUser; +Begin + callCtx := GetCallContext(); + TObject(returnVal) := Nil; + + strPrmName := 'AName'; AFormatter.Get(TypeInfo(string),strPrmName,AName); + + tmpObj := Self.GetFactory().CreateInstance() as UserService; + if Supports(tmpObj,ICallControl,cllCntrl) then + cllCntrl.SetCallContext(GetCallContext()); + + returnVal := tmpObj.Find(AName); + If Assigned(TObject(returnVal)) Then + callCtx.AddObjectToFree(TObject(returnVal)); + + procName := AFormatter.GetCallProcedureName(); + trgName := AFormatter.GetCallTarget(); + AFormatter.Clear(); + AFormatter.BeginCallResponse(procName,trgName); + AFormatter.Put('result',TypeInfo(TUser),returnVal); + AFormatter.EndCallResponse(); + + callCtx := Nil; +End; + +procedure TUserService_ServiceBinder.DeleteHandler(AFormatter:IFormatterResponse); +Var + cllCntrl : ICallControl; + tmpObj : UserService; + callCtx : ICallContext; + strPrmName : string; + procName,trgName : string; + AName : string; + returnVal : boolean; +Begin + callCtx := GetCallContext(); + + strPrmName := 'AName'; AFormatter.Get(TypeInfo(string),strPrmName,AName); + + tmpObj := Self.GetFactory().CreateInstance() as UserService; + if Supports(tmpObj,ICallControl,cllCntrl) then + cllCntrl.SetCallContext(GetCallContext()); + + returnVal := tmpObj.Delete(AName); + + procName := AFormatter.GetCallProcedureName(); + trgName := AFormatter.GetCallTarget(); + AFormatter.Clear(); + AFormatter.BeginCallResponse(procName,trgName); + AFormatter.Put('result',TypeInfo(boolean),returnVal); + AFormatter.EndCallResponse(); + + callCtx := Nil; +End; + + +constructor TUserService_ServiceBinder.Create(); +Begin + Inherited Create(GetServiceImplementationRegistry().FindFactory('UserService')); + RegisterVerbHandler('GetList',@GetListHandler); + RegisterVerbHandler('Add',@AddHandler); + RegisterVerbHandler('Update',@UpdateHandler); + RegisterVerbHandler('Find',@FindHandler); + RegisterVerbHandler('Delete',@DeleteHandler); +End; + + +{ TUserService_ServiceBinderFactory } +function TUserService_ServiceBinderFactory.CreateInstance():IInterface; +Begin + Result := TUserService_ServiceBinder.Create() as IInterface; +End; + + +procedure Server_service_RegisterUserServiceService(); +Begin + GetServerServiceRegistry().Register('UserService',TUserService_ServiceBinderFactory.Create() as IItemFactory); +End; + +initialization + + {$IF DECLARED(Register_user_service_intf_NameSpace)} + Register_user_service_intf_NameSpace(); + {$ENDIF} + + {$i user_service_intf.wst} + +End. diff --git a/wst/tags/0.4/samples/user_service_intf_imp.pas b/wst/tags/0.4/samples/user_service_intf_imp.pas new file mode 100644 index 000000000..c0fd894f5 --- /dev/null +++ b/wst/tags/0.4/samples/user_service_intf_imp.pas @@ -0,0 +1,202 @@ +{ +This unit has been produced by ws_helper. + Input unit name : "user_service_intf". + This unit name : "user_service_intf_imp". + Date : "30/04/2007 00:07". +} +Unit user_service_intf_imp; +{$mode objfpc}{$H+} +Interface + +Uses SysUtils, Classes, + base_service_intf, server_service_intf, server_service_imputils, + user_service_intf, cursor_intf; + +Type + + + { TUserService_ServiceImp } + + TUserService_ServiceImp=class(TBaseServiceImplementation,UserService) + Protected + function GetList():TUserArray; + procedure Add( + Const AUser : TUser + ); + procedure Update( + Const AUser : TUser + ); + function Find( + Const AName : string + ):TUser; + function Delete( + Const AName : string + ):boolean; + End; + + const sDATA_FILE_NAME = 'sample.data'; + + procedure RegisterUserServiceImplementationFactory(); + procedure SaveDataToFile(const AFileName : string); + +Implementation +uses Contnrs, std_cursors, rtti_filters, imp_helper; + +var + FUserList : TObjectList = nil; + FUserCursor : IObjectCursor = nil; + +procedure FillArrayFromCursor(ACursor: IObjectCursor;ARes: TUserArray); +var + i, c : Integer; +begin + ACursor.Reset(); + c := 0; + while ACursor.MoveNext() do begin + Inc(c); + end; + ARes.SetLength(c); + i := 0; + ACursor.Reset(); + while ACursor.MoveNext() do begin + ARes[i].Assign(ACursor.GetCurrent() as TUser); + Inc(i); + end; +end; + +{ TUserService_ServiceImp implementation } +function TUserService_ServiceImp.GetList():TUserArray; +var + locCrs : IObjectCursor; + srcUsr, locUsr : TUser; +Begin + Result := TUserArray.Create(); + try + FillArrayFromCursor(FUserCursor.Clone() as IObjectCursor,Result); + except + FreeAndNil(Result); + raise; + end; + SaveDataToFile(sDATA_FILE_NAME); +End; + +procedure TUserService_ServiceImp.Add(Const AUser : TUser); +var + locObj : TUser; +Begin + locObj := Find(AUser.UserName); + if ( locObj <> nil ) then + raise Exception.CreateFmt('Duplicated user : "%s"',[AUser.UserName]); + locObj := TUser.Create(); + locObj.Assign(AUser); + FUserList.Add(locObj); +End; + +procedure TUserService_ServiceImp.Update(const AUser: TUser); +var + locCrs : IObjectCursor; +Begin + locCrs := FUserCursor.Clone() as IObjectCursor; + locCrs.Reset(); + locCrs := CreateCursorOn(locCrs,ParseFilter(Format('%s=%s',['UserName',QuotedStr(AUser.UserName)]),TUser)); + if locCrs.MoveNext() then begin + (locCrs.GetCurrent() as TUser).Assign(AUser); + end; +end; + +function TUserService_ServiceImp.Find(Const AName : string):TUser; +var + locCrs : IObjectCursor; +Begin + Result := nil; + locCrs := FUserCursor.Clone() as IObjectCursor; + locCrs.Reset(); + locCrs := CreateCursorOn(locCrs,ParseFilter(Format('%s=%s',['UserName',QuotedStr(AName)]),TUser)); + if locCrs.MoveNext() then begin + Result := TUser.Create(); + Result.Assign(locCrs.GetCurrent() as TUser); + end; +End; + +function TUserService_ServiceImp.Delete(Const AName : string):boolean; +var + locCrs : IObjectCursor; +Begin + Result := False; + locCrs := FUserCursor.Clone() as IObjectCursor; + locCrs.Reset(); + locCrs := CreateCursorOn(locCrs,ParseFilter(Format('%s=%s',['UserName',QuotedStr(AName)]),TUser)); + if locCrs.MoveNext() then begin + FUserList.Delete(FUserList.IndexOf(locCrs.GetCurrent() as TUser)); + Result := True; + end; +End; + +procedure RegisterUserServiceImplementationFactory(); +Begin + GetServiceImplementationRegistry().Register('UserService',TImplementationFactory.Create(TUserService_ServiceImp) as IServiceImplementationFactory); +End; + +procedure FillSampleData(); +var + locUser : TUser; +begin + locUser := TUser.Create(); + locUser.UserName := 'Lazarus FreePascal'; + locUser.eMail := 'Lazarus@FreePascal.wst'; + FUserList.Add(locUser); + locUser := TUser.Create(); + locUser.UserName := 'Inoussa OUEDRAOGO'; + locUser.eMail := 'sample@example.wst'; + FUserList.Add(locUser); +end; + +procedure FillDataFromFile(const AFileName : string); +var + objArray : TUserArray; + i : PtrInt; + obj : TUser; +begin + objArray := TUserArray.Create(); + try + LoadObjectFromFile(objArray,AFileName); + FUserList.Clear(); + for i := 0 to Pred(objArray.Length) do begin + obj := TUser.Create(); + FUserList.Add(obj); + obj.Assign(objArray[i]); + end; + finally + FreeAndNil(objArray); + end; +end; + +procedure SaveDataToFile(const AFileName : string); +var + objArray : TUserArray; +begin + objArray := TUserArray.Create(); + try + FUserCursor.Reset(); + FillArrayFromCursor(FUserCursor,objArray); + SaveObjectToFile(objArray,AFileName); + finally + FreeAndNil(objArray); + end; +end; + +initialization + FUserList := TObjectList.Create(True); + FUserCursor := TObjectListCursor.Create(FUserList); + if FileExists(sDATA_FILE_NAME) then + FillDataFromFile(sDATA_FILE_NAME) + else + FillSampleData(); + +finalization + if Assigned(FUserCursor) then + SaveDataToFile(sDATA_FILE_NAME); + FUserCursor := nil; + FreeAndNil(FUserList); + +end. diff --git a/wst/tags/0.4/samples/user_service_intf_proxy.pas b/wst/tags/0.4/samples/user_service_intf_proxy.pas new file mode 100644 index 000000000..bbfc159a9 --- /dev/null +++ b/wst/tags/0.4/samples/user_service_intf_proxy.pas @@ -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 : "6-5-07 16:06:17". +} + +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 + ); + procedure Update( + Const AUser : TUser + ); + function Find( + Const AName : string + ):TUser; + 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 +); +Var + locSerializer : IFormatterClient; + strPrmName : string; +Begin + locSerializer := GetSerializer(); + Try + locSerializer.BeginCall('Add', GetTarget(),(Self as ICallContext)); + locSerializer.Put('AUser', TypeInfo(TUser), AUser); + locSerializer.EndCall(); + + MakeCall(); + + locSerializer.BeginCallRead((Self as ICallContext)); + + Finally + locSerializer.Clear(); + End; +End; + +procedure TUserService_Proxy.Update( + Const AUser : TUser +); +Var + locSerializer : IFormatterClient; + strPrmName : string; +Begin + locSerializer := GetSerializer(); + Try + locSerializer.BeginCall('Update', GetTarget(),(Self as ICallContext)); + locSerializer.Put('AUser', TypeInfo(TUser), AUser); + locSerializer.EndCall(); + + MakeCall(); + + locSerializer.BeginCallRead((Self as ICallContext)); + + Finally + locSerializer.Clear(); + End; +End; + +function TUserService_Proxy.Find( + Const AName : string +):TUser; +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), 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. diff --git a/wst/tags/0.4/server_binary_formatter.pas b/wst/tags/0.4/server_binary_formatter.pas new file mode 100644 index 000000000..a98332897 --- /dev/null +++ b/wst/tags/0.4/server_binary_formatter.pas @@ -0,0 +1,137 @@ +{ + This file is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This file is provide under modified LGPL licence + ( the files COPYING.modifiedLGPL and COPYING.LGPL). + + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +} +unit server_binary_formatter; + +{$INCLUDE wst.inc} + +interface + +uses + Classes, SysUtils, TypInfo, + base_service_intf, server_service_intf, + base_binary_formatter; + +const + sBINARY_CONTENT_TYPE = 'binary'; + + procedure Server_service_RegisterBinaryFormat(); + +implementation + +Type + + { TBinaryFormatter } + + TBinaryFormatter = class(TBaseBinaryFormatter,IFormatterBase,IFormatterResponse) + Private + FCallProcedureName : string; + FCallTarget : string; + Protected + procedure BeginCallResponse(Const AProcName,ATarget:string); + procedure EndCallResponse(); + procedure BeginCallRead(ACallContext : ICallContext); + function GetCallProcedureName():String; + function GetCallTarget():String; + procedure BeginExceptionList( + const AErrorCode : string; + const AErrorMsg : string + ); + procedure EndExceptionList(); + End; + + { TBinaryFormatterFactory } + + TBinaryFormatterFactory = class(TInterfacedObject,IItemFactory) + protected + function CreateInstance():IInterface; + End; + +{ TBinaryFormatterFactory } + +function TBinaryFormatterFactory.CreateInstance(): IInterface; +begin + Result := TBinaryFormatter.Create() as IFormatterResponse; +end; + + +{ TBinaryFormatter } + +procedure TBinaryFormatter.BeginCallResponse(const AProcName, ATarget: string); +begin + BeginObject('Body',Nil); + BeginObject(ATarget,Nil); + BeginObject(AProcName + 'Response',Nil); +end; + +procedure Print(const AMsg:string); +begin + WriteLn(AMsg); +End; + +procedure TBinaryFormatter.EndCallResponse(); +begin + EndScope(); + EndScope(); + EndScope(); + //PrintObj(GetRootData(),0,@Print); +end; + +procedure TBinaryFormatter.BeginCallRead(ACallContext : ICallContext); +Var + s : string; +begin + ClearStack(); + PushStack(GetRootData(),stObject); + s := 'Body'; + BeginObjectRead(s,nil); + FCallTarget := StackTop().GetByIndex(0)^.Name; + BeginObjectRead(FCallTarget,nil); + FCallProcedureName := StackTop().GetByIndex(0)^.Name; + BeginObjectRead(FCallProcedureName,nil); +end; + +function TBinaryFormatter.GetCallProcedureName(): String; +begin + Result := FCallProcedureName; +end; + +function TBinaryFormatter.GetCallTarget(): String; +begin + Result := FCallTarget; +end; + +procedure TBinaryFormatter.BeginExceptionList( + const AErrorCode: string; + const AErrorMsg: string +); +begin + BeginObject('Body',Nil); + BeginObject('Fault',Nil); + Put('faultcode',TypeInfo(string),AErrorCode); + Put('faultstring',TypeInfo(string),AErrorMsg); +end; + +procedure TBinaryFormatter.EndExceptionList(); +begin + EndScope(); + EndScope(); +end; + +procedure Server_service_RegisterBinaryFormat(); +begin + GetFormatterRegistry().Register(sBINARY_CONTENT_TYPE,TBinaryFormatterFactory.Create() as IItemFactory); +end; + +Initialization + +end. diff --git a/wst/tags/0.4/server_service_imputils.pas b/wst/tags/0.4/server_service_imputils.pas new file mode 100644 index 000000000..92e4326dd --- /dev/null +++ b/wst/tags/0.4/server_service_imputils.pas @@ -0,0 +1,105 @@ +{ + This file is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This file is provide under modified LGPL licence + ( the files COPYING.modifiedLGPL and COPYING.LGPL). + + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +} +unit server_service_imputils; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, TypInfo, + server_service_intf; + +Type + + { TRequestBuffer } + + TRequestBuffer = class(TInterfacedObject,IRequestBuffer) + private + FTargetService : string; + FContentType : string; + //FLength : Integer; + FContent : TStream; + FResponse : TStream; + protected + function GetTargetService():string; + function GetContentType():string; + //function GetLength():Integer; + function GetContent():TStream; + function GetResponse():TStream; + public + constructor Create( + ATargetService : string; + AContentType : string; + //ALength : Integer; + AContent : TStream; + AResponse : TStream + ); + End; + + + function IsStrEmpty(Const AStr:String):Boolean; + +implementation + +function IsStrEmpty(Const AStr:String):Boolean; +begin + Result := ( Length(Trim(AStr)) = 0 ); +end; + +{ TRequestBuffer } + +function TRequestBuffer.GetTargetService(): string; +begin + Result := FTargetService; +end; + +function TRequestBuffer.GetContentType(): string; +begin + Result := FContentType; +end; + +{function TRequestBuffer.GetLength(): Integer; +begin + Result := FLength; +end;} + +function TRequestBuffer.GetContent(): TStream; +begin + Result := FContent; +end; + +function TRequestBuffer.GetResponse(): TStream; +begin + Result := FResponse; +end; + +constructor TRequestBuffer.Create( + ATargetService : string; + AContentType : string; + //ALength : Integer; + AContent : TStream; + AResponse : TStream +); +begin + FTargetService := ATargetService; + FContentType := AContentType; + //FLength := ALength; + FContent := AContent; + FResponse := AResponse; +end; + + + + +end. diff --git a/wst/tags/0.4/server_service_intf.pas b/wst/tags/0.4/server_service_intf.pas new file mode 100644 index 000000000..373c7e55f --- /dev/null +++ b/wst/tags/0.4/server_service_intf.pas @@ -0,0 +1,635 @@ +{ + This file is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This file is provide under modified LGPL licence + ( the files COPYING.modifiedLGPL and COPYING.LGPL). + + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +} + +unit server_service_intf; + +{$INCLUDE wst.inc} + +interface + +uses + Classes, SysUtils, TypInfo, Contnrs, + base_service_intf; + +Type + + IRequestBuffer = interface; + IServerService = interface; + IServerServiceRegistry = interface; + IFormatterResponse = interface; + IServiceImplementationRegistry = interface; + IServiceImplementationFactory = interface; + ICallControl = interface; + + IServiceExtension = interface; + IServiceExtensionRegistry = interface; + + ICallControl = interface + ['{7B4B7192-EE96-4B52-92C7-AE855FBC31E7}'] + procedure SetCallContext(ACallContext : ICallContext); + function GetCallContext():ICallContext; + end; + + IRequestBuffer = interface + ['{6BF71D1F-DDC0-4432-83C6-6D50D26762C3}'] + function GetTargetService():string; + function GetContentType():string; + //function GetLength():Integer; + function GetContent():TStream; + function GetResponse():TStream; + End; + + IServerService = Interface + ['{EEBF8E24-8B20-462F-AA4A-48A5C8BAE680}'] + procedure HandleRequest(ARequestBuffer : IRequestBuffer); + End; + + TMessageStage = ( + msAfterDeserialize, msAfterSerialize, msBeforeDeserialize, msBeforeSerialize + ); + IServiceExtension = interface + ['{E192E6B3-7932-4D44-A8AC-135D7A0B8C93}'] + procedure ProcessMessage( + const AMessageStage : TMessageStage; + ACallContext : ICallContext; + AMsgData : IInterface + { The "AMsgData" parameter actual type depends on the message state + on correspond to : + - IRequestBuffer on "msBeforeDeserialize" and "msAfterSerialize" + - IFormatterResponse on "msAfterDeserialize", "msBeforeSerialize" + } + ); + end; + + IServiceExtensionRegistry = Interface + ['{68DC78F1-E6CF-4D6B-8473-75288794769C}'] + function Find(const AName : string):IServiceExtension; + procedure Register( + const AName : string; + AFactory : IItemFactory + ); + end; + + IServerServiceRegistry = Interface + ['{83E7BBEB-A33D-4A3E-896D-D351C2819009}'] + function Find(const AServiceName : string):IServerService; + procedure Register( + const AServiceName : string; + AFactory : IItemFactory + ); + End; + + IServiceImplementationFactory = interface(IItemFactoryEx) + ['{23A745BC-5F63-404D-BF53-55A6E64DE5BE}'] + procedure RegisterExtension( + const AExtensionList : array of string + ); + function GetExtension( + out AExtensionList : string + ) : Boolean; + end; + + IServiceImplementationRegistry = Interface + ['{0AE04033-475E-4FD5-88BD-9F816FD53A97}'] + function FindFactory(const AServiceName : string):IServiceImplementationFactory; + function Register( + const AServiceName : string; + AFactory : IServiceImplementationFactory + ) : IServiceImplementationFactory; + End; + + IFormatterResponse = Interface(IFormatterBase) + ['{CA7538D4-2C16-48C2-9F39-ACE45FEBB27E}'] + procedure BeginCallResponse(Const AProcName,ATarget:string); + procedure EndCallResponse(); + procedure BeginCallRead(ACallContext : ICallContext); + function GetCallProcedureName():String; + function GetCallTarget():String; + procedure BeginExceptionList( + const AErrorCode : string; + const AErrorMsg : string + ); + procedure EndExceptionList(); + End; + + TServiceVerbMethod = procedure(AFormatter:IFormatterResponse) of object; + + { TBaseServiceBinder } + + TBaseServiceBinder = Class(TInterfacedObject,IServerService) + Private + FVerbList : TObjectList; + FImplementationFactory : IServiceImplementationFactory; + FCallContext : ICallContext; + Protected + procedure RegisterVerbHandler( + const AVerb : string; + AVerbHandler : TServiceVerbMethod + ); + function FindVerbHandler(const AVerb : string):TServiceVerbMethod; + procedure HandleRequest(ARequestBuffer : IRequestBuffer); + function GetFactory():IItemFactory; + function CreateCallContext():ICallContext;virtual; + function GetCallContext():ICallContext; + procedure DoProcessMessage( + const AMessageStage : TMessageStage; + ACallContext : ICallContext; + AMsgData : IInterface + ); + Public + constructor Create(AImplementationFactory : IServiceImplementationFactory); + destructor Destroy();override; + procedure Error(Const AMsg : string);overload; + procedure Error(Const AMsg : string;Const AArgs : Array of Const);overload; + End; + + { TBaseServiceImplementation } + + TBaseServiceImplementation = class(TSimpleFactoryItem,ICallControl) + private + FCallContext : ICallContext; + protected + procedure SetCallContext(ACallContext : ICallContext); + function GetCallContext():ICallContext; + End; + + + { TImplementationFactory } + + TImplementationFactory = class( + TSimpleItemFactoryEx, + IInterface, + IItemFactory, + IItemFactoryEx, + IServiceImplementationFactory + ) + protected + procedure RegisterExtension( + const AExtensionList : array of string + ); + function GetExtension( + out AExtensionList : string + ) : Boolean; + end; + + + procedure HandleServiceRequest( + ARequestBuffer : IRequestBuffer; + AServiceRegistry : IServerServiceRegistry = Nil + ); + function GetFormatterRegistry():IFormatterRegistry; + function GetServerServiceRegistry():IServerServiceRegistry; + function GetServiceImplementationRegistry():IServiceImplementationRegistry ; + function GetServiceExtensionRegistry():IServiceExtensionRegistry; + +implementation +Var + FormatterRegistryInst : IFormatterRegistry = Nil; + ServerServiceRegistryInst : IServerServiceRegistry = Nil; + ServiceImplementationRegistryInst : IServiceImplementationRegistry = Nil; + ServiceExtensionRegistryInst : IServiceExtensionRegistry = nil; + +procedure HandleServiceRequest( + ARequestBuffer : IRequestBuffer; + AServiceRegistry : IServerServiceRegistry +); +Var + sr : IServerServiceRegistry; + s : IServerService; + svcName : string; +Begin + Assert(Assigned(ARequestBuffer)); + If Assigned(AServiceRegistry) Then + sr := AServiceRegistry + Else + sr := GetServerServiceRegistry(); + svcName := ARequestBuffer.GetTargetService(); + s := sr.Find(svcName); + If Not Assigned(s) Then + Raise EServiceException.CreateFmt('Service not found : "%s"',[svcName]); + s.HandleRequest(ARequestBuffer); +End; + +Type + + TFormatterRegistry = class(TBaseFactoryRegistry,IFormatterRegistry) + protected + function Find(const AFormatterName : string):IFormatterBase; + End; + + { TServerServiceRegistry } + + TServerServiceRegistry = class(TBaseFactoryRegistry,IServerServiceRegistry) + protected + function Find(const AServiceName : string):IServerService; + End; + +{ TServerServiceRegistry } + +function TServerServiceRegistry.Find(const AServiceName: string): IServerService; +Var + fct : IItemFactory; +begin + fct := FindFactory(AServiceName); + If Assigned(fct) Then + Result := fct.CreateInstance() as IServerService + Else + Result := Nil; +end; + +function TFormatterRegistry.Find(const AFormatterName: string): IFormatterBase; +Var + fct : IItemFactory; +begin + fct := FindFactory(AFormatterName); + If Assigned(fct) Then + Result := fct.CreateInstance() as IFormatterBase + Else + Result := Nil; +end; + +Type + + { TServiceVerbItem } + + TServiceVerbItem = class + private + FVerb: string; + FVerbHandler: TServiceVerbMethod; + public + constructor Create( + const AVerb : string; + AVerbHandler : TServiceVerbMethod + ); + property Verb : string Read FVerb; + property VerbHandler : TServiceVerbMethod Read FVerbHandler; + End; + +{ TServiceVerbItem } + +constructor TServiceVerbItem.Create( + const AVerb: string; + AVerbHandler: TServiceVerbMethod +); +begin + FVerb := AVerb; + FVerbHandler := AVerbHandler; +end; + +{ TBaseServiceBinder } + +procedure TBaseServiceBinder.RegisterVerbHandler( + const AVerb : string; + AVerbHandler : TServiceVerbMethod +); +Var + s : string; +begin + Assert(Assigned(AVerbHandler)); + s := LowerCase(Trim(AVerb)); + If Not Assigned(FindVerbHandler(s)) Then + FVerbList.Add(TServiceVerbItem.Create(s,AVerbHandler)); +end; + +function TBaseServiceBinder.FindVerbHandler(const AVerb: string):TServiceVerbMethod; +Var + i : Integer; + s : string; +begin + s := LowerCase(Trim(AVerb)); + For i := 0 To Pred(FVerbList.Count) Do Begin + If AnsiSameText(TServiceVerbItem(FVerbList[i]).Verb,s) Then Begin + Result := TServiceVerbItem(FVerbList[i]).VerbHandler; + Exit; + End; + End; + Result := Nil; +end; + +procedure TBaseServiceBinder.HandleRequest(ARequestBuffer: IRequestBuffer); +Var + f : IFormatterResponse; + s : string; + m : TServiceVerbMethod; + strm : TStream; + cllCtx : ICallContext; + i : Integer; + hdr : THeaderBlock; + typRegItm : TTypeRegistryItem; +begin + s := ARequestBuffer.GetContentType(); + f := GetFormatterRegistry().Find(s) as IFormatterResponse; + if not Assigned(f) then + Error('No formatter for that content type : "%s"',[s]); + try + cllCtx := GetCallContext(); + DoProcessMessage(msBeforeDeserialize,cllCtx,ARequestBuffer); + strm := ARequestBuffer.GetContent(); + f.LoadFromStream(strm); + f.BeginCallRead(GetCallContext()); + DoProcessMessage(msAfterDeserialize,cllCtx,f); + s := f.GetCallProcedureName(); + m := FindVerbHandler(s); + if not Assigned(m) then + Error('No handler for that verb : "%s"',[s]); + m(f); + for i := 0 to Pred(cllCtx.GetHeaderCount(AllHeaderDirection)) do begin + hdr := cllCtx.GetHeader(i); + if ( hdr.Direction = hdIn ) and ( hdr.mustUnderstand <> 0 ) and ( not hdr.Understood ) then begin + typRegItm := GetTypeRegistry().Find(hdr.ClassName); + if Assigned(typRegItm) then + s := typRegItm.DeclaredName + else + s := hdr.ClassName; + Error('Header "%s" not Understood.',[s]); + end; + end; + except + on e : Exception do begin + f.Clear(); + f.SetSerializationStyle(ssNodeSerialization); + f.BeginExceptionList('Server',E.Message); + f.EndExceptionList(); + end; + end; + strm := ARequestBuffer.GetResponse(); + DoProcessMessage(msBeforeSerialize,cllCtx,f); + f.SaveToStream(strm); + DoProcessMessage(msAfterSerialize,cllCtx,ARequestBuffer); +end; + +function TBaseServiceBinder.GetFactory(): IItemFactory; +begin + Result := FImplementationFactory; +end; + +function TBaseServiceBinder.CreateCallContext(): ICallContext; +begin + if not Assigned(FCallContext) then + FCallContext := TSimpleCallContext.Create() as ICallContext; + Result := FCallContext; +end; + +function TBaseServiceBinder.GetCallContext(): ICallContext; +begin + if not Assigned(FCallContext) then + CreateCallContext(); + Result := FCallContext; +end; + +procedure TBaseServiceBinder.DoProcessMessage( + const AMessageStage : TMessageStage; + ACallContext : ICallContext; + AMsgData : IInterface +); +var + s : string; + ls : TStringList; + i : Integer; + exreg : IServiceExtensionRegistry; + se : IServiceExtension; +begin + exreg := GetServiceExtensionRegistry(); + if FImplementationFactory.GetExtension(s) then begin + ls := TStringList.Create(); + try + ls.QuoteChar := #0; + ls.Delimiter := PROP_LIST_DELIMITER; + ls.DelimitedText := s; + for i := 0 to Pred(ls.Count) do begin + s := ls[i]; + se := exreg.Find(s); + if Assigned(se) then + se.ProcessMessage(AMessageStage,ACallContext,AMsgData); + end; + finally + ls.Free(); + end; + end; +end; + +constructor TBaseServiceBinder.Create(AImplementationFactory : IServiceImplementationFactory); +begin + Assert(Assigned(AImplementationFactory)); + FImplementationFactory := AImplementationFactory; + FVerbList := TObjectList.Create(True); +end; + +destructor TBaseServiceBinder.Destroy(); +begin + FVerbList.Free(); + inherited Destroy(); +end; + +procedure TBaseServiceBinder.Error(const AMsg: string); +begin + Raise EServiceException.Create(AMsg); +end; + +procedure TBaseServiceBinder.Error(const AMsg: string;const AArgs: array of const); +begin + Raise EServiceException.CreateFmt(AMsg,AArgs); +end; + +function GetFormatterRegistry():IFormatterRegistry; +begin + Result := FormatterRegistryInst; +end; + +function GetServerServiceRegistry():IServerServiceRegistry; +begin + Result := ServerServiceRegistryInst; +end; + +Type + + { TServiceImplementationRegistry } + + TServiceImplementationRegistry = class(TInterfacedObject,IInterface,IServiceImplementationRegistry) + private + FList : TObjectList; + protected + function FindFactory(const AServiceName : string): IServiceImplementationFactory; + function Register( + const AServiceName : string; + AFactory : IServiceImplementationFactory + ) : IServiceImplementationFactory; + public + constructor Create(); + destructor Destroy();override; + End; + + { TServiceImplementationRegistryItem } + + TServiceImplementationRegistryItem = class + private + FFactory: IServiceImplementationFactory; + FItemTypeInfo: string; + public + constructor Create( + const AItemTypeInfo : string; + AFactory : IServiceImplementationFactory + ); + property ItemTypeInfo : string Read FItemTypeInfo; + property Factory : IServiceImplementationFactory Read FFactory; + End; + +function TServiceImplementationRegistry.FindFactory( + const AServiceName : string +): IServiceImplementationFactory; +Var + i : Integer; +begin + For i := 0 To Pred(FList.Count) Do Begin + If ( AServiceName = TServiceImplementationRegistryItem(FList[i]).ItemTypeInfo ) Then Begin + Result := TServiceImplementationRegistryItem(FList[i]).Factory; + Exit; + End; + End; + Result := Nil; +end; + +function TServiceImplementationRegistry.Register( + const AServiceName : string; + AFactory : IServiceImplementationFactory +) : IServiceImplementationFactory; +begin + Assert(Assigned(AFactory)); + if not Assigned(FindFactory(AServiceName)) then + FList.Add(TServiceImplementationRegistryItem.Create(AServiceName,AFactory)); + Result := AFactory; +end; + +constructor TServiceImplementationRegistry.Create(); +begin + FList := TObjectList.Create(True); + inherited Create(); +end; + +destructor TServiceImplementationRegistry.Destroy(); +begin + FreeAndNil(FList); + inherited Destroy(); +end; + +{ TServiceImplementationRegistryItem } + +constructor TServiceImplementationRegistryItem.Create( + const AItemTypeInfo: string; + AFactory: IServiceImplementationFactory +); +begin + Assert(Assigned(AFactory)); + FItemTypeInfo := AItemTypeInfo; + FFactory := AFactory; +end; + +function GetServiceImplementationRegistry():IServiceImplementationRegistry ; +begin + Result := ServiceImplementationRegistryInst; +end; + +{ TBaseServiceImplementation } + +procedure TBaseServiceImplementation.SetCallContext(ACallContext: ICallContext); +begin + FCallContext := ACallContext; +end; + +function TBaseServiceImplementation.GetCallContext(): ICallContext; +begin + Result := FCallContext; +end; + + +{ TImplementationFactory } +const sSERVICES_EXTENSIONS = 'extensions';sLIST = 'list'; +procedure TImplementationFactory.RegisterExtension( + const AExtensionList : array of string +); +var + pmngr : IPropertyManager; + i : Integer; + strBuffer, s : string; +begin + if ( Length(AExtensionList) > 0 ) then begin + pmngr := GetPropertyManager(sSERVICES_EXTENSIONS,True); + strBuffer := ''; + for i := Low(AExtensionList) to High(AExtensionList) do begin + s := Trim(AExtensionList[i]); + if ( Length(s) > 0 ) then + strBuffer := strBuffer + ';' + s; + end; + if ( Length(strBuffer) > 0 ) then begin + s:= Trim(pmngr.GetProperty(sLIST)); + if ( Length(s) = 0 ) then + Delete(strBuffer,1,1); + s := s + strBuffer; + pmngr.SetProperty(sLIST,s); + end; + end; +end; + +function TImplementationFactory.GetExtension( + out AExtensionList : string +): Boolean; +var + pmngr : IPropertyManager; +begin + pmngr := GetPropertyManager(sSERVICES_EXTENSIONS,False); + if Assigned(pmngr) then + AExtensionList := Trim(pmngr.GetProperty(sLIST)) + else + AExtensionList := ''; + Result := ( Length(AExtensionList) > 0 ); +end; + +type + + { TServiceExtensionRegistry } + + TServiceExtensionRegistry = class(TBaseFactoryRegistry,IServiceExtensionRegistry) + protected + function Find(const AName : string):IServiceExtension; + End; + +{ TServiceExtensionRegistry } + +function TServiceExtensionRegistry.Find(const AName: string): IServiceExtension; +Var + fct : IItemFactory; +begin + fct := FindFactory(AName); + If Assigned(fct) Then + Result := fct.CreateInstance() as IServiceExtension + Else + Result := Nil; +end; + +function GetServiceExtensionRegistry():IServiceExtensionRegistry ; +begin + Result := ServiceExtensionRegistryInst; +end; + +Initialization + FormatterRegistryInst := TFormatterRegistry.Create() as IFormatterRegistry; + ServerServiceRegistryInst := TServerServiceRegistry.Create() as IServerServiceRegistry; + ServiceImplementationRegistryInst := TServiceImplementationRegistry.Create() As IServiceImplementationRegistry; + ServiceExtensionRegistryInst := TServiceExtensionRegistry.Create() as IServiceExtensionRegistry; + +Finalization + ServiceExtensionRegistryInst := nil; + ServiceImplementationRegistryInst := Nil; + ServerServiceRegistryInst := Nil; + FormatterRegistryInst := Nil; +end. diff --git a/wst/tags/0.4/server_service_soap.pas b/wst/tags/0.4/server_service_soap.pas new file mode 100644 index 000000000..7fc174403 --- /dev/null +++ b/wst/tags/0.4/server_service_soap.pas @@ -0,0 +1,201 @@ +{ + This file is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This file is provide under modified LGPL licence + ( the files COPYING.modifiedLGPL and COPYING.LGPL). + + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +} +unit server_service_soap; + +{$INCLUDE wst.inc} + +interface + +uses + Classes, SysUtils, TypInfo, DOM, + base_service_intf, server_service_intf, server_service_imputils, + base_soap_formatter; + +Type + + { TSOAPFormatter } + +{$M+} + TSOAPFormatter = class(TSOAPBaseFormatter,IFormatterBase,IFormatterResponse) + private + FCallProcedureName : string; + FCallTarget : String; + FCallContext : ICallContext; + public + + procedure BeginCallResponse(Const AProcName,ATarget:string); + procedure EndCallResponse(); + + procedure BeginCallRead(ACallContext : ICallContext); + function GetCallProcedureName():String; + function GetCallTarget():String; + + procedure BeginExceptionList( + const AErrorCode : string; + const AErrorMsg : string + ); + procedure EndExceptionList(); + End; + + procedure Server_service_RegisterSoapFormat(); + +implementation + +Const NAMESPACE_SEPARATOR = ':'; +function ExtractNamespacePart( Const AQualifiedName : string):String; +Var + i : Integer; +begin + Result := ''; + i := Pos(NAMESPACE_SEPARATOR,AQualifiedName); + If ( i <= 0 ) Then + Exit; + Result := Copy(AQualifiedName,1,Pred(i)); +end; + +function ExtractNamePart(Const AQualifiedName : string):String; +Var + i : Integer; +begin + i := Pos(NAMESPACE_SEPARATOR,AQualifiedName); + If ( i <= 0 ) Then + i := 0; + Result := Copy(AQualifiedName,Succ(i),MaxInt); +end; + +{ TSOAPFormatter } + +procedure TSOAPFormatter.BeginCallResponse(Const AProcName,ATarget:string); +begin + Clear(); + Prepare(); + WriteHeaders(FCallContext); + BeginScope('Body',sSOAP_ENV,'',stObject,asNone); + BeginScope(AProcName + 'Response',ATarget,'',stObject,asNone); +end; + +procedure TSOAPFormatter.EndCallResponse(); +begin + EndScope(); //BeginScope(AProcName,ATarget); + EndScope(); //BeginScope('Body','http://schemas.xmlsoap.org/soap/envelope/'); + EndScope(); //BeginScope('Envelope','http://schemas.xmlsoap.org/soap/envelope/','SOAP-ENV'); +end; + +procedure TSOAPFormatter.BeginCallRead(ACallContext : ICallContext); +Var + envNd : TDOMElement; + hdrNd, bdyNd, mthdNd, tmpNode : TDOMNode; + s,nsShortName,eltName : string; + doc : TXMLDocument; +begin + FCallContext := ACallContext; + ClearStack(); + doc := GetXmlDoc(); + If FindAttributeByValueInNode(sSOAP_ENV,doc.DocumentElement,nsShortName) Then Begin + nsShortName := Copy(nsShortName,1 + Pos(':',nsShortName),MaxInt); + If Not IsStrEmpty(nsShortName) Then + nsShortName := nsShortName + ':'; + End Else + nsShortName := ''; + eltName := nsShortName + 'Envelope'; + envNd := doc.DocumentElement; + If Not SameText(eltName,envNd.NodeName) Then + Error('XML root node must be "Envelope".'); + PushStack(envNd).SetNameSpace(sSOAP_ENV); + + bdyNd := envNd.FirstChild; + If Not Assigned(bdyNd) Then + Error('Node not found : "Body".'); + + eltName := nsShortName + 'Body'; + if not SameText(bdyNd.NodeName,eltName) then begin + eltName := nsShortName + 'Header'; + hdrNd := bdyNd; + bdyNd := hdrNd.NextSibling; + if SameText(hdrNd.NodeName,eltName) then begin + PushStack(hdrNd,asScoped,'').SetNameSpace(sSOAP_ENV); + ReadHeaders(FCallContext); + PopStack().Free(); + end; + end; + + eltName := nsShortName + 'Body'; + If Not Assigned(bdyNd) Then + Error('Node not found : "Body".'); + PushStack(bdyNd).SetNameSpace(sSOAP_ENV); + If Not Assigned(bdyNd.FirstChild) Then + Error('Method Node not found.'); + mthdNd := bdyNd.FirstChild; + PushStack(mthdNd); + s := mthdNd.NodeName; + nsShortName := ExtractNamespacePart(s); + If IsStrEmpty(nsShortName) Then + Error('Method Node must have a qualified name.'); + FCallProcedureName := ExtractNamePart(s); + If IsStrEmpty(FCallProcedureName) Then + Error('No Method name.'); + tmpNode := mthdNd.Attributes.GetNamedItem(sXML_NS + ':' + nsShortName); + If Not Assigned(tmpNode) Then + Error('Call target attribute not found.'); + FCallTarget := tmpNode.NodeValue; +end; + +function TSOAPFormatter.GetCallProcedureName(): String; +begin + Result := FCallProcedureName; +end; + +function TSOAPFormatter.GetCallTarget(): String; +begin + Result := FCallTarget; +end; + +procedure TSOAPFormatter.BeginExceptionList( + const AErrorCode: string; + const AErrorMsg: string +); +Var + c,m :string; +begin + If IsStrEmpty(AErrorCode) Then + c := 'SOAP-ENV:Server' + Else + c := AErrorCode; + If IsStrEmpty(AErrorMsg) Then + m := 'Server Error' + Else + m := AErrorMsg; + Clear(); + BeginScope('Envelope',sSOAP_ENV,'SOAP-ENV',stObject,asNone); + AddScopeAttribute('xmlns:xsi',sXSI_NS); + AddScopeAttribute('xmlns:'+sXSD, sXSD_NS); + BeginScope('Body',sSOAP_ENV,'',stObject,asNone); + BeginScope('Fault',sSOAP_ENV,'',stObject,asNone); + Put('faultcode',TypeInfo(string),c); + Put('faultstring',TypeInfo(string),m); +end; + +procedure TSOAPFormatter.EndExceptionList(); +begin + EndScope(); //BeginScope('Fault',sSOAP_ENV); + EndScope(); //BeginScope('Body','http://schemas.xmlsoap.org/soap/envelope/'); + EndScope(); //BeginScope('Envelope','http://schemas.xmlsoap.org/soap/envelope/','SOAP-ENV'); +end; + +procedure Server_service_RegisterSoapFormat(); +begin + GetFormatterRegistry().Register(sSOAP_CONTENT_TYPE,TSimpleItemFactory.Create(TSOAPFormatter) as IItemFactory); + RegisterStdTypes(); +end; + +end. diff --git a/wst/tags/0.4/service_intf.pas b/wst/tags/0.4/service_intf.pas new file mode 100644 index 000000000..bd3280177 --- /dev/null +++ b/wst/tags/0.4/service_intf.pas @@ -0,0 +1,594 @@ +{ + This file is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This file is provide under modified LGPL licence + ( the files COPYING.modifiedLGPL and COPYING.LGPL). + + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +} + +{ Base service interface } + +unit service_intf; + +interface + +uses + Classes, SysUtils, TypInfo, Contnrs, + base_service_intf; + +{$INCLUDE wst.inc} + +Const + sTARGET = 'target'; + +Type + + ITransport = Interface + ['{AEB6677A-9620-4E7D-82A0-43E3C4C52B43}'] + function GetPropertyManager():IPropertyManager; + procedure SendAndReceive(ARequest,AResponse:TStream); + End; + + //The client formater interface, used to marshall parameters. + IFormatterClient = Interface(IFormatterBase) + ['{73746BC7-CA43-4C00-8789-71E23033C3B2}'] + function GetPropertyManager():IPropertyManager; + + procedure BeginCall( + const AProcName, + ATarget : string; + ACallContext : ICallContext + ); + procedure EndCall(); + procedure BeginCallRead(ACallContext : ICallContext); + function GetCallProcedureName():String; + function GetCallTarget():String; + End; + + (* This interface is used with IFormatterClient to handle messages *) + ICallMaker = Interface + ['{4CF7B98B-8C37-479F-AFF3-822FCCEECEC8}'] + function GetPropertyManager():IPropertyManager; + procedure MakeCall( + ASerializer : IFormatterClient; + ATransport : ITransport + ); + End; + + + (* A service protocol is defined by : + - a marshaller + - a call handler for that marshaller + - and a tranport. *) + IServiceProtocol = Interface + ['{777FE102-0F6C-495C-9A92-528D07F1C60C}'] + function GetSerializer() : IFormatterClient; // the marshaller >> SOAP, XML-RPC, Binary,... + function GetCallHandler() : ICallMaker; // Call handler >> SOAP call handler, XML-RPC call handler, ... + function GetTransport() : ITransport; // the transport >> HTTP, TCP, named pipes, ... + procedure SetTransport(AValue : ITransport); + End; + + + { TBaseProxy } + (* The base class for service proxy *) + TBaseProxy = Class(TInterfacedObject,IInterface,ICallContext) + private + FTarget : String; + FProtocol : IServiceProtocol; + FOperationsProperties : TStrings; + private + procedure LoadProperties(); + protected + function GetTarget():String; + function GetSerializer() : IFormatterClient; + function GetCallHandler() : ICallMaker; + function GetTransport() : ITransport; + procedure MakeCall(); + class function GetServiceType() : PTypeInfo;virtual;abstract; + + // ---- BEGIN >> ICallContext implementation ---- + private + FCallContext : ICallContext; + protected + procedure AddObjectToFree(const AObject : TObject); + procedure Clear(); + function AddHeader( + const AHeader : THeaderBlock; + const AKeepOwnership : Boolean + ):Integer; + function GetHeaderCount(const ADirections : THeaderDirections):Integer; + function GetHeader(const AIndex : Integer) : THeaderBlock; + // ---- END >> ICallContext implementation ---- + procedure ClearHeaders(const ADirection : THeaderDirection); + public + (* This is the primary constructor! *) + constructor Create( + Const ATarget : String; // the target service + Const AProtocol : IServiceProtocol + );overload;virtual; + (* A User friendly constructor *) + constructor Create( + Const ATarget : String; + Const AProtocolData : string; + Const ATransportData : string + );overload;virtual; + destructor Destroy();override; + End; + + + IFormaterQueryRegistry = Interface + ['{037907E1-5E44-4A91-B290-CA70ACACF5E6}'] + function Find( + Const AProtocolData : string; + Out ARes : IServiceProtocol + ):Boolean; + procedure Register( + Const AProtocolName : string; + AFormaterFactory : IItemFactory; + ACallHandlerFactory : IItemFactory + ); + End; + + ITransportRegistry = Interface + ['{ED34F7A2-2335-4FD3-A457-2B8C4349664E}'] + function Find( + Const ATransportData : string; + Out ARes : ITransport + ):Boolean; + procedure Register( + const ATransportName : string; + AFactory : IItemFactory + ); + End; + + function GetFormaterRegistry():IFormaterQueryRegistry; + function GetTransportRegistry():ITransportRegistry; + +implementation +uses imp_utils, metadata_repository; + +{ TBaseProxy } + +procedure TBaseProxy.LoadProperties(); +var + pd : PPropertyData; + i : Integer; + sd : PService; + opd : PServiceOperation; + mm : IModuleMetadataMngr; + strTransportBuffer, strFormatBuffer, strName : string; +begin + if not Assigned(FOperationsProperties) then begin + FOperationsProperties := TStringList.Create(); + mm := GetModuleMetadataMngr(); + sd := mm.GetServiceMetadata(GetTypeData(GetServiceType())^.IntfUnit,GetServiceType()^.Name); + try + Assert(Assigned(sd)); + opd := sd^.Operations; + for i := 0 to Pred(sd^.OperationsCount) do begin + strFormatBuffer := ''; + strTransportBuffer := ''; + pd := opd^.Properties; + while Assigned(pd) do begin + strName := ExtractOptionName(pd^.Name); + if ( AnsiPos(sFORMAT + '_',pd^.Name) = 1 ) then begin + if ( Length(strName) > 0 ) then begin + strFormatBuffer := Format('%s%s=%s;',[strFormatBuffer,strName,pd^.Data]); + end; + end else if ( AnsiPos(sTRANSPORT + '_',pd^.Name) = 1 ) then begin + if ( Length(strName) > 0 ) then begin + strTransportBuffer := Format('%s%s=%s;',[strTransportBuffer,strName,pd^.Data]); + end; + end; + pd := pd^.Next; + end; + if not IsStrEmpty(strFormatBuffer) then begin + Delete(strFormatBuffer,Length(strFormatBuffer),1); + FOperationsProperties.Values[opd^.Name + '_' + sFORMAT] := strFormatBuffer; + end; + if not IsStrEmpty(strTransportBuffer) then begin + Delete(strTransportBuffer,Length(strTransportBuffer),1); + FOperationsProperties.Values[opd^.Name + '_' + sTRANSPORT] := strTransportBuffer; + end; + Inc(opd); + end; + finally + mm.ClearServiceMetadata(sd); + end; + end; +end; + +function TBaseProxy.GetTarget(): String; +begin + Result := FTarget; +end; + +function TBaseProxy.GetSerializer(): IFormatterClient; +begin + Result := FProtocol.GetSerializer(); +end; + +function TBaseProxy.GetCallHandler(): ICallMaker; +begin + Result := FProtocol.GetCallHandler(); +end; + +function TBaseProxy.GetTransport(): ITransport; +begin + Result := FProtocol.GetTransport(); +end; + +procedure TBaseProxy.MakeCall(); +var + trans : ITransport; + frmt : IFormatterClient; + + procedure PrepareCall(); + var + strBuffer, strName : string; + begin + LoadProperties(); + strName := frmt.GetCallProcedureName() + '_'; + strBuffer := FOperationsProperties.Values[strName + sTRANSPORT]; + if not IsStrEmpty(strBuffer) then + trans.GetPropertyManager().SetProperties(strBuffer); + strBuffer := FOperationsProperties.Values[strName + sFORMAT]; + if not IsStrEmpty(strBuffer) then + frmt.GetPropertyManager().SetProperties(strBuffer); + end; + +begin + trans := GetTransport(); + frmt := GetSerializer(); + PrepareCall(); + GetCallHandler().MakeCall(frmt,trans); +end; + +procedure TBaseProxy.AddObjectToFree(const AObject: TObject); +begin + FCallContext.AddObjectToFree(AObject); +end; + +procedure TBaseProxy.Clear(); +begin + FCallContext.Clear(); +end; + +function TBaseProxy.AddHeader( + const AHeader: THeaderBlock; + const AKeepOwnership: Boolean +): Integer; +begin + Result := FCallContext.AddHeader(AHeader,AKeepOwnership); +end; + +function TBaseProxy.GetHeaderCount(const ADirections : THeaderDirections):Integer; +begin + Result := FCallContext.GetHeaderCount(ADirections); +end; + +function TBaseProxy.GetHeader(const AIndex: Integer): THeaderBlock; +begin + Result := FCallContext.GetHeader(AIndex); +end; + +procedure TBaseProxy.ClearHeaders(const ADirection: THeaderDirection); +begin + FCallContext.ClearHeaders(ADirection); +end; + +constructor TBaseProxy.Create( + const ATarget : String; + const AProtocol : IServiceProtocol +); +begin + Assert(Assigned(AProtocol)); + Assert(Assigned(AProtocol.GetCallHandler())); + Assert(Assigned(AProtocol.GetSerializer())); + Assert(Assigned(AProtocol.GetTransport())); + FCallContext := TSimpleCallContext.Create() as ICallContext; + FTarget := ATarget; + FProtocol := AProtocol; + FProtocol.GetSerializer().GetPropertyManager().SetProperty(sTARGET,FTarget); + FProtocol.GetCallHandler().GetPropertyManager().SetProperty(sTARGET,FTarget); +end; + +constructor TBaseProxy.Create( + const ATarget: String; + const AProtocolData: string; + const ATransportData: string +); +Var + ptcl : IServiceProtocol; + tmpTrprt : ITransport; +begin + ptcl := Nil; + If GetFormaterRegistry().Find(AProtocolData,ptcl) And + GetTransportRegistry().Find(ATransportData,tmpTrprt) + Then Begin + ptcl.SetTransport(tmpTrprt); + Create(ATarget,ptcl); + End; +end; + +destructor TBaseProxy.Destroy(); +begin + FProtocol := Nil; + FreeAndNil(FOperationsProperties); + inherited Destroy(); +end; + +Const PROTOCOL_SEPARATOR = ':'; +function ExtractProtocol( Const AProtocolName : string):String; +Var + i : Integer; +begin + i := Pos(PROTOCOL_SEPARATOR,AProtocolName); + If ( i <= 0 ) Then + i := MaxInt; + Result := lowercase(Copy(AProtocolName,1,Pred(i))); +end; + +function ExtractProtocolData(Const AProtocolPropsStr : string):String; +Var + i : Integer; +begin + i := Pos(PROTOCOL_SEPARATOR,AProtocolPropsStr); + If ( i <= 0 ) Then + i := 0; + Result := Copy(AProtocolPropsStr,Succ(i),MaxInt); +end; + +Type + + { TFormatterFactoryRegistryItem } + + { TServiceProtocol } + + TServiceProtocol = class(TInterfacedObject,IInterface,IServiceProtocol) + Private + FFormatter : IFormatterClient; + FCallHandler : ICallMaker; + FTransport : ITransport; + Protected + function GetSerializer() : IFormatterClient; + function GetCallHandler() : ICallMaker; + function GetTransport() : ITransport; + procedure SetTransport(AValue : ITransport); + Public + constructor Create( + AFormatter : IFormatterClient; + ACallHandler : ICallMaker + ); + End; + + TFormatterFactoryRegistryItem = class + private + FCallHandlerFactory: IItemFactory; + FFormaterFactory: IItemFactory; + FProtocolName: string; + public + constructor Create( + Const AProtocolName : string; + AFormaterFactory : IItemFactory; + ACallHandlerFactory : IItemFactory + ); + destructor Destroy();override; + property ProtocolName : string Read FProtocolName; + property FormaterFactory : IItemFactory Read FFormaterFactory; + property CallHandlerFactory : IItemFactory Read FCallHandlerFactory; + End; + + { TFormatterRegistry } + //Make it Threadsafe ??? + TFormatterRegistry = class(TInterfacedObject,IInterface,IFormaterQueryRegistry) + private + FList : TObjectList; + function IndexOf(Const AName : string ):Integer; + procedure Clear(); + function GetCount():Integer; + function GetItem(const AIndex:Integer): TFormatterFactoryRegistryItem; + protected + function Find( + Const AProtocolData : string; + Out ARes : IServiceProtocol + ):Boolean; + procedure Register( + Const AProtocolName : string; + AFormaterFactory : IItemFactory; + ACallHandlerFactory : IItemFactory + ); + public + constructor Create(); + destructor Destroy();override; + End; + +{ TServiceProtocol } + +function TServiceProtocol.GetSerializer(): IFormatterClient; +begin + Result := FFormatter; +end; + +function TServiceProtocol.GetCallHandler(): ICallMaker; +begin + Result := FCallHandler; +end; + +function TServiceProtocol.GetTransport(): ITransport; +begin + Result := FTransport; +end; + +procedure TServiceProtocol.SetTransport(AValue: ITransport); +begin + FTransport := AValue; +end; + +constructor TServiceProtocol.Create(AFormatter: IFormatterClient;ACallHandler: ICallMaker); +begin + FFormatter := AFormatter; + FCallHandler := ACallHandler; +end; + +{ TFormatterFactoryRegistryItem } + +constructor TFormatterFactoryRegistryItem.Create( + const AProtocolName: string; + AFormaterFactory: IItemFactory; ACallHandlerFactory: IItemFactory); +begin + FProtocolName := AProtocolName; + FFormaterFactory := AFormaterFactory; + FCallHandlerFactory := ACallHandlerFactory; +end; + +destructor TFormatterFactoryRegistryItem.Destroy(); +begin + FFormaterFactory := nil; + FCallHandlerFactory := nil; + inherited Destroy(); +end; + +Var + FormaterRegistryInst : IFormaterQueryRegistry = Nil; +function GetFormaterRegistry():IFormaterQueryRegistry; +begin + If Not Assigned(FormaterRegistryInst) Then + FormaterRegistryInst := TFormatterRegistry.Create() as IFormaterQueryRegistry;// Lock!!! + Result := FormaterRegistryInst; +end; + +{ TFormatterRegistry } + +function TFormatterRegistry.IndexOf(const AName: string): Integer; +Var + s : string; +begin + s := lowercase(AName); + + For Result := 0 To Pred(GetCount()) Do + If SameText(s,GetItem(Result).ProtocolName) Then + Exit; + Result := -1; +end; + +procedure TFormatterRegistry.Clear(); +begin + FList.Clear(); +end; + +function TFormatterRegistry.GetCount(): Integer; +begin + Result := FList.Count; +end; + +function TFormatterRegistry.GetItem(const AIndex: Integer): TFormatterFactoryRegistryItem; +begin + Result := FList[AIndex] as TFormatterFactoryRegistryItem; +end; + +function TFormatterRegistry.Find( + Const AProtocolData : string; + Out ARes : IServiceProtocol +): Boolean; +Var + i : Integer; + r : TFormatterFactoryRegistryItem; + initData : String; +begin + ARes := Nil; + i := IndexOf(ExtractProtocol(AProtocolData)); + Result := ( i > -1 ); + If Result Then Begin + initData := ExtractProtocolData(AProtocolData); + r := GetItem(i); + ARes := TServiceProtocol.Create( + r.FormaterFactory.CreateInstance() as IFormatterClient, + r.CallHandlerFactory.CreateInstance() as ICallMaker + ) as IServiceProtocol; + ARes.GetSerializer().GetPropertyManager().SetProperties(initData); + ARes.GetCallHandler().GetPropertyManager().SetProperties(initData); + End; +end; + +procedure TFormatterRegistry.Register( + Const AProtocolName : string; + AFormaterFactory : IItemFactory; + ACallHandlerFactory : IItemFactory +); +Var + i : Integer; + s : string; +begin + Assert(Assigned(AFormaterFactory)); + Assert(Assigned(ACallHandlerFactory)); + s := ExtractProtocol(AProtocolName); + i := IndexOf(s); + If ( i = -1 ) Then + FList.Add(TFormatterFactoryRegistryItem.Create(s,AFormaterFactory,ACallHandlerFactory)); +end; + +constructor TFormatterRegistry.Create(); +begin + FList := TObjectList.Create(True); +end; + +destructor TFormatterRegistry.Destroy(); +begin + FreeAndNil(FList); + inherited Destroy(); +end; + +Type + { TTransportRegistry } + //Make it Threadsafe ??? + TTransportRegistry = class(TBaseFactoryRegistry,IInterface,ITransportRegistry) + protected + function Find( + Const ATransportData : string; + Out ARes : ITransport + ):Boolean; + End; + + +Var + TransportRegistryInst : ITransportRegistry = Nil; +function GetTransportRegistry():ITransportRegistry; +begin + If Not Assigned(TransportRegistryInst) Then + TransportRegistryInst := TTransportRegistry.Create() as ITransportRegistry;// Lock!!! + Result := TransportRegistryInst; +end; + +{ TTransportRegistry } + +function TTransportRegistry.Find( + const ATransportData : string; + Out ARes : ITransport +): Boolean; +Var + fct : IItemFactory; +begin + fct := FindFactory(ExtractProtocol(ATransportData)); + If Assigned(fct) Then Begin + ARes := fct.CreateInstance() as ITransport; + ARes.GetPropertyManager().SetProperties(ExtractProtocolData(ATransportData)); + Result := True; + End Else Begin + Result := False; + End; +end; + +initialization + TransportRegistryInst := TTransportRegistry.Create() as ITransportRegistry; + FormaterRegistryInst := TFormatterRegistry.Create() as IFormaterQueryRegistry; + +finalization + FormaterRegistryInst := nil; + TransportRegistryInst := nil; +end. diff --git a/wst/tags/0.4/soap_formatter.pas b/wst/tags/0.4/soap_formatter.pas new file mode 100644 index 000000000..3426e5c52 --- /dev/null +++ b/wst/tags/0.4/soap_formatter.pas @@ -0,0 +1,263 @@ +{ + This file is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This file is provide under modified LGPL licence + ( the files COPYING.modifiedLGPL and COPYING.LGPL). + + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +} +unit soap_formatter; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, TypInfo, DOM, + base_service_intf, service_intf, imp_utils, base_soap_formatter; + + +Type + + + { TSOAPFormatter } +{$M+} + TSOAPFormatter = class(TSOAPBaseFormatter,IFormatterClient) + private + FPropMngr : IPropertyManager; + FCallProcedureName : string; + FCallTarget : String; + public + destructor Destroy();override; + function GetPropertyManager():IPropertyManager; + + procedure BeginCall( + const AProcName, + ATarget : string; + ACallContext : ICallContext + ); + procedure EndCall(); + procedure BeginCallRead(ACallContext : ICallContext); + + function GetCallProcedureName():String; + function GetCallTarget():String; + End; + + { TSOAPCallMaker } + + TSOAPCallMaker = class(TSimpleFactoryItem,ICallMaker) + private + FPropMngr : IPropertyManager; + FUniqueAddress: Boolean; + public + constructor Create();override; + destructor Destroy();override; + function GetPropertyManager():IPropertyManager; + procedure MakeCall( + ASerializer : IFormatterClient; + ATransport : ITransport + ); + published + property UniqueAddress : Boolean read FUniqueAddress Write FUniqueAddress; + end; +{$M-} + +implementation + + +{ TSOAPFormatter } + +destructor TSOAPFormatter.Destroy(); +begin + FPropMngr := nil; + inherited Destroy(); +end; + +function TSOAPFormatter.GetPropertyManager(): IPropertyManager; +begin + If Not Assigned(FPropMngr) Then + FPropMngr := TPublishedPropertyManager.Create(Self); + Result := FPropMngr; +end; + +procedure TSOAPFormatter.BeginCall( + const AProcName, + ATarget : string; + ACallContext : ICallContext +); +begin + Prepare(); + WriteHeaders(ACallContext); + BeginScope('Body',sSOAP_ENV,'',stObject,asNone); + if ( Style = RPC ) then + BeginScope(AProcName,ATarget,'',stObject,asNone); + + FCallTarget := ATarget; + FCallProcedureName := AProcName; +end; + +procedure TSOAPFormatter.EndCall(); +begin + if ( Style = RPC ) then + EndScope(); //BeginScope(AProcName,ATarget); + EndScope(); //BeginScope('Body','http://schemas.xmlsoap.org/soap/envelope/'); + EndScope(); //BeginScope('Envelope','http://schemas.xmlsoap.org/soap/envelope/','SOAP-ENV'); +end; + +procedure TSOAPFormatter.BeginCallRead(ACallContext : ICallContext); +Var + envNd : TDOMElement; + bdyNd, fltNd, hdrNd : TDOMNode; + nsShortName,eltName, msgBuff : string; + excpt_Obj : ESOAPException; + doc : TXMLDocument; +begin + ClearStack(); + doc := GetXmlDoc(); + If FindAttributeByValueInNode(sSOAP_ENV,doc.DocumentElement,nsShortName) or + FindAttributeByValueInNode('"' + sSOAP_ENV + '"',doc.DocumentElement,nsShortName) + Then Begin + nsShortName := Copy(nsShortName,1 + Pos(':',nsShortName),MaxInt); + If Not IsStrEmpty(nsShortName) Then + nsShortName := nsShortName + ':'; + End Else + nsShortName := ''; + eltName := nsShortName + sENVELOPE; + envNd := doc.DocumentElement; + If Not SameText(eltName,envNd.NodeName) Then + Error('XML root node must be "Envelope", found : "%s"',[envNd.NodeName + ':::' + nsShortName]); + PushStack(envNd); + + bdyNd := envNd.FirstChild; + if not Assigned(bdyNd) then + Error('Node not found : "Body".'); + + eltName := nsShortName + 'Body'; + if not SameText(bdyNd.NodeName,eltName) then begin + eltName := nsShortName + 'Header'; + hdrNd := bdyNd; + bdyNd := hdrNd.NextSibling; + if SameText(hdrNd.NodeName,eltName) then begin + PushStack(hdrNd,asScoped,'').SetNameSpace(sSOAP_ENV); + ReadHeaders(ACallContext); + PopStack().Free(); + end; + end; + + eltName := nsShortName + 'Body'; + bdyNd := envNd.FirstChild; + If Not Assigned(bdyNd) Then + Error('Node not found : "Body"'); + If Not SameText(bdyNd.NodeName,eltName) Then + bdyNd := bdyNd.NextSibling; + If Not Assigned(bdyNd) Then + Error('Node not found : "Body"'); + PushStack(bdyNd); + If Not Assigned(bdyNd.FirstChild) Then + Error('Response Node not found'); + if ( Style = RPC ) then begin + PushStack(bdyNd.FirstChild); + end; + eltName := nsShortName + 'Fault'; + If SameText(eltName,bdyNd.FirstChild.NodeName) Then Begin + fltNd := bdyNd.FirstChild; + excpt_Obj := ESOAPException.Create(''); + Try + eltName := 'faultcode'; + Get(TypeInfo(string),eltName,msgBuff); + excpt_Obj.FaultCode := msgBuff; + eltName := 'faultstring'; + Get(TypeInfo(string),eltName,msgBuff); + excpt_Obj.FaultString := msgBuff; ; + excpt_Obj.Message := Format( + 'Service exception :%s Code = "%s"%s Message = "%s"', + [LineEnding,excpt_Obj.FaultCode,LineEnding,excpt_Obj.FaultString] + ); + Except + FreeAndNil(excpt_Obj); + Raise; + End; + Raise excpt_Obj; + End; +end; + +function TSOAPFormatter.GetCallProcedureName(): String; +begin + Result := FCallProcedureName; +end; + +function TSOAPFormatter.GetCallTarget(): String; +begin + Result := FCallTarget; +end; + +{ TSOAPCallMaker } + +constructor TSOAPCallMaker.Create(); +begin + FUniqueAddress := True; + FPropMngr := TPublishedPropertyManager.Create(Self); +end; + +destructor TSOAPCallMaker.Destroy(); +begin + FPropMngr := Nil; + inherited Destroy(); +end; + +function TSOAPCallMaker.GetPropertyManager(): IPropertyManager; +begin + Result := FPropMngr; +end; + +procedure TSOAPCallMaker.MakeCall( + ASerializer : IFormatterClient; + ATransport : ITransport +); +Var + rqt, rsps : TMemoryStream; + {$IFDEF WST_DBG} + s : string; + {$ENDIF WST_DBG} +begin + Assert(Assigned(ASerializer)); + Assert(Assigned(ATransport)); + ATransport.GetPropertyManager().SetProperty( + sCONTENT_TYPE, + ASerializer.GetPropertyManager().GetProperty(sCONTENT_TYPE) + ); + rsps := Nil; + rqt := TMemoryStream.Create(); + Try + rsps := TMemoryStream.Create(); + ASerializer.SaveToStream(rqt); + rqt.Position := 0; + ATransport.SendAndReceive(rqt,rsps); + rqt.Clear(); + rsps.Position := 0; + ASerializer.Clear(); + ASerializer.LoadFromStream(rsps); + Finally + rsps.Free(); + rqt.Free(); + End; +end; + +procedure RegisterSoapProtocol(); +begin + RegisterStdTypes(); + GetFormaterRegistry().Register( + sPROTOCOL_NAME, + TSimpleItemFactory.Create(TSOAPFormatter) as IItemFactory, + TSimpleItemFactory.Create(TSOAPCallMaker) as IItemFactory + ); +end; + +Initialization + RegisterSoapProtocol(); + +end. diff --git a/wst/tags/0.4/synapse_http_protocol.pas b/wst/tags/0.4/synapse_http_protocol.pas new file mode 100644 index 000000000..a5e364825 --- /dev/null +++ b/wst/tags/0.4/synapse_http_protocol.pas @@ -0,0 +1,183 @@ +{ + This file is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This file is provide under modified LGPL licence + ( the files COPYING.modifiedLGPL and COPYING.LGPL). + + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +} +unit synapse_http_protocol; + +//{$DEFINE WST_DBG} + +interface + +uses + Classes, SysUtils,{$IFDEF WST_DBG}Dialogs,{$ENDIF} + service_intf, imp_utils, base_service_intf, + httpsend; + +{$INCLUDE wst.inc} + +Const + sTRANSPORT_NAME = 'HTTP'; + +Type + +{$M+} + { THTTPTransport } + THTTPTransport = class(TSimpleFactoryItem,ITransport) + Private + FPropMngr : IPropertyManager; + FConnection : THTTPSend; + FAddress : string; + private + FSoapAction: string; + function GetAddress: string; + function GetContentType: string; + function GetProxyPassword: string; + function GetProxyPort: Integer; + function GetProxyServer: string; + function GetProxyUsername: string; + procedure SetAddress(const AValue: string); + procedure SetContentType(const AValue: string); + procedure SetProxyPassword(const AValue: string); + procedure SetProxyPort(const AValue: Integer); + procedure SetProxyServer(const AValue: string); + procedure SetProxyUsername(const AValue: string); + Public + constructor Create();override; + destructor Destroy();override; + function GetPropertyManager():IPropertyManager; + procedure SendAndReceive(ARequest,AResponse:TStream); + Published + property ContentType : string Read GetContentType Write SetContentType; + property Address : string Read GetAddress Write SetAddress; + property ProxyServer : string Read GetProxyServer Write SetProxyServer; + property ProxyPort : Integer Read GetProxyPort Write SetProxyPort; + property ProxyUsername : string read GetProxyUsername write SetProxyUsername; + property ProxyPassword : string read GetProxyPassword write SetProxyPassword; + property SoapAction : string read FSoapAction write FSoapAction; + End; +{$M+} + + procedure SYNAPSE_RegisterHTTP_Transport(); + +implementation + +{ THTTPTransport } + +function THTTPTransport.GetAddress: string; +begin + Result := FAddress; +end; + +function THTTPTransport.GetContentType: string; +begin + Result := FConnection.MimeType; +end; + +function THTTPTransport.GetProxyPassword: string; +begin + Result := FConnection.ProxyPass; +end; + +function THTTPTransport.GetProxyPort: Integer; +begin + Result := StrToInt(FConnection.ProxyPort); +end; + +function THTTPTransport.GetProxyServer: string; +begin + Result := FConnection.ProxyHost; +end; + +function THTTPTransport.GetProxyUsername: string; +begin + Result := FConnection.ProxyUser; +end; + +procedure THTTPTransport.SetAddress(const AValue: string); +begin + FAddress := AValue; +end; + +procedure THTTPTransport.SetContentType(const AValue: string); +begin + FConnection.MimeType := AValue; +end; + +procedure THTTPTransport.SetProxyPassword(const AValue: string); +begin + FConnection.ProxyPass := AValue; +end; + +procedure THTTPTransport.SetProxyPort(const AValue: Integer); +begin + FConnection.ProxyPort := IntToStr(AValue); +end; + +procedure THTTPTransport.SetProxyServer(const AValue: string); +begin + FConnection.ProxyHost := AValue; +end; + +procedure THTTPTransport.SetProxyUsername(const AValue: string); +begin + FConnection.ProxyUser := AValue; +end; + +constructor THTTPTransport.Create(); +begin + inherited Create(); + FPropMngr := TPublishedPropertyManager.Create(Self); + FConnection := THTTPSend.Create(); + FConnection.Protocol := '1.1'; +end; + +destructor THTTPTransport.Destroy(); +begin + FreeAndNil(FConnection); + FPropMngr := Nil; + inherited Destroy(); +end; + +function THTTPTransport.GetPropertyManager(): IPropertyManager; +begin + Result := FPropMngr; +end; + +procedure THTTPTransport.SendAndReceive(ARequest, AResponse: TStream); +{$IFDEF WST_DBG} +var + s : string; +{$ENDIF} +begin + FConnection.Document.Size := 0; + FConnection.Headers.Add('soapAction:' + SoapAction); + FConnection.Document.CopyFrom(ARequest,0); + FConnection.HTTPMethod('POST',FAddress); + AResponse.CopyFrom(FConnection.Document,0); + FConnection.Clear(); +{$IFDEF WST_DBG} + TMemoryStream(ARequest).SaveToFile('request.log'); + SetLength(s,AResponse.Size); + Move(TMemoryStream(AResponse).Memory^,s[1],Length(s)); + TMemoryStream(AResponse).SaveToFile('response.log'); + if IsConsole then + WriteLn(s) + else + ShowMessage(s); +{$ENDIF} +end; + +procedure SYNAPSE_RegisterHTTP_Transport(); +begin + GetTransportRegistry().Register(sTRANSPORT_NAME,TSimpleItemFactory.Create(THTTPTransport) as IItemFactory); +end; + +end. diff --git a/wst/tags/0.4/synapse_tcp_protocol.pas b/wst/tags/0.4/synapse_tcp_protocol.pas new file mode 100644 index 000000000..860c7c33f --- /dev/null +++ b/wst/tags/0.4/synapse_tcp_protocol.pas @@ -0,0 +1,148 @@ +{ + This file is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This file is provide under modified LGPL licence + ( the files COPYING.modifiedLGPL and COPYING.LGPL). + + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +} +unit synapse_tcp_protocol; + +interface + +uses + Classes, SysUtils, + service_intf, imp_utils, base_service_intf, + blcksock; + +{$INCLUDE wst.inc} + +Const + sTRANSPORT_NAME = 'TCP'; + +Type + + ETCPException = class(EServiceException) + End; + +{$M+} + { TTCPTransport } + TTCPTransport = class(TSimpleFactoryItem,ITransport) + Private + FPropMngr : IPropertyManager; + FConnection : TTCPBlockSocket; + FContentType : string; + FTarget: string; + FAddress : string; + FPort : string; + FDefaultTimeOut: Integer; + public + constructor Create();override; + destructor Destroy();override; + function GetPropertyManager():IPropertyManager; + procedure SendAndReceive(ARequest,AResponse:TStream); + Published + property Target : string Read FTarget Write FTarget; + property ContentType : string Read FContentType Write FContentType; + property Address : string Read FAddress Write FAddress; + property Port : string Read FPort Write FPort; + property DefaultTimeOut : Integer read FDefaultTimeOut write FDefaultTimeOut; + End; +{$M+} + + procedure SYNAPSE_RegisterTCP_Transport(); + +implementation +uses binary_streamer, Math; + +{ TTCPTransport } + +constructor TTCPTransport.Create(); +begin + FPropMngr := TPublishedPropertyManager.Create(Self); + FConnection := TTCPBlockSocket.Create(); + FConnection.RaiseExcept := True; + FDefaultTimeOut := 90000; +end; + +destructor TTCPTransport.Destroy(); +begin + FreeAndNil(FConnection); + FPropMngr := Nil; + inherited Destroy(); +end; + +function TTCPTransport.GetPropertyManager(): IPropertyManager; +begin + Result := FPropMngr; +end; + +procedure TTCPTransport.SendAndReceive(ARequest, AResponse: TStream); +Var + wrtr : IDataStore; + buffStream : TMemoryStream; + strBuff : string; + bufferLen : LongInt; + i, j, c : PtrInt; +{$IFDEF WST_DBG} + s : string; +{$ENDIF WST_DBG} +begin + buffStream := TMemoryStream.Create(); + Try + wrtr := CreateBinaryWriter(buffStream); + wrtr.WriteInt32S(0); + wrtr.WriteStr(Target); + wrtr.WriteStr(ContentType); + SetLength(strBuff,ARequest.Size); + ARequest.Position := 0; + ARequest.Read(strBuff[1],Length(strBuff)); + wrtr.WriteStr(strBuff); + buffStream.Position := 0; + wrtr.WriteInt32S(buffStream.Size-4); + + if ( FConnection.Socket = NOT(0) ) then + FConnection.Connect(Address,Port); + FConnection.SendBuffer(buffStream.Memory,buffStream.Size); + + bufferLen := 0; + FConnection.RecvBufferEx(@bufferLen,SizeOf(bufferLen),DefaultTimeOut); + FConnection.ExceptCheck(); + bufferLen := Reverse_32(bufferLen); + AResponse.Size := bufferLen; + if ( bufferLen > 0 ) then begin + c := 0; + i := 1024; + if ( i > bufferLen ) then + i := bufferLen; + SetLength(strBuff,i); + repeat + j := FConnection.RecvBufferEx(@(strBuff[1]),i,DefaultTimeOut); + FConnection.ExceptCheck(); + AResponse.Write(strBuff[1],j); + Inc(c,j); + i := Min(1024,(bufferLen-c)); + until ( i =0 ) or ( j <= 0 ); + end; + AResponse.Position := 0; + {$IFDEF WST_DBG} + i := AResponse.Position; + SetLength(s,AResponse.Size); + AResponse.Read(s[1],AResponse.Size); + WriteLn(s); + {$ENDIF WST_DBG} + Finally + buffStream.Free(); + End; +end; + +procedure SYNAPSE_RegisterTCP_Transport(); +begin + GetTransportRegistry().Register(sTRANSPORT_NAME,TSimpleItemFactory.Create(TTCPTransport) as IItemFactory); +end; + +end. diff --git a/wst/tags/0.4/synapse_tcp_server.pas b/wst/tags/0.4/synapse_tcp_server.pas new file mode 100644 index 000000000..4397e73a1 --- /dev/null +++ b/wst/tags/0.4/synapse_tcp_server.pas @@ -0,0 +1,257 @@ +{ + This file is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This file is provide under modified LGPL licence + ( the files COPYING.modifiedLGPL and COPYING.LGPL). + + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +} +unit synapse_tcp_server; + +{$INCLUDE wst.inc} + +interface + +uses + Classes, SysUtils, blcksock, synsock; + +const + sSERVER_PORT = '1234'; + +type + + ILogger = interface + ['{CA357B9A-604F-4603-96FA-65D445837E80}'] + procedure Log(const AMsg : string);overload; + procedure Log(const AMsg : string;const AArgs : array of const);overload; + end; + + { TClientHandlerThread } + + TClientHandlerThread = class(TThread) + private + FDefaultTimeOut: Integer; + FSocketObject : TTCPBlockSocket; + FSocketHandle : TSocket; + FInputStream : TMemoryStream; + FOutputStream : TMemoryStream; + private + procedure ClearBuffers(); + function ReadInputBuffer():Integer; + procedure SendOutputBuffer(); + public + constructor Create (ASocketHandle : TSocket); + destructor Destroy();override; + procedure Execute(); override; + property DefaultTimeOut : Integer read FDefaultTimeOut write FDefaultTimeOut; + end; + + { TServerListnerThread } + + TServerListnerThread = class(TThread) + private + FDefaultTimeOut: Integer; + FSocketObject : TTCPBlockSocket; + public + constructor Create(); + destructor Destroy(); override; + procedure Execute(); override; + property DefaultTimeOut : Integer read FDefaultTimeOut write FDefaultTimeOut; + end; + + { TConsoleLogger } + + TConsoleLogger = class(TInterfacedObject,IInterface,ILogger) + protected + procedure Log(const AMsg : string);overload; + procedure Log(const AMsg : string;const AArgs : array of const);overload; + end; + + function Logger():ILogger ; + function SetLogger(ALogger : ILogger):ILogger ; + +implementation +uses binary_streamer, server_service_intf, server_service_imputils; + +var FLoggerInst : ILogger = nil; +function SetLogger(ALogger : ILogger):ILogger ; +begin + Result := FLoggerInst; + FLoggerInst := ALogger; +end; + +function Logger():ILogger ; +begin + Result := FLoggerInst; +end; + +{ TConsoleLogger } + +procedure TConsoleLogger.Log(const AMsg: string); +begin + WriteLn(AMsg); +end; + +procedure TConsoleLogger.Log(const AMsg: string; const AArgs: array of const); +begin + WriteLn(Format(AMsg,AArgs)); +end; + +{ TClientHandlerThread } + +procedure TClientHandlerThread.ClearBuffers(); +begin + FInputStream.Size := 0; + FOutputStream.Size := 0; +end; + +function TClientHandlerThread.ReadInputBuffer(): Integer; +var + strBuff : string; + bufferLen : LongInt; + i, j, c : PtrInt; +begin + FInputStream.Size := 0; + Result := 0; + bufferLen := 0; + FSocketObject.RecvBufferEx(@bufferLen,SizeOf(bufferLen),DefaultTimeOut); + FSocketObject.ExceptCheck(); + bufferLen := Reverse_32(bufferLen); + FInputStream.Size := bufferLen; + if ( bufferLen > 0 ) then begin + c := 0; + i := 1024; + if ( i > bufferLen ) then + i := bufferLen; + SetLength(strBuff,i); + repeat + j := FSocketObject.RecvBufferEx(@(strBuff[1]),i,DefaultTimeOut); + FSocketObject.ExceptCheck(); + FInputStream.Write(strBuff[1],j); + Inc(c,j); + if ( ( bufferLen - c ) > 1024 ) then + i := 1024 + else + i := bufferLen - c; + until ( i = 0 ) or ( j <= 0 ); + end; + FInputStream.Position := 0; + Result := FInputStream.Size; +end; + +procedure TClientHandlerThread.SendOutputBuffer(); +begin + FSocketObject.SendBuffer(FOutputStream.Memory,FOutputStream.Size); +end; + +constructor TClientHandlerThread.Create(ASocketHandle: TSocket); +begin + FSocketHandle := ASocketHandle; + FreeOnTerminate := True; + FDefaultTimeOut := 90000; + inherited Create(False); +end; + +destructor TClientHandlerThread.Destroy(); +begin + FreeAndNil(FOutputStream); + FreeAndNil(FInputStream); + inherited Destroy(); +end; + +procedure TClientHandlerThread.Execute(); +var + wrtr : IDataStore; + rdr : IDataStoreReader; + buff, trgt,ctntyp : string; + rqst : IRequestBuffer; + i : PtrUInt; +begin + FInputStream := TMemoryStream.Create(); + FOutputStream := TMemoryStream.Create(); + FSocketObject := TTCPBlockSocket.Create(); + try + FSocketObject.RaiseExcept := True; + try + FSocketObject.Socket := FSocketHandle; + FSocketObject.GetSins(); + while not Terminated do begin + FOutputStream.Size := 0; + if ( ReadInputBuffer() >= SizeOf(LongInt) ) then begin + rdr := CreateBinaryReader(FInputStream); + trgt := rdr.ReadStr(); + ctntyp := rdr.ReadStr(); + buff := rdr.ReadStr(); + rdr := nil; + FInputStream.Size := 0; + FInputStream.Write(buff[1],Length(buff)); + FInputStream.Position := 0; + rqst := TRequestBuffer.Create(trgt,ctntyp,FInputStream,FOutputStream); + HandleServiceRequest(rqst); + i := FOutputStream.Size; + SetLength(buff,i); + FOutputStream.Position := 0; + FOutputStream.Read(buff[1],i); + FOutputStream.Size := 0; + wrtr := CreateBinaryWriter(FOutputStream); + wrtr.WriteStr(buff); + SendOutputBuffer(); + ClearBuffers(); + end; + end; + except + on e : Exception do begin + Logger().Log('Error : ThreadID = %d; Message = %s',[Self.ThreadID,e.Message]); + end; + end; + finally + FreeAndNil(FSocketObject); + end; +end; + +{ TServerListnerThread } + +constructor TServerListnerThread.Create(); +begin + FSocketObject := TTCPBlockSocket.Create(); + FreeOnTerminate := True; + FDefaultTimeOut := 1000; + inherited Create(false); +end; + +destructor TServerListnerThread.Destroy(); +begin + FreeAndNil(FSocketObject); + inherited Destroy(); +end; + +procedure TServerListnerThread.Execute(); +var + ClientSock : TSocket; +begin + try + FSocketObject.RaiseExcept := True; + FSocketObject.CreateSocket(); + FSocketObject.SetLinger(True,10); + FSocketObject.Bind('127.0.0.1',sSERVER_PORT); + FSocketObject.Listen(); + while not Terminated do begin + if FSocketObject.CanRead(DefaultTimeOut) then begin + ClientSock := FSocketObject.Accept(); + TClientHandlerThread.Create(ClientSock); + end; + end; + except + on e : Exception do begin + Logger().Log('Listner Thread Error : ThreadID = %d; Message = %s',[Self.ThreadID,e.Message]); + Logger().Log('Listner stoped.'); + end; + end; +end; + +end. + diff --git a/wst/tags/0.4/tests/amazon/amazon.lpi b/wst/tags/0.4/tests/amazon/amazon.lpi new file mode 100644 index 000000000..491f11fe2 --- /dev/null +++ b/wst/tags/0.4/tests/amazon/amazon.lpi @@ -0,0 +1,452 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wst/tags/0.4/tests/amazon/amazon.lpr b/wst/tags/0.4/tests/amazon/amazon.lpr new file mode 100644 index 000000000..06b1db083 --- /dev/null +++ b/wst/tags/0.4/tests/amazon/amazon.lpr @@ -0,0 +1,18 @@ +program amazon; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Interfaces, // this includes the LCL widgetset + Forms, + umain, AWSECommerceService; + +begin + Application.Initialize; + Application.CreateForm(TfMain, fMain); + Application.Run; +end. + diff --git a/wst/tags/0.4/tests/amazon/umain.lfm b/wst/tags/0.4/tests/amazon/umain.lfm new file mode 100644 index 000000000..68d52950f --- /dev/null +++ b/wst/tags/0.4/tests/amazon/umain.lfm @@ -0,0 +1,120 @@ +object fMain: TfMain + Left = 339 + Height = 471 + Top = 181 + Width = 476 + HorzScrollBar.Page = 475 + VertScrollBar.Page = 470 + ActiveControl = edtAccessID + Caption = 'WST Amazon - Sample' + Position = poDesktopCenter + object Label1: TLabel + Left = 16 + Height = 18 + Top = 24 + Width = 69 + Caption = 'Access Key' + Color = clNone + ParentColor = False + end + object Bevel1: TBevel + Left = 16 + Height = 8 + Top = 64 + Width = 451 + Anchors = [akTop, akLeft, akRight] + Shape = bsBottomLine + end + object Label2: TLabel + Left = 16 + Height = 18 + Top = 91 + Width = 82 + Caption = 'Search Index' + Color = clNone + ParentColor = False + end + object Label3: TLabel + Left = 16 + Height = 18 + Top = 142 + Width = 82 + Caption = 'Manufacturer' + Color = clNone + ParentColor = False + end + object Label4: TLabel + Left = 16 + Height = 18 + Top = 188 + Width = 65 + Caption = 'Key words' + Color = clNone + ParentColor = False + end + object Bevel2: TBevel + Left = 16 + Height = 8 + Top = 216 + Width = 450 + Anchors = [akTop, akLeft, akRight] + Shape = bsBottomLine + end + object edtAccessID: TEdit + Left = 118 + Height = 23 + Top = 24 + Width = 202 + TabOrder = 0 + end + object edtSearchIndex: TEdit + Left = 127 + Height = 23 + Top = 91 + Width = 338 + Anchors = [akTop, akLeft, akRight] + TabOrder = 1 + Text = 'All' + end + object edtManufacturer: TEdit + Left = 127 + Height = 23 + Top = 142 + Width = 338 + Anchors = [akTop, akLeft, akRight] + TabOrder = 2 + end + object mmoRes: TMemo + Left = 16 + Height = 210 + Top = 248 + Width = 449 + Anchors = [akTop, akLeft, akRight, akBottom] + Lines.Strings = ( + 'Memo1' + ) + ScrollBars = ssAutoBoth + TabOrder = 3 + WordWrap = False + end + object btnSearch: TButton + Left = 390 + Height = 25 + Top = 24 + Width = 75 + Anchors = [akTop, akRight] + BorderSpacing.InnerBorder = 4 + Caption = 'Search' + OnClick = btnSearchClick + TabOrder = 4 + end + object edtKeywords: TEdit + Left = 127 + Height = 23 + Top = 188 + Width = 338 + Anchors = [akTop, akLeft, akRight] + TabOrder = 5 + Text = 'Harry Potter' + end +end diff --git a/wst/tags/0.4/tests/amazon/umain.lrs b/wst/tags/0.4/tests/amazon/umain.lrs new file mode 100644 index 000000000..7db5494d7 --- /dev/null +++ b/wst/tags/0.4/tests/amazon/umain.lrs @@ -0,0 +1,34 @@ +{ Ceci est un fichier ressource généré automatiquement par Lazarus } + +LazarusResources.Add('TfMain','FORMDATA',[ + 'TPF0'#6'TfMain'#5'fMain'#4'Left'#3'S'#1#6'Height'#3#215#1#3'Top'#3#181#0#5'W' + +'idth'#3#220#1#18'HorzScrollBar.Page'#3#219#1#18'VertScrollBar.Page'#3#214#1 + +#13'ActiveControl'#7#11'edtAccessID'#7'Caption'#6#19'WST Amazon - Sample'#8 + +'Position'#7#15'poDesktopCenter'#0#6'TLabel'#6'Label1'#4'Left'#2#16#6'Height' + +#2#18#3'Top'#2#24#5'Width'#2'E'#7'Caption'#6#10'Access Key'#5'Color'#7#6'clN' + +'one'#11'ParentColor'#8#0#0#6'TBevel'#6'Bevel1'#4'Left'#2#16#6'Height'#2#8#3 + +'Top'#2'@'#5'Width'#3#195#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#5 + +'Shape'#7#12'bsBottomLine'#0#0#6'TLabel'#6'Label2'#4'Left'#2#16#6'Height'#2 + +#18#3'Top'#2'['#5'Width'#2'R'#7'Caption'#6#12'Search Index'#5'Color'#7#6'clN' + +'one'#11'ParentColor'#8#0#0#6'TLabel'#6'Label3'#4'Left'#2#16#6'Height'#2#18#3 + +'Top'#3#142#0#5'Width'#2'R'#7'Caption'#6#12'Manufacturer'#5'Color'#7#6'clNon' + +'e'#11'ParentColor'#8#0#0#6'TLabel'#6'Label4'#4'Left'#2#16#6'Height'#2#18#3 + +'Top'#3#188#0#5'Width'#2'A'#7'Caption'#6#9'Key words'#5'Color'#7#6'clNone'#11 + +'ParentColor'#8#0#0#6'TBevel'#6'Bevel2'#4'Left'#2#16#6'Height'#2#8#3'Top'#3 + +#216#0#5'Width'#3#194#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#5'Shap' + +'e'#7#12'bsBottomLine'#0#0#5'TEdit'#11'edtAccessID'#4'Left'#2'v'#6'Height'#2 + +#23#3'Top'#2#24#5'Width'#3#202#0#8'TabOrder'#2#0#0#0#5'TEdit'#14'edtSearchIn' + +'dex'#4'Left'#2''#6'Height'#2#23#3'Top'#2'['#5'Width'#3'R'#1#7'Anchors'#11#5 + +'akTop'#6'akLeft'#7'akRight'#0#8'TabOrder'#2#1#4'Text'#6#3'All'#0#0#5'TEdit' + +#15'edtManufacturer'#4'Left'#2''#6'Height'#2#23#3'Top'#3#142#0#5'Width'#3'R' + +#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#8'TabOrder'#2#2#0#0#5'TMemo' + +#6'mmoRes'#4'Left'#2#16#6'Height'#3#210#0#3'Top'#3#248#0#5'Width'#3#193#1#7 + +'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#13'Lines.Strings'#1 + +#6#5'Memo1'#0#10'ScrollBars'#7#10'ssAutoBoth'#8'TabOrder'#2#3#8'WordWrap'#8#0 + +#0#7'TButton'#9'btnSearch'#4'Left'#3#134#1#6'Height'#2#25#3'Top'#2#24#5'Widt' + +'h'#2'K'#7'Anchors'#11#5'akTop'#7'akRight'#0#25'BorderSpacing.InnerBorder'#2 + +#4#7'Caption'#6#6'Search'#7'OnClick'#7#14'btnSearchClick'#8'TabOrder'#2#4#0#0 + +#5'TEdit'#11'edtKeywords'#4'Left'#2''#6'Height'#2#23#3'Top'#3#188#0#5'Width' + +#3'R'#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#8'TabOrder'#2#5#4'Text' + +#6#12'Harry Potter'#0#0#0 +]); diff --git a/wst/tags/0.4/tests/amazon/umain.pas b/wst/tags/0.4/tests/amazon/umain.pas new file mode 100644 index 000000000..6fb087384 --- /dev/null +++ b/wst/tags/0.4/tests/amazon/umain.pas @@ -0,0 +1,120 @@ +unit umain; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, + AWSECommerceService, StdCtrls, ExtCtrls, Buttons; + +type + + { TfMain } + + TfMain = class(TForm) + Bevel1: TBevel; + Bevel2: TBevel; + btnSearch: TButton; + edtAccessID: TEdit; + edtKeywords: TEdit; + edtSearchIndex: TEdit; + edtManufacturer: TEdit; + Label1: TLabel; + Label2: TLabel; + Label3: TLabel; + Label4: TLabel; + mmoRes: TMemo; + procedure btnSearchClick(Sender: TObject); + private + { private declarations } + public + { public declarations } + end; + +var + fMain: TfMain; + +implementation +uses soap_formatter, + synapse_http_protocol, + AWSECommerceService_proxy, + metadata_repository; + +{ TfMain } + +procedure TfMain.btnSearchClick(Sender: TObject); +var + locService : AWSECommerceServicePortType; + rqst : ItemSearch_Type; + rsps : ItemSearchResponse_Type; + rspsItem : Items_Type; + i, j, k : Integer; + itm : Item_Type; +begin + mmoRes.Clear(); + rsps := nil; + rqst := ItemSearch_Type.Create(); + try + Screen.Cursor := crHourGlass; + locService := wst_CreateInstance_AWSECommerceServicePortType(); + rqst.AWSAccessKeyId := edtAccessID.Text; + rqst.Request.SetLength(1); + rqst.Request[0].Manufacturer := edtManufacturer.Text; + rqst.Request[0].SearchIndex := edtSearchIndex.Text; + rqst.Request[0].Availability := Available; + rqst.Request[0].Count := 10; + rqst.Request[0].MerchantId := 'Amazon'; + rqst.Request[0].ItemPage := 1; + rqst.Request[0].Keywords := edtKeywords.Text; + rsps := locService.ItemSearch(rqst); + if ( rsps.OperationRequest.Errors.Length > 0 ) then begin + mmoRes.Lines.Add(Format('Errors ( %d ) : ',[rsps.OperationRequest.Errors.Length])); + for i := 0 to Pred(rsps.OperationRequest.Errors.Length) do begin + mmoRes.Lines.Add(Format(' Error[%d] :',[i])); + mmoRes.Lines.Add(' ' + rsps.OperationRequest.Errors[i].Code); + mmoRes.Lines.Add(' ' + rsps.OperationRequest.Errors[i].Message); + end; + end else begin + mmoRes.Lines.Add(Format('Response ( %d ) : ',[rsps.Items.Length])); + if Assigned(rsps) then begin + for i := 0 to Pred(rsps.Items.Length) do begin + rspsItem := rsps.Items[i]; + mmoRes.Lines.Add(' TotalPages :' + IntToStr(rspsItem.TotalPages)); + mmoRes.Lines.Add(' TotalResults :' + IntToStr(rspsItem.TotalResults)); + mmoRes.Lines.Add(' Items :' + IntToStr(rspsItem._Item.Length)); + mmoRes.Lines.Add(''); + for j := 0 to Pred(rspsItem._Item.Length) do begin + itm := rspsItem._Item[j];; + mmoRes.Lines.Add(' ASIN :' + itm.ASIN); + mmoRes.Lines.Add(' DetailPageURL :' + itm.DetailPageURL); + if Assigned(itm.ItemAttributes) then begin + mmoRes.Lines.Add(' Title :' + itm.ItemAttributes.Title); + for k := 0 to Pred(itm.ItemAttributes.Author.Length) do begin + mmoRes.Lines.Add(' Author[ ' + IntToStr(k) + ' ] ' + itm.ItemAttributes.Author.Item[k]); + end; + mmoRes.Lines.Add(' Manufacturer :' + itm.ItemAttributes.Manufacturer); + mmoRes.Lines.Add(' ProductGroup :' + itm.ItemAttributes.ProductGroup); + end; + mmoRes.Lines.Add(''); + end; + end; + mmoRes.SelStart := 0; + end else begin + ShowMessage('not Assigned(rsps)'); + end; + end; + finally + Screen.Cursor := crDefault; + FreeAndNil(rqst); + FreeAndNil(rsps); + end; +end; + + +initialization + {$I umain.lrs} + + SYNAPSE_RegisterHTTP_Transport(); + +end. diff --git a/wst/tags/0.4/tests/apache_module/mod_wst.lpi b/wst/tags/0.4/tests/apache_module/mod_wst.lpi new file mode 100644 index 000000000..5572db971 --- /dev/null +++ b/wst/tags/0.4/tests/apache_module/mod_wst.lpi @@ -0,0 +1,257 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wst/tags/0.4/tests/apache_module/mod_wst.lpr b/wst/tags/0.4/tests/apache_module/mod_wst.lpr new file mode 100644 index 000000000..a908942dd --- /dev/null +++ b/wst/tags/0.4/tests/apache_module/mod_wst.lpr @@ -0,0 +1,51 @@ +library mod_wst; +{$mode objfpc}{$H+} + +{$IFDEF WIN32} + {$DEFINE WINDOWS} +{$ENDIF} + +uses + SysUtils, + httpd, apr, apriconv, aprutil, wst_apache_binding; + +var + wst_module: module; {$ifdef Unix} public name 'wst_module'; {$endif} + default_module_ptr: Pmodule; + +const + MODULE_NAME = 'mod_wst.so'; + +{$ifdef WINDOWS} +exports + wst_module name 'wst_module'; +{$endif} + + +function DefaultHandler(r: Prequest_rec): Integer; cdecl; +begin + if not SameText(r^.handler, 'wst-handler') then + begin + Result := DECLINED; + Exit; + end; + + Result := wst_RequestHandler(r); +end; + +procedure RegisterHooks(p: Papr_pool_t); cdecl; +begin + ap_hook_handler(@DefaultHandler, nil, nil, APR_HOOK_MIDDLE); +end; + +begin + default_module_ptr := @wst_module; + FillChar(default_module_ptr^, SizeOf(default_module_ptr^), 0); + STANDARD20_MODULE_STUFF(default_module_ptr^); + with wst_module do + begin + name := MODULE_NAME; + magic := MODULE_MAGIC_COOKIE; + register_hooks := @RegisterHooks; + end; +end. diff --git a/wst/tags/0.4/tests/apache_module/wst_apache_binding.pas b/wst/tags/0.4/tests/apache_module/wst_apache_binding.pas new file mode 100644 index 000000000..3c3143e47 --- /dev/null +++ b/wst/tags/0.4/tests/apache_module/wst_apache_binding.pas @@ -0,0 +1,318 @@ +//{$DEFINE WST_DBG} + +unit wst_apache_binding; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, + httpd, apr, apriconv, aprutil; + +const + sWST_ROOT = 'wst'; + sSEPARATOR = '/'; + sSERVICES_PREFIXE = 'services'; + sWSDL = 'WSDL'; + sHTTP_BINARY_CONTENT_TYPE = 'application/octet-stream'; + sCONTENT_TYPE = 'Content-Type'; + + function wst_RequestHandler(r: Prequest_rec): Integer; + +implementation +uses base_service_intf, + server_service_intf, server_service_imputils, + server_service_soap, server_binary_formatter, + metadata_repository, metadata_wsdl, DOM, XMLWrite, + + calculator, calculator_binder, calculator_imp, + metadata_service, metadata_service_binder, metadata_service_imp; + +type + TRequestInfo = record + Root : string; + URI : string; + ContentType : string; + Buffer : string; + end; + + TResponseInfo = record + ContentText : string; + ContentType : string; + end; + + +procedure SaveStringToFile(const AStr,AFile:string;const AKeepExisting : Boolean); +begin + with TMemoryStream.Create() do try + if AKeepExisting and FileExists(AFile) then begin + LoadFromFile(AFile); + Position := Size; + end; + if ( Length(AStr) > 0 ) then + Write(AStr[1],Length(AStr)); + SaveToFile(AFile); + finally + Free(); + end; +end; + +function ReadBuffer(r : Prequest_rec; out rbuf : string ) : Integer; +var + argsbuffer : string; + rsize, len_read, rpos : Integer; + loc_length : Integer; +begin + rbuf := ''; + Result := ap_setup_client_block(r, REQUEST_CHUNKED_ERROR); + if ( Result <> OK ) then + Exit; + + if ( ap_should_client_block(r) <> 0 ) then begin + SetLength(argsbuffer,HUGE_STRING_LEN); + FillChar(argsbuffer[1],Length(argsbuffer),0); + rsize := 0; len_read := 0; rpos := 0; + loc_length := r^.remaining; + SetLength(rbuf, loc_length ); + + while True do begin + len_read := ap_get_client_block(r, @(argsbuffer[1]), Length(argsbuffer)); + if ( len_read <= 0 ) then + Exit; + if ( ( rpos + len_read ) > loc_length ) then + rsize := loc_length - rpos + else + rsize := len_read; + Move(argsbuffer[1],rbuf[ ( 1 + rpos ) ], rsize); + Inc(rpos,rsize); + end; + end; +end; + +function ExtractNextPathElement(var AFullPath : string):string; +var + i : SizeInt; +begin + Result := ''; + if ( Length(AFullPath) > 0 ) then begin + while ( Length(AFullPath) > 0 ) and ( AFullPath[1] = sSEPARATOR ) do begin + Delete(AFullPath,1,1); + end; + i := Pos(sSEPARATOR,AFullPath); + if ( i < 1 ) then begin + Result := AFullPath; + AFullPath := ''; + end else begin + Result := Copy(AFullPath,1,Pred(i)); + Delete(AFullPath,1,i); + end; + end; +end; + +function GetWSDL(const ARepName, ARootAddress: shortstring):string; +var + strm : TMemoryStream; + rep : PServiceRepository; + doc :TXMLDocument; + i : SizeInt; + s : string; +begin + Result := ''; + rep := nil; + doc := Nil; + i := GetModuleMetadataMngr().IndexOfName(ARepName); + if ( i < 0 ) then + Exit; + strm := TMemoryStream.Create(); + try + s := GetModuleMetadataMngr().GetRepositoryName(i); + GetModuleMetadataMngr().LoadRepositoryName(s,ARootAddress,rep); + strm.Clear(); + doc := TXMLDocument.Create(); + GenerateWSDL(rep,doc); + WriteXMLFile(doc,strm); + i := strm.Size; + if ( i > 0 ) then begin + SetLength(Result,i); + Move(strm.memory^,Result[1],i); + end; + finally + doc.Free(); + strm.Free(); + GetModuleMetadataMngr().ClearRepository(rep); + end; +end; + +function GenerateWSDLTable(): string; +var + r : IModuleMetadataMngr; + i : Integer; +begin + r := GetModuleMetadataMngr(); + Result := '' + + ''+ + ''+ + 'The Web Service Toolkit generated Metadata table'+ + ''+ + '' + + '

The following repositories has available. Click on the link to view the corresponding WSDL.

'+ + ''; + + for i := 0 to Pred(r.GetCount()) do + Result := Result + '' + + '' + + ''; + + Result := Result + + ''+ + '
' + + Format('',[sSEPARATOR+sWST_ROOT+sSEPARATOR+sSERVICES_PREFIXE+sSEPARATOR+sWSDL+sSEPARATOR+r.GetRepositoryName(i)])+ + r.GetRepositoryName(i) + + ''+ + '
'+ + ''+ + ''+ + ''; +end; + +procedure ProcessWSDLRequest( + const ARequestInfo : TRequestInfo; + out AResponseInfo : TResponseInfo +); +var + locRepName, strBuff, locPath : string; + i : Integer; +begin + FillChar(AResponseInfo,SizeOf(TResponseInfo),#0); + locPath := ARequestInfo.URI; + locRepName := ExtractNextPathElement(locPath); + if AnsiSameText(sWSDL,locRepName) then + locRepName := ExtractNextPathElement(locPath); + strBuff := GetWSDL(locRepName,ARequestInfo.Root); + i := Length(strBuff); + if ( i > 0 ) then begin + AResponseInfo.ContentType := 'text/xml'; + AResponseInfo.ContentText := strBuff; + Exit; + end; + AResponseInfo.ContentText := GenerateWSDLTable(); + AResponseInfo.ContentType := 'text/html'; +end; + +function ProcessServiceRequest( + const ARequestInfo : TRequestInfo; + out AResponseInfo : TResponseInfo +):Boolean; +var + trgt,ctntyp, loc_path : string; + rqst : IRequestBuffer; + inStream, outStream: TMemoryStream; + i : Integer; +begin + FillChar(AResponseInfo,SizeOf(TResponseInfo),#0); + loc_path := ARequestInfo.URI; + trgt := ExtractNextPathElement(loc_path); + Result := False; + if AnsiSameText(sWSDL,trgt) then + Exit; + Result := True; + inStream := nil; + outStream := nil; + try + inStream := TMemoryStream.Create(); + outStream := TMemoryStream.Create(); + + ctntyp := ARequestInfo.ContentType; + i := Length(ARequestInfo.Buffer); + if ( i > 0 ) then + inStream.Write(ARequestInfo.Buffer[1],i); + inStream.Position := 0; + if AnsiSameText(sBINARY_CONTENT_TYPE,ctntyp) then + AResponseInfo.ContentType := sHTTP_BINARY_CONTENT_TYPE + else + AResponseInfo.ContentType := ctntyp; + rqst := TRequestBuffer.Create(trgt,ctntyp,inStream,outStream); + HandleServiceRequest(rqst); + i := outStream.Size; + if ( i > 0 ) then begin + SetLength(AResponseInfo.ContentText,i); + Move(outStream.Memory^,AResponseInfo.ContentText[1],i); + end; + finally + outStream.Free(); + inStream.Free(); + {$IFDEF WST_DBG} + {SaveStringToFile('RequestInfo.ContentType=' + ARequestInfo.ContentType + LineEnding,'E:\Inoussa\Sources\lazarus\wst\v0.3\tests\apache_module\log.log',False); + SaveStringToFile('RequestInfo.Buffer=' + ARequestInfo.Buffer + LineEnding,'E:\Inoussa\Sources\lazarus\wst\v0.3\tests\apache_module\log.log',True); + SaveStringToFile('RequestInfo.URI=' + ARequestInfo.URI + LineEnding,'E:\Inoussa\Sources\lazarus\wst\v0.3\tests\apache_module\log.log',True); + SaveStringToFile('ResponseInfo.ContentType=' + AResponseInfo.ContentType + LineEnding,'E:\Inoussa\Sources\lazarus\wst\v0.3\tests\apache_module\log.log',True); + SaveStringToFile('ResponseInfo.ContentText=' + AResponseInfo.ContentText + LineEnding,'E:\Inoussa\Sources\lazarus\wst\v0.3\tests\apache_module\log.log',True); + } + {$ENDIF} + end; +end; + +function wst_RequestHandler(r: Prequest_rec): Integer; + + function FillRequestInfo(var ARequestInfo : TRequestInfo):Integer; + begin + ARequestInfo.ContentType := apr_table_get(r^.headers_in,sCONTENT_TYPE); + ARequestInfo.Root := ap_get_server_name(r) + sSEPARATOR + sWST_ROOT + sSEPARATOR; + ARequestInfo.URI := r^.uri; + Result := ReadBuffer(r,ARequestInfo.Buffer); + end; + +var + sInputBuffer : string; + iRet, iLen : Integer; + loc_RequestInfo : TRequestInfo; + loc_ResponseInfo : TResponseInfo; +begin + Result := FillRequestInfo(loc_RequestInfo); + if not AnsiSameText(sWST_ROOT,ExtractNextPathElement(loc_RequestInfo.URI)) then + Result := DECLINED; + if ( Result <> OK ) then + Exit; + + try + if AnsiSameText(sSERVICES_PREFIXE,ExtractNextPathElement(loc_RequestInfo.URI)) then begin + if not ProcessServiceRequest(loc_RequestInfo,loc_ResponseInfo) then + ProcessWSDLRequest(loc_RequestInfo,loc_ResponseInfo); + end else begin + ProcessWSDLRequest(loc_RequestInfo,loc_ResponseInfo); + end; + + ap_set_content_type(r, PCHAR(loc_ResponseInfo.ContentType)); + if AnsiSameText(sHTTP_BINARY_CONTENT_TYPE,loc_ResponseInfo.ContentType) then begin + ap_set_content_length(r,Length(loc_ResponseInfo.ContentText)); + ap_rwrite(@(loc_ResponseInfo.ContentText[1]),Length(loc_ResponseInfo.ContentText),r); + ap_rflush(r); + end else begin + ap_rputs(PCHAR(loc_ResponseInfo.ContentText), r); + end; + Result := OK; + Exit; + except + on e : Exception do begin + ap_set_content_type(r, 'text/html'); + ap_rputs(' Error' + LineEnding, r); + ap_rputs('',r); + ap_rprintf(r, '

"%s"

' + LineEnding, [PCHAR(e.Message)]); + Exit; + end; + end; +end; + +initialization + RegisterStdTypes(); + Server_service_RegisterBinaryFormat(); + Server_service_RegisterSoapFormat(); + + RegisterCalculatorImplementationFactory(); + Server_service_RegisterCalculatorService(); + + Server_service_RegisterWSTMetadataServiceService(); + RegisterWSTMetadataServiceImplementationFactory(); + +end. diff --git a/wst/tags/0.4/tests/calculator/calculator.pas b/wst/tags/0.4/tests/calculator/calculator.pas new file mode 100644 index 000000000..279d6c242 --- /dev/null +++ b/wst/tags/0.4/tests/calculator/calculator.pas @@ -0,0 +1,121 @@ +unit calculator; + +{$IFDEF FPC} + {$mode objfpc}{$H+} + {$DEFINE HAS_QWORD} + {$DEFINE USE_INLINE} +{$ELSE} + {$UNDEF HAS_QWORD} + {$UNDEF USE_INLINE} +{$ENDIF} + +interface +uses SysUtils, + base_service_intf; + +Type + + + TCalc_Op = ( coAdd, coSub, coMul, coDiv ); + + { TCalcHeader } + + TCalcHeader = class(THeaderBlock) + private + FLogin: string; + FPassword: string; + FWantedPrecision: Integer; + published + property Login : string read FLogin write FLogin; + property Password : string read FPassword write FPassword; + property WantedPrecision : Integer read FWantedPrecision write FWantedPrecision; + end; + + { TCalcResultHeader } + + TCalcResultHeader = class(TCalcHeader) + private + FSessionID: string; + FTimeStamp: string; + published + property TimeStamp : string read FTimeStamp write FTimeStamp; + property SessionID : string read FSessionID write FSessionID; + end; + + TBinaryArgsResult = class(TBaseComplexRemotable) + private + FArg_A: Integer; + FArg_B: Integer; + FArg_OP: string; + FArg_OpEnum: TCalc_Op; + FArg_R: Integer; + FComment: string; + private + function GetHasComment: boolean; + Published + Property Arg_A : Integer Read FArg_A Write FArg_A; + Property Arg_B : Integer Read FArg_B Write FArg_B; + Property Arg_R : Integer Read FArg_R Write FArg_R; + Property Arg_OP : string Read FArg_OP Write FArg_OP; + Property Arg_OpEnum : TCalc_Op Read FArg_OpEnum Write FArg_OpEnum; + property Comment : string read FComment write FComment stored GetHasComment; + End; + + TBinaryArgsResultArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): TBinaryArgsResult; + Public + class function GetItemClass():TBaseRemotableClass;override; + Property Item[AIndex:Integer] : TBinaryArgsResult Read GetItem;Default; + End; + + ICalculator = Interface + function AddInt( + Const A:Integer; + Const B:Integer + ):TBinaryArgsResult; + function DivInt( + Const A:Integer; + Const B:Integer + ):Integer; + function DoAllOperations( + Const A:Integer; + Const B:Integer + ):TBinaryArgsResultArray; + function DoOperation( + Const A:Integer; + Const B:Integer; + const AOperation : TCalc_Op + ):TBinaryArgsResult; + End; + +implementation + + +{ TBinaryArgsResultArray } + +function TBinaryArgsResultArray.GetItem(AIndex: Integer): TBinaryArgsResult; +begin + Result := Inherited GetItem(AIndex) as TBinaryArgsResult; +end; + +class function TBinaryArgsResultArray.GetItemClass(): TBaseRemotableClass; +begin + Result := TBinaryArgsResult; +end; + +{ TBinaryArgsResult } + +function TBinaryArgsResult.GetHasComment: boolean; +begin + Result := ( Length(Trim(FComment)) > 0 ) ; +end; + +Initialization + GetTypeRegistry().Register('urn:calculator',TypeInfo(TCalc_Op),'TCalc_Op'); + GetTypeRegistry().Register('urn:calculator',TypeInfo(TBinaryArgsResult),'TBinaryArgsResult'); + GetTypeRegistry().Register('urn:calculator',TypeInfo(TBinaryArgsResultArray),'TBinaryArgsResultArray'); + GetTypeRegistry().Register('urn:calculator',TypeInfo(TCalcHeader),'CalcHeader').AddPascalSynonym('TCalcHeader'); + GetTypeRegistry().Register('urn:calculator',TypeInfo(TCalcResultHeader),'CalcResultHeader').AddPascalSynonym('TCalcResultHeader'); + +end. diff --git a/wst/tags/0.4/tests/calculator/calculator.wst_meta b/wst/tags/0.4/tests/calculator/calculator.wst_meta new file mode 100644 index 000000000..b4a0cfa80 Binary files /dev/null and b/wst/tags/0.4/tests/calculator/calculator.wst_meta differ diff --git a/wst/tags/0.4/tests/calculator/client/calc_client.lpi b/wst/tags/0.4/tests/calculator/client/calc_client.lpi new file mode 100644 index 000000000..6e1720966 --- /dev/null +++ b/wst/tags/0.4/tests/calculator/client/calc_client.lpi @@ -0,0 +1,251 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wst/tags/0.4/tests/calculator/client/calc_client.pas b/wst/tags/0.4/tests/calculator/client/calc_client.pas new file mode 100644 index 000000000..63b16fcd4 --- /dev/null +++ b/wst/tags/0.4/tests/calculator/client/calc_client.pas @@ -0,0 +1,83 @@ +program calc_client; + +{$mode objfpc}{$H+} + +uses + Classes, SysUtils, + service_intf, + base_soap_formatter, soap_formatter, binary_formatter, + ics_tcp_protocol, + calculator, calculator_proxy, TypInfo; + +Var + calcObj : ICalculator; + i, j, k : Integer; + rk : TBinaryArgsResult; + vA : TBinaryArgsResultArray; + f : IFormatterClient; + s : TStream; + msgProt : string; +begin +{ vA := TBinaryArgsResultArray.Create(); + vA.SetLength(2); + f := TBinaryFormatter.Create() as IFormatterClient; + f.BeginCall('pr','trgt'); + f.Put('xx',TypeInfo(TBinaryArgsResultArray),vA); + f.EndCall(); + s:= TMemoryStream.Create(); + f.SaveToStream(s); + f := Nil; + f := TBinaryFormatter.Create() as IFormatterClient; + s.Position := 0; + WriteLn('------------------------------------------'); + WriteLn('------------------------------------------'); + f.LoadFromStream(s); + ReadLn(); + Exit;} + //Client + Write('Enter msg protocol :'); + ReadLn(msgProt); + If Not( AnsiSameText(msgProt,'SOAP') Or AnsiSameText(msgProt,'binary') ) Then + msgProt := 'binary'; + Writeln('USED Msg protocol = ',msgProt); + ICS_RegisterTCP_Transport(); + + rk := nil; + Try + Try + calcObj := TCalculator_Proxy.Create( + 'ICalculator', // Target + msgProt,//'SOAP',//'binary', // Protocol Data + 'TCP:Address=127.0.0.1;Port=1234;target=ICalculator' // Transport Data + ); + WriteLn('Calculator test.'); + Write('Enter A = '); ReadLn(i); + Write('Enter B = '); ReadLn(j); + k := calcObj.DivInt(i,j); + Write(' A / B = '); WriteLn(k); + rk := calcObj.AddInt(i,j); + WriteLn(Format(' ( %d %s %d ) = %d',[rk.Arg_A, rk.Arg_OP, rk.Arg_B, rk.Arg_R])); + WriteLn('----------------------------------------------'); + vA := calcObj.DoAllOperations(i,j); + Try + For i := 0 To Pred(vA.Length) Do + WriteLn(Format(' ( %d %s %d ) = %d; OP=%s',[vA[i].Arg_A, vA[i].Arg_OP, vA[i].Arg_B, vA[i].Arg_R,GetEnumName(TypeInfo(TCalc_Op),Ord(vA[i].Arg_OpEnum))])); + Finally + vA.Free(); + End; + Except + On E : ESOAPException Do Begin + WriteLn('Oups ( SOAP Exception ) :'); + WriteLn(' Code=',E.FaultCode); + WriteLn(' String=',E.FaultString); + End; + On E : Exception Do Begin + WriteLn('Oups:'); + WriteLn(E.Message); + End; + End; + Finally + rk.Free(); + End; + ReadLn(); +end. diff --git a/wst/tags/0.4/tests/calculator/client/calculator.wst b/wst/tags/0.4/tests/calculator/client/calculator.wst new file mode 100644 index 000000000..8d987fa93 --- /dev/null +++ b/wst/tags/0.4/tests/calculator/client/calculator.wst @@ -0,0 +1,13 @@ + GetWSTResourceManager().AddResource('CALCULATOR', + #0#0#0#20'WST_METADATA_0.2.2.0'#0#0#0#10'calculator'#1#0#0#0#11'ICalculator'#4 + +#0#0#0#6'AddInt'#3#0#0#0#1'A'#0#0#0#7'Integer'#0#0#0#0#0#0#0#1#0#0#0#1'B'#0#0 + +#0#7'Integer'#0#0#0#0#0#0#0#1#0#0#0#6'result'#0#0#0#17'TBinaryArgsResult'#0#0 + +#0#0#0#0#0#3#0#0#0#6'DivInt'#3#0#0#0#1'A'#0#0#0#7'Integer'#0#0#0#0#0#0#0#1#0 + +#0#0#1'B'#0#0#0#7'Integer'#0#0#0#0#0#0#0#1#0#0#0#6'result'#0#0#0#7'Integer'#0 + +#0#0#0#0#0#0#3#0#0#0#15'DoAllOperations'#3#0#0#0#1'A'#0#0#0#7'Integer'#0#0#0 + +#0#0#0#0#1#0#0#0#1'B'#0#0#0#7'Integer'#0#0#0#0#0#0#0#1#0#0#0#6'result'#0#0#0 + +#22'TBinaryArgsResultArray'#0#0#0#0#0#0#0#3#0#0#0#11'DoOperation'#4#0#0#0#1'A' + +#0#0#0#7'Integer'#0#0#0#0#0#0#0#1#0#0#0#1'B'#0#0#0#7'Integer'#0#0#0#0#0#0#0#1 + +#0#0#0#10'AOperation'#0#0#0#8'TCalc_Op'#0#0#0#0#0#0#0#1#0#0#0#6'result'#0#0#0 + +#17'TBinaryArgsResult'#0#0#0#0#0#0#0#3'' + ); \ No newline at end of file diff --git a/wst/tags/0.4/tests/calculator/client/calculator_proxy.pas b/wst/tags/0.4/tests/calculator/client/calculator_proxy.pas new file mode 100644 index 000000000..f9aa10959 --- /dev/null +++ b/wst/tags/0.4/tests/calculator/client/calculator_proxy.pas @@ -0,0 +1,164 @@ +{ +This unit has been produced by ws_helper. + Input unit name : "calculator". + This unit name : "calculator_proxy". + Date : "12/11/2006 11:21". +} +Unit calculator_proxy; +{$mode objfpc}{$H+} +Interface + +Uses SysUtils, Classes, TypInfo, base_service_intf, service_intf, calculator; + +Type + + + TCalculator_Proxy=class(TBaseProxy,ICalculator) + Protected + class function GetServiceType() : PTypeInfo;override; + function AddInt( + Const A : Integer; + Const B : Integer + ):TBinaryArgsResult; + function DivInt( + Const A : Integer; + Const B : Integer + ):Integer; + function DoAllOperations( + Const A : Integer; + Const B : Integer + ):TBinaryArgsResultArray; + function DoOperation( + Const A : Integer; + Const B : Integer; + Const AOperation : TCalc_Op + ):TBinaryArgsResult; + End; + +Implementation +uses wst_resources_imp, metadata_repository; + +{ TCalculator_Proxy implementation } + +class function TCalculator_Proxy.GetServiceType() : PTypeInfo; +begin + result := TypeInfo(ICalculator); +end; + +function TCalculator_Proxy.AddInt( + Const A : Integer; + Const B : Integer +):TBinaryArgsResult; +Var + locSerializer : IFormatterClient; + strPrmName : string; +Begin + locSerializer := GetSerializer(); + Try + locSerializer.BeginCall('AddInt', GetTarget(),(Self as ICallContext)); + locSerializer.Put('A', TypeInfo(Integer), A); + locSerializer.Put('B', TypeInfo(Integer), B); + locSerializer.EndCall(); + + MakeCall(); + + locSerializer.BeginCallRead((Self as ICallContext)); + Pointer(Result) := Nil; + strPrmName := 'return'; + locSerializer.Get(TypeInfo(TBinaryArgsResult), strPrmName, result); + + Finally + locSerializer.Clear(); + End; +End; + +function TCalculator_Proxy.DivInt( + Const A : Integer; + Const B : Integer +):Integer; +Var + locSerializer : IFormatterClient; + strPrmName : string; +Begin + locSerializer := GetSerializer(); + Try + locSerializer.BeginCall('DivInt', GetTarget(),(Self as ICallContext)); + locSerializer.Put('A', TypeInfo(Integer), A); + locSerializer.Put('B', TypeInfo(Integer), B); + locSerializer.EndCall(); + + MakeCall(); + + locSerializer.BeginCallRead((Self as ICallContext)); + strPrmName := 'return'; + locSerializer.Get(TypeInfo(Integer), strPrmName, result); + + Finally + locSerializer.Clear(); + End; +End; + +function TCalculator_Proxy.DoAllOperations( + Const A : Integer; + Const B : Integer +):TBinaryArgsResultArray; +Var + locSerializer : IFormatterClient; + strPrmName : string; +Begin + locSerializer := GetSerializer(); + Try + locSerializer.BeginCall('DoAllOperations', GetTarget(),(Self as ICallContext)); + locSerializer.Put('A', TypeInfo(Integer), A); + locSerializer.Put('B', TypeInfo(Integer), B); + locSerializer.EndCall(); + + MakeCall(); + + locSerializer.BeginCallRead((Self as ICallContext)); + Pointer(Result) := Nil; + strPrmName := 'return'; + locSerializer.Get(TypeInfo(TBinaryArgsResultArray), strPrmName, result); + + Finally + locSerializer.Clear(); + End; +End; + +function TCalculator_Proxy.DoOperation( + Const A : Integer; + Const B : Integer; + Const AOperation : TCalc_Op +):TBinaryArgsResult; +Var + locSerializer : IFormatterClient; + strPrmName : string; +Begin + locSerializer := GetSerializer(); + Try + locSerializer.BeginCall('DoOperation', GetTarget(),(Self as ICallContext)); + locSerializer.Put('A', TypeInfo(Integer), A); + locSerializer.Put('B', TypeInfo(Integer), B); + locSerializer.Put('AOperation', TypeInfo(TCalc_Op), AOperation); + locSerializer.EndCall(); + + MakeCall(); + + locSerializer.BeginCallRead((Self as ICallContext)); + Pointer(Result) := Nil; + strPrmName := 'return'; + locSerializer.Get(TypeInfo(TBinaryArgsResult), strPrmName, result); + + Finally + locSerializer.Clear(); + End; +End; + + +initialization + {$i calculator.wst} + + {$IF DECLARED(Register_calculator_ServiceMetadata)} + Register_calculator_ServiceMetadata(); + {$ENDIF} +End. diff --git a/wst/tags/0.4/tests/calculator/gui_client/calculator.wst b/wst/tags/0.4/tests/calculator/gui_client/calculator.wst new file mode 100644 index 000000000..8d987fa93 --- /dev/null +++ b/wst/tags/0.4/tests/calculator/gui_client/calculator.wst @@ -0,0 +1,13 @@ + GetWSTResourceManager().AddResource('CALCULATOR', + #0#0#0#20'WST_METADATA_0.2.2.0'#0#0#0#10'calculator'#1#0#0#0#11'ICalculator'#4 + +#0#0#0#6'AddInt'#3#0#0#0#1'A'#0#0#0#7'Integer'#0#0#0#0#0#0#0#1#0#0#0#1'B'#0#0 + +#0#7'Integer'#0#0#0#0#0#0#0#1#0#0#0#6'result'#0#0#0#17'TBinaryArgsResult'#0#0 + +#0#0#0#0#0#3#0#0#0#6'DivInt'#3#0#0#0#1'A'#0#0#0#7'Integer'#0#0#0#0#0#0#0#1#0 + +#0#0#1'B'#0#0#0#7'Integer'#0#0#0#0#0#0#0#1#0#0#0#6'result'#0#0#0#7'Integer'#0 + +#0#0#0#0#0#0#3#0#0#0#15'DoAllOperations'#3#0#0#0#1'A'#0#0#0#7'Integer'#0#0#0 + +#0#0#0#0#1#0#0#0#1'B'#0#0#0#7'Integer'#0#0#0#0#0#0#0#1#0#0#0#6'result'#0#0#0 + +#22'TBinaryArgsResultArray'#0#0#0#0#0#0#0#3#0#0#0#11'DoOperation'#4#0#0#0#1'A' + +#0#0#0#7'Integer'#0#0#0#0#0#0#0#1#0#0#0#1'B'#0#0#0#7'Integer'#0#0#0#0#0#0#0#1 + +#0#0#0#10'AOperation'#0#0#0#8'TCalc_Op'#0#0#0#0#0#0#0#1#0#0#0#6'result'#0#0#0 + +#17'TBinaryArgsResult'#0#0#0#0#0#0#0#3'' + ); \ No newline at end of file diff --git a/wst/tags/0.4/tests/calculator/gui_client/calculator.wst_meta b/wst/tags/0.4/tests/calculator/gui_client/calculator.wst_meta new file mode 100644 index 000000000..b4a0cfa80 Binary files /dev/null and b/wst/tags/0.4/tests/calculator/gui_client/calculator.wst_meta differ diff --git a/wst/tags/0.4/tests/calculator/gui_client/calculator_proxy.pas b/wst/tags/0.4/tests/calculator/gui_client/calculator_proxy.pas new file mode 100644 index 000000000..c6c76f55a --- /dev/null +++ b/wst/tags/0.4/tests/calculator/gui_client/calculator_proxy.pas @@ -0,0 +1,164 @@ +{ +This unit has been produced by ws_helper. + Input unit name : "calculator". + This unit name : "calculator_proxy". + Date : "12/11/2006 11:22". +} +Unit calculator_proxy; +{$mode objfpc}{$H+} +Interface + +Uses SysUtils, Classes, TypInfo, base_service_intf, service_intf, calculator; + +Type + + + TCalculator_Proxy=class(TBaseProxy,ICalculator) + Protected + class function GetServiceType() : PTypeInfo;override; + function AddInt( + Const A : Integer; + Const B : Integer + ):TBinaryArgsResult; + function DivInt( + Const A : Integer; + Const B : Integer + ):Integer; + function DoAllOperations( + Const A : Integer; + Const B : Integer + ):TBinaryArgsResultArray; + function DoOperation( + Const A : Integer; + Const B : Integer; + Const AOperation : TCalc_Op + ):TBinaryArgsResult; + End; + +Implementation +uses wst_resources_imp, metadata_repository; + +{ TCalculator_Proxy implementation } + +class function TCalculator_Proxy.GetServiceType() : PTypeInfo; +begin + result := TypeInfo(ICalculator); +end; + +function TCalculator_Proxy.AddInt( + Const A : Integer; + Const B : Integer +):TBinaryArgsResult; +Var + locSerializer : IFormatterClient; + strPrmName : string; +Begin + locSerializer := GetSerializer(); + Try + locSerializer.BeginCall('AddInt', GetTarget(),(Self as ICallContext)); + locSerializer.Put('A', TypeInfo(Integer), A); + locSerializer.Put('B', TypeInfo(Integer), B); + locSerializer.EndCall(); + + MakeCall(); + + locSerializer.BeginCallRead((Self as ICallContext)); + Pointer(Result) := Nil; + strPrmName := 'return'; + locSerializer.Get(TypeInfo(TBinaryArgsResult), strPrmName, result); + + Finally + locSerializer.Clear(); + End; +End; + +function TCalculator_Proxy.DivInt( + Const A : Integer; + Const B : Integer +):Integer; +Var + locSerializer : IFormatterClient; + strPrmName : string; +Begin + locSerializer := GetSerializer(); + Try + locSerializer.BeginCall('DivInt', GetTarget(),(Self as ICallContext)); + locSerializer.Put('A', TypeInfo(Integer), A); + locSerializer.Put('B', TypeInfo(Integer), B); + locSerializer.EndCall(); + + MakeCall(); + + locSerializer.BeginCallRead((Self as ICallContext)); + strPrmName := 'return'; + locSerializer.Get(TypeInfo(Integer), strPrmName, result); + + Finally + locSerializer.Clear(); + End; +End; + +function TCalculator_Proxy.DoAllOperations( + Const A : Integer; + Const B : Integer +):TBinaryArgsResultArray; +Var + locSerializer : IFormatterClient; + strPrmName : string; +Begin + locSerializer := GetSerializer(); + Try + locSerializer.BeginCall('DoAllOperations', GetTarget(),(Self as ICallContext)); + locSerializer.Put('A', TypeInfo(Integer), A); + locSerializer.Put('B', TypeInfo(Integer), B); + locSerializer.EndCall(); + + MakeCall(); + + locSerializer.BeginCallRead((Self as ICallContext)); + Pointer(Result) := Nil; + strPrmName := 'return'; + locSerializer.Get(TypeInfo(TBinaryArgsResultArray), strPrmName, result); + + Finally + locSerializer.Clear(); + End; +End; + +function TCalculator_Proxy.DoOperation( + Const A : Integer; + Const B : Integer; + Const AOperation : TCalc_Op +):TBinaryArgsResult; +Var + locSerializer : IFormatterClient; + strPrmName : string; +Begin + locSerializer := GetSerializer(); + Try + locSerializer.BeginCall('DoOperation', GetTarget(),(Self as ICallContext)); + locSerializer.Put('A', TypeInfo(Integer), A); + locSerializer.Put('B', TypeInfo(Integer), B); + locSerializer.Put('AOperation', TypeInfo(TCalc_Op), AOperation); + locSerializer.EndCall(); + + MakeCall(); + + locSerializer.BeginCallRead((Self as ICallContext)); + Pointer(Result) := Nil; + strPrmName := 'return'; + locSerializer.Get(TypeInfo(TBinaryArgsResult), strPrmName, result); + + Finally + locSerializer.Clear(); + End; +End; + + +initialization + {$i calculator.wst} + + {$IF DECLARED(Register_calculator_ServiceMetadata)} + Register_calculator_ServiceMetadata(); + {$ENDIF} +End. diff --git a/wst/tags/0.4/tests/calculator/gui_client/main_unit.lfm b/wst/tags/0.4/tests/calculator/gui_client/main_unit.lfm new file mode 100644 index 000000000..0f3eb5164 --- /dev/null +++ b/wst/tags/0.4/tests/calculator/gui_client/main_unit.lfm @@ -0,0 +1,128 @@ +object fmain: Tfmain + Left = 269 + Height = 300 + Top = 234 + Width = 528 + HorzScrollBar.Page = 527 + VertScrollBar.Page = 299 + ActiveControl = edtA + Caption = '"calculator" service test' + ClientHeight = 300 + ClientWidth = 528 + OnCreate = FormCreate + object Label1: TLabel + Left = 16 + Height = 18 + Top = 48 + Width = 64 + Caption = 'Param "A"' + Color = clNone + ParentColor = False + end + object Label2: TLabel + Left = 17 + Height = 18 + Top = 80 + Width = 64 + Caption = 'Param "B"' + Color = clNone + ParentColor = False + end + object Label3: TLabel + Left = 240 + Height = 18 + Top = 52 + Width = 45 + Caption = 'Format' + Color = clNone + ParentColor = False + end + object Label4: TLabel + Left = 16 + Height = 18 + Top = 8 + Width = 49 + Caption = 'Address' + Color = clNone + ParentColor = False + end + object edtA: TEdit + Left = 80 + Height = 23 + Top = 48 + Width = 80 + TabOrder = 0 + Text = '5' + end + object edtB: TEdit + Left = 80 + Height = 23 + Top = 80 + Width = 80 + TabOrder = 1 + Text = '2' + end + object btnExec: TButton + Left = 384 + Height = 25 + Top = 8 + Width = 128 + BorderSpacing.InnerBorder = 4 + Caption = 'Execute' + OnClick = btnExecClick + TabOrder = 2 + end + object mmoLog: TMemo + Height = 180 + Top = 120 + Width = 528 + Align = alBottom + Anchors = [akTop, akLeft, akRight, akBottom] + Font.CharSet = ANSI_CHARSET + Font.Color = clBlack + Font.Height = -19 + Font.Name = 'Courier New' + Font.Pitch = fpFixed + Lines.Strings = ( + '' + ) + ScrollBars = ssBoth + TabOrder = 3 + end + object edtFormat: TEdit + Left = 288 + Height = 23 + Top = 50 + Width = 80 + TabOrder = 4 + Text = 'SOAP' + end + object btnInit: TButton + Left = 384 + Height = 25 + Top = 48 + Width = 75 + BorderSpacing.InnerBorder = 4 + Caption = 'Init Obj' + OnClick = btnInitClick + TabOrder = 5 + end + object btnClearLog: TButton + Left = 384 + Height = 25 + Top = 80 + Width = 75 + BorderSpacing.InnerBorder = 4 + Caption = 'Clear Log' + OnClick = btnClearLogClick + TabOrder = 6 + end + object edtAddress: TEdit + Left = 80 + Height = 23 + Top = 11 + Width = 288 + TabOrder = 7 + Text = 'http:Address=http://127.0.0.1:8000/services/ICalculator' + end +end diff --git a/wst/tags/0.4/tests/calculator/gui_client/main_unit.lrs b/wst/tags/0.4/tests/calculator/gui_client/main_unit.lrs new file mode 100644 index 000000000..d64d47fa6 --- /dev/null +++ b/wst/tags/0.4/tests/calculator/gui_client/main_unit.lrs @@ -0,0 +1,35 @@ +{ Ceci est un fichier ressource généré automatiquement par Lazarus } + +LazarusResources.Add('Tfmain','FORMDATA',[ + 'TPF0'#6'Tfmain'#5'fmain'#4'Left'#3#13#1#6'Height'#3','#1#3'Top'#3#234#0#5'Wi' + +'dth'#3#16#2#18'HorzScrollBar.Page'#3#15#2#18'VertScrollBar.Page'#3'+'#1#13 + +'ActiveControl'#7#4'edtA'#7'Caption'#6#25'"calculator" service test'#12'Clie' + +'ntHeight'#3','#1#11'ClientWidth'#3#16#2#8'OnCreate'#7#10'FormCreate'#0#6'TL' + +'abel'#6'Label1'#4'Left'#2#16#6'Height'#2#18#3'Top'#2'0'#5'Width'#2'@'#7'Cap' + +'tion'#6#9'Param "A"'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#6'TLabel'#6 + +'Label2'#4'Left'#2#17#6'Height'#2#18#3'Top'#2'P'#5'Width'#2'@'#7'Caption'#6#9 + +'Param "B"'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#6'TLabel'#6'Label3'#4 + +'Left'#3#240#0#6'Height'#2#18#3'Top'#2'4'#5'Width'#2'-'#7'Caption'#6#6'Forma' + +'t'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#6'TLabel'#6'Label4'#4'Left'#2 + +#16#6'Height'#2#18#3'Top'#2#8#5'Width'#2'1'#7'Caption'#6#7'Address'#5'Color' + +#7#6'clNone'#11'ParentColor'#8#0#0#5'TEdit'#4'edtA'#4'Left'#2'P'#6'Height'#2 + +#23#3'Top'#2'0'#5'Width'#2'P'#8'TabOrder'#2#0#4'Text'#6#1'5'#0#0#5'TEdit'#4 + +'edtB'#4'Left'#2'P'#6'Height'#2#23#3'Top'#2'P'#5'Width'#2'P'#8'TabOrder'#2#1 + +#4'Text'#6#1'2'#0#0#7'TButton'#7'btnExec'#4'Left'#3#128#1#6'Height'#2#25#3'T' + +'op'#2#8#5'Width'#3#128#0#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#7'E' + +'xecute'#7'OnClick'#7#12'btnExecClick'#8'TabOrder'#2#2#0#0#5'TMemo'#6'mmoLog' + +#6'Height'#3#180#0#3'Top'#2'x'#5'Width'#3#16#2#5'Align'#7#8'alBottom'#7'Anch' + +'ors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#12'Font.CharSet'#7#12'A' + +'NSI_CHARSET'#10'Font.Color'#7#7'clBlack'#11'Font.Height'#2#237#9'Font.Name' + +#6#11'Courier New'#10'Font.Pitch'#7#7'fpFixed'#13'Lines.Strings'#1#6#0#0#10 + +'ScrollBars'#7#6'ssBoth'#8'TabOrder'#2#3#0#0#5'TEdit'#9'edtFormat'#4'Left'#3 + +' '#1#6'Height'#2#23#3'Top'#2'2'#5'Width'#2'P'#8'TabOrder'#2#4#4'Text'#6#4'S' + +'OAP'#0#0#7'TButton'#7'btnInit'#4'Left'#3#128#1#6'Height'#2#25#3'Top'#2'0'#5 + +'Width'#2'K'#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#8'Init Obj'#7'On' + +'Click'#7#12'btnInitClick'#8'TabOrder'#2#5#0#0#7'TButton'#11'btnClearLog'#4 + +'Left'#3#128#1#6'Height'#2#25#3'Top'#2'P'#5'Width'#2'K'#25'BorderSpacing.Inn' + +'erBorder'#2#4#7'Caption'#6#9'Clear Log'#7'OnClick'#7#16'btnClearLogClick'#8 + +'TabOrder'#2#6#0#0#5'TEdit'#10'edtAddress'#4'Left'#2'P'#6'Height'#2#23#3'Top' + +#2#11#5'Width'#3' '#1#8'TabOrder'#2#7#4'Text'#6'7http:Address=http://127.0.0' + +'.1:8000/services/ICalculator'#0#0#0 +]); diff --git a/wst/tags/0.4/tests/calculator/gui_client/main_unit.pas b/wst/tags/0.4/tests/calculator/gui_client/main_unit.pas new file mode 100644 index 000000000..0a390e2b3 --- /dev/null +++ b/wst/tags/0.4/tests/calculator/gui_client/main_unit.pas @@ -0,0 +1,146 @@ +unit main_unit; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls, + Buttons, calculator, calculator_proxy; + +type + + { Tfmain } + + Tfmain = class(TForm) + btnExec: TButton; + btnInit: TButton; + btnClearLog: TButton; + edtAddress: TEdit; + edtFormat: TEdit; + edtA: TEdit; + edtB: TEdit; + Label1: TLabel; + Label2: TLabel; + Label3: TLabel; + Label4: TLabel; + mmoLog: TMemo; + procedure btnClearLogClick(Sender: TObject); + procedure btnExecClick(Sender: TObject); + procedure btnInitClick(Sender: TObject); + procedure FormCreate(Sender: TObject); + private + FObj : ICalculator; + procedure LogMsg(const AMsg : string); + public + end; + +var + fmain: Tfmain; + +implementation +uses TypInfo, base_service_intf, soap_formatter, binary_formatter, + ics_tcp_protocol, ics_http_protocol, + //synapse_http_protocol, + library_protocol, + service_intf; + +{ Tfmain } + +procedure Tfmain.btnExecClick(Sender: TObject); +Var + a, b, k : Integer; + rk : TBinaryArgsResult; + vA : TBinaryArgsResultArray; + ch : TCalcHeader; + rch : TCalcResultHeader; + hdrs : ICallContext; +begin + try + if not Assigned(FObj) then + FObj := TCalculator_Proxy.Create( + 'ICalculator', // Target + edtFormat.Text,//'SOAP',//'binary', // Protocol Data + edtAddress.Text + //'http:Address=http://127.0.0.1:8000/services/ICalculator' + //'TCP:Address=127.0.0.1;Port=1234;target=ICalculator' + );//'TCP:Address=127.0.0.1;Port=1234;target=ICalculator' + + ch := TCalcHeader.Create(); + ch.mustUnderstand := 0; + ch.Login := 'azerty'; + ch.Password := 'qwerty'; + ch.WantedPrecision := 121076; + hdrs := FObj as ICallContext; + hdrs.AddHeader(ch,true); + ch := TCalcHeader.Create(); + ch.Login := 'azerty'; + ch.Password := ''; + ch.WantedPrecision := 321654; + hdrs.AddHeader(ch,true); + ch := nil; + rk := Nil; + vA := Nil; + a := StrToInt(edtA.Text); + b := StrToInt(edtB.Text); + Try + rk := FObj.AddInt(a,b); + hdrs.ClearHeaders(hdOut); + LogMsg(Format('Header Count = %d',[hdrs.GetHeaderCount(AllHeaderDirection)])); + if ( hdrs.GetHeaderCount(AllHeaderDirection) > 0 ) then begin + LogMsg(Format('Header(0) Class = %s',[hdrs.GetHeader(0).ClassName])); + if hdrs.GetHeader(0).InheritsFrom(TCalcResultHeader) then begin + rch := hdrs.GetHeader(0) as TCalcResultHeader; + LogMsg(Format('Header(0) Dir = %d; TimeStamp = %s; SessionID = %s; Login =%s; Password = %s',[Ord(rch.Direction),rch.TimeStamp,rch.SessionID,rch.Login,rch.Password])); + end; + end; + LogMsg(Format(' ( %d %s %d ) = %d; Comment = %s',[rk.Arg_A, rk.Arg_OP, rk.Arg_B, rk.Arg_R,rk.Comment])); + + + rk := FObj.DoOperation(a,b,coSub); + LogMsg(Format(' ( %d %s %d ) = %d; Comment = %s',[rk.Arg_A, rk.Arg_OP, rk.Arg_B, rk.Arg_R,rk.Comment])); + + vA := FObj.DoAllOperations(a,b); + For k := 0 To Pred(vA.Length) Do + LogMsg(Format(' ( %d %s %d ) = %d; OP=%s; Comment = %s',[vA[k].Arg_A, vA[k].Arg_OP, vA[k].Arg_B, vA[k].Arg_R,GetEnumName(TypeInfo(TCalc_Op),Ord(vA[k].Arg_OpEnum)),vA[k].Comment])); + Finally + FreeAndNil(rk); + FreeAndNil(vA); + End; + except + on e : Exception do + ShowMessage(e.Message); + end; +end; + +procedure Tfmain.btnClearLogClick(Sender: TObject); +begin + mmoLog.Clear(); +end; + +procedure Tfmain.btnInitClick(Sender: TObject); +begin + FObj := Nil; +end; + +procedure Tfmain.FormCreate(Sender: TObject); +begin + FObj := Nil; + ICS_RegisterTCP_Transport(); + ICS_RegisterHTTP_Transport(); + LIB_Register_Transport(); + //SYNAPSE_RegisterHTTP_Transport(); +end; + +procedure Tfmain.LogMsg(const AMsg: string); +begin + mmoLog.Lines.Add(AMsg); +end; + +initialization + {$I main_unit.lrs} + + RegisterStdTypes(); + +end. + diff --git a/wst/tags/0.4/tests/calculator/gui_client/test_calc.lpi b/wst/tags/0.4/tests/calculator/gui_client/test_calc.lpi new file mode 100644 index 000000000..30f4d3c08 --- /dev/null +++ b/wst/tags/0.4/tests/calculator/gui_client/test_calc.lpi @@ -0,0 +1,391 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wst/tags/0.4/tests/calculator/gui_client/test_calc.lpr b/wst/tags/0.4/tests/calculator/gui_client/test_calc.lpr new file mode 100644 index 000000000..62c5c8912 --- /dev/null +++ b/wst/tags/0.4/tests/calculator/gui_client/test_calc.lpr @@ -0,0 +1,18 @@ +program test_calc; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Interfaces, // this includes the LCL widgetset + Forms + { add your units here }, main_unit, calculator, calculator_proxy; + +begin + Application.Initialize; + Application.CreateForm(Tfmain, fmain); + Application.Run; +end. + diff --git a/wst/tags/0.4/tests/calculator/srv/calculator.wst b/wst/tags/0.4/tests/calculator/srv/calculator.wst new file mode 100644 index 000000000..8d987fa93 --- /dev/null +++ b/wst/tags/0.4/tests/calculator/srv/calculator.wst @@ -0,0 +1,13 @@ + GetWSTResourceManager().AddResource('CALCULATOR', + #0#0#0#20'WST_METADATA_0.2.2.0'#0#0#0#10'calculator'#1#0#0#0#11'ICalculator'#4 + +#0#0#0#6'AddInt'#3#0#0#0#1'A'#0#0#0#7'Integer'#0#0#0#0#0#0#0#1#0#0#0#1'B'#0#0 + +#0#7'Integer'#0#0#0#0#0#0#0#1#0#0#0#6'result'#0#0#0#17'TBinaryArgsResult'#0#0 + +#0#0#0#0#0#3#0#0#0#6'DivInt'#3#0#0#0#1'A'#0#0#0#7'Integer'#0#0#0#0#0#0#0#1#0 + +#0#0#1'B'#0#0#0#7'Integer'#0#0#0#0#0#0#0#1#0#0#0#6'result'#0#0#0#7'Integer'#0 + +#0#0#0#0#0#0#3#0#0#0#15'DoAllOperations'#3#0#0#0#1'A'#0#0#0#7'Integer'#0#0#0 + +#0#0#0#0#1#0#0#0#1'B'#0#0#0#7'Integer'#0#0#0#0#0#0#0#1#0#0#0#6'result'#0#0#0 + +#22'TBinaryArgsResultArray'#0#0#0#0#0#0#0#3#0#0#0#11'DoOperation'#4#0#0#0#1'A' + +#0#0#0#7'Integer'#0#0#0#0#0#0#0#1#0#0#0#1'B'#0#0#0#7'Integer'#0#0#0#0#0#0#0#1 + +#0#0#0#10'AOperation'#0#0#0#8'TCalc_Op'#0#0#0#0#0#0#0#1#0#0#0#6'result'#0#0#0 + +#17'TBinaryArgsResult'#0#0#0#0#0#0#0#3'' + ); \ No newline at end of file diff --git a/wst/tags/0.4/tests/calculator/srv/calculator_binder.pas b/wst/tags/0.4/tests/calculator/srv/calculator_binder.pas new file mode 100644 index 000000000..8ccc064fe --- /dev/null +++ b/wst/tags/0.4/tests/calculator/srv/calculator_binder.pas @@ -0,0 +1,207 @@ +{ +This unit has been produced by ws_helper. + Input unit name : "calculator". + This unit name : "calculator_binder". + Date : "12/11/2006 11:22". +} +unit calculator_binder; +{$mode objfpc}{$H+} +interface + +uses SysUtils, Classes, base_service_intf, server_service_intf, calculator; + +type + + + TCalculator_ServiceBinder=class(TBaseServiceBinder) + Protected + procedure AddIntHandler(AFormatter:IFormatterResponse); + procedure DivIntHandler(AFormatter:IFormatterResponse); + procedure DoAllOperationsHandler(AFormatter:IFormatterResponse); + procedure DoOperationHandler(AFormatter:IFormatterResponse); + Public + constructor Create(); + End; + + TCalculator_ServiceBinderFactory = class(TInterfacedObject,IItemFactory) + protected + function CreateInstance():IInterface; + End; + + procedure Server_service_RegisterCalculatorService(); + +Implementation +uses TypInfo, wst_resources_imp,metadata_repository; + +{ TCalculator_ServiceBinder implementation } +procedure TCalculator_ServiceBinder.AddIntHandler(AFormatter:IFormatterResponse); +Var + cllCntrl : ICallControl; + tmpObj : ICalculator; + callCtx : ICallContext; + strPrmName : string; + procName,trgName : string; + A : Integer; + B : Integer; + returnVal : TBinaryArgsResult; +Begin + callCtx := GetCallContext(); + Pointer(returnVal) := Nil; + + strPrmName := 'A'; AFormatter.Get(TypeInfo(Integer),strPrmName,A); + strPrmName := 'B'; AFormatter.Get(TypeInfo(Integer),strPrmName,B); + + tmpObj := Self.GetFactory().CreateInstance() as ICalculator; + if Supports(tmpObj,ICallControl,cllCntrl) then + cllCntrl.SetCallContext(GetCallContext()); + + returnVal := tmpObj.AddInt(A,B); + If Assigned(Pointer(returnVal)) Then + callCtx.AddObjectToFree(TObject(returnVal)); + + procName := AFormatter.GetCallProcedureName(); + trgName := AFormatter.GetCallTarget(); + AFormatter.Clear(); + AFormatter.BeginCallResponse(procName,trgName); + AFormatter.Put('return',TypeInfo(TBinaryArgsResult),returnVal); + AFormatter.EndCallResponse(); + + callCtx := Nil; +End; + +procedure TCalculator_ServiceBinder.DivIntHandler(AFormatter:IFormatterResponse); +Var + cllCntrl : ICallControl; + tmpObj : ICalculator; + callCtx : ICallContext; + strPrmName : string; + procName,trgName : string; + A : Integer; + B : Integer; + returnVal : Integer; +Begin + callCtx := GetCallContext(); + + strPrmName := 'A'; AFormatter.Get(TypeInfo(Integer),strPrmName,A); + strPrmName := 'B'; AFormatter.Get(TypeInfo(Integer),strPrmName,B); + + tmpObj := Self.GetFactory().CreateInstance() as ICalculator; + if Supports(tmpObj,ICallControl,cllCntrl) then + cllCntrl.SetCallContext(GetCallContext()); + + returnVal := tmpObj.DivInt(A,B); + + procName := AFormatter.GetCallProcedureName(); + trgName := AFormatter.GetCallTarget(); + AFormatter.Clear(); + AFormatter.BeginCallResponse(procName,trgName); + AFormatter.Put('return',TypeInfo(Integer),returnVal); + AFormatter.EndCallResponse(); + + callCtx := Nil; +End; + +procedure TCalculator_ServiceBinder.DoAllOperationsHandler(AFormatter:IFormatterResponse); +Var + cllCntrl : ICallControl; + tmpObj : ICalculator; + callCtx : ICallContext; + strPrmName : string; + procName,trgName : string; + A : Integer; + B : Integer; + returnVal : TBinaryArgsResultArray; +Begin + callCtx := GetCallContext(); + Pointer(returnVal) := Nil; + + strPrmName := 'A'; AFormatter.Get(TypeInfo(Integer),strPrmName,A); + strPrmName := 'B'; AFormatter.Get(TypeInfo(Integer),strPrmName,B); + + tmpObj := Self.GetFactory().CreateInstance() as ICalculator; + if Supports(tmpObj,ICallControl,cllCntrl) then + cllCntrl.SetCallContext(GetCallContext()); + + returnVal := tmpObj.DoAllOperations(A,B); + If Assigned(Pointer(returnVal)) Then + callCtx.AddObjectToFree(TObject(returnVal)); + + procName := AFormatter.GetCallProcedureName(); + trgName := AFormatter.GetCallTarget(); + AFormatter.Clear(); + AFormatter.BeginCallResponse(procName,trgName); + AFormatter.Put('return',TypeInfo(TBinaryArgsResultArray),returnVal); + AFormatter.EndCallResponse(); + + callCtx := Nil; +End; + +procedure TCalculator_ServiceBinder.DoOperationHandler(AFormatter:IFormatterResponse); +Var + cllCntrl : ICallControl; + tmpObj : ICalculator; + callCtx : ICallContext; + strPrmName : string; + procName,trgName : string; + A : Integer; + B : Integer; + AOperation : TCalc_Op; + returnVal : TBinaryArgsResult; +Begin + callCtx := GetCallContext(); + Pointer(returnVal) := Nil; + + strPrmName := 'A'; AFormatter.Get(TypeInfo(Integer),strPrmName,A); + strPrmName := 'B'; AFormatter.Get(TypeInfo(Integer),strPrmName,B); + strPrmName := 'AOperation'; AFormatter.Get(TypeInfo(TCalc_Op),strPrmName,AOperation); + + tmpObj := Self.GetFactory().CreateInstance() as ICalculator; + if Supports(tmpObj,ICallControl,cllCntrl) then + cllCntrl.SetCallContext(GetCallContext()); + + returnVal := tmpObj.DoOperation(A,B,AOperation); + If Assigned(Pointer(returnVal)) Then + callCtx.AddObjectToFree(TObject(returnVal)); + + procName := AFormatter.GetCallProcedureName(); + trgName := AFormatter.GetCallTarget(); + AFormatter.Clear(); + AFormatter.BeginCallResponse(procName,trgName); + AFormatter.Put('return',TypeInfo(TBinaryArgsResult),returnVal); + AFormatter.EndCallResponse(); + + callCtx := Nil; +End; + + +constructor TCalculator_ServiceBinder.Create(); +Begin + Inherited Create(GetServiceImplementationRegistry().FindFactory('ICalculator')); + RegisterVerbHandler('AddInt',@AddIntHandler); + RegisterVerbHandler('DivInt',@DivIntHandler); + RegisterVerbHandler('DoAllOperations',@DoAllOperationsHandler); + RegisterVerbHandler('DoOperation',@DoOperationHandler); +End; + + +{ TCalculator_ServiceBinderFactory } +function TCalculator_ServiceBinderFactory.CreateInstance():IInterface; +Begin + Result := TCalculator_ServiceBinder.Create() as IInterface; +End; + + +procedure Server_service_RegisterCalculatorService(); +Begin + GetServerServiceRegistry().Register('ICalculator',TCalculator_ServiceBinderFactory.Create() as IItemFactory); +End; + +initialization + + {$IF DECLARED(Register_calculator_NameSpace)} + Register_calculator_NameSpace(); + {$ENDIF} + + {$i calculator.wst} + +End. diff --git a/wst/tags/0.4/tests/calculator/srv/calculator_imp.pas b/wst/tags/0.4/tests/calculator/srv/calculator_imp.pas new file mode 100644 index 000000000..9f4da2731 --- /dev/null +++ b/wst/tags/0.4/tests/calculator/srv/calculator_imp.pas @@ -0,0 +1,157 @@ +{ +This unit has been produced by ws_helper. + Input unit name : "calculator". + This unit name : "calculator_imp". + Date : "02/07/2006 16:49". +} +Unit calculator_imp; +{$mode objfpc}{$H+} +Interface + +Uses SysUtils, Classes, + base_service_intf, server_service_intf, server_service_imputils, calculator; + +Type + + + TCalculator_ServiceImp=class(TBaseServiceImplementation,ICalculator) + Protected + function AddInt( + Const A : Integer; + Const B : Integer + ):TBinaryArgsResult; + function DivInt( + Const A : Integer; + Const B : Integer + ):Integer; + function DoAllOperations( + Const A : Integer; + Const B : Integer + ):TBinaryArgsResultArray; + function DoOperation( + Const A : Integer; + Const B : Integer; + Const AOperation : TCalc_Op + ):TBinaryArgsResult; + End; + + + procedure RegisterCalculatorImplementationFactory(); + +Implementation + +{ TCalculator_ServiceImp implementation } +function TCalculator_ServiceImp.AddInt( + Const A : Integer; + Const B : Integer +):TBinaryArgsResult; +var + hdr : TCalcResultHeader; + h : TCalcHeader; + cc : ICallContext; +Begin + hdr := TCalcResultHeader.Create(); + cc := GetCallContext(); + if Assigned(cc) and ( cc.GetHeaderCount([hdIn]) > 0 ) and ( cc.GetHeader(0).InheritsFrom(TCalcHeader) ) then begin + h := cc.GetHeader(0) as TCalcHeader; + h.Understood := True; + hdr.Assign(h); + end; + hdr.TimeStamp := DateTimeToStr(Now()); + hdr.SessionID := 'testSession'; + cc.AddHeader(hdr,True); + hdr := nil; + Result := TBinaryArgsResult.Create(); + Try + Result.Arg_OP := '+'; + Result.Arg_OpEnum := coAdd; + Result.Arg_A := A; + Result.Arg_B := B; + Result.Arg_R := A + B; + Result.Comment := 'Doing an + operation'; + Except + FreeAndNil(Result); + Raise; + End; +End; + +function TCalculator_ServiceImp.DivInt( + Const A : Integer; + Const B : Integer +):Integer; +Begin + Result := A div B; +End; + +function TCalculator_ServiceImp.DoAllOperations( + Const A : Integer; + Const B : Integer +):TBinaryArgsResultArray; +Begin + Result := TBinaryArgsResultArray.Create(); + Result.SetLength(4); + With Result[0] do Begin + Arg_A := A; + Arg_B := B; + Arg_OP := '-'; + Arg_OpEnum := coSub; + Arg_R := Arg_A - Arg_B; + End; + With Result[1] do Begin + Arg_A := A; + Arg_B := B; + Arg_OP := '+'; + Arg_OpEnum := coAdd; + Arg_R := Arg_A + Arg_B; + End; + With Result[2] do Begin + Arg_A := A; + Arg_B := B; + Arg_OP := '*'; + Arg_OpEnum := coMul; + Arg_R := Arg_A * Arg_B; + End; + With Result[3] do Begin + Arg_A := A; + Arg_B := B; + Arg_OP := '/'; + Arg_OpEnum := coDiv; + Arg_R := Arg_A div Arg_B; + End; +End; + +function TCalculator_ServiceImp.DoOperation( + Const A : Integer; + Const B : Integer; + Const AOperation : TCalc_Op +):TBinaryArgsResult; +Begin + Result := TBinaryArgsResult.Create(); + try + Result.Arg_A := A; + Result.Arg_B := B; + Result.Arg_OP := 'X'; + Result.Arg_OpEnum := AOperation; + Result.Comment := 'Doing an operation...'; + + case AOperation of + coAdd : Result.Arg_R := Result.Arg_A + Result.Arg_B; + coSub : Result.Arg_R := Result.Arg_A - Result.Arg_B; + coMul : Result.Arg_R := Result.Arg_A * Result.Arg_B; + coDiv : Result.Arg_R := Result.Arg_A div Result.Arg_B; + end; + except + FreeAndNil(Result); + raise; + end; +End; + +procedure RegisterCalculatorImplementationFactory(); +Begin + GetServiceImplementationRegistry().Register( + 'ICalculator', + TImplementationFactory.Create(TCalculator_ServiceImp) as IServiceImplementationFactory + ).RegisterExtension(['TLoggerServiceExtension']); +End; + +End. diff --git a/wst/tags/0.4/tests/calculator/srv/logger_extension.pas b/wst/tags/0.4/tests/calculator/srv/logger_extension.pas new file mode 100644 index 000000000..c5fc91108 --- /dev/null +++ b/wst/tags/0.4/tests/calculator/srv/logger_extension.pas @@ -0,0 +1,81 @@ +{ + This file is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This file is provide under modified LGPL licence + ( the files COPYING.modifiedLGPL and COPYING.LGPL). + + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +} +unit logger_extension; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, base_service_intf, server_service_intf; + +type + + { TLoggerServiceExtension } + + TLoggerServiceExtension = class(TSimpleFactoryItem,IServiceExtension) + private + procedure TraceMessage(const AMsg : string); + protected + procedure ProcessMessage( + const AMessageStage : TMessageStage; + ACallContext : ICallContext; + AMsgData : IInterface + { The "AMsgData" parameter actual type depends on the message state + on correspond to : + - IRequestBuffer on "msBeforeDeserialize" and "msAfterSerialize" + - IFormatterResponse on "msAfterDeserialize", "msBeforeSerialize" + } + ); + end; + +implementation +uses TypInfo; + +{ TLoggerServiceExtension } + +procedure TLoggerServiceExtension.TraceMessage(const AMsg: string); +begin + WriteLn(AMsg); +end; + +procedure TLoggerServiceExtension.ProcessMessage( + const AMessageStage: TMessageStage; + ACallContext: ICallContext; + AMsgData: IInterface +); +var + s : string; + rqb : IRequestBuffer; + frmtr : IFormatterResponse; +begin + s := GetEnumName(TypeInfo(TMessageStage),Ord(AMessageStage)); + case AMessageStage of + msBeforeDeserialize, msAfterSerialize : + begin + rqb := AMsgData as IRequestBuffer; + s := Format('Called service : "%s"; Processing stage : "%s"',[rqb.GetTargetService(),s]); + end; + msAfterDeserialize, msBeforeSerialize : + begin + frmtr := AMsgData as IFormatterResponse; + s := Format('Called service : "%s"; Target Operation = "%s"; Processing stage : "%s"',[frmtr.GetCallTarget(),frmtr.GetCallProcedureName(),s]); + end; + end; + TraceMessage(s); +end; + +initialization + GetServiceExtensionRegistry().Register('TLoggerServiceExtension',TSimpleItemFactory.Create(TLoggerServiceExtension) as IItemFactory); + +end. diff --git a/wst/tags/0.4/tests/delphi/test_binary/test_binary.cfg b/wst/tags/0.4/tests/delphi/test_binary/test_binary.cfg new file mode 100644 index 000000000..af03ae14d --- /dev/null +++ b/wst/tags/0.4/tests/delphi/test_binary/test_binary.cfg @@ -0,0 +1,43 @@ +-$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"C:\Programmes\lazarus\wst;C:\lazarusClean\others_package\ics\latest_distr\Delphi\Vc32;C:\Programmes\lazarus\wst\tests\calculator;C:\lazarusClean\others_package\synapse" +-O"C:\Programmes\lazarus\wst;C:\lazarusClean\others_package\ics\latest_distr\Delphi\Vc32;C:\Programmes\lazarus\wst\tests\calculator;C:\lazarusClean\others_package\synapse" +-I"C:\Programmes\lazarus\wst;C:\lazarusClean\others_package\ics\latest_distr\Delphi\Vc32;C:\Programmes\lazarus\wst\tests\calculator;C:\lazarusClean\others_package\synapse" +-R"C:\Programmes\lazarus\wst;C:\lazarusClean\others_package\ics\latest_distr\Delphi\Vc32;C:\Programmes\lazarus\wst\tests\calculator;C:\lazarusClean\others_package\synapse" +-w-UNSAFE_TYPE +-w-UNSAFE_CODE +-w-UNSAFE_CAST diff --git a/wst/tags/0.4/tests/delphi/test_binary/test_binary.dof b/wst/tags/0.4/tests/delphi/test_binary/test_binary.dof new file mode 100644 index 000000000..f758555f6 --- /dev/null +++ b/wst/tags/0.4/tests/delphi/test_binary/test_binary.dof @@ -0,0 +1,157 @@ +[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=C:\Programmes\lazarus\wst;C:\lazarusClean\others_package\ics\latest_distr\Delphi\Vc32;C:\Programmes\lazarus\wst\tests\calculator;C:\lazarusClean\others_package\synapse +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= +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\hlUnitAliases] +Count=1 +Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +[HistoryLists\hlSearchPath] +Count=5 +Item0=C:\Programmes\lazarus\wst;C:\lazarusClean\others_package\ics\latest_distr\Delphi\Vc32;C:\Programmes\lazarus\wst\tests\calculator;C:\lazarusClean\others_package\synapse +Item1=C:\Programmes\lazarus\wst;C:\lazarusClean\others_package\ics\latest_distr\Delphi\Vc32;C:\Programmes\lazarus\wst\tests\calculator +Item2=C:\Programmes\lazarus\wst;C:\lazarusClean\others_package\ics\latest_distr\Delphi\Vc32 +Item3=C:\Programmes\lazarus\wst +Item4=..\ +[HistoryLists\hlUnitOutputDirectory] +Count=1 +Item0=obj diff --git a/wst/tags/0.4/tests/delphi/test_binary/test_binary.dpr b/wst/tags/0.4/tests/delphi/test_binary/test_binary.dpr new file mode 100644 index 000000000..c8d23b2cd --- /dev/null +++ b/wst/tags/0.4/tests/delphi/test_binary/test_binary.dpr @@ -0,0 +1,71 @@ +program test_binary; + +{$APPTYPE CONSOLE} + +uses + SysUtils, + Classes, + base_service_intf, + service_intf, + base_binary_formatter, + binary_formatter, + //ics_tcp_protocol, + user_service_intf, + user_service_intf_proxy, + TypInfo, + synapse_http_protocol, + synapse_tcp_protocol; + +Var + calcObj : ICalculator; + i, j, k : Integer; + rk : TBinaryArgsResult; + vA : TBinaryArgsResultArray; + msgProt, s : string; +begin + msgProt := 'binary'; + Writeln('USED Msg protocol = ',msgProt); + //ICS_RegisterTCP_Transport(); + SYNAPSE_RegisterTCP_Transport(); + + rk := nil; + Try + Try + calcObj := TCalculator_Proxy.Create( + 'ICalculator', // Target + msgProt,//'SOAP',//'binary', // Protocol Data + 'TCP:Address=127.0.0.1;Port=1234;target=ICalculator' // Transport Data + ); + WriteLn('Calculator test.'); + while True do begin + Write('Enter A = '); ReadLn(i); + Write('Enter B = '); ReadLn(j); + k := calcObj.DivInt(i,j); + Write(' A / B = '); WriteLn(k); + rk := calcObj.AddInt(i,j); + WriteLn(Format(' ( %d %s %d ) = %d',[rk.Arg_A, rk.Arg_OP, rk.Arg_B, rk.Arg_R])); + WriteLn('----------------------------------------------'); + vA := calcObj.DoAllOperations(i,j); + Try + For i := 0 To Pred(vA.Length) Do + WriteLn(Format(' ( %d %s %d ) = %d; OP=%s',[vA[i].Arg_A, vA[i].Arg_OP, vA[i].Arg_B, vA[i].Arg_R,GetEnumName(TypeInfo(TCalc_Op),Ord(vA[i].Arg_OpEnum))])); + Finally + vA.Free(); + End; + Write('Stop now Y/N: '); + Readln(s); + s := UpperCase(Trim(s)); + if ( Length(s) > 0 ) and ( s[1] = 'Y' ) then + Break; + end; + Except + On E : Exception Do Begin + WriteLn('Oups:'); + WriteLn(E.Message); + End; + End; + Finally + rk.Free(); + End; + ReadLn; +end. diff --git a/wst/tags/0.4/tests/ebay/ebay.pas b/wst/tags/0.4/tests/ebay/ebay.pas new file mode 100644 index 000000000..8dc59c9e4 --- /dev/null +++ b/wst/tags/0.4/tests/ebay/ebay.pas @@ -0,0 +1,562 @@ +unit ebay; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, base_service_intf; + +const + sAPP_ID = 'INOUSSAOUEU258CIC9Z5E83UXC1BE5';//''; + sEBAY_VERSION = '467'; + +type + + TAckCodeType = ( Success, Failure, Warning, PartialFailure, CustomCode ); + +{ TErrorType = class(TBaseComplexRemotable) + published + property ShortMessage : string read FShortMessage write FShortMessage stored HasShortMessage; + property LongMessage : string read FLongMessage write FLongMessage stored HasLongMessage; + end; +} + + { TPaginationType } + + TPaginationType = class(TBaseComplexRemotable) + private + FEntriesPerPage: Integer; + FPageNumber: Integer; + function HasEntriesPerPage: boolean; + function HasPageNumber: boolean; + published + property EntriesPerPage : Integer read FEntriesPerPage write FEntriesPerPage stored HasEntriesPerPage; + property PageNumber : Integer read FPageNumber write FPageNumber stored HasPageNumber; + end; + + { TPaginationResultType } + + TPaginationResultType = class(TBaseComplexRemotable) + private + FTotalNumberOfEntries: Integer; + FTotalNumberOfPages: Integer; + function HasTotalNumberOfEntries: boolean; + function HasTotalNumberOfPages: boolean; + published + property TotalNumberOfPages : Integer read FTotalNumberOfPages write FTotalNumberOfPages stored HasTotalNumberOfPages; + property TotalNumberOfEntries : Integer read FTotalNumberOfEntries write FTotalNumberOfEntries stored HasTotalNumberOfEntries; + end; + + { TCategoryType } + + TCategoryType = class(TBaseComplexRemotable) + private + FAutoPayEnabled: Boolean; + FB2BVATEnabled: Boolean; + FBestOfferEnabled: Boolean; + FCatalogEnabled: Boolean; + FCategoryID: string; + FCategoryLevel: Integer; + FCategoryName: string; + FCategoryParentID: string; + FCategoryParentName: string; + FKeywords: string; + FProductFinderAvailable: Boolean; + FProductFinderID: Integer; + FProductSearchPageAvailable: Boolean; + function HasCategoryID: boolean; + function HasCategoryLevel: boolean; + function HasCategoryName: boolean; + function HasCategoryParentID: boolean; + function HasCategoryParentName: boolean; + function HasKeywords: boolean; + function HasProductFinderID: boolean; + published + property BestOfferEnabled : Boolean read FBestOfferEnabled write FBestOfferEnabled stored FBestOfferEnabled; + property AutoPayEnabled : Boolean read FAutoPayEnabled write FAutoPayEnabled stored FAutoPayEnabled; + property B2BVATEnabled : Boolean read FB2BVATEnabled write FB2BVATEnabled stored FB2BVATEnabled; + property CatalogEnabled : Boolean read FCatalogEnabled write FCatalogEnabled stored FCatalogEnabled; + property CategoryID : string read FCategoryID write FCategoryID stored HasCategoryID; + property CategoryLevel : Integer read FCategoryLevel write FCategoryLevel stored HasCategoryLevel; + property CategoryName : string read FCategoryName write FCategoryName stored HasCategoryName; + property CategoryParentID : string read FCategoryParentID write FCategoryParentID stored HasCategoryParentID; + property CategoryParentName : string read FCategoryParentName write FCategoryParentName stored HasCategoryParentName; + property ProductFinderID : Integer read FProductFinderID write FProductFinderID stored HasProductFinderID; + property ProductSearchPageAvailable : Boolean read FProductSearchPageAvailable write FProductSearchPageAvailable stored FProductSearchPageAvailable; + property ProductFinderAvailable : Boolean read FProductFinderAvailable write FProductFinderAvailable stored FProductFinderAvailable; + property Keywords : string read FKeywords write FKeywords stored HasKeywords; + end; + + { TCategoryArrayType } + + TCategoryArrayType = class(TBaseObjectArrayRemotable) + private + function GetCategoryItem(AIndex: Integer): TCategoryType; + public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : TCategoryType read GetCategoryItem; + property Category[AIndex:Integer] : TCategoryType read GetCategoryItem;default; + end; + + { TUserIdPasswordType } + + TUserIdPasswordType = class(TBaseComplexRemotable) + private + FAppId: string; + FAuthCert: string; + FDevId: string; + FPassword: string; + FUsername: string; + function HasAppId: boolean; + function HasAuthCert: boolean; + function HasDevId: boolean; + function HasPassword: boolean; + function HasUsername: boolean; + published + property AppId : string read FAppId write FAppId stored HasAppId; + property DevId : string read FDevId write FDevId stored HasDevId; + property AuthCert : string read FAuthCert write FAuthCert stored HasAuthCert; + property Username : string read FUsername write FUsername stored HasUsername; + property Password : string read FPassword write FPassword stored HasPassword; + end; + + { TCustomSecurityHeaderType } + + TCustomSecurityHeaderType = class(THeaderBlock) + private + FCredentials: TUserIdPasswordType; + FeBayAuthToken: string; + public + constructor Create();override; + destructor Destroy();override; + published + property eBayAuthToken : string read FeBayAuthToken write FeBayAuthToken; + property Credentials : TUserIdPasswordType read FCredentials write FCredentials; + end; + + { TAbstractRequestType } + + TAbstractRequestType = class(TBaseComplexRemotable) + private + FVersion: string; + published + property Version : string read FVersion write FVersion; + end; + + { TAbstractResponseType } + + TAbstractResponseType = class(TBaseComplexRemotable) + private + FAck: TAckCodeType; + FCorrelationID: string; + FMessage: string; + FVersion: string; + function HasAck: boolean; + function HasCorrelationID: boolean; + function HasMessage: boolean; + function HasVersion: boolean; + published + property CorrelationID : string read FCorrelationID write FCorrelationID stored HasCorrelationID; + property Message : string read FMessage write FMessage stored HasMessage; + property Version : string read FVersion write FVersion stored HasVersion; + property Ack : TAckCodeType read FAck write FAck stored HasAck; + end; + + { TGetCategoriesRequestType } + + TGetCategoriesRequestType = class(TAbstractRequestType) + private + FCategorySiteID: string; + function HasCategorySiteID: boolean; + published + property CategorySiteID : string read FCategorySiteID write FCategorySiteID stored HasCategorySiteID; + end; + + { TGetCategoriesResponseType } + + TGetCategoriesResponseType = class(TAbstractResponseType) + private + FCategoryCount: Integer; + FCategoryVersion: string; + FMinimumReservePrice: Double; + FReservePriceAllowed: Boolean; + function HasCategoryCount: boolean; + function HasCategoryVersion: boolean; + function HasMinimumReservePrice: boolean; + function HasReservePriceAllowed: boolean; + published + property CategoryCount : Integer read FCategoryCount write FCategoryCount stored HasCategoryCount; + property CategoryVersion : string read FCategoryVersion write FCategoryVersion stored HasCategoryVersion; + property ReservePriceAllowed : Boolean read FReservePriceAllowed write FReservePriceAllowed stored HasReservePriceAllowed; + property MinimumReservePrice : Double read FMinimumReservePrice write FMinimumReservePrice stored HasMinimumReservePrice; + end; + + { TGetPopularKeywordsRequestType } + + TGetPopularKeywordsRequestType = class(TAbstractRequestType) + private + FCategoryID: string; + FIncludeChildCategories: Boolean; + FMaxKeywordsRetrieved: Integer; + FPagination: TPaginationType; + function HasCategoryID: boolean; + function HasIncludeChildCategories: boolean; + function HasMaxKeywordsRetrieved: boolean; + function HasPagination: boolean; + public + constructor Create();override; + destructor Destroy();override; + published + property CategoryID : string read FCategoryID write FCategoryID stored HasCategoryID; + property IncludeChildCategories : Boolean read FIncludeChildCategories write FIncludeChildCategories stored HasIncludeChildCategories; + property MaxKeywordsRetrieved : Integer read FMaxKeywordsRetrieved write FMaxKeywordsRetrieved stored HasMaxKeywordsRetrieved; + property Pagination : TPaginationType read FPagination write FPagination stored HasPagination; + end; + + { TGetPopularKeywordsResponseType } + + TGetPopularKeywordsResponseType = class(TAbstractResponseType) + private + FCategoryArray: TCategoryArrayType; + FHasMore: Boolean; + FPaginationResult: TPaginationResultType; + function HasCategoryArray: boolean; + function HasPaginationResult: boolean; + procedure SetCategoryArray(const AValue: TCategoryArrayType); + procedure SetPaginationResult(const AValue: TPaginationResultType); + public + constructor Create();override; + destructor Destroy();override; + published + property HasMore : Boolean read FHasMore write FHasMore stored FHasMore; + property CategoryArray : TCategoryArrayType read FCategoryArray write SetCategoryArray stored HasCategoryArray; + property PaginationResult : TPaginationResultType read FPaginationResult write SetPaginationResult stored HasPaginationResult; + end; + + IeBayAPIInterfaceService = interface + {function GetCategories(GetCategoriesRequest : TGetCategoriesRequestType ) : TGetCategoriesResponseType;} + procedure GetCategories( + const GetCategoriesRequest : TGetCategoriesRequestType; + out GetCategoriesResponse : TGetCategoriesResponseType + ); + procedure GetPopularKeywords( + const GetPopularKeywordsRequest : TGetPopularKeywordsRequestType; + out GetPopularKeywordsResponse : TGetPopularKeywordsResponseType + ); + end; + + procedure Register_ebay_ServiceMetadata(); + +implementation +uses imp_utils, metadata_repository; + +const + sE_BAY_API_VERSION = 'Version 467'; + sE_BAY_NAME_SPACE = 'urn:ebay:apis:eBLBaseComponents'; + +{ TAbstractResponseType } + +function TAbstractResponseType.HasCorrelationID: boolean; +begin + Result := not IsStrEmpty(FCorrelationID); +end; + +function TAbstractResponseType.HasAck: boolean; +begin + Result := FAck > Success; +end; + +function TAbstractResponseType.HasMessage: boolean; +begin + Result := not IsStrEmpty(FMessage); +end; + +function TAbstractResponseType.HasVersion: boolean; +begin + Result := not IsStrEmpty(FVersion); +end; + +{ TGetCategoriesRequestType } + +function TGetCategoriesRequestType.HasCategorySiteID: boolean; +begin + Result := not IsStrEmpty(FCategorySiteID); +end; + +{ TGetCategoriesResponseType } + +function TGetCategoriesResponseType.HasCategoryCount: boolean; +begin + Result := ( FCategoryCount > 0 ); +end; + +function TGetCategoriesResponseType.HasCategoryVersion: boolean; +begin + Result := not IsStrEmpty(FCategoryVersion); +end; + +function TGetCategoriesResponseType.HasMinimumReservePrice: boolean; +begin + Result := ( MinimumReservePrice <> 0 ); +end; + +function TGetCategoriesResponseType.HasReservePriceAllowed: boolean; +begin + Result := FReservePriceAllowed; +end; + +{ TUserIdPasswordType } + +function TUserIdPasswordType.HasAppId: boolean; +begin + Result := not IsStrEmpty(FAppId); +end; + +function TUserIdPasswordType.HasAuthCert: boolean; +begin + Result := not IsStrEmpty(FAuthCert); +end; + +function TUserIdPasswordType.HasDevId: boolean; +begin + Result := not IsStrEmpty(FDevId); +end; + +function TUserIdPasswordType.HasPassword: boolean; +begin + Result := not IsStrEmpty(FPassword); +end; + +function TUserIdPasswordType.HasUsername: boolean; +begin + Result := not IsStrEmpty(FUsername); +end; + +{ TCustomSecurityHeaderType } + +constructor TCustomSecurityHeaderType.Create(); +begin + inherited Create(); + FCredentials := TUserIdPasswordType.Create(); +end; + +destructor TCustomSecurityHeaderType.Destroy(); +begin + FreeAndNil(FCredentials); + inherited Destroy(); +end; + +{ TPaginationType } + +function TPaginationType.HasEntriesPerPage: boolean; +begin + Result := HasEntriesPerPage; +end; + +function TPaginationType.HasPageNumber: boolean; +begin + Result := ( FPageNumber <> 0 ); +end; + +{ TGetPopularKeywordsRequestType } + +function TGetPopularKeywordsRequestType.HasCategoryID: boolean; +begin + Result := not IsStrEmpty(FCategoryID); +end; + +function TGetPopularKeywordsRequestType.HasIncludeChildCategories: boolean; +begin + Result := IncludeChildCategories; +end; + +function TGetPopularKeywordsRequestType.HasMaxKeywordsRetrieved: boolean; +begin + Result := ( MaxKeywordsRetrieved <> 0 ); +end; + +function TGetPopularKeywordsRequestType.HasPagination: boolean; +begin + Result := Assigned(FPagination) and + ( FPagination.HasEntriesPerPage or FPagination.HasPageNumber); +end; + +constructor TGetPopularKeywordsRequestType.Create(); +begin + inherited Create(); +end; + +destructor TGetPopularKeywordsRequestType.Destroy(); +begin + FreeAndNil(FPagination); + inherited Destroy(); +end; + +{ TCategoryType } + +function TCategoryType.HasCategoryID: boolean; +begin + Result := not IsStrEmpty(FCategoryID); +end; + +function TCategoryType.HasCategoryLevel: boolean; +begin + Result := ( FCategoryLevel <> 0 ); +end; + +function TCategoryType.HasCategoryName: boolean; +begin + Result := not IsStrEmpty(FCategoryName); +end; + +function TCategoryType.HasCategoryParentID: boolean; +begin + Result := not IsStrEmpty(FCategoryParentID); +end; + +function TCategoryType.HasCategoryParentName: boolean; +begin + Result := not IsStrEmpty(FCategoryParentName); +end; + +function TCategoryType.HasKeywords: boolean; +begin + Result := not IsStrEmpty(FKeywords); +end; + +function TCategoryType.HasProductFinderID: boolean; +begin + Result := ( FProductFinderID > 0 ); +end; + +{ TCategoryArrayType } + +function TCategoryArrayType.GetCategoryItem(AIndex: Integer): TCategoryType; +begin + Result := inherited GetItem(AIndex) as TCategoryType; +end; + +class function TCategoryArrayType.GetItemClass(): TBaseRemotableClass; +begin + Result := TCategoryType; +end; + +{ TGetPopularKeywordsResponseType } + +function TGetPopularKeywordsResponseType.HasCategoryArray: boolean; +begin + Result := ( FCategoryArray.Length > 0 ); +end; + +function TGetPopularKeywordsResponseType.HasPaginationResult: boolean; +begin + Result := ( FPaginationResult.TotalNumberOfEntries <> 0 ) or + ( FPaginationResult.TotalNumberOfPages <> 0 ) ; +end; + +procedure TGetPopularKeywordsResponseType.SetCategoryArray( + const AValue: TCategoryArrayType +); +begin + if ( FCategoryArray = AValue ) then + exit; + FCategoryArray.Assign(AValue) ; +end; + +procedure TGetPopularKeywordsResponseType.SetPaginationResult( + const AValue: TPaginationResultType +); +begin + if ( FPaginationResult = AValue ) then + exit; + FPaginationResult.Assign(AValue); +end; + +constructor TGetPopularKeywordsResponseType.Create(); +begin + FCategoryArray := TCategoryArrayType.Create(); + FPaginationResult := TPaginationResultType.Create(); + inherited Create(); +end; + +destructor TGetPopularKeywordsResponseType.Destroy(); +begin + FreeAndNil(FPaginationResult); + FreeAndNil(FCategoryArray); + inherited Destroy(); +end; + +procedure RegisterEbayTypes(); +Var + r : TTypeRegistry; + ri : TTypeRegistryItem; +begin + r := GetTypeRegistry(); + + r.Register(sE_BAY_NAME_SPACE,TypeInfo(TAckCodeType),'AckCodeType'); + r.Register(sE_BAY_NAME_SPACE,TypeInfo(TCategoryType),'CategoryType'); + r.Register(sE_BAY_NAME_SPACE,TypeInfo(TCategoryArrayType),'CategoryArrayType'); + + + r.Register(sE_BAY_NAME_SPACE,TypeInfo(TPaginationType),'PaginationType'); + r.Register(sE_BAY_NAME_SPACE,TypeInfo(TPaginationResultType),'PaginationResultType'); + + r.Register(sE_BAY_NAME_SPACE,TypeInfo(TGetPopularKeywordsRequestType),'GetPopularKeywordsRequestType'); + r.Register(sE_BAY_NAME_SPACE,TypeInfo(TGetPopularKeywordsResponseType),'GetPopularKeywordsResponseType'); + + r.Register(sE_BAY_NAME_SPACE,TypeInfo(TUserIdPasswordType),'UserIdPasswordType'); + r.Register(sE_BAY_NAME_SPACE,TypeInfo(TCustomSecurityHeaderType),'RequesterCredentials');//'CustomSecurityHeaderType'); + + r.Register(sE_BAY_NAME_SPACE,TypeInfo(TGetCategoriesRequestType),'GetCategoriesRequestType'); + r.Register(sE_BAY_NAME_SPACE,TypeInfo(TGetCategoriesResponseType),'GetCategoriesResponseType'); +end; + +procedure Register_ebay_ServiceMetadata(); +var + mm : IModuleMetadataMngr; +begin + mm := GetModuleMetadataMngr(); + mm.SetOperationCustomData( + 'ebay', + 'IeBayAPIInterfaceService', + 'GetCategories', + 'Address', + 'https://api.sandbox.ebay.com/wsapi?' + + 'callname=GetCategories' + + '&siteid=0' + + '&appid=' + sAPP_ID + + '&version=' + sEBAY_VERSION + ); + + mm.SetOperationCustomData( + 'ebay', + 'IeBayAPIInterfaceService', + 'GetPopularKeywords', + 'Address', + 'https://api.sandbox.ebay.com/wsapi?' + + 'callname=GetPopularKeywords' + + '&siteid=0' + + '&appid=' + sAPP_ID + + '&version=' + sEBAY_VERSION + + ); + +end; + +{ TPaginationResultType } + +function TPaginationResultType.HasTotalNumberOfEntries: boolean; +begin + Result := ( FTotalNumberOfEntries <> 0 ); +end; + +function TPaginationResultType.HasTotalNumberOfPages: boolean; +begin + Result := ( FTotalNumberOfPages <> 0 ); +end; + +initialization + RegisterEbayTypes(); + +end. diff --git a/wst/tags/0.4/tests/ebay/ebay.wst b/wst/tags/0.4/tests/ebay/ebay.wst new file mode 100644 index 000000000..bf79a1447 --- /dev/null +++ b/wst/tags/0.4/tests/ebay/ebay.wst @@ -0,0 +1,9 @@ + GetWSTResourceManager().AddResource('EBAY', + #0#0#0#20'WST_METADATA_0.2.2.0'#0#0#0#4'ebay'#1#0#0#0#24'IeBayAPIInterfaceSe' + +'rvice'#2#0#0#0#13'GetCategories'#2#0#0#0#20'GetCategoriesRequest'#0#0#0#25'T' + +'GetCategoriesRequestType'#0#0#0#0#0#0#0#1#0#0#0#21'GetCategoriesResponse'#0 + +#0#0#26'TGetCategoriesResponseType'#0#0#0#0#0#0#0#3#0#0#0#18'GetPopularKeywo' + +'rds'#2#0#0#0#25'GetPopularKeywordsRequest'#0#0#0#30'TGetPopularKeywordsRequ' + +'estType'#0#0#0#0#0#0#0#1#0#0#0#26'GetPopularKeywordsResponse'#0#0#0#31'TGet' + +'PopularKeywordsResponseType'#0#0#0#0#0#0#0#3'' + ); \ No newline at end of file diff --git a/wst/tags/0.4/tests/ebay/ebay.wst_meta b/wst/tags/0.4/tests/ebay/ebay.wst_meta new file mode 100644 index 000000000..141b44490 Binary files /dev/null and b/wst/tags/0.4/tests/ebay/ebay.wst_meta differ diff --git a/wst/tags/0.4/tests/ebay/ebay_proxy.pas b/wst/tags/0.4/tests/ebay/ebay_proxy.pas new file mode 100644 index 000000000..af77049ba --- /dev/null +++ b/wst/tags/0.4/tests/ebay/ebay_proxy.pas @@ -0,0 +1,98 @@ +{ +This unit has been produced by ws_helper. + Input unit name : "ebay". + This unit name : "ebay_proxy". + Date : "12/11/2006 11:44". +} +Unit ebay_proxy; +{$mode objfpc}{$H+} +Interface + +Uses SysUtils, Classes, TypInfo, base_service_intf, service_intf, ebay; + +Type + + + TeBayAPIInterfaceService_Proxy=class(TBaseProxy,IeBayAPIInterfaceService) + Protected + class function GetServiceType() : PTypeInfo;override; + procedure GetCategories( + Const GetCategoriesRequest : TGetCategoriesRequestType; + Out GetCategoriesResponse : TGetCategoriesResponseType + ); + procedure GetPopularKeywords( + Const GetPopularKeywordsRequest : TGetPopularKeywordsRequestType; + Out GetPopularKeywordsResponse : TGetPopularKeywordsResponseType + ); + End; + +Implementation +uses wst_resources_imp, metadata_repository; + +{ TeBayAPIInterfaceService_Proxy implementation } + +class function TeBayAPIInterfaceService_Proxy.GetServiceType() : PTypeInfo; +begin + result := TypeInfo(IeBayAPIInterfaceService); +end; + +procedure TeBayAPIInterfaceService_Proxy.GetCategories( + Const GetCategoriesRequest : TGetCategoriesRequestType; + Out GetCategoriesResponse : TGetCategoriesResponseType +); +Var + locSerializer : IFormatterClient; + strPrmName : string; +Begin + locSerializer := GetSerializer(); + Try + locSerializer.BeginCall('GetCategories', GetTarget(),(Self as ICallContext)); + locSerializer.Put('GetCategoriesRequest', TypeInfo(TGetCategoriesRequestType), GetCategoriesRequest); + locSerializer.EndCall(); + + MakeCall(); + + locSerializer.BeginCallRead((Self as ICallContext)); + Pointer(GetCategoriesResponse) := Nil; + strPrmName := 'GetCategoriesResponse'; + locSerializer.Get(TypeInfo(TGetCategoriesResponseType), strPrmName, GetCategoriesResponse); + + Finally + locSerializer.Clear(); + End; +End; + +procedure TeBayAPIInterfaceService_Proxy.GetPopularKeywords( + Const GetPopularKeywordsRequest : TGetPopularKeywordsRequestType; + Out GetPopularKeywordsResponse : TGetPopularKeywordsResponseType +); +Var + locSerializer : IFormatterClient; + strPrmName : string; +Begin + locSerializer := GetSerializer(); + Try + locSerializer.BeginCall('GetPopularKeywords', GetTarget(),(Self as ICallContext)); + locSerializer.Put('GetPopularKeywordsRequest', TypeInfo(TGetPopularKeywordsRequestType), GetPopularKeywordsRequest); + locSerializer.EndCall(); + + MakeCall(); + + locSerializer.BeginCallRead((Self as ICallContext)); + Pointer(GetPopularKeywordsResponse) := Nil; + strPrmName := 'GetPopularKeywordsResponse'; + locSerializer.Get(TypeInfo(TGetPopularKeywordsResponseType), strPrmName, GetPopularKeywordsResponse); + + Finally + locSerializer.Clear(); + End; +End; + + +initialization + {$i ebay.wst} + + {$IF DECLARED(Register_ebay_ServiceMetadata)} + Register_ebay_ServiceMetadata(); + {$ENDIF} +End. diff --git a/wst/tags/0.4/tests/ebay/test_ebay.lpi b/wst/tags/0.4/tests/ebay/test_ebay.lpi new file mode 100644 index 000000000..c3f5f9526 --- /dev/null +++ b/wst/tags/0.4/tests/ebay/test_ebay.lpi @@ -0,0 +1,276 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wst/tags/0.4/tests/ebay/test_ebay.lpr b/wst/tags/0.4/tests/ebay/test_ebay.lpr new file mode 100644 index 000000000..c2108e3fd --- /dev/null +++ b/wst/tags/0.4/tests/ebay/test_ebay.lpr @@ -0,0 +1,57 @@ +program test_ebay; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Classes, SysUtils, + service_intf, soap_formatter, base_service_intf, base_soap_formatter, + //ics_http_protocol, + //indylaz, + //indy_http_protocol, + ebay, ebay_proxy, + ssl_openssl, synapse_http_protocol; + +var + locService : IeBayAPIInterfaceService; + locHdr : TCustomSecurityHeaderType; + r : TGetCategoriesRequestType; + rsp : TGetCategoriesResponseType; +begin + //Indy_RegisterHTTP_Transport(); + SYNAPSE_RegisterHTTP_Transport(); + r := nil; + rsp := nil; + locHdr := TCustomSecurityHeaderType.Create(); + try + locHdr.eBayAuthToken := '...'; + + locHdr.Credentials.AppId := '...'; + locHdr.Credentials.DevId := '...'; + locHdr.Credentials.AuthCert := '...'; + locService := TeBayAPIInterfaceService_Proxy.Create( + 'eBayAPIInterfaceService', + 'SOAP:Style=Document;EncodingStyle=Litteral', + 'http:Address=https://api.sandbox.ebay.com/wsapi?callname=GetCategories&siteid=0&appid=INOUSSAOUEU258CIC9Z5E83UXC1BE5&version=467' + ); //https://api.sandbox.ebay.com/wsapi + //https://api.sandbox.ebay.com/wsapi + //https://api.sandbox.ebay.com/ws/api.dll + (locService as ICallContext).AddHeader(locHdr,True); + r := TGetCategoriesRequestType.Create(); + r.Version := '467'; + try + locService.GetCategories(r,rsp); + except + on e : Exception do begin + WriteLn('Exception : ',e.Message); + raise; + end; + end; + finally + r.Free(); + rsp.Free(); + end; +end. + diff --git a/wst/tags/0.4/tests/ebay/test_ebay_gui.lpi b/wst/tags/0.4/tests/ebay/test_ebay_gui.lpi new file mode 100644 index 000000000..0a945b18b --- /dev/null +++ b/wst/tags/0.4/tests/ebay/test_ebay_gui.lpi @@ -0,0 +1,441 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wst/tags/0.4/tests/ebay/test_ebay_gui.lpr b/wst/tags/0.4/tests/ebay/test_ebay_gui.lpr new file mode 100644 index 000000000..9bc754f0b --- /dev/null +++ b/wst/tags/0.4/tests/ebay/test_ebay_gui.lpr @@ -0,0 +1,18 @@ +program test_ebay_gui; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Interfaces, // this includes the LCL widgetset + Forms + { add your units here }, umain, synapse_http_protocol, ebay, ebay_proxy; + +begin + Application.Initialize; + Application.CreateForm(TForm1, Form1); + Application.Run; +end. + diff --git a/wst/tags/0.4/tests/ebay/umain.lfm b/wst/tags/0.4/tests/ebay/umain.lfm new file mode 100644 index 000000000..0f7db7488 --- /dev/null +++ b/wst/tags/0.4/tests/ebay/umain.lfm @@ -0,0 +1,121 @@ +object Form1: TForm1 + Left = 301 + Height = 388 + Top = 159 + Width = 400 + HorzScrollBar.Page = 399 + VertScrollBar.Page = 387 + ActiveControl = Button1 + Caption = 'Form1' + OnCreate = FormCreate + object Panel1: TPanel + Height = 184 + Width = 400 + Align = alTop + TabOrder = 0 + object Label1: TLabel + Left = 16 + Height = 18 + Top = 53 + Width = 98 + Caption = 'eBayAuthToken' + Color = clNone + ParentColor = False + end + object Label2: TLabel + Left = 16 + Height = 18 + Top = 79 + Width = 37 + Caption = 'AppId' + Color = clNone + ParentColor = False + end + object Label3: TLabel + Left = 16 + Height = 18 + Top = 111 + Width = 38 + Caption = 'DevId' + Color = clNone + ParentColor = False + end + object Label4: TLabel + Left = 16 + Height = 18 + Top = 144 + Width = 56 + Caption = 'AuthCert' + Color = clNone + ParentColor = False + end + object Bevel1: TBevel + Left = 10 + Height = 170 + Top = 4 + Width = 380 + Anchors = [akTop, akLeft, akRight] + end + object Button1: TButton + Left = 288 + Height = 25 + Top = 8 + Width = 99 + BorderSpacing.InnerBorder = 4 + Caption = 'GetCategories' + OnClick = Button1Click + TabOrder = 0 + Visible = False + end + object Button3: TButton + Left = 16 + Height = 25 + Top = 8 + Width = 136 + BorderSpacing.InnerBorder = 4 + Caption = 'GetPopularKeywords' + OnClick = Button3Click + TabOrder = 1 + end + object edteBayAuthToken: TEdit + Left = 96 + Height = 23 + Top = 48 + Width = 288 + Anchors = [akTop, akLeft, akRight] + TabOrder = 2 + end + object edtAppId: TEdit + Left = 96 + Height = 23 + Top = 77 + Width = 288 + Anchors = [akTop, akLeft, akRight] + TabOrder = 3 + end + object edtDevId: TEdit + Left = 96 + Height = 23 + Top = 108 + Width = 288 + Anchors = [akTop, akLeft, akRight] + TabOrder = 4 + end + object edtAuthCert: TEdit + Left = 96 + Height = 23 + Top = 136 + Width = 288 + Anchors = [akTop, akLeft, akRight] + TabOrder = 5 + end + end + object trvOut: TTreeView + Height = 204 + Top = 184 + Width = 400 + Align = alClient + DefaultItemHeight = 19 + TabOrder = 1 + end +end diff --git a/wst/tags/0.4/tests/ebay/umain.lrs b/wst/tags/0.4/tests/ebay/umain.lrs new file mode 100644 index 000000000..d7e60b0ba --- /dev/null +++ b/wst/tags/0.4/tests/ebay/umain.lrs @@ -0,0 +1,33 @@ +{ Ceci est un fichier ressource généré automatiquement par Lazarus } + +LazarusResources.Add('TForm1','FORMDATA',[ + 'TPF0'#6'TForm1'#5'Form1'#4'Left'#3'-'#1#6'Height'#3#132#1#3'Top'#3#159#0#5'W' + +'idth'#3#144#1#18'HorzScrollBar.Page'#3#143#1#18'VertScrollBar.Page'#3#131#1 + +#13'ActiveControl'#7#7'Button1'#7'Caption'#6#5'Form1'#8'OnCreate'#7#10'FormC' + +'reate'#0#6'TPanel'#6'Panel1'#6'Height'#3#184#0#5'Width'#3#144#1#5'Align'#7#5 + +'alTop'#8'TabOrder'#2#0#0#6'TLabel'#6'Label1'#4'Left'#2#16#6'Height'#2#18#3 + +'Top'#2'5'#5'Width'#2'b'#7'Caption'#6#13'eBayAuthToken'#5'Color'#7#6'clNone' + +#11'ParentColor'#8#0#0#6'TLabel'#6'Label2'#4'Left'#2#16#6'Height'#2#18#3'Top' + +#2'O'#5'Width'#2'%'#7'Caption'#6#5'AppId'#5'Color'#7#6'clNone'#11'ParentColo' + +'r'#8#0#0#6'TLabel'#6'Label3'#4'Left'#2#16#6'Height'#2#18#3'Top'#2'o'#5'Widt' + +'h'#2'&'#7'Caption'#6#5'DevId'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#6 + +'TLabel'#6'Label4'#4'Left'#2#16#6'Height'#2#18#3'Top'#3#144#0#5'Width'#2'8'#7 + +'Caption'#6#8'AuthCert'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#6'TBevel' + +#6'Bevel1'#4'Left'#2#10#6'Height'#3#170#0#3'Top'#2#4#5'Width'#3'|'#1#7'Ancho' + +'rs'#11#5'akTop'#6'akLeft'#7'akRight'#0#0#0#7'TButton'#7'Button1'#4'Left'#3 + +' '#1#6'Height'#2#25#3'Top'#2#8#5'Width'#2'c'#25'BorderSpacing.InnerBorder'#2 + +#4#7'Caption'#6#13'GetCategories'#7'OnClick'#7#12'Button1Click'#8'TabOrder'#2 + +#0#7'Visible'#8#0#0#7'TButton'#7'Button3'#4'Left'#2#16#6'Height'#2#25#3'Top' + +#2#8#5'Width'#3#136#0#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#18'GetP' + +'opularKeywords'#7'OnClick'#7#12'Button3Click'#8'TabOrder'#2#1#0#0#5'TEdit' + +#16'edteBayAuthToken'#4'Left'#2'`'#6'Height'#2#23#3'Top'#2'0'#5'Width'#3' '#1 + +#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#8'TabOrder'#2#2#0#0#5'TEdit'#8 + +'edtAppId'#4'Left'#2'`'#6'Height'#2#23#3'Top'#2'M'#5'Width'#3' '#1#7'Anchors' + +#11#5'akTop'#6'akLeft'#7'akRight'#0#8'TabOrder'#2#3#0#0#5'TEdit'#8'edtDevId' + +#4'Left'#2'`'#6'Height'#2#23#3'Top'#2'l'#5'Width'#3' '#1#7'Anchors'#11#5'akT' + +'op'#6'akLeft'#7'akRight'#0#8'TabOrder'#2#4#0#0#5'TEdit'#11'edtAuthCert'#4'L' + +'eft'#2'`'#6'Height'#2#23#3'Top'#3#136#0#5'Width'#3' '#1#7'Anchors'#11#5'akT' + +'op'#6'akLeft'#7'akRight'#0#8'TabOrder'#2#5#0#0#0#9'TTreeView'#6'trvOut'#6'H' + +'eight'#3#204#0#3'Top'#3#184#0#5'Width'#3#144#1#5'Align'#7#8'alClient'#17'De' + +'faultItemHeight'#2#19#8'TabOrder'#2#1#0#0#0 +]); diff --git a/wst/tags/0.4/tests/ebay/umain.pas b/wst/tags/0.4/tests/ebay/umain.pas new file mode 100644 index 000000000..c0b0e983e --- /dev/null +++ b/wst/tags/0.4/tests/ebay/umain.pas @@ -0,0 +1,183 @@ +unit umain; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ExtCtrls, + Buttons, StdCtrls, ComCtrls, eBayWSDL; + +type + + { TForm1 } + + TForm1 = class(TForm) + Bevel1: TBevel; + Button1: TButton; + Button3: TButton; + edteBayAuthToken: TEdit; + edtAppId: TEdit; + edtDevId: TEdit; + edtAuthCert: TEdit; + Label1: TLabel; + Label2: TLabel; + Label3: TLabel; + Label4: TLabel; + Panel1: TPanel; + trvOut: TTreeView; + procedure Button1Click(Sender: TObject); + procedure Button3Click(Sender: TObject); + procedure FormCreate(Sender: TObject); + private + { private declarations } + public + { public declarations } + end; + +var + Form1: TForm1; + +implementation +uses TypInfo, StrUtils, + httpsend, + ssl_openssl, + service_intf, soap_formatter, base_service_intf, base_soap_formatter, + ebay, ebay_proxy, + synapse_http_protocol; + + +{ TForm1 } + +procedure TForm1.Button1Click(Sender: TObject); +var + locService : IeBayAPIInterfaceService; + locHdr : TCustomSecurityHeaderType; + r : TGetCategoriesRequestType; + rsp : TGetCategoriesResponseType; +begin + try + r := nil; + rsp := nil; + locHdr := TCustomSecurityHeaderType.Create(); + try + locHdr.eBayAuthToken := edteBayAuthToken.Text; + + locHdr.Credentials.AppId := edtAppId.Text; + locHdr.Credentials.DevId := edtDevId.Text; + locHdr.Credentials.AuthCert := edtAuthCert.Text; + locService := TeBayAPIInterfaceService_Proxy.Create( + 'eBayAPIInterfaceService', + 'SOAP:Style=Document;EncodingStyle=Litteral;UniqueAddress=false', + 'http:Address=https://api.sandbox.ebay.com/wsapi' + ); + (locService as ICallContext).AddHeader(locHdr,True); + r := TGetCategoriesRequestType.Create(); + r.Version := sEBAY_VERSION; + locService.GetCategories(r,rsp); + if Assigned(rsp) then + ShowMessageFmt('CategoryCount=%d; Message=%s; Version = %s',[rsp.CategoryCount,rsp.Message,rsp.Version]) + else + ShowMessage('rsp = nil'); + finally + r.Free(); + rsp.Free(); + end; + except + on e : ESOAPException do begin + ShowMessageFmt('SOAP EXCEPTION Code : "%s"; String = "%s"; Msg : '#13'%s',[e.FaultCode,e.FaultString,e.Message]); + end; + end; +end; + +procedure TForm1.Button3Click(Sender: TObject); + + procedure ShowResponse(ARsp : TGetPopularKeywordsResponseType); + var + nd, an, nn, pn : TTreeNode; + k : Integer; + ci : TCategoryType; + begin + trvOut.BeginUpdate(); + try + trvOut.Items.Clear(); + if not Assigned(ARsp) then + Exit; + nd := trvOut.Items.AddChild(nil,'Response'); + trvOut.Items.AddChild(nd,'Ack = ' + GetEnumName(TypeInfo(TAckCodeType),Ord(ARsp.Ack))); + trvOut.Items.AddChild(nd,'Version = ' + ARsp.Version); + trvOut.Items.AddChild(nd,'HasMore = ' + IfThen(ARsp.HasMore,'True','False')); + + pn := trvOut.Items.AddChild(nd,'PaginationResult'); + trvOut.Items.AddChild(pn,'TotalNumberOfEntries = ' + IntToStr(ARsp.PaginationResult.TotalNumberOfEntries)); + trvOut.Items.AddChild(pn,'TotalNumberOfPages = ' + IntToStr(ARsp.PaginationResult.TotalNumberOfPages)); + + an := trvOut.Items.AddChild(nd,'CategoryArray ( ' + IntToStr(ARsp.CategoryArray.Length) + ')'); + for k := 0 to Pred(ARsp.CategoryArray.Length) do begin + ci := ARsp.CategoryArray[k]; + nn := trvOut.Items.AddChild(an,'Category ( ' + IntToStr(k) + ' )'); + trvOut.Items.AddChild(nn,'CategoryID = ' + ci.CategoryID); + trvOut.Items.AddChild(nn,'CategoryParentID = ' + ci.CategoryParentID); + trvOut.Items.AddChild(nn,'Keywords = ' + ci.Keywords); + end; + finally + trvOut.EndUpdate(); + end; + end; + +var + locService : IeBayAPIInterfaceService; + locHdr : TCustomSecurityHeaderType; + r : TGetPopularKeywordsRequestType; + rsp : TGetPopularKeywordsResponseType; + kpCrs : TCursor; +begin + try + r := nil; + rsp := nil; + kpCrs := Screen.Cursor; + locHdr := TCustomSecurityHeaderType.Create(); + try + Screen.Cursor := crHourGlass; + locHdr.eBayAuthToken := edteBayAuthToken.Text; + + locHdr.Credentials.AppId := edtAppId.Text; + locHdr.Credentials.DevId := edtDevId.Text; + locHdr.Credentials.AuthCert := edtAuthCert.Text; + locService := TeBayAPIInterfaceService_Proxy.Create( + 'eBayAPIInterfaceService', + 'SOAP:Style=Document;EncodingStyle=Litteral;UniqueAddress=false', + 'http:Address=https://api.sandbox.ebay.com/wsapi' + ); + (locService as ICallContext).AddHeader(locHdr,True); + r := TGetPopularKeywordsRequestType.Create(); + r.Version := sEBAY_VERSION; + r.IncludeChildCategories := True; + locService.GetPopularKeywords(r,rsp); + if Assigned(rsp) then begin + ShowResponse(rsp); + end else begin + ShowMessage('rsp = nil'); + end; + finally + Screen.Cursor := kpCrs; + r.Free(); + rsp.Free(); + end; + except + on e : ESOAPException do begin + ShowMessageFmt('SOAP EXCEPTION Code : "%s"; String = "%s"; Msg : '#13'%s',[e.FaultCode,e.FaultString,e.Message]); + end; + end; +end; + +procedure TForm1.FormCreate(Sender: TObject); +begin + SYNAPSE_RegisterHTTP_Transport(); +end; + +initialization + {$I umain.lrs} + +end. + diff --git a/wst/tags/0.4/tests/files/CALCULATOR.wsdl b/wst/tags/0.4/tests/files/CALCULATOR.wsdl new file mode 100644 index 000000000..923a08b43 --- /dev/null +++ b/wst/tags/0.4/tests/files/CALCULATOR.wsdl @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/wst/tags/0.4/tests/files/metadata_service.wsdl b/wst/tags/0.4/tests/files/metadata_service.wsdl new file mode 100644 index 000000000..bbe923578 --- /dev/null +++ b/wst/tags/0.4/tests/files/metadata_service.wsdl @@ -0,0 +1,214 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/wst/tags/0.4/tests/google_api/googlewebapi.pas b/wst/tags/0.4/tests/google_api/googlewebapi.pas new file mode 100644 index 000000000..d05a778c6 --- /dev/null +++ b/wst/tags/0.4/tests/google_api/googlewebapi.pas @@ -0,0 +1,157 @@ +Unit googlewebapi; +{$mode objfpc}{$H+} +interface +uses SysUtils, Classes, base_service_intf; + +Type + + TResultElement = class(TBaseComplexRemotable) + private + FcachedSize: string; + FdirectoryTitle: string; + FhostName: string; + FrelatedInformationPresent: boolean; + Fsnippet: string; + Fsummary: string; + Ftitle: string; + FURL: string; + Published + property summary : string Read Fsummary Write Fsummary; + property URL : string Read FURL Write FURL; + property snippet: string Read Fsnippet Write Fsnippet; + property title : string Read Ftitle Write Ftitle; + property cachedSize : string Read FcachedSize Write FcachedSize; + property relatedInformationPresent : boolean Read FrelatedInformationPresent Write FrelatedInformationPresent; + property hostName : string Read FhostName Write FhostName; + property directoryTitle : string Read FdirectoryTitle Write FdirectoryTitle; + End; + + TResultElementArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): TResultElement; + Public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : TResultElement Read GetItem;Default; + End; + + TDirectoryCategory = class(TBaseComplexRemotable) + private + FfullViewableName: string; + FspecialEncoding: string; + Published + property fullViewableName : string Read FfullViewableName Write FfullViewableName; + property specialEncoding : string Read FspecialEncoding Write FspecialEncoding; + End; + + TDirectoryCategoryArray = class(TBaseObjectArrayRemotable) + private + function GetItem(AIndex: Integer): TDirectoryCategory; + Public + class function GetItemClass():TBaseRemotableClass;override; + property Item[AIndex:Integer] : TDirectoryCategory Read GetItem;Default; + End; + + TGoogleSearchResult = class(TBaseComplexRemotable) + private + FdirectoryCategories: TDirectoryCategoryArray; + FdocumentFiltering: Boolean; + FendIndex: Integer; + FestimatedTotalResultsCount: Integer; + FestimateIsExact: Boolean; + FresultElements: TResultElementArray; + FsearchComments: string; + FsearchQuery: string; + FsearchTime: Double; + FsearchTips: string; + FstartIndex: Integer; + Public + constructor Create();override; + destructor Destroy();override; + Published + property documentFiltering : Boolean Read FdocumentFiltering Write FdocumentFiltering; + property searchComments :string Read FsearchComments Write FsearchComments; + property estimatedTotalResultsCount: Integer Read FestimatedTotalResultsCount Write FestimatedTotalResultsCount; + property estimateIsExact : Boolean Read FestimateIsExact Write FestimateIsExact; + property searchQuery : string Read FsearchQuery Write FsearchQuery; + property startIndex : Integer Read FstartIndex Write FstartIndex; + property endIndex : Integer Read FendIndex Write FendIndex; + property searchTips :string Read FsearchTips Write FsearchTips; + property searchTime : Double Read FsearchTime Write FsearchTime; + property resultElements : TResultElementArray Read FresultElements Write FresultElements; + property directoryCategories : TDirectoryCategoryArray Read FdirectoryCategories Write FdirectoryCategories; + End; + + IGoogleSearch = Interface + ['{17FCCC65-4A0B-4D19-93F6-F69EAA719CA3}'] + function doSpellingSuggestion( + const key:string; + const phrase:string + ):string; + function doGoogleSearch( + Const key : string; + Const q : string; + Const start : Integer; + Const maxResults : Integer; + Const filter : Boolean; + Const restrict : string; + Const safeSearch : Boolean; + Const lr : string; + Const ie : string; + Const oe : string + ) : TGoogleSearchResult ; + End; + +Implementation +uses base_soap_formatter; + +Const + GOOGLE_NAMESPACE = 'urn:GoogleSearch'; + +{ TResultElementArray } + +function TResultElementArray.GetItem(AIndex: Integer): TResultElement; +begin + Result := Inherited GetItem(AIndex) As TResultElement; +end; + +class function TResultElementArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= TResultElement; +end; + +{ TGoogleSearchResult } + +constructor TGoogleSearchResult.Create(); +begin + inherited Create(); + FresultElements := TResultElementArray.Create(); + FdirectoryCategories := TDirectoryCategoryArray.Create(); +end; + +destructor TGoogleSearchResult.Destroy(); +begin + FdirectoryCategories.Free(); + FresultElements.Free(); + inherited Destroy(); +end; + +{ TDirectoryCategoryArray } + +function TDirectoryCategoryArray.GetItem(AIndex: Integer): TDirectoryCategory; +begin + Result := Inherited GetItem(AIndex) As TDirectoryCategory; +end; + +class function TDirectoryCategoryArray.GetItemClass(): TBaseRemotableClass; +begin + Result:= TDirectoryCategory; +end; + +Initialization + GetTypeRegistry().Register(GOOGLE_NAMESPACE,TypeInfo(TDirectoryCategory),'DirectoryCategory'); + GetTypeRegistry().Register(GOOGLE_NAMESPACE,TypeInfo(TDirectoryCategoryArray),'DirectoryCategoryArray'); + GetTypeRegistry().Register(GOOGLE_NAMESPACE,TypeInfo(TResultElement),'ResultElement'); + GetTypeRegistry().Register(GOOGLE_NAMESPACE,TypeInfo(TResultElementArray),'ResultElementArray'); + GetTypeRegistry().Register(GOOGLE_NAMESPACE,TypeInfo(TGoogleSearchResult),'GoogleSearchResult'); + +End. diff --git a/wst/tags/0.4/tests/google_api/googlewebapi.wst b/wst/tags/0.4/tests/google_api/googlewebapi.wst new file mode 100644 index 000000000..1f85c9c84 --- /dev/null +++ b/wst/tags/0.4/tests/google_api/googlewebapi.wst @@ -0,0 +1,13 @@ + GetWSTResourceManager().AddResource('GOOGLEWEBAPI', + #0#0#0#20'WST_METADATA_0.2.2.0'#0#0#0#12'googlewebapi'#1#0#0#0#13'IGoogleSea' + +'rch'#2#0#0#0#20'doSpellingSuggestion'#3#0#0#0#3'key'#0#0#0#6'string'#0#0#0#0 + +#0#0#0#1#0#0#0#6'phrase'#0#0#0#6'string'#0#0#0#0#0#0#0#1#0#0#0#6'result'#0#0 + +#0#6'string'#0#0#0#0#0#0#0#3#0#0#0#14'doGoogleSearch'#11#0#0#0#3'key'#0#0#0#6 + +'string'#0#0#0#0#0#0#0#1#0#0#0#1'q'#0#0#0#6'string'#0#0#0#0#0#0#0#1#0#0#0#5's' + +'tart'#0#0#0#7'Integer'#0#0#0#0#0#0#0#1#0#0#0#10'maxResults'#0#0#0#7'Integer' + +#0#0#0#0#0#0#0#1#0#0#0#6'filter'#0#0#0#7'Boolean'#0#0#0#0#0#0#0#1#0#0#0#8're' + +'strict'#0#0#0#6'string'#0#0#0#0#0#0#0#1#0#0#0#10'safeSearch'#0#0#0#7'Boolea' + +'n'#0#0#0#0#0#0#0#1#0#0#0#2'lr'#0#0#0#6'string'#0#0#0#0#0#0#0#1#0#0#0#2'ie'#0 + +#0#0#6'string'#0#0#0#0#0#0#0#1#0#0#0#2'oe'#0#0#0#6'string'#0#0#0#0#0#0#0#1#0 + +#0#0#6'result'#0#0#0#19'TGoogleSearchResult'#0#0#0#0#0#0#0#3'' + ); \ No newline at end of file diff --git a/wst/tags/0.4/tests/google_api/googlewebapi.wst_meta b/wst/tags/0.4/tests/google_api/googlewebapi.wst_meta new file mode 100644 index 000000000..c6cac8262 Binary files /dev/null and b/wst/tags/0.4/tests/google_api/googlewebapi.wst_meta differ diff --git a/wst/tags/0.4/tests/google_api/googlewebapi_binder.pas b/wst/tags/0.4/tests/google_api/googlewebapi_binder.pas new file mode 100644 index 000000000..bb91a5188 --- /dev/null +++ b/wst/tags/0.4/tests/google_api/googlewebapi_binder.pas @@ -0,0 +1,147 @@ +{ +This unit has been produced by ws_helper. + Input unit name : "googlewebapi". + This unit name : "googlewebapi_binder". + Date : "12/11/2006 00:24". +} +unit googlewebapi_binder; +{$mode objfpc}{$H+} +interface + +uses SysUtils, Classes, base_service_intf, server_service_intf, googlewebapi; + +type + + + TGoogleSearch_ServiceBinder=class(TBaseServiceBinder) + Protected + procedure doSpellingSuggestionHandler(AFormatter:IFormatterResponse); + procedure doGoogleSearchHandler(AFormatter:IFormatterResponse); + Public + constructor Create(); + End; + + TGoogleSearch_ServiceBinderFactory = class(TInterfacedObject,IItemFactory) + protected + function CreateInstance():IInterface; + End; + + procedure Server_service_RegisterGoogleSearchService(); + +Implementation +uses TypInfo, wst_resources_imp,metadata_repository; + +{ TGoogleSearch_ServiceBinder implementation } +procedure TGoogleSearch_ServiceBinder.doSpellingSuggestionHandler(AFormatter:IFormatterResponse); +Var + cllCntrl : ICallControl; + tmpObj : IGoogleSearch; + callCtx : ICallContext; + strPrmName : string; + procName,trgName : string; + key : string; + phrase : string; + returnVal : string; +Begin + callCtx := GetCallContext(); + + strPrmName := 'key'; AFormatter.Get(TypeInfo(string),strPrmName,key); + strPrmName := 'phrase'; AFormatter.Get(TypeInfo(string),strPrmName,phrase); + + tmpObj := Self.GetFactory().CreateInstance() as IGoogleSearch; + if Supports(tmpObj,ICallControl,cllCntrl) then + cllCntrl.SetCallContext(GetCallContext()); + + returnVal := tmpObj.doSpellingSuggestion(key,phrase); + + procName := AFormatter.GetCallProcedureName(); + trgName := AFormatter.GetCallTarget(); + AFormatter.Clear(); + AFormatter.BeginCallResponse(procName,trgName); + AFormatter.Put('return',TypeInfo(string),returnVal); + AFormatter.EndCallResponse(); + + callCtx := Nil; +End; + +procedure TGoogleSearch_ServiceBinder.doGoogleSearchHandler(AFormatter:IFormatterResponse); +Var + cllCntrl : ICallControl; + tmpObj : IGoogleSearch; + callCtx : ICallContext; + strPrmName : string; + procName,trgName : string; + key : string; + q : string; + start : Integer; + maxResults : Integer; + filter : Boolean; + restrict : string; + safeSearch : Boolean; + lr : string; + ie : string; + oe : string; + returnVal : TGoogleSearchResult; +Begin + callCtx := GetCallContext(); + Pointer(returnVal) := Nil; + + strPrmName := 'key'; AFormatter.Get(TypeInfo(string),strPrmName,key); + strPrmName := 'q'; AFormatter.Get(TypeInfo(string),strPrmName,q); + strPrmName := 'start'; AFormatter.Get(TypeInfo(Integer),strPrmName,start); + strPrmName := 'maxResults'; AFormatter.Get(TypeInfo(Integer),strPrmName,maxResults); + strPrmName := 'filter'; AFormatter.Get(TypeInfo(Boolean),strPrmName,filter); + strPrmName := 'restrict'; AFormatter.Get(TypeInfo(string),strPrmName,restrict); + strPrmName := 'safeSearch'; AFormatter.Get(TypeInfo(Boolean),strPrmName,safeSearch); + strPrmName := 'lr'; AFormatter.Get(TypeInfo(string),strPrmName,lr); + strPrmName := 'ie'; AFormatter.Get(TypeInfo(string),strPrmName,ie); + strPrmName := 'oe'; AFormatter.Get(TypeInfo(string),strPrmName,oe); + + tmpObj := Self.GetFactory().CreateInstance() as IGoogleSearch; + if Supports(tmpObj,ICallControl,cllCntrl) then + cllCntrl.SetCallContext(GetCallContext()); + + returnVal := tmpObj.doGoogleSearch(key,q,start,maxResults,filter,restrict,safeSearch,lr,ie,oe); + If Assigned(Pointer(returnVal)) Then + callCtx.AddObjectToFree(TObject(returnVal)); + + procName := AFormatter.GetCallProcedureName(); + trgName := AFormatter.GetCallTarget(); + AFormatter.Clear(); + AFormatter.BeginCallResponse(procName,trgName); + AFormatter.Put('return',TypeInfo(TGoogleSearchResult),returnVal); + AFormatter.EndCallResponse(); + + callCtx := Nil; +End; + + +constructor TGoogleSearch_ServiceBinder.Create(); +Begin + Inherited Create(GetServiceImplementationRegistry().FindFactory('IGoogleSearch')); + RegisterVerbHandler('doSpellingSuggestion',@doSpellingSuggestionHandler); + RegisterVerbHandler('doGoogleSearch',@doGoogleSearchHandler); +End; + + +{ TGoogleSearch_ServiceBinderFactory } +function TGoogleSearch_ServiceBinderFactory.CreateInstance():IInterface; +Begin + Result := TGoogleSearch_ServiceBinder.Create() as IInterface; +End; + + +procedure Server_service_RegisterGoogleSearchService(); +Begin + GetServerServiceRegistry().Register('IGoogleSearch',TGoogleSearch_ServiceBinderFactory.Create() as IItemFactory); +End; + +initialization + + {$IF DECLARED(Register_googlewebapi_NameSpace)} + Register_googlewebapi_NameSpace(); + {$ENDIF} + + {$i googlewebapi.wst} + +End. diff --git a/wst/tags/0.4/tests/google_api/googlewebapi_proxy.pas b/wst/tags/0.4/tests/google_api/googlewebapi_proxy.pas new file mode 100644 index 000000000..c00cda864 --- /dev/null +++ b/wst/tags/0.4/tests/google_api/googlewebapi_proxy.pas @@ -0,0 +1,123 @@ +{ +This unit has been produced by ws_helper. + Input unit name : "googlewebapi". + This unit name : "googlewebapi_proxy". + Date : "12/11/2006 00:24". +} +Unit googlewebapi_proxy; +{$mode objfpc}{$H+} +Interface + +Uses SysUtils, Classes, TypInfo, base_service_intf, service_intf, googlewebapi; + +Type + + + TGoogleSearch_Proxy=class(TBaseProxy,IGoogleSearch) + Protected + class function GetServiceType() : PTypeInfo;override; + function doSpellingSuggestion( + Const key : string; + Const phrase : string + ):string; + function doGoogleSearch( + Const key : string; + Const q : string; + Const start : Integer; + Const maxResults : Integer; + Const filter : Boolean; + Const restrict : string; + Const safeSearch : Boolean; + Const lr : string; + Const ie : string; + Const oe : string + ):TGoogleSearchResult; + End; + +Implementation +uses wst_resources_imp, metadata_repository; + +{ TGoogleSearch_Proxy implementation } + +class function TGoogleSearch_Proxy.GetServiceType() : PTypeInfo; +begin + result := TypeInfo(IGoogleSearch); +end; + +function TGoogleSearch_Proxy.doSpellingSuggestion( + Const key : string; + Const phrase : string +):string; +Var + locSerializer : IFormatterClient; + strPrmName : string; +Begin + locSerializer := GetSerializer(); + Try + locSerializer.BeginCall('doSpellingSuggestion', GetTarget(),(Self as ICallContext)); + locSerializer.Put('key', TypeInfo(string), key); + locSerializer.Put('phrase', TypeInfo(string), phrase); + locSerializer.EndCall(); + + MakeCall(); + + locSerializer.BeginCallRead((Self as ICallContext)); + strPrmName := 'return'; + locSerializer.Get(TypeInfo(string), strPrmName, result); + + Finally + locSerializer.Clear(); + End; +End; + +function TGoogleSearch_Proxy.doGoogleSearch( + Const key : string; + Const q : string; + Const start : Integer; + Const maxResults : Integer; + Const filter : Boolean; + Const restrict : string; + Const safeSearch : Boolean; + Const lr : string; + Const ie : string; + Const oe : string +):TGoogleSearchResult; +Var + locSerializer : IFormatterClient; + strPrmName : string; +Begin + locSerializer := GetSerializer(); + Try + locSerializer.BeginCall('doGoogleSearch', GetTarget(),(Self as ICallContext)); + locSerializer.Put('key', TypeInfo(string), key); + locSerializer.Put('q', TypeInfo(string), q); + locSerializer.Put('start', TypeInfo(Integer), start); + locSerializer.Put('maxResults', TypeInfo(Integer), maxResults); + locSerializer.Put('filter', TypeInfo(Boolean), filter); + locSerializer.Put('restrict', TypeInfo(string), restrict); + locSerializer.Put('safeSearch', TypeInfo(Boolean), safeSearch); + locSerializer.Put('lr', TypeInfo(string), lr); + locSerializer.Put('ie', TypeInfo(string), ie); + locSerializer.Put('oe', TypeInfo(string), oe); + locSerializer.EndCall(); + + MakeCall(); + + locSerializer.BeginCallRead((Self as ICallContext)); + Pointer(Result) := Nil; + strPrmName := 'return'; + locSerializer.Get(TypeInfo(TGoogleSearchResult), strPrmName, result); + + Finally + locSerializer.Clear(); + End; +End; + + +initialization + {$i googlewebapi.wst} + + {$IF DECLARED(Register_googlewebapi_ServiceMetadata)} + Register_googlewebapi_ServiceMetadata(); + {$ENDIF} +End. diff --git a/wst/tags/0.4/tests/google_api/test_google_api.lpi b/wst/tags/0.4/tests/google_api/test_google_api.lpi new file mode 100644 index 000000000..1d2aa398b --- /dev/null +++ b/wst/tags/0.4/tests/google_api/test_google_api.lpi @@ -0,0 +1,449 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wst/tags/0.4/tests/google_api/test_google_api.pas b/wst/tags/0.4/tests/google_api/test_google_api.pas new file mode 100644 index 000000000..7dbbc8bd0 --- /dev/null +++ b/wst/tags/0.4/tests/google_api/test_google_api.pas @@ -0,0 +1,100 @@ +program test_google_api; +{$mode objfpc}{$H+} +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Classes, SysUtils, + base_service_intf, service_intf, soap_formatter, + //indy_http_protocol, + ics_http_protocol, + synapse_http_protocol, + googlewebapi, googlewebapi_proxy, wst_resources_imp; + +Const + //sADRESS = 'http:Address=http://api.google.com/search/beta2;Proxy'; + sADDRESS = 'http:Address=http://api.google.com/search/beta2';//+ + //';ProxyServer=10.0.0.5;ProxyPort=8080'; + sTARGET = 'urn:GoogleSearch'; + sKEY = '0w9pU3tQFHJyjRUP/bKgv2qwCoXf5pop';//''; + sSERVICE_PROTOCOL = 'SOAP:style=rpc'; +Var + tmpObj : IGoogleSearch; + qryRes : TGoogleSearchResult; + strBuffer : string; + i , c: Integer; + resElt : TResultElement; + resDir : TDirectoryCategory; +begin + //ICS_RegisterHTTP_Transport(); + SYNAPSE_RegisterHTTP_Transport(); + //INDY_RegisterHTTP_Transport(); + WriteLn(); + WriteLn('Enter phrase to spell :'); + ReadLn(strBuffer); + tmpObj := TGoogleSearch_Proxy.Create(sTARGET,sSERVICE_PROTOCOL,sADDRESS); + Try + strBuffer := tmpObj.doSpellingSuggestion(sKEY,strBuffer); + WriteLn('google spell >>> ',strBuffer); + Except + On E : Exception Do + WriteLn(E.Message); + End; + + WriteLn(); + WriteLn('Enter phrase to search :'); + ReadLn(strBuffer); + Try + qryRes := tmpObj.doGoogleSearch(sKEY,strBuffer,0,10,True,'',False,'','latin1','latin1'); + Try + WriteLn('---------------------------------------'); + WriteLn('google Search >>'); + WriteLn('documentFiltering = ',qryRes.documentFiltering); + WriteLn('startIndex = ',qryRes.startIndex); + WriteLn('endIndex = ',qryRes.endIndex); + WriteLn('estimatedTotalResultsCount = ',qryRes.estimatedTotalResultsCount); + WriteLn('estimateIsExact = ',qryRes.estimateIsExact); + WriteLn('searchComments = ',qryRes.searchComments); + WriteLn('searchQuery = ',qryRes.searchQuery); + WriteLn('searchTime = ',qryRes.searchTime); + WriteLn('searchTips = ',qryRes.searchTips); + + WriteLn('-------------------------------------------'); + WriteLn('directoryCategories >>'); + WriteLn(' Length = ',qryRes.directoryCategories.Length); + c := qryRes.directoryCategories.Length; + For i := 0 To Pred(c) Do Begin + resDir := qryRes.directoryCategories[i]; + WriteLn(''); + WriteLn('Item[',i,'] >>'); + WriteLn(' fullViewableName = ',resDir.fullViewableName); + WriteLn(' specialEncoding = ',resDir.specialEncoding); + End; + + WriteLn('-------------------------------------------'); + WriteLn('resultElements >>'); + WriteLn(' Length = ',qryRes.resultElements.Length); + c := qryRes.resultElements.Length; + For i := 0 To Pred(c) Do Begin + resElt := qryRes.resultElements[i]; + WriteLn(''); + WriteLn('Item[',i,'] >>'); + WriteLn(' cachedSize = ',resElt.cachedSize); + WriteLn(' directoryTitle = ',resElt.directoryTitle); + WriteLn(' hostName = ',resElt.hostName); + WriteLn(' relatedInformationPresent = ',resElt.relatedInformationPresent); + WriteLn(' snippet = ',resElt.snippet); + WriteLn(' summary = ',resElt.summary); + WriteLn(' title = ',resElt.title); + WriteLn(' URL = ',resElt.URL); + End; + Finally + qryRes.Free(); + End; + Except + On E : Exception Do + WriteLn(E.Message); + End; + + ReadLn(); +end. diff --git a/wst/tags/0.4/tests/http_server/app_object.pas b/wst/tags/0.4/tests/http_server/app_object.pas new file mode 100644 index 000000000..b2443ab6d --- /dev/null +++ b/wst/tags/0.4/tests/http_server/app_object.pas @@ -0,0 +1,309 @@ +{ + This file is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This file is provide under modified LGPL licence + ( the files COPYING.modifiedLGPL and COPYING.LGPL). + + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +} + +unit app_object; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, + IdCustomHTTPServer, + IdHTTPServer, IdContext, IdSocketHandle; + +type + + { TwstWebApplication } + + TwstWebApplication = class(TObject) + private + FHTTPServerObject: TIdHTTPServer; + FRootAddress : string; + private + function GenerateWSDLTable():string; + + procedure ProcessWSDLRequest( + AContext : TIdContext; + ARequestInfo : TIdHTTPRequestInfo; + AResponseInfo : TIdHTTPResponseInfo; + var APath : string + ); + procedure ProcessServiceRequest( + AContext : TIdContext; + ARequestInfo : TIdHTTPRequestInfo; + AResponseInfo : TIdHTTPResponseInfo; + var APath : string + ); + private + procedure Handler_CommandGet( + AContext : TIdContext; + ARequestInfo : TIdHTTPRequestInfo; + AResponseInfo : TIdHTTPResponseInfo + ); + public + constructor Create(); + destructor Destroy(); override; + procedure Display(const AMsg : string); + end; + + +implementation +uses base_service_intf, + server_service_intf, server_service_imputils, + server_service_soap, server_binary_formatter, + metadata_repository, metadata_wsdl, DOM, XMLWrite, + calculator, calculator_binder, calculator_imp, + metadata_service, metadata_service_binder, metadata_service_imp, + + user_service_intf, user_service_intf_binder, user_service_intf_imp; + +const + sSEPARATOR = '/'; + sSERVICES_PREFIXE = 'services'; + sWSDL = 'WSDL'; + +function ExtractNextPathElement(var AFullPath : string):string; +var + i : SizeInt; +begin + Result := ''; + if ( Length(AFullPath) > 0 ) then begin + while ( Length(AFullPath) > 0 ) and ( AFullPath[1] = sSEPARATOR ) do begin + Delete(AFullPath,1,1); + end; + i := Pos(sSEPARATOR,AFullPath); + if ( i < 1 ) then begin + Result := AFullPath; + AFullPath := ''; + end else begin + Result := Copy(AFullPath,1,Pred(i)); + Delete(AFullPath,1,i); + end; + end; +end; + +function GetWSDL(const ARepName, ARootAddress: shortstring):string; +var + strm : TMemoryStream; + rep : PServiceRepository; + doc :TXMLDocument; + i : SizeInt; + s : string; +begin + Result := ''; + rep := nil; + doc := Nil; + i := GetModuleMetadataMngr().IndexOfName(ARepName); + if ( i < 0 ) then + Exit; + strm := TMemoryStream.Create(); + try + s := GetModuleMetadataMngr().GetRepositoryName(i); + GetModuleMetadataMngr().LoadRepositoryName(s,ARootAddress,rep); + //if ( GetModuleMetadataMngr().LoadRepositoryName(s,rep) > 0 ) then + //rep^.namespace := 'urn:wst'; + strm.Clear(); + doc := TXMLDocument.Create(); + GenerateWSDL(rep,doc); + WriteXMLFile(doc,strm); + i := strm.Size; + if ( i > 0 ) then begin + SetLength(Result,i); + Move(strm.memory^,Result[1],i); + end; + finally + doc.Free(); + strm.Free(); + GetModuleMetadataMngr().ClearRepository(rep); + end; +end; + + +{ TwstWebApplication } + +function TwstWebApplication.GenerateWSDLTable(): string; +var + r : IModuleMetadataMngr; + i : Integer; +begin + r := GetModuleMetadataMngr(); + Result := '' + + ''+ + ''+ + 'The Web Service Toolkit generated Metadata table'+ + ''+ + '' + + '

The following repositories has available. Click on the link to view the corresponding WSDL.

'+ + '' + + ''; + + for i := 0 to Pred(r.GetCount()) do + Result := Result + ''; + + Result := Result + + ''+ + '
' + + Format('',[sSEPARATOR+sSERVICES_PREFIXE+sSEPARATOR+sWSDL+sSEPARATOR+r.GetRepositoryName(i)])+ + r.GetRepositoryName(i) + + ''+ + '
'+ + ''+ + ''+ + ''; +end; + +procedure TwstWebApplication.ProcessWSDLRequest( + AContext : TIdContext; + ARequestInfo : TIdHTTPRequestInfo; + AResponseInfo : TIdHTTPResponseInfo; + var APath : string +); +var + locRepName, strBuff : string; + i : Integer; +begin + locRepName := ExtractNextPathElement(APath); + if AnsiSameText(sWSDL,locRepName) then + locRepName := ExtractNextPathElement(APath); + strBuff := GetWSDL(locRepName,FRootAddress); + i := Length(strBuff); + if ( i > 0 ) then begin + AResponseInfo.ContentType := 'text/xml'; + if not Assigned(AResponseInfo.ContentStream) then + AResponseInfo.ContentStream := TMemoryStream.Create(); + AResponseInfo.ContentStream.Write(strBuff[1],i); + Exit; + end; + AResponseInfo.ContentText := GenerateWSDLTable(); + AResponseInfo.ContentType := 'text/html'; +end; + +procedure TwstWebApplication.ProcessServiceRequest( + AContext : TIdContext; + ARequestInfo : TIdHTTPRequestInfo; + AResponseInfo : TIdHTTPResponseInfo; + var APath : string +); +var + trgt,ctntyp : string; + rqst : IRequestBuffer; + inStream: TMemoryStream; +begin + trgt := ExtractNextPathElement(APath); + if AnsiSameText(sWSDL,trgt) then begin + ProcessWSDLRequest(AContext,ARequestInfo,AResponseInfo,APath); + Exit; + end; + inStream := nil; + try + try + inStream := TMemoryStream.Create(); + AResponseInfo.ContentStream := TMemoryStream.Create(); + + ctntyp := ARequestInfo.ContentType; + inStream.CopyFrom(ARequestInfo.PostStream,0); + inStream.Position := 0; + AResponseInfo.ContentType := ctntyp; + rqst := TRequestBuffer.Create(trgt,ctntyp,inStream,AResponseInfo.ContentStream); + HandleServiceRequest(rqst); + finally + inStream.Free(); + end; + except + on e : Exception do begin + Display('ProcessData()>> Exception = '+e.Message); + raise; + end; + end; +end; + +procedure TwstWebApplication.Handler_CommandGet( + AContext : TIdContext; + ARequestInfo : TIdHTTPRequestInfo; + AResponseInfo : TIdHTTPResponseInfo +); +var + locPath, locPathPart, s : string; + j : SizeInt; +begin + if Assigned(ARequestInfo.PostStream) and ( ARequestInfo.PostStream.Size > 0 ) then begin + j := ARequestInfo.PostStream.Size; + SetLength(s,j); + ARequestInfo.PostStream.Read(s[1],j); + Display('----------- QUERY ----------------------'); + Display(s); + end; + locPath := ARequestInfo.Document; + locPathPart := ExtractNextPathElement(locPath); + if AnsiSameText(sSERVICES_PREFIXE,locPathPart) then begin + ProcessServiceRequest(AContext,ARequestInfo,AResponseInfo,locPath); + if Assigned(AResponseInfo.ContentStream) and ( AResponseInfo.ContentStream.Size > 0 ) then begin + j := AResponseInfo.ContentStream.Size; + SetLength(s,j); + AResponseInfo.ContentStream.Position := 0; + AResponseInfo.ContentStream.Read(s[1],j); + Display('--------- RESPONSE ------------------------'); + Display(s); + end; + Exit; + end; + + ProcessWSDLRequest(AContext,ARequestInfo,AResponseInfo,locPath); +end; + +constructor TwstWebApplication.Create(); +var + b : TIdSocketHandle; +begin + inherited Create(); + FHTTPServerObject := TIdHTTPServer.Create(); + b := FHTTPServerObject.Bindings.Add(); + b.IP:='127.0.0.1'; + b.port:=8000; + FRootAddress := 'http://127.0.0.1:8000/'; + + FHTTPServerObject.DefaultPort := 25000; + FHTTPServerObject.ServerSoftware := 'Web Service Toolkit Sample WebServer'; + FHTTPServerObject.Active := True; + FHTTPServerObject.OnCommandGet := @Handler_CommandGet; + + Server_service_RegisterUserServiceService(); + RegisterUserServiceImplementationFactory(); +end; + +destructor TwstWebApplication.Destroy(); +begin + FreeAndNil(FHTTPServerObject); + inherited Destroy(); +end; + +procedure TwstWebApplication.Display(const AMsg: string); +begin + WriteLn(AMsg); +end; + +initialization + RegisterStdTypes(); + Server_service_RegisterBinaryFormat(); + Server_service_RegisterSoapFormat(); + + Server_service_RegisterCalculatorService(); + RegisterCalculatorImplementationFactory(); + + Server_service_RegisterWSTMetadataServiceService(); + RegisterWSTMetadataServiceImplementationFactory(); + + + +end. diff --git a/wst/tags/0.4/tests/http_server/wst_http_server.lpi b/wst/tags/0.4/tests/http_server/wst_http_server.lpi new file mode 100644 index 000000000..b5ab9e5fa --- /dev/null +++ b/wst/tags/0.4/tests/http_server/wst_http_server.lpi @@ -0,0 +1,718 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wst/tags/0.4/tests/http_server/wst_http_server.pas b/wst/tags/0.4/tests/http_server/wst_http_server.pas new file mode 100644 index 000000000..c627f53be --- /dev/null +++ b/wst/tags/0.4/tests/http_server/wst_http_server.pas @@ -0,0 +1,40 @@ +{ + This file is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This file is provide under modified LGPL licence + ( the files COPYING.modifiedLGPL and COPYING.LGPL). + + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +} + +program wst_http_server; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Classes, SysUtils, + app_object, metadata_service, logger_extension; + + +var + AppObject : TwstWebApplication; +begin + AppObject := TwstWebApplication.Create(); + try + WriteLn('"Web Service Toolkit" WebServer listening at:'); + WriteLn(''); + WriteLn('http://127.0.0.1:8000/'); + WriteLn(''); + WriteLn('Press enter to quit.'); + ReadLn(); + finally + FreeAndNil(AppObject); + end; +end. diff --git a/wst/tags/0.4/tests/library/lib_server.lpi b/wst/tags/0.4/tests/library/lib_server.lpi new file mode 100644 index 000000000..f7cf2253b --- /dev/null +++ b/wst/tags/0.4/tests/library/lib_server.lpi @@ -0,0 +1,279 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wst/tags/0.4/tests/library/lib_server.lpr b/wst/tags/0.4/tests/library/lib_server.lpr new file mode 100644 index 000000000..0f248ab8e --- /dev/null +++ b/wst/tags/0.4/tests/library/lib_server.lpr @@ -0,0 +1,45 @@ +{ + This file is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This file is provide under modified LGPL licence + ( the files COPYING.modifiedLGPL and COPYING.LGPL). + + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +} +library lib_server; + +{$mode objfpc}{$H+} + +uses + SysUtils, Classes, + + base_service_intf, + server_service_intf, + server_service_soap, server_binary_formatter, + metadata_repository, metadata_wsdl, + metadata_service, metadata_service_binder, metadata_service_imp, + library_base_intf, library_server_intf, + + calculator_binder, calculator_imp; + + + +exports + wstHandleRequest name WST_LIB_HANDLER; + +begin + RegisterStdTypes(); + Server_service_RegisterBinaryFormat(); + Server_service_RegisterSoapFormat(); + + RegisterCalculatorImplementationFactory(); + Server_service_RegisterCalculatorService(); + + Server_service_RegisterWSTMetadataServiceService(); + RegisterWSTMetadataServiceImplementationFactory(); +end. + diff --git a/wst/tags/0.4/tests/metadata_browser/metadata_browser.lpi b/wst/tags/0.4/tests/metadata_browser/metadata_browser.lpi new file mode 100644 index 000000000..223139469 --- /dev/null +++ b/wst/tags/0.4/tests/metadata_browser/metadata_browser.lpi @@ -0,0 +1,297 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wst/tags/0.4/tests/metadata_browser/metadata_browser.lpr b/wst/tags/0.4/tests/metadata_browser/metadata_browser.lpr new file mode 100644 index 000000000..ae2101736 --- /dev/null +++ b/wst/tags/0.4/tests/metadata_browser/metadata_browser.lpr @@ -0,0 +1,19 @@ +program metadata_browser; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Interfaces, // this includes the LCL widgetset + Forms + { add your units here }, umain, metadata_service_proxy, + metadata_service; + +begin + Application.Initialize; + Application.CreateForm(TfMain, fMain); + Application.Run; +end. + diff --git a/wst/tags/0.4/tests/metadata_browser/umain.lfm b/wst/tags/0.4/tests/metadata_browser/umain.lfm new file mode 100644 index 000000000..2cc9fcbca --- /dev/null +++ b/wst/tags/0.4/tests/metadata_browser/umain.lfm @@ -0,0 +1,152 @@ +object fMain: TfMain + Left = 175 + Height = 311 + Top = 233 + Width = 574 + HorzScrollBar.Page = 573 + VertScrollBar.Page = 310 + ActiveControl = edtAddress + Caption = 'WST Metadata Browser' + object pnlHead: TPanel + Height = 82 + Width = 574 + Align = alTop + TabOrder = 0 + object Label1: TLabel + Left = 14 + Height = 18 + Top = 12 + Width = 26 + Caption = 'URL' + Color = clNone + ParentColor = False + end + object Label3: TLabel + Left = 11 + Height = 18 + Top = 46 + Width = 45 + Caption = 'Format' + Color = clNone + ParentColor = False + end + object edtAddress: TEdit + Left = 88 + Height = 23 + Top = 12 + Width = 480 + Anchors = [akTop, akLeft, akRight] + Font.CharSet = ANSI_CHARSET + Font.Color = clBlack + Font.Height = -13 + Font.Name = 'Arial' + Font.Pitch = fpVariable + TabOrder = 0 + Text = 'http://127.0.0.1:8000/wst/services/IWSTMetadataService' + end + object btnGetRepList: TButton + Left = 477 + Height = 25 + Top = 40 + Width = 91 + Action = actGetRepositoryList + Anchors = [akTop, akRight] + BorderSpacing.InnerBorder = 4 + TabOrder = 2 + end + object edtFormat: TRadioGroup + Left = 88 + Height = 37 + Top = 35 + Width = 280 + AutoFill = True + Caption = ' &Format ' + ChildSizing.LeftRightSpacing = 6 + ChildSizing.TopBottomSpacing = 6 + ChildSizing.EnlargeHorizontal = crsHomogenousChildResize + ChildSizing.EnlargeVertical = crsHomogenousChildResize + ChildSizing.ShrinkHorizontal = crsScaleChilds + ChildSizing.ShrinkVertical = crsScaleChilds + ChildSizing.Layout = cclLeftToRightThenTopToBottom + ChildSizing.ControlsPerLine = 2 + Columns = 2 + ItemIndex = 0 + Items.Strings = ( + '&SOAP' + '&binary' + ) + TabOrder = 1 + end + end + object pnlClient: TPanel + Height = 229 + Top = 82 + Width = 574 + Align = alClient + BevelInner = bvRaised + BevelOuter = bvLowered + TabOrder = 1 + object Label2: TLabel + Left = 14 + Height = 18 + Top = 14 + Width = 67 + Caption = 'Repository' + Color = clNone + ParentColor = False + end + object edtRepositoryList: TComboBox + Left = 112 + Height = 24 + Top = 7 + Width = 344 + Anchors = [akTop, akLeft, akRight] + AutoCompleteText = [cbactEndOfLineComplete, cbactSearchAscending] + MaxLength = 0 + TabOrder = 0 + Text = 'edtRepositoryList' + end + object tvwMetadata: TTreeView + Left = 11 + Height = 176 + Top = 38 + Width = 555 + Anchors = [akTop, akLeft, akRight, akBottom] + DefaultItemHeight = 18 + Font.CharSet = ANSI_CHARSET + Font.Color = clBlack + Font.Height = -13 + Font.Name = 'Courier New' + Font.Pitch = fpFixed + ReadOnly = True + TabOrder = 1 + Options = [tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoReadOnly, tvoShowButtons, tvoShowLines, tvoShowRoot, tvoShowSeparators, tvoToolTips] + TreeLineColor = clNavy + end + object Button1: TButton + Left = 477 + Height = 25 + Top = 6 + Width = 91 + Action = actGetRepository + Anchors = [akTop, akRight] + BorderSpacing.InnerBorder = 4 + TabOrder = 2 + end + end + object AL: TActionList + left = 72 + top = 464 + object actGetRepositoryList: TAction + Caption = 'Get Rep. List' + DisableIfNoHandler = True + OnExecute = actGetRepositoryListExecute + end + object actGetRepository: TAction + Caption = 'Get Repository' + DisableIfNoHandler = True + OnExecute = actGetRepositoryExecute + OnUpdate = actGetRepositoryUpdate + end + end +end diff --git a/wst/tags/0.4/tests/metadata_browser/umain.lrs b/wst/tags/0.4/tests/metadata_browser/umain.lrs new file mode 100644 index 000000000..a865fd84a --- /dev/null +++ b/wst/tags/0.4/tests/metadata_browser/umain.lrs @@ -0,0 +1,51 @@ +{ Ceci est un fichier ressource généré automatiquement par Lazarus } + +LazarusResources.Add('TfMain','FORMDATA',[ + 'TPF0'#6'TfMain'#5'fMain'#4'Left'#3#175#0#6'Height'#3'7'#1#3'Top'#3#233#0#5'W' + +'idth'#3'>'#2#18'HorzScrollBar.Page'#3'='#2#18'VertScrollBar.Page'#3'6'#1#13 + +'ActiveControl'#7#10'edtAddress'#7'Caption'#6#20'WST Metadata Browser'#0#6'T' + +'Panel'#7'pnlHead'#6'Height'#2'R'#5'Width'#3'>'#2#5'Align'#7#5'alTop'#8'TabO' + +'rder'#2#0#0#6'TLabel'#6'Label1'#4'Left'#2#14#6'Height'#2#18#3'Top'#2#12#5'W' + +'idth'#2#26#7'Caption'#6#3'URL'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#6 + +'TLabel'#6'Label3'#4'Left'#2#11#6'Height'#2#18#3'Top'#2'.'#5'Width'#2'-'#7'C' + +'aption'#6#6'Format'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#5'TEdit'#10 + +'edtAddress'#4'Left'#2'X'#6'Height'#2#23#3'Top'#2#12#5'Width'#3#224#1#7'Anch' + +'ors'#11#5'akTop'#6'akLeft'#7'akRight'#0#12'Font.CharSet'#7#12'ANSI_CHARSET' + +#10'Font.Color'#7#7'clBlack'#11'Font.Height'#2#243#9'Font.Name'#6#5'Arial'#10 + +'Font.Pitch'#7#10'fpVariable'#8'TabOrder'#2#0#4'Text'#6'6http://127.0.0.1:80' + +'00/wst/services/IWSTMetadataService'#0#0#7'TButton'#13'btnGetRepList'#4'Lef' + +'t'#3#221#1#6'Height'#2#25#3'Top'#2'('#5'Width'#2'['#6'Action'#7#20'actGetRe' + +'positoryList'#7'Anchors'#11#5'akTop'#7'akRight'#0#25'BorderSpacing.InnerBor' + +'der'#2#4#8'TabOrder'#2#2#0#0#11'TRadioGroup'#9'edtFormat'#4'Left'#2'X'#6'He' + +'ight'#2'%'#3'Top'#2'#'#5'Width'#3#24#1#8'AutoFill'#9#7'Caption'#6#9' &Forma' + +'t '#28'ChildSizing.LeftRightSpacing'#2#6#28'ChildSizing.TopBottomSpacing'#2 + +#6#29'ChildSizing.EnlargeHorizontal'#7#24'crsHomogenousChildResize'#27'Child' + +'Sizing.EnlargeVertical'#7#24'crsHomogenousChildResize'#28'ChildSizing.Shrin' + +'kHorizontal'#7#14'crsScaleChilds'#26'ChildSizing.ShrinkVertical'#7#14'crsSc' + +'aleChilds'#18'ChildSizing.Layout'#7#29'cclLeftToRightThenTopToBottom'#27'Ch' + +'ildSizing.ControlsPerLine'#2#2#7'Columns'#2#2#9'ItemIndex'#2#0#13'Items.Str' + +'ings'#1#6#5'&SOAP'#6#7'&binary'#0#8'TabOrder'#2#1#0#0#0#6'TPanel'#9'pnlClie' + +'nt'#6'Height'#3#229#0#3'Top'#2'R'#5'Width'#3'>'#2#5'Align'#7#8'alClient'#10 + +'BevelInner'#7#8'bvRaised'#10'BevelOuter'#7#9'bvLowered'#8'TabOrder'#2#1#0#6 + +'TLabel'#6'Label2'#4'Left'#2#14#6'Height'#2#18#3'Top'#2#14#5'Width'#2'C'#7'C' + +'aption'#6#10'Repository'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#9'TComb' + +'oBox'#17'edtRepositoryList'#4'Left'#2'p'#6'Height'#2#24#3'Top'#2#7#5'Width' + +#3'X'#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#16'AutoCompleteText'#11 + +#22'cbactEndOfLineComplete'#20'cbactSearchAscending'#0#9'MaxLength'#2#0#8'Ta' + +'bOrder'#2#0#4'Text'#6#17'edtRepositoryList'#0#0#9'TTreeView'#11'tvwMetadata' + +#4'Left'#2#11#6'Height'#3#176#0#3'Top'#2'&'#5'Width'#3'+'#2#7'Anchors'#11#5 + +'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#17'DefaultItemHeight'#2#18#12'Fon' + +'t.CharSet'#7#12'ANSI_CHARSET'#10'Font.Color'#7#7'clBlack'#11'Font.Height'#2 + +#243#9'Font.Name'#6#11'Courier New'#10'Font.Pitch'#7#7'fpFixed'#8'ReadOnly'#9 + +#8'TabOrder'#2#1#7'Options'#11#17'tvoAutoItemHeight'#16'tvoHideSelection'#21 + +'tvoKeepCollapsedNodes'#11'tvoReadOnly'#14'tvoShowButtons'#12'tvoShowLines' + +#11'tvoShowRoot'#17'tvoShowSeparators'#11'tvoToolTips'#0#13'TreeLineColor'#7 + +#6'clNavy'#0#0#7'TButton'#7'Button1'#4'Left'#3#221#1#6'Height'#2#25#3'Top'#2 + +#6#5'Width'#2'['#6'Action'#7#16'actGetRepository'#7'Anchors'#11#5'akTop'#7'a' + +'kRight'#0#25'BorderSpacing.InnerBorder'#2#4#8'TabOrder'#2#2#0#0#0#11'TActio' + +'nList'#2'AL'#4'left'#2'H'#3'top'#3#208#1#0#7'TAction'#20'actGetRepositoryLi' + +'st'#7'Caption'#6#13'Get Rep. List'#18'DisableIfNoHandler'#9#9'OnExecute'#7 + +#27'actGetRepositoryListExecute'#0#0#7'TAction'#16'actGetRepository'#7'Capti' + +'on'#6#14'Get Repository'#18'DisableIfNoHandler'#9#9'OnExecute'#7#23'actGetR' + +'epositoryExecute'#8'OnUpdate'#7#22'actGetRepositoryUpdate'#0#0#0#0 +]); diff --git a/wst/tags/0.4/tests/metadata_browser/umain.pas b/wst/tags/0.4/tests/metadata_browser/umain.pas new file mode 100644 index 000000000..89f941d08 --- /dev/null +++ b/wst/tags/0.4/tests/metadata_browser/umain.pas @@ -0,0 +1,170 @@ +unit umain; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ExtCtrls, + StdCtrls, Buttons, ActnList, metadata_service, ComCtrls; + +type + + { TfMain } + + TfMain = class(TForm) + actGetRepositoryList: TAction; + actGetRepository: TAction; + AL: TActionList; + btnGetRepList: TButton; + Button1: TButton; + edtRepositoryList: TComboBox; + edtAddress: TEdit; + Label1: TLabel; + Label2: TLabel; + Label3: TLabel; + pnlClient: TPanel; + pnlHead: TPanel; + edtFormat: TRadioGroup; + tvwMetadata: TTreeView; + procedure actGetRepositoryExecute(Sender: TObject); + procedure actGetRepositoryListExecute(Sender: TObject); + procedure actGetRepositoryUpdate(Sender: TObject); + private + function CreateMetadataObject():IWSTMetadataService; + procedure LoadRepository(ARep : TWSTMtdRepository); + public + { public declarations } + end; + +var + fMain: TfMain; + +implementation +uses base_service_intf, service_intf, + soap_formatter, binary_formatter, + synapse_http_protocol, //indy_http_protocol, ics_http_protocol, + ics_tcp_protocol, + library_protocol, + metadata_service_proxy; + +{ TfMain } + +procedure TfMain.actGetRepositoryListExecute(Sender: TObject); +var + tmpObj : IWSTMetadataService; + locList : TArrayOfStringRemotable; + i : Integer; +begin + tmpObj := CreateMetadataObject(); + locList := tmpObj.GetRepositoryList(); + edtRepositoryList.Items.Clear(); + for i := 0 to Pred(locList.Length) do begin + edtRepositoryList.Items.Add(locList.Item[i]); + end; +end; + +procedure TfMain.actGetRepositoryExecute(Sender: TObject); +var + rd : TWSTMtdRepository; +begin + rd := CreateMetadataObject().GetRepositoryInfo(edtRepositoryList.Items[edtRepositoryList.ItemIndex]); + try + LoadRepository(rd); + finally + rd.Free(); + end; +end; + +procedure TfMain.actGetRepositoryUpdate(Sender: TObject); +begin + TAction(Sender).Enabled := ( edtRepositoryList.ItemIndex > -1 ); +end; + +function TfMain.CreateMetadataObject(): IWSTMetadataService; +const FORMAT_MAP : Array[0..1] of string = ( 'SOAP', 'binary' ); +var + i : Integer; + s : string; +begin + i := edtFormat.ItemIndex; + if not ( i in [0..1] ) then + i := 0; + s := FORMAT_MAP[i]; + Result := TWSTMetadataService_Proxy.Create( + 'WSTMetadataService', + s, + edtAddress.Text//Format('http:Address=%s',[edtAddress.Text]) + ) as IWSTMetadataService; +//lib:FileName=C:\Programmes\lazarus\wst\tests\library\obj\lib_server.dll;target=IWSTMetadataService +//'http:Address=http://127.0.0.1:8000/services/IWSTMetadataService' +//'TCP:Address=127.0.0.1;Port=1234;target=Calculator' +end; + +procedure TfMain.LoadRepository(ARep: TWSTMtdRepository); + + procedure LoadService(ASrvsNd : TTreeNode; AService : TWSTMtdService); + + procedure LoadOperation(AOprsNd : TTreeNode; AOper : TWSTMtdServiceOperation); + + procedure LoadParam(APrmsNd : TTreeNode; APrm : TWSTMtdOperationParam); + var + prmNd : TTreeNode; + begin + prmNd := tvwMetadata.Items.AddChild(APrmsNd,APrm.Name); + tvwMetadata.Items.AddChild(prmNd,Format('Name = %s',[APrm.Name])); + tvwMetadata.Items.AddChild(prmNd,Format('Type = %s',[APrm.TypeName])); + end; + + var + opNd, prmsNd : TTreeNode; + ii, cc : Integer; + begin + opNd := tvwMetadata.Items.AddChild(AOprsNd,AOper.Name); + tvwMetadata.Items.AddChild(opNd,Format('Name = %s',[AOper.Name])); + cc := AOper.Params.Length; + prmsNd := tvwMetadata.Items.AddChild(opNd,Format('Parameters = %d',[cc])); + for ii := 0 to Pred(cc) do + LoadParam(prmsNd,AOper.Params[ii]); + end; + + var + svNd, oprsNd : TTreeNode; + j, k : Integer; + begin + svNd := tvwMetadata.Items.AddChild(ASrvsNd,AService.Name); + tvwMetadata.Items.AddChild(svNd,Format('Name = %s',[AService.Name])); + k := AService.Operations.Length; + oprsNd := tvwMetadata.Items.AddChild(svNd,Format('Operations = %d',[k])); + for j := 0 to Pred(k) do + LoadOperation(oprsNd,AService.Operations[j]); + end; + +var + rtNd, srvsNd : TTreeNode; + i, c : Integer; +begin + tvwMetadata.Items.Clear(); + if not Assigned(ARep) then + Exit; + rtNd := tvwMetadata.Items.AddChild(Nil,ARep.Name); + tvwMetadata.Items.AddChild(rtNd,Format('Name = %s',[ARep.Name])); + tvwMetadata.Items.AddChild(rtNd,Format('Name Space = %s',[ARep.Name])); + c := ARep.Services.Length; + srvsNd := tvwMetadata.Items.AddChild(rtNd,Format('Services Count = %d',[c])); + for i := 0 to Pred(c) do begin + LoadService(srvsNd,ARep.Services[i]); + end; +end; + +initialization + {$I umain.lrs} + + RegisterStdTypes(); + SYNAPSE_RegisterHTTP_Transport(); + LIB_Register_Transport(); + ICS_RegisterTCP_Transport(); + //ICS_RegisterHTTP_Transport(); + //INDY_RegisterHTTP_Transport(); +end. + diff --git a/wst/tags/0.4/tests/tcp_server/server_unit.pas b/wst/tags/0.4/tests/tcp_server/server_unit.pas new file mode 100644 index 000000000..75322866b --- /dev/null +++ b/wst/tags/0.4/tests/tcp_server/server_unit.pas @@ -0,0 +1,270 @@ +unit server_unit; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, Windows, Dialogs, + WSocket, WSocketS; + + +Type + + { TTcpSrvClient } + + TTcpSrvClient = class(TWSocketClient) + Private + FConnectTime: TDateTime; + FDataLentgh: LongInt; + FRequestStream : TStream; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy();override; + function TryRead():Boolean; + property ConnectTime : TDateTime Read FConnectTime Write FConnectTime; + property RequestStream : TStream Read FRequestStream; + property DataLentgh : LongInt Read FDataLentgh; + end; + + { TTcpSrvApp } + + TTcpSrvApp = class + Private + procedure HandleClientConnect(Sender: TObject;Client: TWSocketClient; Error: Word); + procedure HandleClientDisconnect(Sender: TObject; + Client: TWSocketClient; Error: Word); + procedure HandleBgException(Sender: TObject; E: Exception; + var CanClose: Boolean); + private + FWSocketServer: TWSocketServer; + procedure ClientDataAvailable(Sender: TObject; Error: Word); + procedure ProcessData(Client : TTcpSrvClient); + procedure ClientBgException(Sender : TObject; + E : Exception; + var CanClose : Boolean); + procedure ClientLineLimitExceeded(Sender : TObject; + Cnt : LongInt; + var ClearData : Boolean); + Public + constructor Create(); + destructor Destroy();override; + procedure Display(Msg : String); + procedure Start(); + procedure Stop(); + function IsActive():Boolean; + End; + +Implementation +uses umain, server_service_intf, server_service_imputils, binary_streamer; + +procedure LogMsg(const Msg : String); +Begin + fMain.LogMessage(Msg); +End; + +procedure TTcpSrvApp.Display(Msg : String); +begin + LogMsg(Msg); +end; + +procedure TTcpSrvApp.Start(); +begin + Display('Starting...'); + FWSocketServer.Proto := 'tcp'; { Use TCP protocol } + FWSocketServer.Port := '1234'; + FWSocketServer.Addr := '0.0.0.0'; { Use any interface } + FWSocketServer.ClientClass := TTcpSrvClient; + FWSocketServer.Listen; { Start litening } + Display('Waiting for clients...'); +end; + +procedure TTcpSrvApp.Stop(); +begin + FWSocketServer.CloseDelayed(); +end; + +function TTcpSrvApp.IsActive(): Boolean; +begin + Result := ( FWSocketServer.State < wsClosed ); +end; + +procedure TTcpSrvApp.HandleClientConnect( + Sender : TObject; + Client : TWSocketClient; + Error : Word); +begin + with Client as TTcpSrvClient do begin + Display('Client connected.' + + ' Remote: ' + PeerAddr + '/' + PeerPort + + ' Local: ' + GetXAddr + '/' + GetXPort); + Display('There is now ' + + IntToStr(TWSocketServer(Sender).ClientCount) + + ' clients connected.'); + LineMode := False; + LineEdit := False; + OnDataAvailable := @ClientDataAvailable; + OnLineLimitExceeded := @ClientLineLimitExceeded; + OnBgException := @ClientBgException; + ConnectTime := Now; + end; +end; + +procedure TTcpSrvApp.HandleClientDisconnect( + Sender : TObject; + Client : TWSocketClient; + Error : Word); +begin + with Client as TTcpSrvClient do begin + Display('Client disconnecting : ' + PeerAddr + ' ' + + 'Duration: ' + FormatDateTime('hh:nn:ss', + Now - ConnectTime)); + Display('There is now ' + + IntToStr(TWSocketServer(Sender).ClientCount - 1) + + ' clients connected.'); + end; +end; + +procedure TTcpSrvApp.ClientLineLimitExceeded( + Sender : TObject; + Cnt : LongInt; + var ClearData : Boolean); +begin + with Sender as TTcpSrvClient do begin + Display('Line limit exceeded from ' + GetPeerAddr + '. Closing.'); + ClearData := TRUE; + Close; + end; +end; + +constructor TTcpSrvApp.Create(); +begin + FWSocketServer := TWSocketServer.Create(Nil); + FWSocketServer.Banner := ''; + FWSocketServer.OnClientConnect := @HandleClientConnect; + FWSocketServer.OnBgException := @HandleBgException; + FWSocketServer.OnClientDisconnect := @HandleClientDisconnect; +end; + +destructor TTcpSrvApp.Destroy(); +begin + FWSocketServer.Free(); +end; + +procedure TTcpSrvApp.ClientDataAvailable(Sender : TObject;Error : Word); +Var + cliTCP : TTcpSrvClient; +begin + cliTCP := Sender as TTcpSrvClient; + //Display('ClientDataAvailable()'); + If cliTCP.TryRead() And ( cliTCP.DataLentgh > 0 ) Then + ProcessData(cliTCP) +end; + +procedure TTcpSrvApp.ProcessData(Client : TTcpSrvClient); +Var + buff, trgt,ctntyp : string; + rqst : IRequestBuffer; + wrtr : IDataStore; + rdr : IDataStoreReader; + inStream, outStream, bufStream : TMemoryStream; + i : Integer; +begin + inStream := Nil; + outStream := Nil; + bufStream := Nil; + Try + Client.RequestStream.Position := 0; + Try + inStream := TMemoryStream.Create(); + outStream := TMemoryStream.Create(); + bufStream := TMemoryStream.Create(); + rdr := CreateBinaryReader(Client.RequestStream); + trgt := rdr.ReadStr(); + ctntyp := rdr.ReadStr(); + buff := rdr.ReadStr(); + inStream.Write(buff[1],Length(buff)); + inStream.Position := 0; + rqst := TRequestBuffer.Create(trgt,ctntyp,inStream,bufStream); + HandleServiceRequest(rqst); + i := bufStream.Size; + SetLength(buff,i); + bufStream.Position := 0; + bufStream.Read(buff[1],i); + wrtr := CreateBinaryWriter(outStream); + wrtr.WriteStr(buff); + //Display('ProcessData() resp Ln =' + IntToStr(i) + '; resp = ' + buff); + Client.Send(outStream.Memory,outStream.Size); + Finally + //Display('ProcessData()>> END'); + bufStream.Free(); + outStream.Free(); + inStream.Free(); + Client.FDataLentgh := -1; + Client.RequestStream.Size := 0; + End; + Except + On e : Exception Do + Display('ProcessData()>> Exception = '+e.Message); + End; +end; + +procedure TTcpSrvApp.HandleBgException( + Sender : TObject; + E : Exception; + var CanClose : Boolean); +begin + Display('Server exception occured: ' + E.ClassName + ': ' + E.Message); + CanClose := FALSE; { Hoping that server will still work ! } +end; + +procedure TTcpSrvApp.ClientBgException( + Sender : TObject; + E : Exception; + var CanClose : Boolean); +begin + Display('Client exception occured: ' + E.ClassName + ': ' + E.Message); + CanClose := TRUE; { Goodbye client ! } +end; + +{ TTcpSrvClient } + +constructor TTcpSrvClient.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FDataLentgh := -1; + FRequestStream := TMemoryStream.Create(); +end; + +destructor TTcpSrvClient.Destroy(); +begin + FRequestStream.Free(); + inherited Destroy(); +end; + +function TTcpSrvClient.TryRead(): Boolean; +Var + i,j : PtrInt; + buff : string; +begin + If ( FDataLentgh < 0 ) Then Begin + i := 4; + If ( Receive(@FDataLentgh,i) < 4 ) Then Begin + FDataLentgh := -1; + Result := False; + Exit; + End; + FDataLentgh := Reverse_32(FDataLentgh); + End; + If ( FDataLentgh > FRequestStream.Size ) Then Begin + i := Min((FDataLentgh-FRequestStream.Size),1024); + SetLength(buff,i); + j := Receive(@(buff[1]),i); + FRequestStream.Write(buff[1],j); + //LogMsg(Format('Read %d bytes; buff=%s',[j,buff])); + End; + Result := ( FDataLentgh <= FRequestStream.Size ); + //LogMsg(Format('TryRead() >> FDataLentgh=%d; Size=%d',[FDataLentgh,FRequestStream.Size])); +end; + +end. diff --git a/wst/tags/0.4/tests/tcp_server/tcp_gui_server.lpi b/wst/tags/0.4/tests/tcp_server/tcp_gui_server.lpi new file mode 100644 index 000000000..73c7fed41 --- /dev/null +++ b/wst/tags/0.4/tests/tcp_server/tcp_gui_server.lpi @@ -0,0 +1,437 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wst/tags/0.4/tests/tcp_server/tcp_gui_server.lpr b/wst/tags/0.4/tests/tcp_server/tcp_gui_server.lpr new file mode 100644 index 000000000..abe43a526 --- /dev/null +++ b/wst/tags/0.4/tests/tcp_server/tcp_gui_server.lpr @@ -0,0 +1,17 @@ +program tcp_gui_server; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Interfaces, // this includes the LCL widgetset + Forms, umain, server_unit, calculator, calculator_imp, calculator_binder; + +begin + Application.Initialize; + Application.CreateForm(TfMain, fMain); + Application.Run; +end. + diff --git a/wst/tags/0.4/tests/tcp_server/umain.lfm b/wst/tags/0.4/tests/tcp_server/umain.lfm new file mode 100644 index 000000000..75c12aec5 --- /dev/null +++ b/wst/tags/0.4/tests/tcp_server/umain.lfm @@ -0,0 +1,75 @@ +object fMain: TfMain + Left = 290 + Height = 300 + Top = 180 + Width = 400 + HorzScrollBar.Page = 399 + VertScrollBar.Page = 299 + ActiveControl = Button1 + Caption = 'Simple TCP App Server' + OnCreate = FormCreate + object Label1: TLabel + Left = 16 + Height = 18 + Top = 72 + Width = 24 + Caption = 'Log' + Color = clNone + ParentColor = False + end + object Button1: TButton + Left = 16 + Height = 25 + Top = 8 + Width = 104 + Action = actStart + TabOrder = 0 + end + object mmoLog: TMemo + Left = 8 + Height = 192 + Top = 96 + Width = 384 + Anchors = [akTop, akLeft, akRight, akBottom] + ReadOnly = True + ScrollBars = ssAutoBoth + TabOrder = 1 + end + object Button2: TButton + Left = 16 + Height = 25 + Top = 40 + Width = 104 + Action = actStop + TabOrder = 2 + end + object edtPort: TEdit + Left = 128 + Height = 23 + Top = 10 + Width = 80 + TabOrder = 3 + Text = '1234' + end + object AL: TActionList + left = 152 + top = 32 + object actStart: TAction + Caption = 'Start( Port=)' + DisableIfNoHandler = True + OnExecute = actStartExecute + OnUpdate = actStartUpdate + end + object actStop: TAction + Caption = 'Stop' + DisableIfNoHandler = True + OnExecute = actStopExecute + OnUpdate = actStopUpdate + end + object actClearLog: TAction + Caption = 'Clear Log' + DisableIfNoHandler = True + OnExecute = actClearLogExecute + end + end +end diff --git a/wst/tags/0.4/tests/tcp_server/umain.lrs b/wst/tags/0.4/tests/tcp_server/umain.lrs new file mode 100644 index 000000000..8f3a0ece6 --- /dev/null +++ b/wst/tags/0.4/tests/tcp_server/umain.lrs @@ -0,0 +1,23 @@ +{ Ceci est un fichier ressource généré automatiquement par Lazarus } + +LazarusResources.Add('TfMain','FORMDATA',[ + 'TPF0'#6'TfMain'#5'fMain'#4'Left'#3'"'#1#6'Height'#3','#1#3'Top'#3#180#0#5'Wi' + +'dth'#3#144#1#18'HorzScrollBar.Page'#3#143#1#18'VertScrollBar.Page'#3'+'#1#13 + +'ActiveControl'#7#7'Button1'#7'Caption'#6#21'Simple TCP App Server'#8'OnCrea' + +'te'#7#10'FormCreate'#0#6'TLabel'#6'Label1'#4'Left'#2#16#6'Height'#2#18#3'To' + +'p'#2'H'#5'Width'#2#24#7'Caption'#6#3'Log'#5'Color'#7#6'clNone'#11'ParentCol' + +'or'#8#0#0#7'TButton'#7'Button1'#4'Left'#2#16#6'Height'#2#25#3'Top'#2#8#5'Wi' + +'dth'#2'h'#6'Action'#7#8'actStart'#8'TabOrder'#2#0#0#0#5'TMemo'#6'mmoLog'#4 + +'Left'#2#8#6'Height'#3#192#0#3'Top'#2'`'#5'Width'#3#128#1#7'Anchors'#11#5'ak' + +'Top'#6'akLeft'#7'akRight'#8'akBottom'#0#8'ReadOnly'#9#10'ScrollBars'#7#10's' + +'sAutoBoth'#8'TabOrder'#2#1#0#0#7'TButton'#7'Button2'#4'Left'#2#16#6'Height' + +#2#25#3'Top'#2'('#5'Width'#2'h'#6'Action'#7#7'actStop'#8'TabOrder'#2#2#0#0#5 + +'TEdit'#7'edtPort'#4'Left'#3#128#0#6'Height'#2#23#3'Top'#2#10#5'Width'#2'P'#8 + +'TabOrder'#2#3#4'Text'#6#4'1234'#0#0#11'TActionList'#2'AL'#4'left'#3#152#0#3 + +'top'#2' '#0#7'TAction'#8'actStart'#7'Caption'#6#13'Start( Port=)'#18'Disabl' + +'eIfNoHandler'#9#9'OnExecute'#7#15'actStartExecute'#8'OnUpdate'#7#14'actStar' + +'tUpdate'#0#0#7'TAction'#7'actStop'#7'Caption'#6#4'Stop'#18'DisableIfNoHandl' + +'er'#9#9'OnExecute'#7#14'actStopExecute'#8'OnUpdate'#7#13'actStopUpdate'#0#0 + +#7'TAction'#11'actClearLog'#7'Caption'#6#9'Clear Log'#18'DisableIfNoHandler' + +#9#9'OnExecute'#7#18'actClearLogExecute'#0#0#0#0 +]); diff --git a/wst/tags/0.4/tests/tcp_server/umain.pas b/wst/tags/0.4/tests/tcp_server/umain.pas new file mode 100644 index 000000000..430cc5807 --- /dev/null +++ b/wst/tags/0.4/tests/tcp_server/umain.pas @@ -0,0 +1,101 @@ +unit umain; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, Buttons, + StdCtrls, ActnList, ExtCtrls; + +type + + { TfMain } + + TfMain = class(TForm) + actClearLog: TAction; + actStop: TAction; + actStart: TAction; + AL: TActionList; + Button1: TButton; + Button2: TButton; + edtPort: TEdit; + Label1: TLabel; + mmoLog: TMemo; + procedure actClearLogExecute(Sender: TObject); + procedure actStartExecute(Sender: TObject); + procedure actStartUpdate(Sender: TObject); + procedure actStopExecute(Sender: TObject); + procedure actStopUpdate(Sender: TObject); + procedure FormCreate(Sender: TObject); + private + public + procedure LogMessage(const AMsg : string); + end; + +var + fMain: TfMain; + +implementation +uses server_unit, + server_service_soap, server_binary_formatter, + calculator, calculator_imp, calculator_binder, + metadata_service, metadata_service_imp, metadata_service_binder; + +Var + scktServer : TTcpSrvApp; + +{ TfMain } + +procedure TfMain.actStartUpdate(Sender: TObject); +begin + TAction(Sender).Enabled := Not ( Assigned(scktServer) And scktServer.IsActive() ); +end; + +procedure TfMain.actStopExecute(Sender: TObject); +begin + If Assigned(scktServer) Then Begin + scktServer.Stop(); + End; +end; + +procedure TfMain.actStopUpdate(Sender: TObject); +begin + TAction(Sender).Enabled := Assigned(scktServer) And scktServer.IsActive(); +end; + +procedure TfMain.actStartExecute(Sender: TObject); +begin + mmoLog.Clear(); + If Not Assigned(scktServer) Then + scktServer := TTcpSrvApp.Create(); + If Not scktServer.IsActive() Then + scktServer.Start(); +end; + +procedure TfMain.actClearLogExecute(Sender: TObject); +begin + mmoLog.Clear(); +end; + +procedure TfMain.FormCreate(Sender: TObject); +begin + Server_service_RegisterCalculatorService(); + Server_service_RegisterCalculatorService(); + RegisterCalculatorImplementationFactory(); + Server_service_RegisterSoapFormat(); + Server_service_RegisterBinaryFormat(); + + RegisterWSTMetadataServiceImplementationFactory(); + Server_service_RegisterWSTMetadataServiceService +end; + +procedure TfMain.LogMessage(const AMsg: string); +begin + mmoLog.Lines.Add(AMsg); +end; + +initialization + {$I umain.lrs} + +end. diff --git a/wst/tags/0.4/tests/test_float_to_str/project1.lpi b/wst/tags/0.4/tests/test_float_to_str/project1.lpi new file mode 100644 index 000000000..387f7eb93 --- /dev/null +++ b/wst/tags/0.4/tests/test_float_to_str/project1.lpi @@ -0,0 +1,171 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wst/tags/0.4/tests/test_float_to_str/project1.lpr b/wst/tags/0.4/tests/test_float_to_str/project1.lpr new file mode 100644 index 000000000..63cbfae1d --- /dev/null +++ b/wst/tags/0.4/tests/test_float_to_str/project1.lpr @@ -0,0 +1,18 @@ +program project1; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Interfaces, // this includes the LCL widgetset + Forms + { add your units here }, Unit1; + +begin + Application.Initialize; + Application.CreateForm(TForm1, Form1); + Application.Run; +end. + diff --git a/wst/tags/0.4/tests/test_float_to_str/unit1.lfm b/wst/tags/0.4/tests/test_float_to_str/unit1.lfm new file mode 100644 index 000000000..f1dbc25f1 --- /dev/null +++ b/wst/tags/0.4/tests/test_float_to_str/unit1.lfm @@ -0,0 +1,58 @@ +object Form1: TForm1 + Left = 295 + Height = 300 + Top = 234 + Width = 400 + HorzScrollBar.Page = 399 + VertScrollBar.Page = 299 + Caption = 'Form1' + ClientHeight = 300 + ClientWidth = 400 + PixelsPerInch = 96 + object Button1: TButton + Left = 72 + Height = 25 + Top = 56 + Width = 75 + BorderSpacing.InnerBorder = 2 + Caption = 'Button1' + OnClick = Button1Click + TabOrder = 0 + end + object Edit1: TEdit + Left = 176 + Height = 23 + Top = 58 + Width = 80 + TabOrder = 1 + Text = '124656.32145' + end + object Memo1: TMemo + Left = 24 + Height = 184 + Top = 104 + Width = 352 + Lines.Strings = ( + 'Memo1' + ) + TabOrder = 2 + end + object Edit2: TEdit + Left = 103 + Height = 23 + Top = 26 + Width = 80 + TabOrder = 3 + Text = '#.#######E-0' + end + object Button2: TButton + Left = 264 + Height = 25 + Top = 24 + Width = 75 + BorderSpacing.InnerBorder = 2 + Caption = 'Button2' + OnClick = Button2Click + TabOrder = 4 + end +end diff --git a/wst/tags/0.4/tests/test_float_to_str/unit1.lrs b/wst/tags/0.4/tests/test_float_to_str/unit1.lrs new file mode 100644 index 000000000..4db2d6571 --- /dev/null +++ b/wst/tags/0.4/tests/test_float_to_str/unit1.lrs @@ -0,0 +1,17 @@ +{ Ceci est un fichier ressource généré automatiquement par Lazarus } + +LazarusResources.Add('TForm1','FORMDATA',[ + 'TPF0'#6'TForm1'#5'Form1'#4'Left'#3''''#1#6'Height'#3','#1#3'Top'#3#234#0#5'W' + +'idth'#3#144#1#18'HorzScrollBar.Page'#3#143#1#18'VertScrollBar.Page'#3'+'#1#7 + +'Caption'#6#5'Form1'#12'ClientHeight'#3','#1#11'ClientWidth'#3#144#1#13'Pixe' + +'lsPerInch'#2'`'#0#7'TButton'#7'Button1'#4'Left'#2'H'#6'Height'#2#25#3'Top'#2 + +'8'#5'Width'#2'K'#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#7'Button1'#7 + +'OnClick'#7#12'Button1Click'#8'TabOrder'#2#0#0#0#5'TEdit'#5'Edit1'#4'Left'#3 + +#176#0#6'Height'#2#23#3'Top'#2':'#5'Width'#2'P'#8'TabOrder'#2#1#4'Text'#6#12 + +'124656.32145'#0#0#5'TMemo'#5'Memo1'#4'Left'#2#24#6'Height'#3#184#0#3'Top'#2 + +'h'#5'Width'#3'`'#1#13'Lines.Strings'#1#6#5'Memo1'#0#8'TabOrder'#2#2#0#0#5'T' + +'Edit'#5'Edit2'#4'Left'#2'g'#6'Height'#2#23#3'Top'#2#26#5'Width'#2'P'#8'TabO' + +'rder'#2#3#4'Text'#6#12'#.#######E-0'#0#0#7'TButton'#7'Button2'#4'Left'#3#8#1 + +#6'Height'#2#25#3'Top'#2#24#5'Width'#2'K'#25'BorderSpacing.InnerBorder'#2#2#7 + +'Caption'#6#7'Button2'#7'OnClick'#7#12'Button2Click'#8'TabOrder'#2#4#0#0#0 +]); diff --git a/wst/tags/0.4/tests/test_float_to_str/unit1.pas b/wst/tags/0.4/tests/test_float_to_str/unit1.pas new file mode 100644 index 000000000..d5759d2f9 --- /dev/null +++ b/wst/tags/0.4/tests/test_float_to_str/unit1.pas @@ -0,0 +1,69 @@ +unit Unit1; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, Buttons, + StdCtrls; + +type + + { TForm1 } + + TForm1 = class(TForm) + Button1: TButton; + Button2: TButton; + Edit1: TEdit; + Edit2: TEdit; + Memo1: TMemo; + procedure Button1Click(Sender: TObject); + procedure Button2Click(Sender: TObject); + private + { private declarations } + public + { public declarations } + end; + +var + Form1: TForm1; + +implementation + +{ TForm1 } + +procedure TForm1.Button1Click(Sender: TObject); +Var + s : single; +begin + If TryStrToFloat(Edit1.Text,s) then begin + Memo1.Clear(); + Memo1.Lines.Add(FloatToStrF(s,ffExponent,8,5)); + Memo1.Lines.Add(FloatToStrF(s,ffGeneral,8,5)); + Memo1.Lines.Add(FloatToStrF(s,ffFixed,8,5)); + Memo1.Lines.Add(FloatToStrF(s,ffNumber,8,5)); + Memo1.Lines.Add(FloatToStrF(s,ffCurrency,8,5)) ; + Memo1.Lines.Add(FormatFloat(Edit2.Text,s)); + end; +end; + +procedure TForm1.Button2Click(Sender: TObject); +Var + v : TFloatRec; + s : single; + b : string; +begin + If TryStrToFloat(Edit1.Text,s) then begin + FillChar(v,SizeOf(v),0); + FloatToDecimal(v,s,7,1); + Memo1.Clear(); + Memo1.Lines.Add(Format('%d',[v.Exponent])); + end; +end; + +initialization + {$I unit1.lrs} + +end. + diff --git a/wst/tags/0.4/tests/test_suite/test_parserdef.pas b/wst/tags/0.4/tests/test_suite/test_parserdef.pas new file mode 100644 index 000000000..ec11768c4 --- /dev/null +++ b/wst/tags/0.4/tests/test_suite/test_parserdef.pas @@ -0,0 +1,109 @@ +unit test_parserdef; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, parserdefs, fpcunit, testregistry; + +type + + { TTest_TClassTypeDefinition } + + TTest_TClassTypeDefinition = class(TTestCase) + published + procedure IsDescendantOf(); + procedure SetParent(); + end; + +implementation + +{ TTest_TClassTypeDefinition } + +procedure TTest_TClassTypeDefinition.IsDescendantOf(); +var + a, b , c, d : TClassTypeDefinition; +begin + a := nil; + b := nil; + c := nil; + d := nil; + try + a := TClassTypeDefinition.Create('a'); + + b := TClassTypeDefinition.Create('b'); + b.SetParent(a); + + c := TClassTypeDefinition.Create('c'); + c.SetParent(b); + + d := TClassTypeDefinition.Create('d'); + + AssertTrue('b IsDescendantOf a',b.IsDescendantOf(a)); + AssertTrue('c IsDescendantOf b',c.IsDescendantOf(b)); + AssertTrue('c IsDescendantOf a',c.IsDescendantOf(a)); + + AssertFalse('b IsDescendantOf c',b.IsDescendantOf(c)); + AssertFalse('a IsDescendantOf b',a.IsDescendantOf(b)); + AssertFalse('a IsDescendantOf c',a.IsDescendantOf(c)); + + AssertFalse('d IsDescendantOf a',d.IsDescendantOf(a)); + + finally + FreeAndNil(d); + FreeAndNil(c); + FreeAndNil(b); + FreeAndNil(a); + end; +end; + +procedure TTest_TClassTypeDefinition.SetParent(); +var + a, b , c, d : TClassTypeDefinition; + excp : Boolean; +begin + a := nil; + b := nil; + c := nil; + d := nil; + try + a := TClassTypeDefinition.Create('a'); + + b := TClassTypeDefinition.Create('b'); + b.SetParent(a); + + c := TClassTypeDefinition.Create('c'); + c.SetParent(b); + + d := TClassTypeDefinition.Create('d'); + + excp := False;; + try + c.SetParent(c); + except + excp := True; + end; + if not excp then begin + Fail('c.SetParent(c);'); + end; + + AssertSame('a.Parent = nil',nil,a.Parent); + AssertSame('b.Parent = a',a,b.Parent); + AssertSame('c.Parent = b',b,c.Parent); + AssertSame('d.Parent = nil',nil,d.Parent); + + finally + FreeAndNil(d); + FreeAndNil(c); + FreeAndNil(b); + FreeAndNil(a); + end; + +end; + +initialization + RegisterTest(TTest_TClassTypeDefinition); + +end. + diff --git a/wst/tags/0.4/tests/test_suite/testformatter_unit.pas b/wst/tags/0.4/tests/test_suite/testformatter_unit.pas new file mode 100644 index 000000000..2c589b04c --- /dev/null +++ b/wst/tags/0.4/tests/test_suite/testformatter_unit.pas @@ -0,0 +1,3104 @@ +{ + This file is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This file is provide under modified LGPL licence + ( the files COPYING.modifiedLGPL and COPYING.LGPL). + + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +} + +unit testformatter_unit; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, fpcunit, testutils, testregistry, + TypInfo, + base_service_intf; + +type + + TTestEnum = ( teOne, teTwo, teThree, teFour ); + + { TClass_A } + + TClass_A = class(TBaseComplexRemotable) + private + FVal_32S: LongInt; + FVal_Bool: Boolean; + FVal_Enum: TTestEnum; + FVal_String: string; + Published + property Val_32S : LongInt Read FVal_32S Write FVal_32S; + property Val_Enum : TTestEnum Read FVal_Enum Write FVal_Enum; + property Val_Bool : Boolean Read FVal_Bool Write FVal_Bool; + property Val_String : string Read FVal_String Write FVal_String; + End; + + { TClass_B } + + TClass_B = class(TBaseComplexRemotable) + private + FNonStored: Integer; + FObjProp: TClass_A; + FVal_32S: LongInt; + FVal_Bool: Boolean; + FVal_Enum: TTestEnum; + FVal_String: string; + procedure SetObjProp(const AValue: TClass_A); + Public + constructor Create();override; + destructor Destroy();override; + Published + property Val_32S : LongInt Read FVal_32S Write FVal_32S; + property Val_Enum : TTestEnum Read FVal_Enum Write FVal_Enum; + property Val_Bool : Boolean Read FVal_Bool Write FVal_Bool; + property Val_String : string Read FVal_String Write FVal_String; + property ObjProp : TClass_A Read FObjProp Write SetObjProp stored True; + property NonStored : Integer Read FNonStored Write FNonStored stored false; + End; + + { TClass_Int } + + TClass_Int = class(TBaseComplexRemotable) + private + FVal_16S: SmallInt; + FVal_16U: Word; + FVal_32S: LongInt; + FVal_32U: LongWord; + FVal_64S: Int64; + FVal_64U: QWord; + FVal_8S: ShortInt; + FVal_8U: Byte; + Published + property Val_8U : Byte Read FVal_8U Write FVal_8U; + property Val_8S : ShortInt Read FVal_8S Write FVal_8S; + property Val_16U : Word Read FVal_16U Write FVal_16U; + property Val_16S : SmallInt Read FVal_16S Write FVal_16S; + property Val_32U : LongWord Read FVal_32U Write FVal_32U; + property Val_32S : LongInt Read FVal_32S Write FVal_32S; + property Val_64U : QWord Read FVal_64U Write FVal_64U; + property Val_64S : Int64 Read FVal_64S Write FVal_64S; + End; + + T_ComplexInt64SContent = class(TComplexInt64SContentRemotable) + private + FBoolSimpleAtt_Exemple: Boolean; + FIntSimpleAtt_Exemple: Integer; + FStrSimpleAtt_Exemple: string; + published + property StrSimpleAtt_Exemple : string read FStrSimpleAtt_Exemple write FStrSimpleAtt_Exemple; + property IntSimpleAtt_Exemple : Integer read FIntSimpleAtt_Exemple write FIntSimpleAtt_Exemple; + property BoolSimpleAtt_Exemple : Boolean read FBoolSimpleAtt_Exemple write FBoolSimpleAtt_Exemple; + end; + + T_ComplexInt64UContent = class(TComplexInt64UContentRemotable) + private + FBoolSimpleAtt_Exemple: Boolean; + FIntSimpleAtt_Exemple: Integer; + FStrSimpleAtt_Exemple: string; + published + property StrSimpleAtt_Exemple : string read FStrSimpleAtt_Exemple write FStrSimpleAtt_Exemple; + property IntSimpleAtt_Exemple : Integer read FIntSimpleAtt_Exemple write FIntSimpleAtt_Exemple; + property BoolSimpleAtt_Exemple : Boolean read FBoolSimpleAtt_Exemple write FBoolSimpleAtt_Exemple; + end; + + { T_ComplexInt32SContent } + + T_ComplexInt32SContent = class(TComplexInt32SContentRemotable) + private + FBoolSimpleAtt_Exemple: Boolean; + FIntSimpleAtt_Exemple: Integer; + FStrSimpleAtt_Exemple: string; + published + property StrSimpleAtt_Exemple : string read FStrSimpleAtt_Exemple write FStrSimpleAtt_Exemple; + property IntSimpleAtt_Exemple : Integer read FIntSimpleAtt_Exemple write FIntSimpleAtt_Exemple; + property BoolSimpleAtt_Exemple : Boolean read FBoolSimpleAtt_Exemple write FBoolSimpleAtt_Exemple; + end; + + T_ComplexInt32UContent = class(TComplexInt32UContentRemotable) + private + FBoolSimpleAtt_Exemple: Boolean; + FIntSimpleAtt_Exemple: Integer; + FStrSimpleAtt_Exemple: string; + published + property StrSimpleAtt_Exemple : string read FStrSimpleAtt_Exemple write FStrSimpleAtt_Exemple; + property IntSimpleAtt_Exemple : Integer read FIntSimpleAtt_Exemple write FIntSimpleAtt_Exemple; + property BoolSimpleAtt_Exemple : Boolean read FBoolSimpleAtt_Exemple write FBoolSimpleAtt_Exemple; + end; + + T_ComplexInt16SContent = class(TComplexInt16SContentRemotable) + private + FBoolSimpleAtt_Exemple: Boolean; + FIntSimpleAtt_Exemple: Integer; + FStrSimpleAtt_Exemple: string; + published + property StrSimpleAtt_Exemple : string read FStrSimpleAtt_Exemple write FStrSimpleAtt_Exemple; + property IntSimpleAtt_Exemple : Integer read FIntSimpleAtt_Exemple write FIntSimpleAtt_Exemple; + property BoolSimpleAtt_Exemple : Boolean read FBoolSimpleAtt_Exemple write FBoolSimpleAtt_Exemple; + end; + + T_ComplexInt16UContent = class(TComplexInt16UContentRemotable) + private + FBoolSimpleAtt_Exemple: Boolean; + FIntSimpleAtt_Exemple: Integer; + FStrSimpleAtt_Exemple: string; + published + property StrSimpleAtt_Exemple : string read FStrSimpleAtt_Exemple write FStrSimpleAtt_Exemple; + property IntSimpleAtt_Exemple : Integer read FIntSimpleAtt_Exemple write FIntSimpleAtt_Exemple; + property BoolSimpleAtt_Exemple : Boolean read FBoolSimpleAtt_Exemple write FBoolSimpleAtt_Exemple; + end; + + T_ComplexInt8SContent = class(TComplexInt8SContentRemotable) + private + FBoolSimpleAtt_Exemple: Boolean; + FIntSimpleAtt_Exemple: Integer; + FStrSimpleAtt_Exemple: string; + published + property StrSimpleAtt_Exemple : string read FStrSimpleAtt_Exemple write FStrSimpleAtt_Exemple; + property IntSimpleAtt_Exemple : Integer read FIntSimpleAtt_Exemple write FIntSimpleAtt_Exemple; + property BoolSimpleAtt_Exemple : Boolean read FBoolSimpleAtt_Exemple write FBoolSimpleAtt_Exemple; + end; + + T_ComplexInt8UContent = class(TComplexInt8UContentRemotable) + private + FBoolSimpleAtt_Exemple: Boolean; + FIntSimpleAtt_Exemple: Integer; + FStrSimpleAtt_Exemple: string; + published + property StrSimpleAtt_Exemple : string read FStrSimpleAtt_Exemple write FStrSimpleAtt_Exemple; + property IntSimpleAtt_Exemple : Integer read FIntSimpleAtt_Exemple write FIntSimpleAtt_Exemple; + property BoolSimpleAtt_Exemple : Boolean read FBoolSimpleAtt_Exemple write FBoolSimpleAtt_Exemple; + end; + + T_ComplexFloatExtendedContent = class(TComplexFloatExtendedContentRemotable) + private + FBoolSimpleAtt_Exemple: Boolean; + FIntSimpleAtt_Exemple: Integer; + FStrSimpleAtt_Exemple: string; + published + property StrSimpleAtt_Exemple : string read FStrSimpleAtt_Exemple write FStrSimpleAtt_Exemple; + property IntSimpleAtt_Exemple : Integer read FIntSimpleAtt_Exemple write FIntSimpleAtt_Exemple; + property BoolSimpleAtt_Exemple : Boolean read FBoolSimpleAtt_Exemple write FBoolSimpleAtt_Exemple; + end; + + T_ComplexFloatDoubleContent = class(TComplexFloatDoubleContentRemotable) + private + FBoolSimpleAtt_Exemple: Boolean; + FIntSimpleAtt_Exemple: Integer; + FStrSimpleAtt_Exemple: string; + published + property StrSimpleAtt_Exemple : string read FStrSimpleAtt_Exemple write FStrSimpleAtt_Exemple; + property IntSimpleAtt_Exemple : Integer read FIntSimpleAtt_Exemple write FIntSimpleAtt_Exemple; + property BoolSimpleAtt_Exemple : Boolean read FBoolSimpleAtt_Exemple write FBoolSimpleAtt_Exemple; + end; + + T_ComplexStringContent = class(TComplexStringContentRemotable) + private + FBoolSimpleAtt_Exemple: Boolean; + FIntSimpleAtt_Exemple: Integer; + FStrSimpleAtt_Exemple: string; + published + property StrSimpleAtt_Exemple : string read FStrSimpleAtt_Exemple write FStrSimpleAtt_Exemple; + property IntSimpleAtt_Exemple : Integer read FIntSimpleAtt_Exemple write FIntSimpleAtt_Exemple; + property BoolSimpleAtt_Exemple : Boolean read FBoolSimpleAtt_Exemple write FBoolSimpleAtt_Exemple; + end; + + { TClass_CplxSimpleContent } + + TClass_CplxSimpleContent = class(TBaseComplexRemotable) + private + FElt_Exemple: string; + FVal_CplxDouble: T_ComplexFloatDoubleContent; + FVal_CplxInt16S: T_ComplexInt16SContent; + FVal_CplxInt16U: T_ComplexInt16UContent; + FVal_CplxInt32S: T_ComplexInt32SContent; + FVal_CplxInt32U: T_ComplexInt32UContent; + FVal_CplxExtended : T_ComplexFloatExtendedContent; + FVal_CplxInt64S: T_ComplexInt64SContent; + FVal_CplxInt64U: T_ComplexInt64UContent; + FVal_CplxInt8S: T_ComplexInt8SContent; + FVal_CplxInt8U: T_ComplexInt8UContent; + FVal_CplxString: T_ComplexStringContent; + public + constructor Create();override; + destructor Destroy();override; + published + property Val_CplxInt64S : T_ComplexInt64SContent read FVal_CplxInt64S write FVal_CplxInt64S; + property Val_CplxInt64U : T_ComplexInt64UContent read FVal_CplxInt64U write FVal_CplxInt64U; + + property Val_CplxInt32S : T_ComplexInt32SContent read FVal_CplxInt32S write FVal_CplxInt32S; + property Val_CplxInt32U : T_ComplexInt32UContent read FVal_CplxInt32U write FVal_CplxInt32U; + + property Val_CplxInt16U : T_ComplexInt16UContent read FVal_CplxInt16U write FVal_CplxInt16U; + property Val_CplxInt16S : T_ComplexInt16SContent read FVal_CplxInt16S write FVal_CplxInt16S; + + property Val_CplxInt8U : T_ComplexInt8UContent read FVal_CplxInt8U write FVal_CplxInt8U; + property Val_CplxInt8S : T_ComplexInt8SContent read FVal_CplxInt8S write FVal_CplxInt8S; + + property Val_CplxExtended : T_ComplexFloatExtendedContent read FVal_CplxExtended write FVal_CplxExtended; + property Val_CplxDouble : T_ComplexFloatDoubleContent read FVal_CplxDouble write FVal_CplxDouble; + property Val_CplxString : T_ComplexStringContent read FVal_CplxString write FVal_CplxString; + + property Elt_Exemple : string read FElt_Exemple write FElt_Exemple; + end; + + { TClass_Enum } + + TClass_Enum = class(TBaseComplexRemotable) + private + FVal_Bool: Boolean; + FVal_Enum: TTestEnum; + FVal_String: string; + Published + property Val_Enum : TTestEnum Read FVal_Enum Write FVal_Enum; + property Val_Bool : Boolean Read FVal_Bool Write FVal_Bool; + property Val_String : string Read FVal_String Write FVal_String; + End; + + { TClass_Float } + + TClass_Float = class(TBaseComplexRemotable) + private + FVal_Currency: Currency; + FVal_Double: Double; + FVal_Extended: Extended; + FVal_Single: Single; + Published + property Val_Single : Single Read FVal_Single Write FVal_Single; + property Val_Double : Double Read FVal_Double Write FVal_Double; + property Val_Extended : Extended Read FVal_Extended Write FVal_Extended; + property Val_Currency : Currency Read FVal_Currency Write FVal_Currency; + End; + + TEmbeddedArrayOfStringRemotable = class(TArrayOfStringRemotable); + + { TTestFormatterSimpleType } + + TTestFormatterSimpleType= class(TTestCase) + protected + function CreateFormatter(ARootType : PTypeInfo):IFormatterBase;virtual;abstract; + published + procedure Test_Int_8; + procedure Test_Int_8_ScopeData; + procedure Test_Int_16; + procedure Test_Int_32; + procedure Test_Int_64; + + procedure Test_Single_4; + procedure Test_Double_8; + procedure Test_Currency_8; + procedure Test_Extended_10; + + procedure Test_String; + procedure Test_Bool; + procedure Test_Enum; + end; + + { TTestFormatter } + + TTestFormatter= class(TTestFormatterSimpleType) + published + procedure Test_Int_WithClass; + + procedure Test_Float_WithClass; + + procedure Test_Enum_Bool_String_WithClass; + + procedure Test_CplxInt64SimpleContent_WithClass; + procedure Test_CplxInt32SimpleContent_WithClass; + procedure Test_CplxInt16SimpleContent_WithClass; + procedure Test_CplxInt8SimpleContent_WithClass; + + procedure Test_CplxFloatExtendedSimpleContent_WithClass; + procedure Test_CplxStringSimpleContent_WithClass; + + procedure Test_Object(); + procedure Test_Object_Nil(); + procedure Test_StringArray(); + procedure Test_StringArray_Embedded(); + procedure Test_StringArrayZeroLength(); + procedure Test_BooleanArray(); + + procedure Test_Int8UArray(); + procedure Test_Int8SArray(); + + procedure Test_Int16SArray(); + procedure Test_Int16UArray(); + + procedure Test_Int32UArray(); + procedure Test_Int32SArray(); + + procedure Test_Int64SArray(); + procedure Test_Int64UArray(); + + procedure Test_FloatSingleArray(); + procedure Test_FloatDoubleArray(); + procedure Test_FloatExtendedArray(); + procedure Test_FloatCurrencyArray(); + + procedure Test_ComplexInt32S(); + end; + + { TTestBinaryFormatter } + + TTestBinaryFormatter= class(TTestFormatter) + protected + function CreateFormatter(ARootType : PTypeInfo):IFormatterBase;override; + end; + + { TTestBinaryFormatterAttributes } + + TTestBinaryFormatterAttributes= class(TTestFormatterSimpleType) + protected + function CreateFormatter(ARootType : PTypeInfo):IFormatterBase;override; + end; + + { TTestSOAPFormatter } + + TTestSOAPFormatter= class(TTestFormatter) + protected + function CreateFormatter(ARootType : PTypeInfo):IFormatterBase;override; + end; + + { TTestSOAPFormatterAttributes } + + TTestSOAPFormatterAttributes = class(TTestFormatterSimpleType) + protected + function CreateFormatter(ARootType : PTypeInfo):IFormatterBase;override; + end; + + { TTestArray } + + TTestArray= class(TTestCase) + published + procedure Test_StringArray(); + procedure Test_BooleanArray(); + + procedure Test_Int8UArray(); + procedure Test_Int8SArray(); + + procedure Test_Int16SArray(); + procedure Test_Int16UArray(); + + procedure Test_Int32UArray(); + procedure Test_Int32SArray(); + + procedure Test_Int64SArray(); + procedure Test_Int64UArray(); + + procedure Test_FloatSingleArray(); + procedure Test_FloatDoubleArray(); + procedure Test_FloatExtendedArray(); + procedure Test_FloatCurrencyArray(); + end; + + { TTest_TBaseComplexRemotable } + + TTest_TBaseComplexRemotable= class(TTestCase) + published + procedure Test_Assign(); + end; + + { TTest_TDateRemotable } + + TTest_TDateRemotable = class(TTestCase) + published + procedure FormatDate(); + procedure ParseDate(); + end; + + { TTest_TDurationRemotable } + + TTest_TDurationRemotable = class(TTestCase) + published + procedure FormatDate(); + procedure ParseDate(); + end; + + { TTest_TTimeRemotable } + + TTest_TTimeRemotable = class(TTestCase) + published + procedure FormatDate(); + procedure ParseDate(); + end; + +implementation +uses base_binary_formatter, base_soap_formatter; + +procedure TTestFormatterSimpleType.Test_Int_8; +const VAL_1 = 12; VAL_2 = -10; +Var + f : IFormatterBase; + s : TMemoryStream; + x : string; + intVal_U : Byte; intVal_S : ShortInt; +begin + s := Nil; + Try + intVal_U := VAL_1; + intVal_S := VAL_2; + f := CreateFormatter(TypeInfo(TClass_Int)); + + f.BeginObject('Root',TypeInfo(TClass_Int)); + f.Put('intVal_U',TypeInfo(Byte),intVal_U); + f.Put('intVal_S',TypeInfo(ShortInt),intVal_S); + f.EndScope(); + + s := TMemoryStream.Create(); + f.SaveToStream(s); + intVal_U := 0; + intVal_S := 0; + + f := CreateFormatter(TypeInfo(TClass_Int)); + s.Position := 0; + f.LoadFromStream(s); + x := 'Root'; + f.BeginObjectRead(x,TypeInfo(TClass_Int)); + x := 'intVal_U'; + f.Get(TypeInfo(Byte),x,intVal_U); + x := 'intVal_S'; + f.Get(TypeInfo(ShortInt),x,intVal_S); + f.EndScopeRead(); + + AssertEquals(VAL_1,intVal_U); + AssertEquals(VAL_2,intVal_S); + Finally + s.Free(); + End; +end; + +procedure TTestFormatterSimpleType.Test_Int_8_ScopeData; +const VAL_1 = 12; VAL_2 = -10; +Var + f : IFormatterBase; + s : TMemoryStream; + x : string; + intVal_U : Byte; intVal_S : ShortInt; +begin + s := Nil; + Try + intVal_U := VAL_1; + f := CreateFormatter(TypeInfo(TClass_Int)); + f.BeginObject('Root',TypeInfo(TClass_Int)); + f.PutScopeInnerValue(TypeInfo(Byte),intVal_U); + f.EndScope(); + + s := TMemoryStream.Create(); + f.SaveToStream(s); + intVal_U := 0; + + f := CreateFormatter(TypeInfo(TClass_Int)); + s.Position := 0; + f.LoadFromStream(s); + x := 'Root'; + f.BeginObjectRead(x,TypeInfo(TClass_Int)); + f.GetScopeInnerValue(TypeInfo(Byte),intVal_U); + f.EndScopeRead(); + AssertEquals(VAL_1,intVal_U); + /// + intVal_S := VAL_2; + f := CreateFormatter(TypeInfo(TClass_Int)); + f.BeginObject('Root',TypeInfo(TClass_Int)); + f.PutScopeInnerValue(TypeInfo(ShortInt),intVal_S); + f.EndScope(); + + s := TMemoryStream.Create(); + f.SaveToStream(s); + intVal_S := 0; + + f := CreateFormatter(TypeInfo(TClass_Int)); + s.Position := 0; + f.LoadFromStream(s); + x := 'Root'; + f.BeginObjectRead(x,TypeInfo(TClass_Int)); + f.GetScopeInnerValue(TypeInfo(ShortInt),intVal_S); + f.EndScopeRead(); + AssertEquals(VAL_2,intVal_S); + Finally + s.Free(); + End; +end; + +procedure TTestFormatterSimpleType.Test_Int_16; +const VAL_1 = 1210; VAL_2 : SmallInt = -1012; +Var + f : IFormatterBase; + s : TMemoryStream; + x : string; + intVal_U : Word; intVal_S : SmallInt; +begin + s := Nil; + Try + intVal_U := VAL_1; + intVal_S := VAL_2; + f := CreateFormatter(TypeInfo(TClass_Int)); + + f.BeginObject('Root',TypeInfo(TClass_Int)); + f.Put('intVal_U',TypeInfo(Word),intVal_U); + f.Put('intVal_S',TypeInfo(SmallInt),intVal_S); + f.EndScope(); + + s := TMemoryStream.Create(); + f.SaveToStream(s); + intVal_U := 0; + intVal_S := 0; + + f := CreateFormatter(TypeInfo(TClass_Int)); + s.Position := 0; + f.LoadFromStream(s); + x := 'Root'; + f.BeginObjectRead(x,TypeInfo(TClass_Int)); + x := 'intVal_U'; + f.Get(TypeInfo(Word),x,intVal_U); + x := 'intVal_S'; + f.Get(TypeInfo(SmallInt),x,intVal_S); + f.EndScopeRead(); + + AssertEquals(VAL_1,intVal_U); + AssertEquals(VAL_2,intVal_S); + Finally + s.Free(); + End; +end; + +procedure TTestFormatterSimpleType.Test_Int_32; +const VAL_1 = 121076; VAL_2 : LongInt = -101276; +Var + f : IFormatterBase; + s : TMemoryStream; + x : string; + intVal_U : LongWord; intVal_S : LongInt; +begin + s := Nil; + Try + intVal_U := VAL_1; + intVal_S := VAL_2; + f := CreateFormatter(TypeInfo(TClass_Int)); + + f.BeginObject('Root',TypeInfo(TClass_Int)); + f.Put('intVal_U',TypeInfo(LongWord),intVal_U); + f.Put('intVal_S',TypeInfo(LongInt),intVal_S); + f.EndScope(); + + s := TMemoryStream.Create(); + f.SaveToStream(s); + intVal_U := 0; + intVal_S := 0; + + f := CreateFormatter(TypeInfo(TClass_Int)); + s.Position := 0; + f.LoadFromStream(s); + x := 'Root'; + f.BeginObjectRead(x,TypeInfo(TClass_Int)); + x := 'intVal_U'; + f.Get(TypeInfo(LongWord),x,intVal_U); + x := 'intVal_S'; + f.Get(TypeInfo(LongInt),x,intVal_S); + f.EndScopeRead(); + + AssertEquals(VAL_1,intVal_U); + AssertEquals(VAL_2,intVal_S); + Finally + s.Free(); + End; +end; + +procedure TTestFormatterSimpleType.Test_Int_64; +const VAL_1 = 121076; VAL_2 : Int64 = -101276; +Var + f : IFormatterBase; + s : TMemoryStream; + x : string; + intVal_U : QWord; intVal_S : Int64; +begin + s := Nil; + Try + intVal_U := VAL_1; + intVal_S := VAL_2; + f := CreateFormatter(TypeInfo(TClass_Int)); + + f.BeginObject('Root',TypeInfo(TClass_Int)); + f.Put('intVal_U',TypeInfo(QWord),intVal_U); + f.Put('intVal_S',TypeInfo(Int64),intVal_S); + f.EndScope(); + + s := TMemoryStream.Create(); + f.SaveToStream(s); + intVal_U := 0; + intVal_S := 0; + + f := CreateFormatter(TypeInfo(TClass_Int)); + s.Position := 0; + f.LoadFromStream(s); + x := 'Root'; + f.BeginObjectRead(x,TypeInfo(TClass_Int)); + x := 'intVal_U'; + f.Get(TypeInfo(QWord),x,intVal_U); + x := 'intVal_S'; + f.Get(TypeInfo(Int64),x,intVal_S); + f.EndScopeRead(); + + AssertEquals(VAL_1,intVal_U); + AssertEquals(VAL_2,intVal_S); + Finally + s.Free(); + End; +end; + +procedure TTestFormatterSimpleType.Test_Single_4; +const VAL_1 = 12.10; +Var + f : IFormatterBase; + s : TMemoryStream; + x : string; + tmpVal : Single; +begin + s := Nil; + Try + tmpVal := VAL_1; + f := CreateFormatter(TypeInfo(TClass_Float)); + + f.BeginObject('Root',TypeInfo(TClass_Float)); + f.Put('tmpVal',TypeInfo(Single),tmpVal); + f.EndScope(); + + s := TMemoryStream.Create(); + f.SaveToStream(s); + tmpVal := 0; + + f := CreateFormatter(TypeInfo(TClass_Float)); + s.Position := 0; + f.LoadFromStream(s); + x := 'Root'; + f.BeginObjectRead(x,TypeInfo(TClass_Float)); + x := 'tmpVal'; + f.Get(TypeInfo(Single),x,tmpVal); + f.EndScopeRead(); + + AssertEquals(VAL_1,tmpVal); + Finally + s.Free(); + End; +end; + +procedure TTestFormatterSimpleType.Test_Double_8; +const VAL_1 = 12.10; +Var + f : IFormatterBase; + s : TMemoryStream; + x : string; + tmpVal : Double; +begin + s := Nil; + Try + tmpVal := VAL_1; + f := CreateFormatter(TypeInfo(TClass_Float)); + + f.BeginObject('Root',TypeInfo(TClass_Float)); + f.Put('tmpVal',TypeInfo(Double),tmpVal); + f.EndScope(); + + s := TMemoryStream.Create(); + f.SaveToStream(s); + tmpVal := 0; + + f := CreateFormatter(TypeInfo(TClass_Float)); + s.Position := 0; + f.LoadFromStream(s); + x := 'Root'; + f.BeginObjectRead(x,TypeInfo(TClass_Float)); + x := 'tmpVal'; + f.Get(TypeInfo(Double),x,tmpVal); + f.EndScopeRead(); + + AssertEquals(VAL_1,tmpVal); + Finally + s.Free(); + End; +end; + +procedure TTestFormatterSimpleType.Test_Currency_8; +const VAL_1 = 12.10; +Var + f : IFormatterBase; + s : TMemoryStream; + x : string; + tmpVal : Currency; +begin + s := Nil; + Try + tmpVal := VAL_1; + f := CreateFormatter(TypeInfo(TClass_Float)); + + f.BeginObject('Root',TypeInfo(TClass_Float)); + f.Put('tmpVal',TypeInfo(Currency),tmpVal); + f.EndScope(); + + s := TMemoryStream.Create(); + f.SaveToStream(s); + tmpVal := 0; + + f := CreateFormatter(TypeInfo(TClass_Float)); + s.Position := 0; + f.LoadFromStream(s); + x := 'Root'; + f.BeginObjectRead(x,TypeInfo(TClass_Float)); + x := 'tmpVal'; + f.Get(TypeInfo(Currency),x,tmpVal); + f.EndScopeRead(); + + AssertEquals(VAL_1,tmpVal); + Finally + s.Free(); + End; +end; + +procedure TTestFormatterSimpleType.Test_Extended_10; +const VAL_1 = 12.10; +Var + f : IFormatterBase; + s : TMemoryStream; + x : string; + tmpVal : Extended; +begin + s := Nil; + Try + tmpVal := VAL_1; + f := CreateFormatter(TypeInfo(TClass_Float)); + + f.BeginObject('Root',TypeInfo(TClass_Float)); + f.Put('tmpVal',TypeInfo(Extended),tmpVal); + f.EndScope(); + + s := TMemoryStream.Create(); + f.SaveToStream(s); + tmpVal := 0; + + f := CreateFormatter(TypeInfo(TClass_Float)); + s.Position := 0; + f.LoadFromStream(s); + x := 'Root'; + f.BeginObjectRead(x,TypeInfo(TClass_Float)); + x := 'tmpVal'; + f.Get(TypeInfo(Extended),x,tmpVal); + f.EndScopeRead(); + + AssertEquals(VAL_1,tmpVal); + Finally + s.Free(); + End; +end; + +procedure TTestFormatterSimpleType.Test_String; +const VAL_1 = 'AzErTy'; VAL_2 = 'QwErTy'; +Var + f : IFormatterBase; + s : TMemoryStream; + x : string; + intVal_1 : string; intVal_3 : string; +begin + s := Nil; + Try + intVal_1 := VAL_1; + intVal_3 := VAL_2; + f := CreateFormatter(TypeInfo(TClass_Int)); + + f.BeginObject('Root',TypeInfo(TClass_Int)); + f.Put('intVal_1',TypeInfo(string),intVal_1); + f.Put('intVal_3',TypeInfo(string),intVal_3); + f.EndScope(); + + s := TMemoryStream.Create(); + f.SaveToStream(s); + intVal_1 := ''; + intVal_3 := 'yyyyyyyy'; + + f := CreateFormatter(TypeInfo(TClass_Int)); + s.Position := 0; + f.LoadFromStream(s); + x := 'Root'; + f.BeginObjectRead(x,TypeInfo(TClass_Int)); + x := 'intVal_1'; + f.Get(TypeInfo(string),x,intVal_1); + x := 'intVal_3'; + f.Get(TypeInfo(string),x,intVal_3); + f.EndScopeRead(); + + AssertEquals(VAL_1,intVal_1); + AssertEquals(VAL_2,intVal_3); + Finally + s.Free(); + End; +end; + +procedure TTestFormatterSimpleType.Test_Bool; +const VAL_1 = True; VAL_2 = False; +Var + f : IFormatterBase; + s : TMemoryStream; + x : string; + intVal_1 : Boolean; intVal_3 : Boolean; +begin + s := Nil; + Try + intVal_1 := VAL_1; + intVal_3 := VAL_2; + f := CreateFormatter(TypeInfo(TClass_Int)); + + f.BeginObject('Root',TypeInfo(TClass_Int)); + f.Put('intVal_1',TypeInfo(Boolean),intVal_1); + f.Put('intVal_3',TypeInfo(Boolean),intVal_3); + f.EndScope(); + + s := TMemoryStream.Create(); + f.SaveToStream(s); + intVal_1 := False; + intVal_3 := True; + + f := CreateFormatter(TypeInfo(TClass_Int)); + s.Position := 0; + f.LoadFromStream(s); + x := 'Root'; + f.BeginObjectRead(x,TypeInfo(TClass_Int)); + x := 'intVal_1'; + f.Get(TypeInfo(Boolean),x,intVal_1); + x := 'intVal_3'; + f.Get(TypeInfo(Boolean),x,intVal_3); + f.EndScopeRead(); + + AssertEquals(VAL_1,intVal_1); + AssertEquals(VAL_2,intVal_3); + Finally + s.Free(); + End; +end; + +procedure TTestFormatterSimpleType.Test_Enum; +const VAL_1 = teTwo; VAL_2 = teFour; +Var + f : IFormatterBase; + s : TMemoryStream; + x : string; + intVal_1 : TTestEnum; intVal_3 : TTestEnum; +begin + s := Nil; + Try + intVal_1 := VAL_1; + intVal_3 := VAL_2; + f := CreateFormatter(TypeInfo(TClass_Int)); + + f.BeginObject('Root',TypeInfo(TClass_Enum)); + f.Put('intVal_1',TypeInfo(TTestEnum),intVal_1); + f.Put('intVal_3',TypeInfo(TTestEnum),intVal_3); + f.EndScope(); + + s := TMemoryStream.Create(); + f.SaveToStream(s); + intVal_1 := teOne; + intVal_3 := teOne; + + f := CreateFormatter(TypeInfo(TClass_Int)); + s.Position := 0; + f.LoadFromStream(s); + x := 'Root'; + f.BeginObjectRead(x,TypeInfo(TClass_Int)); + x := 'intVal_1'; + f.Get(TypeInfo(TTestEnum),x,intVal_1); + x := 'intVal_3'; + f.Get(TypeInfo(TTestEnum),x,intVal_3); + f.EndScopeRead(); + + AssertEquals(Ord(VAL_1),Ord(intVal_1)); + AssertEquals(Ord(VAL_2),Ord(intVal_3)); + Finally + s.Free(); + End; +end; + +procedure TTestFormatter.Test_Int_WithClass; +Var + f : IFormatterBase; + s : TMemoryStream; + a : TClass_Int; + x : string; +begin + s := Nil; + a := TClass_Int.Create(); + Try + a.Val_8U := 8; + a.Val_8S := -8; + a.Val_16U := 16; + a.Val_16S := -16; + a.Val_32U := 32; + a.Val_32S := -32; + a.Val_64U := 64; + a.Val_64S := -64; + + f := CreateFormatter(TypeInfo(TClass_Int)); + + f.BeginObject('Root',TypeInfo(TClass_Int)); + f.Put('o1',TypeInfo(TClass_Int),a); + f.EndScope(); + + s := TMemoryStream.Create(); + f.SaveToStream(s); + FreeAndNil(a); + + a := TClass_Int.Create(); + f := CreateFormatter(TypeInfo(TClass_Int)); + s.Position := 0; + f.LoadFromStream(s); + x := 'Root'; + f.BeginObjectRead(x,TypeInfo(TClass_Int)); + x := 'o1'; + f.Get(TypeInfo(TClass_Int),x,a); + f.EndScopeRead(); + + AssertEquals(8,a.Val_8U); + AssertEquals(-8,a.Val_8S); + AssertEquals(16,a.Val_16U); + AssertEquals(-16,a.Val_16S); + AssertEquals(32,a.Val_32U); + AssertEquals(-32,a.Val_32S); + AssertEquals(64,a.Val_64U); + AssertEquals(-64,a.Val_64S); + Finally + a.Free(); + s.Free(); + End; +end; + +procedure TTestFormatter.Test_Float_WithClass; +Var + f : IFormatterBase; + s : TMemoryStream; + a : TClass_Float; + x : string; +begin + s := Nil; + a := TClass_Float.Create(); + Try + a.Val_Currency := 8.8; + a.Val_Double := 8.8; + a.Val_Extended := 10.10; + a.Val_Single := 4.4; + + f := CreateFormatter(TypeInfo(TClass_Float)); + + f.BeginObject('Root',TypeInfo(TClass_Float)); + f.Put('o1',TypeInfo(TClass_Float),a); + f.EndScope(); + + s := TMemoryStream.Create(); + f.SaveToStream(s); + FreeAndNil(a); + + a := TClass_Float.Create(); + f := CreateFormatter(TypeInfo(TClass_Float)); + s.Position := 0; + f.LoadFromStream(s); + x := 'Root'; + f.BeginObjectRead(x,TypeInfo(TClass_Float)); + x := 'o1'; + f.Get(TypeInfo(TClass_Float),x,a); + f.EndScopeRead(); + + AssertEquals(4.4,a.Val_Single); + AssertEquals(8.8,a.Val_Double); + AssertEquals(8.8,a.Val_Currency); + AssertEquals(10.10,a.Val_Extended); + Finally + a.Free(); + s.Free(); + End; +end; + +procedure TTestFormatter.Test_Enum_Bool_String_WithClass; +Var + f : IFormatterBase; + s : TMemoryStream; + a : TClass_Enum; + x : string; +begin + s := Nil; + a := TClass_Enum.Create(); + Try + a.Val_Bool := True; + a.Val_Enum := teThree; + a.Val_String := 'atou'; + f := CreateFormatter(TypeInfo(TClass_Enum)); + + f.BeginObject('Root',TypeInfo(TClass_Enum)); + f.Put('o1',TypeInfo(TClass_Enum),a); + f.EndScope(); + + s := TMemoryStream.Create(); + f.SaveToStream(s); + FreeAndNil(a); + + a := TClass_Enum.Create(); + f := CreateFormatter(TypeInfo(TClass_Enum)); + s.Position := 0; + f.LoadFromStream(s); + x := 'Root'; + f.BeginObjectRead(x,TypeInfo(TClass_Enum)); + x := 'o1'; + f.Get(TypeInfo(TClass_Enum),x,a); + f.EndScopeRead(); + + AssertEquals(True,a.Val_Bool); + AssertEquals(Ord(teThree),Ord(a.Val_Enum)); + AssertEquals('atou',a.Val_String); + Finally + a.Free(); + s.Free(); + End; +end; + +procedure TTestFormatter.Test_CplxInt64SimpleContent_WithClass; +const VAL_S = -12; VAL_U = 10; VAL_X = 121; + VAL_STR_S = 'Test Attribute S'; VAL_STR_U = 'Test Attribute U'; VAL_STR_X = 'test it'; +var + f : IFormatterBase; + s : TMemoryStream; + a : TClass_CplxSimpleContent; + ns : TComplexInt64SContentRemotable; + nu : TComplexInt64UContentRemotable; + x : string; +begin + s := nil; + ns := TComplexInt64SContentRemotable.Create(); + nu := TComplexInt64UContentRemotable.Create(); + a := TClass_CplxSimpleContent.Create(); + try + a.Val_CplxInt64S.Value := VAL_S; + a.Val_CplxInt64S.StrSimpleAtt_Exemple := VAL_STR_S; + a.Val_CplxInt64S.IntSimpleAtt_Exemple := VAL_X; + a.Val_CplxInt64S.BoolSimpleAtt_Exemple := True; + a.Elt_Exemple := VAL_STR_X; + ns.Value := VAL_S; + + a.Val_CplxInt64U.Value := VAL_U; + a.Val_CplxInt64U.StrSimpleAtt_Exemple := VAL_STR_U; + a.Val_CplxInt64U.IntSimpleAtt_Exemple := VAL_X; + a.Val_CplxInt64U.BoolSimpleAtt_Exemple := False; + nu.Value := VAL_U; + + f := CreateFormatter(TypeInfo(TClass_Int)); + + f.BeginObject('Root',TypeInfo(TClass_Int)); + f.Put('o1',TypeInfo(TClass_CplxSimpleContent),a); + f.Put('ns',TypeInfo(TComplexInt64SContentRemotable),ns); + f.Put('nu',TypeInfo(TComplexInt64UContentRemotable),nu); + f.EndScope(); + + s := TMemoryStream.Create(); + f.SaveToStream(s); s.SaveToFile(ClassName + '.txt'); + FreeAndNil(a); + + a := TClass_CplxSimpleContent.Create(); + f := CreateFormatter(TypeInfo(TClass_Int)); + s.Position := 0; + f.LoadFromStream(s); + x := 'Root'; + f.BeginObjectRead(x,TypeInfo(TClass_Int)); + x := 'o1'; + f.Get(TypeInfo(TClass_CplxSimpleContent),x,a); + x := 'ns'; + f.Get(TypeInfo(TComplexInt64SContentRemotable),x,ns); + x := 'nu'; + f.Get(TypeInfo(TComplexInt64UContentRemotable),x,nu); + f.EndScopeRead(); + + AssertEquals(VAL_S,a.Val_CplxInt64S.Value); + AssertEquals(VAL_X,a.Val_CplxInt64S.IntSimpleAtt_Exemple); + AssertEquals(VAL_STR_S,a.Val_CplxInt64S.StrSimpleAtt_Exemple); + AssertEquals(True,a.Val_CplxInt64S.BoolSimpleAtt_Exemple); + AssertEquals(VAL_STR_X,a.Elt_Exemple); + + AssertEquals(VAL_U,a.Val_CplxInt64U.Value); + AssertEquals(VAL_X,a.Val_CplxInt64U.IntSimpleAtt_Exemple); + AssertEquals(VAL_STR_U,a.Val_CplxInt64U.StrSimpleAtt_Exemple); + AssertEquals(False,a.Val_CplxInt64U.BoolSimpleAtt_Exemple); + finally + FreeAndNil(nu); + FreeAndNil(ns); + a.Free(); + s.Free(); + end; +end; + +procedure TTestFormatter.Test_CplxInt32SimpleContent_WithClass; +const VAL_S = -12; VAL_U = 10; VAL_X = 1210; + VAL_STR_S = 'Test Attribute S'; VAL_STR_U = 'Test Attribute U'; VAL_STR_X = 'test it'; +var + f : IFormatterBase; + s : TMemoryStream; + a : TClass_CplxSimpleContent; + ns : TComplexInt32SContentRemotable; + nu : TComplexInt32UContentRemotable; + x : string; +begin + s := nil; + ns := TComplexInt32SContentRemotable.Create(); + nu := TComplexInt32UContentRemotable.Create(); + a := TClass_CplxSimpleContent.Create(); + try + a.Val_CplxInt32S.Value := VAL_S; + a.Val_CplxInt32S.StrSimpleAtt_Exemple := VAL_STR_S; + a.Val_CplxInt32S.IntSimpleAtt_Exemple := VAL_X; + a.Val_CplxInt32S.BoolSimpleAtt_Exemple := True; + a.Elt_Exemple := VAL_STR_X; + ns.Value := VAL_S; + + a.Val_CplxInt32U.Value := VAL_U; + a.Val_CplxInt32U.StrSimpleAtt_Exemple := VAL_STR_U; + a.Val_CplxInt32U.IntSimpleAtt_Exemple := VAL_X; + a.Val_CplxInt32U.BoolSimpleAtt_Exemple := False; + nu.Value := VAL_U; + + f := CreateFormatter(TypeInfo(TClass_Int)); + + f.BeginObject('Root',TypeInfo(TClass_Int)); + f.Put('o1',TypeInfo(TClass_CplxSimpleContent),a); + f.Put('ns',TypeInfo(TComplexInt32SContentRemotable),ns); + f.Put('nu',TypeInfo(TComplexInt32UContentRemotable),nu); + f.EndScope(); + + s := TMemoryStream.Create(); + f.SaveToStream(s); s.SaveToFile(ClassName + '.txt'); + FreeAndNil(a); + + a := TClass_CplxSimpleContent.Create(); + f := CreateFormatter(TypeInfo(TClass_Int)); + s.Position := 0; + f.LoadFromStream(s); + x := 'Root'; + f.BeginObjectRead(x,TypeInfo(TClass_Int)); + x := 'o1'; + f.Get(TypeInfo(TClass_CplxSimpleContent),x,a); + x := 'ns'; + f.Get(TypeInfo(TComplexInt32SContentRemotable),x,ns); + x := 'nu'; + f.Get(TypeInfo(TComplexInt32UContentRemotable),x,nu); + f.EndScopeRead(); + + AssertEquals(VAL_S,a.Val_CplxInt32S.Value); + AssertEquals(VAL_X,a.Val_CplxInt32S.IntSimpleAtt_Exemple); + AssertEquals(VAL_STR_S,a.Val_CplxInt32S.StrSimpleAtt_Exemple); + AssertEquals(True,a.Val_CplxInt32S.BoolSimpleAtt_Exemple); + AssertEquals(VAL_STR_X,a.Elt_Exemple); + + AssertEquals(VAL_U,a.Val_CplxInt32U.Value); + AssertEquals(VAL_X,a.Val_CplxInt32U.IntSimpleAtt_Exemple); + AssertEquals(VAL_STR_U,a.Val_CplxInt32U.StrSimpleAtt_Exemple); + AssertEquals(False,a.Val_CplxInt32U.BoolSimpleAtt_Exemple); + finally + FreeAndNil(nu); + FreeAndNil(ns); + a.Free(); + s.Free(); + end; +end; + +procedure TTestFormatter.Test_CplxInt16SimpleContent_WithClass; +const VAL_S = -12; VAL_U = 10; VAL_X = 1210; + VAL_STR_S = 'Test Attribute S'; VAL_STR_U = 'Test Attribute U'; VAL_STR_X = 'test it'; +var + f : IFormatterBase; + s : TMemoryStream; + a : TClass_CplxSimpleContent; + ns : TComplexInt16SContentRemotable; + nu : TComplexInt16UContentRemotable; + x : string; +begin + s := nil; + ns := TComplexInt16SContentRemotable.Create(); + nu := TComplexInt16UContentRemotable.Create(); + a := TClass_CplxSimpleContent.Create(); + try + a.Val_CplxInt16S.Value := VAL_S; + a.Val_CplxInt16S.StrSimpleAtt_Exemple := VAL_STR_S; + a.Val_CplxInt16S.IntSimpleAtt_Exemple := VAL_X; + a.Val_CplxInt16S.BoolSimpleAtt_Exemple := True; + a.Elt_Exemple := VAL_STR_X; + ns.Value := VAL_S; + + a.Val_CplxInt16U.Value := VAL_U; + a.Val_CplxInt16U.StrSimpleAtt_Exemple := VAL_STR_U; + a.Val_CplxInt16U.IntSimpleAtt_Exemple := VAL_X; + a.Val_CplxInt16U.BoolSimpleAtt_Exemple := False; + nu.Value := VAL_U; + + f := CreateFormatter(TypeInfo(TClass_Int)); + + f.BeginObject('Root',TypeInfo(TClass_Int)); + f.Put('o1',TypeInfo(TClass_CplxSimpleContent),a); + f.Put('ns',TypeInfo(TComplexInt16SContentRemotable),ns); + f.Put('nu',TypeInfo(TComplexInt16UContentRemotable),nu); + f.EndScope(); + + s := TMemoryStream.Create(); + f.SaveToStream(s); s.SaveToFile(ClassName + '.txt'); + FreeAndNil(a); + + a := TClass_CplxSimpleContent.Create(); + f := CreateFormatter(TypeInfo(TClass_Int)); + s.Position := 0; + f.LoadFromStream(s); + x := 'Root'; + f.BeginObjectRead(x,TypeInfo(TClass_Int)); + x := 'o1'; + f.Get(TypeInfo(TClass_CplxSimpleContent),x,a); + x := 'ns'; + f.Get(TypeInfo(TComplexInt16SContentRemotable),x,ns); + x := 'nu'; + f.Get(TypeInfo(TComplexInt16UContentRemotable),x,nu); + f.EndScopeRead(); + + AssertEquals(VAL_S,a.Val_CplxInt16S.Value); + AssertEquals(VAL_X,a.Val_CplxInt16S.IntSimpleAtt_Exemple); + AssertEquals(VAL_STR_S,a.Val_CplxInt16S.StrSimpleAtt_Exemple); + AssertEquals(True,a.Val_CplxInt16S.BoolSimpleAtt_Exemple); + AssertEquals(VAL_STR_X,a.Elt_Exemple); + + AssertEquals(VAL_U,a.Val_CplxInt16U.Value); + AssertEquals(VAL_X,a.Val_CplxInt16U.IntSimpleAtt_Exemple); + AssertEquals(VAL_STR_U,a.Val_CplxInt16U.StrSimpleAtt_Exemple); + AssertEquals(False,a.Val_CplxInt16U.BoolSimpleAtt_Exemple); + finally + FreeAndNil(nu); + FreeAndNil(ns); + a.Free(); + s.Free(); + end; +end; + +procedure TTestFormatter.Test_CplxInt8SimpleContent_WithClass; +const VAL_S = -12; VAL_U = 10; VAL_X = 121; + VAL_STR_S = 'Test Attribute S'; VAL_STR_U = 'Test Attribute U'; VAL_STR_X = 'test it'; +var + f : IFormatterBase; + s : TMemoryStream; + a : TClass_CplxSimpleContent; + ns : TComplexInt8SContentRemotable; + nu : TComplexInt8UContentRemotable; + x : string; +begin + s := nil; + ns := TComplexInt8SContentRemotable.Create(); + nu := TComplexInt8UContentRemotable.Create(); + a := TClass_CplxSimpleContent.Create(); + try + a.Val_CplxInt8S.Value := VAL_S; + a.Val_CplxInt8S.StrSimpleAtt_Exemple := VAL_STR_S; + a.Val_CplxInt8S.IntSimpleAtt_Exemple := VAL_X; + a.Val_CplxInt8S.BoolSimpleAtt_Exemple := True; + a.Elt_Exemple := VAL_STR_X; + ns.Value := VAL_S; + + a.Val_CplxInt8U.Value := VAL_U; + a.Val_CplxInt8U.StrSimpleAtt_Exemple := VAL_STR_U; + a.Val_CplxInt8U.IntSimpleAtt_Exemple := VAL_X; + a.Val_CplxInt8U.BoolSimpleAtt_Exemple := False; + nu.Value := VAL_U; + + f := CreateFormatter(TypeInfo(TClass_Int)); + + f.BeginObject('Root',TypeInfo(TClass_Int)); + f.Put('o1',TypeInfo(TClass_CplxSimpleContent),a); + f.Put('ns',TypeInfo(TComplexInt8SContentRemotable),ns); + f.Put('nu',TypeInfo(TComplexInt8UContentRemotable),nu); + f.EndScope(); + + s := TMemoryStream.Create(); + f.SaveToStream(s); s.SaveToFile(ClassName + '.txt'); + FreeAndNil(a); + + a := TClass_CplxSimpleContent.Create(); + f := CreateFormatter(TypeInfo(TClass_Int)); + s.Position := 0; + f.LoadFromStream(s); + x := 'Root'; + f.BeginObjectRead(x,TypeInfo(TClass_Int)); + x := 'o1'; + f.Get(TypeInfo(TClass_CplxSimpleContent),x,a); + x := 'ns'; + f.Get(TypeInfo(TComplexInt8SContentRemotable),x,ns); + x := 'nu'; + f.Get(TypeInfo(TComplexInt8UContentRemotable),x,nu); + f.EndScopeRead(); + + AssertEquals(VAL_S,a.Val_CplxInt8S.Value); + AssertEquals(VAL_X,a.Val_CplxInt8S.IntSimpleAtt_Exemple); + AssertEquals(VAL_STR_S,a.Val_CplxInt8S.StrSimpleAtt_Exemple); + AssertEquals(True,a.Val_CplxInt8S.BoolSimpleAtt_Exemple); + AssertEquals(VAL_STR_X,a.Elt_Exemple); + + AssertEquals(VAL_U,a.Val_CplxInt8U.Value); + AssertEquals(VAL_X,a.Val_CplxInt8U.IntSimpleAtt_Exemple); + AssertEquals(VAL_STR_U,a.Val_CplxInt8U.StrSimpleAtt_Exemple); + AssertEquals(False,a.Val_CplxInt8U.BoolSimpleAtt_Exemple); + finally + FreeAndNil(nu); + FreeAndNil(ns); + a.Free(); + s.Free(); + end; +end; + +procedure TTestFormatter.Test_CplxFloatExtendedSimpleContent_WithClass; +const VAL_S = -12.10; VAL_U = 10.76; VAL_X = 1210.76; + VAL_STR_S = 'Test Attribute S'; VAL_STR_U = 'Test Attribute U'; VAL_STR_X = 'test it'; +var + f : IFormatterBase; + s : TMemoryStream; + a : TClass_CplxSimpleContent; + ns : TComplexFloatExtendedContentRemotable; + nu : TComplexFloatDoubleContentRemotable; + x : string; +begin + s := nil; + ns := TComplexFloatExtendedContentRemotable.Create(); + nu := TComplexFloatDoubleContentRemotable.Create(); + a := TClass_CplxSimpleContent.Create(); + try + a.Val_CplxExtended := T_ComplexFloatExtendedContent.Create(); + a.Val_CplxExtended.Value := VAL_S; + a.Val_CplxDouble := T_ComplexFloatDoubleContent.Create(); + a.Val_CplxDouble.Value := VAL_U; + + a.Val_CplxInt32S.Free(); + a.Val_CplxInt32S := nil; + a.Val_CplxInt32U.Free(); + a.Val_CplxInt32U := nil; + + ns.Value := VAL_S; + nu.Value := VAL_U; + + f := CreateFormatter(TypeInfo(TClass_Int)); + + f.BeginObject('Root',TypeInfo(TClass_Int)); + f.Put('o1',TypeInfo(TClass_CplxSimpleContent),a); + f.Put('ns',TypeInfo(TComplexFloatExtendedContentRemotable),ns); + f.Put('nu',TypeInfo(TComplexFloatDoubleContentRemotable),nu); + f.EndScope(); + + s := TMemoryStream.Create(); + f.SaveToStream(s); s.SaveToFile(ClassName + '.txt'); + FreeAndNil(a); + + a := TClass_CplxSimpleContent.Create(); + a.Val_CplxInt32S.Free(); + a.Val_CplxInt32S := nil; + a.Val_CplxInt32U.Free(); + a.Val_CplxInt32U := nil; + a.Val_CplxExtended := T_ComplexFloatExtendedContent.Create(); + a.Val_CplxDouble := T_ComplexFloatDoubleContent.Create(); + f := CreateFormatter(TypeInfo(TClass_Int)); + s.Position := 0; + f.LoadFromStream(s); + x := 'Root'; + f.BeginObjectRead(x,TypeInfo(TClass_Int)); + x := 'o1'; + f.Get(TypeInfo(TClass_CplxSimpleContent),x,a); + x := 'ns'; + f.Get(TypeInfo(TComplexFloatExtendedContentRemotable),x,ns); + x := 'nu'; + f.Get(TypeInfo(TComplexFloatDoubleContentRemotable),x,nu); + f.EndScopeRead(); + + AssertEquals('VAL_S <> a.Val_CplxExtended.Value',VAL_S,a.Val_CplxExtended.Value); + AssertEquals('VAL_S <> a.Val_CplxDouble.Value',VAL_U,a.Val_CplxDouble.Value); + AssertEquals('VAL_S <> ns.Value',VAL_S,ns.Value); + AssertEquals('VAL_U <> nu.Value',VAL_U,nu.Value); + AssertNull('a.Val_CplxInt32S <> nil',a.Val_CplxInt32S); + AssertNull('a.Val_CplxInt32U <> nil',a.Val_CplxInt32U); + finally + FreeAndNil(nu); + FreeAndNil(ns); + a.Free(); + s.Free(); + end; +end; + +procedure TTestFormatter.Test_CplxStringSimpleContent_WithClass; +const VAL_S = 'web services toolkit'; + VAL_STR_S = 'Test Attribute S'; +var + f : IFormatterBase; + s : TMemoryStream; + a : TClass_CplxSimpleContent; + ns : TComplexStringContentRemotable; + x : string; +begin + s := nil; + ns := TComplexStringContentRemotable.Create(); + a := TClass_CplxSimpleContent.Create(); + try + a.Val_CplxString := T_ComplexStringContent.Create(); + a.Val_CplxString.Value := VAL_S; + a.Val_CplxInt32S.Free(); + a.Val_CplxInt32S := nil; + a.Val_CplxInt32U.Free(); + a.Val_CplxInt32U := nil; + + ns.Value := VAL_STR_S; + + f := CreateFormatter(TypeInfo(TClass_Int)); + + f.BeginObject('Root',TypeInfo(TClass_Int)); + f.Put('o1',TypeInfo(TClass_CplxSimpleContent),a); + f.Put('ns',TypeInfo(TComplexStringContentRemotable),ns); + f.EndScope(); + + s := TMemoryStream.Create(); + f.SaveToStream(s); s.SaveToFile(ClassName + '.txt'); + FreeAndNil(a); + + a := TClass_CplxSimpleContent.Create(); + a.Val_CplxInt32S.Free(); + a.Val_CplxInt32S := nil; + a.Val_CplxInt32U.Free(); + a.Val_CplxInt32U := nil; + a.Val_CplxString := T_ComplexStringContent.Create(); + f := CreateFormatter(TypeInfo(TClass_Int)); + s.Position := 0; + f.LoadFromStream(s); + x := 'Root'; + f.BeginObjectRead(x,TypeInfo(TClass_Int)); + x := 'o1'; + f.Get(TypeInfo(TClass_CplxSimpleContent),x,a); + x := 'ns'; + f.Get(TypeInfo(TComplexStringContentRemotable),x,ns); + f.EndScopeRead(); + + AssertEquals('VAL_S <> a.Val_CplxString.Value',VAL_S,a.Val_CplxString.Value); + AssertEquals('VAL_STR_S <> ns.Value',VAL_STR_S,ns.Value); + finally + FreeAndNil(ns); + a.Free(); + s.Free(); + end; +end; + +procedure TTestFormatter.Test_Object(); +Var + f : IFormatterBase; + s : TMemoryStream; + a : TClass_B; + x : string; +begin + s := Nil; + a := TClass_B.Create(); + Try + a.Val_Bool := False; + a.Val_Enum := teThree; + a.Val_String := '123'; + a.ObjProp.Val_String := '456'; + a.ObjProp.Val_Enum := teFour; + a.ObjProp.Val_Bool := True; + a.ObjProp.Val_32S := 121076; + a.NonStored := 121076; + + f := CreateFormatter(TypeInfo(TClass_B)); + + f.BeginObject('Root',TypeInfo(TClass_B)); + f.Put('o1',TypeInfo(TClass_B),a); + f.EndScope(); + + s := TMemoryStream.Create(); + f.SaveToStream(s); + FreeAndNil(a); + + a := TClass_B.Create(); + f := CreateFormatter(TypeInfo(TClass_B)); + s.Position := 0; + f.LoadFromStream(s); + x := 'Root'; + f.BeginObjectRead(x,TypeInfo(TClass_B)); + x := 'o1'; + f.Get(TypeInfo(TClass_B),x,a); + f.EndScopeRead(); + + AssertEquals(False,a.Val_Bool); + AssertEquals(Ord(teThree),Ord(a.Val_Enum)); + AssertEquals('123',a.Val_String); + + AssertEquals(True,a.ObjProp.Val_Bool); + AssertEquals(Ord(teFour),Ord(a.ObjProp.Val_Enum)); + AssertEquals('456',a.ObjProp.Val_String); + AssertEquals(121076,a.ObjProp.Val_32S); + + AssertEquals(0,a.NonStored); + Finally + a.Free(); + s.Free(); + End; +end; + +procedure TTestFormatter.Test_Object_Nil(); +var + f : IFormatterBase; + s : TMemoryStream; + a : TClass_B; + x : string; +begin + s := nil; + a := nil; + try + f := CreateFormatter(TypeInfo(TClass_B)); + + f.BeginObject('Root',TypeInfo(TClass_B)); + f.Put('o1',TypeInfo(TClass_B),a); + f.EndScope(); + + s := TMemoryStream.Create(); + f.SaveToStream(s); + FreeAndNil(a); + + a := nil; + f := CreateFormatter(TypeInfo(TClass_B)); + s.Position := 0; + f.LoadFromStream(s); + x := 'Root'; + f.BeginObjectRead(x,TypeInfo(TClass_B)); + x := 'o1'; + f.Get(TypeInfo(TClass_B),x,a); + f.EndScopeRead(); + + AssertNull(a); + finally + a.Free(); + s.Free(); + end; +end; + +procedure TTestFormatter.Test_StringArray(); +const AR_LEN = 5; VAL_AR : array[0..(AR_LEN-1)] of string = ('AzErTy','QwErTy','123456','','1'); +var + a : TArrayOfStringRemotable; + i : Integer; + f : IFormatterBase; + s : TMemoryStream; + x : string; +begin + a := TArrayOfStringRemotable.Create(); + try + AssertEquals(0,a.Length); + a.SetLength(0); + AssertEquals('Length 1', 0,a.Length); + + a.SetLength(AR_LEN); + AssertEquals(AR_LEN,a.Length); + + for i := 0 to Pred(AR_LEN) do + a[i] := VAL_AR[i]; + f := CreateFormatter(TypeInfo(TClass_B)); + f.BeginObject('Root',TypeInfo(TClass_B)); + f.Put('a',TypeInfo(TArrayOfStringRemotable),a); + f.EndScope(); + s := TMemoryStream.Create(); + f.SaveToStream(s); + FreeAndNil(a); + a := TArrayOfStringRemotable.Create(); + a.SetLength(0); + a.SetLength(0); + a.SetLength(0); + f := CreateFormatter(TypeInfo(TClass_B)); + s.Position := 0; + f.LoadFromStream(s); + x := 'Root'; + f.BeginObjectRead(x,TypeInfo(TClass_B)); + x := 'a'; + f.Get(TypeInfo(TArrayOfStringRemotable),x,a); + f.EndScopeRead(); + AssertEquals('Length 2', AR_LEN,a.Length); + + for i := 0 to Pred(AR_LEN) do + AssertEquals(VAL_AR[i],a[i]); + + finally + a.Free(); + s.Free(); + end; +end; + +procedure TTestFormatter.Test_StringArray_Embedded(); +const AR_LEN = 5; VAL_AR : array[0..(AR_LEN-1)] of string = ('AzErTy','QwErTy','123456','','1'); +var + a : TArrayOfStringRemotable; + b : TEmbeddedArrayOfStringRemotable; + i, intVal : Integer; + f : IFormatterBase; + s : TMemoryStream; + x : string; +begin + b := nil; + a := TArrayOfStringRemotable.Create(); + try + b := TEmbeddedArrayOfStringRemotable.Create(); + AssertEquals(0,a.Length); + a.SetLength(0); + AssertEquals('Length 1', 0,a.Length); + + a.SetLength(AR_LEN); + AssertEquals(AR_LEN,a.Length); + + b.SetLength(AR_LEN); + AssertEquals(AR_LEN,b.Length); + + for i := 0 to Pred(AR_LEN) do begin + a[i] := VAL_AR[i]; + b[i] := VAL_AR[Pred(AR_LEN)-i]; + end; + + intVal := 1210; + + f := CreateFormatter(TypeInfo(TClass_B)); + f.BeginObject('Root',TypeInfo(TClass_B)); + f.Put('a',TypeInfo(TArrayOfStringRemotable),a); + f.Put('x',TypeInfo(Integer),intVal); + f.Put('b',TypeInfo(TEmbeddedArrayOfStringRemotable),b); + f.EndScope(); + s := TMemoryStream.Create(); + f.SaveToStream(s); s.SaveToFile(ClassName + '.XML'); + FreeAndNil(a); + FreeAndNil(b); + intVal := 0; + a := TArrayOfStringRemotable.Create(); + b := TEmbeddedArrayOfStringRemotable.Create(); + a.SetLength(0); + a.SetLength(0); + a.SetLength(0); + b.SetLength(0); + f := CreateFormatter(TypeInfo(TClass_B)); + s.Position := 0; + f.LoadFromStream(s); + x := 'Root'; + f.BeginObjectRead(x,TypeInfo(TClass_B)); + x := 'a'; + f.Get(TypeInfo(TArrayOfStringRemotable),x,a); + x := 'x'; + f.Get(TypeInfo(Integer),x,intVal); + x := 'b'; + f.Get(TypeInfo(TEmbeddedArrayOfStringRemotable),x,b); + f.EndScopeRead(); + AssertEquals('IntVal', 1210,intVal); + AssertEquals('Length 2', AR_LEN,a.Length); + AssertEquals('Length 2', AR_LEN,b.Length); + + for i := 0 to Pred(AR_LEN) do begin + AssertEquals(VAL_AR[i],a[i]); + AssertEquals(VAL_AR[Pred(AR_LEN)-i],b[i]); + end; + + finally + b.Free(); + a.Free(); + s.Free(); + end; +end; + +procedure TTestFormatter.Test_StringArrayZeroLength(); +var + a : TArrayOfStringRemotable; + f : IFormatterBase; + s : TMemoryStream; + x : string; +begin + a := TArrayOfStringRemotable.Create(); + try + AssertEquals(0,a.Length); + + f := CreateFormatter(TypeInfo(TClass_B)); + f.BeginObject('Root',TypeInfo(TClass_B)); + f.Put('a',TypeInfo(TArrayOfStringRemotable),a); + f.EndScope(); + s := TMemoryStream.Create(); + f.SaveToStream(s); + FreeAndNil(a); + + f := CreateFormatter(TypeInfo(TClass_B)); + s.Position := 0; + f.LoadFromStream(s); + x := 'Root'; + f.BeginObjectRead(x,TypeInfo(TClass_B)); + x := 'a'; + f.Get(TypeInfo(TArrayOfStringRemotable),x,a); + f.EndScopeRead(); + AssertNotNull(a); + AssertEquals(0,a.Length); + + finally + a.Free(); + s.Free(); + end; +end; + +procedure TTestFormatter.Test_BooleanArray(); +const AR_LEN = 5; VAL_AR : array[0..(AR_LEN-1)] of Boolean = (True,True,False,True,False); +var + a : TArrayOfBooleanRemotable; + i : Integer; + f : IFormatterBase; + s : TMemoryStream; + x : string; +begin + a := TArrayOfBooleanRemotable.Create(); + try + AssertEquals(0,a.Length); + a.SetLength(0); + AssertEquals(0,a.Length); + + a.SetLength(AR_LEN); + AssertEquals(AR_LEN,a.Length); + + for i := 0 to Pred(AR_LEN) do + a[i] := VAL_AR[i]; + f := CreateFormatter(TypeInfo(TClass_B)); + f.BeginObject('Root',TypeInfo(TClass_B)); + f.Put('a',TypeInfo(TArrayOfBooleanRemotable),a); + f.EndScope(); + s := TMemoryStream.Create(); + f.SaveToStream(s); + FreeAndNil(a); + a := TArrayOfBooleanRemotable.Create(); + a.SetLength(0); + a.SetLength(0); + a.SetLength(0); + f := CreateFormatter(TypeInfo(TClass_B)); + s.Position := 0; + f.LoadFromStream(s); + x := 'Root'; + f.BeginObjectRead(x,TypeInfo(TClass_B)); + x := 'a'; + f.Get(TypeInfo(TArrayOfBooleanRemotable),x,a); + f.EndScopeRead(); + AssertEquals(AR_LEN,a.Length); + + for i := 0 to Pred(AR_LEN) do + AssertEquals(VAL_AR[i],a[i]); + + finally + a.Free(); + s.Free(); + end; +end; + +procedure TTestFormatter.Test_Int8UArray(); +const AR_LEN = 5; VAL_AR : array[0..(AR_LEN-1)] of Byte = (12,34,100,200,180); +var + a : TArrayOfInt8URemotable; + i : Integer; + f : IFormatterBase; + s : TMemoryStream; + x : string; +begin + a := TArrayOfInt8URemotable.Create(); + try + AssertEquals(0,a.Length); + a.SetLength(0); + AssertEquals(0,a.Length); + + a.SetLength(AR_LEN); + AssertEquals(AR_LEN,a.Length); + + for i := 0 to Pred(AR_LEN) do + a[i] := VAL_AR[i]; + f := CreateFormatter(TypeInfo(TClass_B)); + f.BeginObject('Root',TypeInfo(TClass_B)); + f.Put('a',TypeInfo(TArrayOfInt8URemotable),a); + f.EndScope(); + s := TMemoryStream.Create(); + f.SaveToStream(s); + FreeAndNil(a); + a := TArrayOfInt8URemotable.Create(); + a.SetLength(0); + a.SetLength(0); + a.SetLength(0); + f := CreateFormatter(TypeInfo(TClass_B)); + s.Position := 0; + f.LoadFromStream(s); + x := 'Root'; + f.BeginObjectRead(x,TypeInfo(TClass_B)); + x := 'a'; + f.Get(TypeInfo(TArrayOfInt8URemotable),x,a); + f.EndScopeRead(); + AssertEquals(AR_LEN,a.Length); + + for i := 0 to Pred(AR_LEN) do + AssertEquals(VAL_AR[i],a[i]); + + finally + a.Free(); + s.Free(); + end; +end; + +procedure TTestFormatter.Test_Int8SArray(); +const AR_LEN = 5; VAL_AR : array[0..(AR_LEN-1)] of ShortInt = (-12,-34,100,200,180); +var + a : TArrayOfInt8SRemotable; + i : Integer; + f : IFormatterBase; + s : TMemoryStream; + x : string; +begin + a := TArrayOfInt8SRemotable.Create(); + try + AssertEquals(0,a.Length); + a.SetLength(0); + AssertEquals(0,a.Length); + + a.SetLength(AR_LEN); + AssertEquals(AR_LEN,a.Length); + + for i := 0 to Pred(AR_LEN) do + a[i] := VAL_AR[i]; + f := CreateFormatter(TypeInfo(TClass_B)); + f.BeginObject('Root',TypeInfo(TClass_B)); + f.Put('a',TypeInfo(TArrayOfInt8SRemotable),a); + f.EndScope(); + s := TMemoryStream.Create(); + f.SaveToStream(s); + FreeAndNil(a); + a := TArrayOfInt8SRemotable.Create(); + a.SetLength(0); + a.SetLength(0); + a.SetLength(0); + f := CreateFormatter(TypeInfo(TClass_B)); + s.Position := 0; + f.LoadFromStream(s); + x := 'Root'; + f.BeginObjectRead(x,TypeInfo(TClass_B)); + x := 'a'; + f.Get(TypeInfo(TArrayOfInt8SRemotable),x,a); + f.EndScopeRead(); + AssertEquals(AR_LEN,a.Length); + + for i := 0 to Pred(AR_LEN) do + AssertEquals(VAL_AR[i],a[i]); + + finally + a.Free(); + s.Free(); + end; +end; + +procedure TTestFormatter.Test_Int16SArray(); +const AR_LEN = 5; VAL_AR : array[0..(AR_LEN-1)] of SmallInt = (-12,-34,100,200,180); +var + a : TArrayOfInt16SRemotable; + i : Integer; + f : IFormatterBase; + s : TMemoryStream; + x : string; +begin + a := TArrayOfInt16SRemotable.Create(); + try + AssertEquals(0,a.Length); + a.SetLength(0); + AssertEquals(0,a.Length); + + a.SetLength(AR_LEN); + AssertEquals(AR_LEN,a.Length); + + for i := 0 to Pred(AR_LEN) do + a[i] := VAL_AR[i]; + f := CreateFormatter(TypeInfo(TClass_B)); + f.BeginObject('Root',TypeInfo(TClass_B)); + f.Put('a',TypeInfo(TArrayOfInt16SRemotable),a); + f.EndScope(); + s := TMemoryStream.Create(); + f.SaveToStream(s); + FreeAndNil(a); + a := TArrayOfInt16SRemotable.Create(); + a.SetLength(0); + a.SetLength(0); + a.SetLength(0); + f := CreateFormatter(TypeInfo(TClass_B)); + s.Position := 0; + f.LoadFromStream(s); + x := 'Root'; + f.BeginObjectRead(x,TypeInfo(TClass_B)); + x := 'a'; + f.Get(TypeInfo(TArrayOfInt16SRemotable),x,a); + f.EndScopeRead(); + AssertEquals(AR_LEN,a.Length); + + for i := 0 to Pred(AR_LEN) do + AssertEquals(VAL_AR[i],a[i]); + + finally + a.Free(); + s.Free(); + end; +end; + +procedure TTestFormatter.Test_Int16UArray(); +const AR_LEN = 5; VAL_AR : array[0..(AR_LEN-1)] of Word = (12,34,100,200,180); +var + a : TArrayOfInt16URemotable; + i : Integer; + f : IFormatterBase; + s : TMemoryStream; + x : string; +begin + a := TArrayOfInt16URemotable.Create(); + try + AssertEquals(0,a.Length); + a.SetLength(0); + AssertEquals(0,a.Length); + + a.SetLength(AR_LEN); + AssertEquals(AR_LEN,a.Length); + + for i := 0 to Pred(AR_LEN) do + a[i] := VAL_AR[i]; + f := CreateFormatter(TypeInfo(TClass_B)); + f.BeginObject('Root',TypeInfo(TClass_B)); + f.Put('a',TypeInfo(TArrayOfInt16URemotable),a); + f.EndScope(); + s := TMemoryStream.Create(); + f.SaveToStream(s); + FreeAndNil(a); + a := TArrayOfInt16URemotable.Create(); + a.SetLength(0); + a.SetLength(0); + a.SetLength(0); + f := CreateFormatter(TypeInfo(TClass_B)); + s.Position := 0; + f.LoadFromStream(s); + x := 'Root'; + f.BeginObjectRead(x,TypeInfo(TClass_B)); + x := 'a'; + f.Get(TypeInfo(TArrayOfInt16URemotable),x,a); + f.EndScopeRead(); + AssertEquals(AR_LEN,a.Length); + + for i := 0 to Pred(AR_LEN) do + AssertEquals(VAL_AR[i],a[i]); + + finally + a.Free(); + s.Free(); + end; +end; + +procedure TTestFormatter.Test_Int32UArray(); +const AR_LEN = 5; VAL_AR : array[0..(AR_LEN-1)] of LongWord = (12,34,100,200,180); +var + a : TArrayOfInt32URemotable; + i : Integer; + f : IFormatterBase; + s : TMemoryStream; + x : string; +begin + a := TArrayOfInt32URemotable.Create(); + try + AssertEquals(0,a.Length); + a.SetLength(0); + AssertEquals(0,a.Length); + + a.SetLength(AR_LEN); + AssertEquals(AR_LEN,a.Length); + + for i := 0 to Pred(AR_LEN) do + a[i] := VAL_AR[i]; + f := CreateFormatter(TypeInfo(TClass_B)); + f.BeginObject('Root',TypeInfo(TClass_B)); + f.Put('a',TypeInfo(TArrayOfInt32URemotable),a); + f.EndScope(); + s := TMemoryStream.Create(); + f.SaveToStream(s); + FreeAndNil(a); + a := TArrayOfInt32URemotable.Create(); + a.SetLength(0); + a.SetLength(0); + a.SetLength(0); + f := CreateFormatter(TypeInfo(TClass_B)); + s.Position := 0; + f.LoadFromStream(s); + x := 'Root'; + f.BeginObjectRead(x,TypeInfo(TClass_B)); + x := 'a'; + f.Get(TypeInfo(TArrayOfInt32URemotable),x,a); + f.EndScopeRead(); + AssertEquals(AR_LEN,a.Length); + + for i := 0 to Pred(AR_LEN) do + AssertEquals(VAL_AR[i],a[i]); + + finally + a.Free(); + s.Free(); + end; +end; + +procedure TTestFormatter.Test_Int32SArray(); +const AR_LEN = 5; VAL_AR : array[0..(AR_LEN-1)] of LongInt = (-12,-34,100,200,180); +var + a : TArrayOfInt32SRemotable; + i : Integer; + f : IFormatterBase; + s : TMemoryStream; + x : string; +begin + a := TArrayOfInt32SRemotable.Create(); + try + AssertEquals(0,a.Length); + a.SetLength(0); + AssertEquals(0,a.Length); + + a.SetLength(AR_LEN); + AssertEquals(AR_LEN,a.Length); + + for i := 0 to Pred(AR_LEN) do + a[i] := VAL_AR[i]; + f := CreateFormatter(TypeInfo(TClass_B)); + f.BeginObject('Root',TypeInfo(TClass_B)); + f.Put('a',TypeInfo(TArrayOfInt32SRemotable),a); + f.EndScope(); + s := TMemoryStream.Create(); + f.SaveToStream(s); + FreeAndNil(a); + a := TArrayOfInt32SRemotable.Create(); + a.SetLength(0); + a.SetLength(0); + a.SetLength(0); + f := CreateFormatter(TypeInfo(TClass_B)); + s.Position := 0; + f.LoadFromStream(s); + x := 'Root'; + f.BeginObjectRead(x,TypeInfo(TClass_B)); + x := 'a'; + f.Get(TypeInfo(TArrayOfInt32SRemotable),x,a); + f.EndScopeRead(); + AssertEquals(AR_LEN,a.Length); + + for i := 0 to Pred(AR_LEN) do + AssertEquals(VAL_AR[i],a[i]); + + finally + a.Free(); + s.Free(); + end; +end; + +procedure TTestFormatter.Test_Int64SArray(); +const AR_LEN = 5; VAL_AR : array[0..(AR_LEN-1)] of Int64 = (-12,-34,100,200,180); +var + a : TArrayOfInt64SRemotable; + i : Integer; + f : IFormatterBase; + s : TMemoryStream; + x : string; +begin + a := TArrayOfInt64SRemotable.Create(); + try + AssertEquals(0,a.Length); + a.SetLength(0); + AssertEquals(0,a.Length); + + a.SetLength(AR_LEN); + AssertEquals(AR_LEN,a.Length); + + for i := 0 to Pred(AR_LEN) do + a[i] := VAL_AR[i]; + f := CreateFormatter(TypeInfo(TClass_B)); + f.BeginObject('Root',TypeInfo(TClass_B)); + f.Put('a',TypeInfo(TArrayOfInt64SRemotable),a); + f.EndScope(); + s := TMemoryStream.Create(); + f.SaveToStream(s); + FreeAndNil(a); + a := TArrayOfInt64SRemotable.Create(); + a.SetLength(0); + a.SetLength(0); + a.SetLength(0); + f := CreateFormatter(TypeInfo(TClass_B)); + s.Position := 0; + f.LoadFromStream(s); + x := 'Root'; + f.BeginObjectRead(x,TypeInfo(TClass_B)); + x := 'a'; + f.Get(TypeInfo(TArrayOfInt64SRemotable),x,a); + f.EndScopeRead(); + AssertEquals(AR_LEN,a.Length); + + for i := 0 to Pred(AR_LEN) do + AssertEquals(VAL_AR[i],a[i]); + + finally + a.Free(); + s.Free(); + end; +end; + +procedure TTestFormatter.Test_Int64UArray(); +const AR_LEN = 5; VAL_AR : array[0..(AR_LEN-1)] of QWord = (12,34,100,200,180); +var + a : TArrayOfInt64URemotable; + i : Integer; + f : IFormatterBase; + s : TMemoryStream; + x : string; +begin + a := TArrayOfInt64URemotable.Create(); + try + AssertEquals(0,a.Length); + a.SetLength(0); + AssertEquals(0,a.Length); + + a.SetLength(AR_LEN); + AssertEquals(AR_LEN,a.Length); + + for i := 0 to Pred(AR_LEN) do + a[i] := VAL_AR[i]; + f := CreateFormatter(TypeInfo(TClass_B)); + f.BeginObject('Root',TypeInfo(TClass_B)); + f.Put('a',TypeInfo(TArrayOfInt64URemotable),a); + f.EndScope(); + s := TMemoryStream.Create(); + f.SaveToStream(s); + FreeAndNil(a); + a := TArrayOfInt64URemotable.Create(); + a.SetLength(0); + a.SetLength(0); + a.SetLength(0); + f := CreateFormatter(TypeInfo(TClass_B)); + s.Position := 0; + f.LoadFromStream(s); + x := 'Root'; + f.BeginObjectRead(x,TypeInfo(TClass_B)); + x := 'a'; + f.Get(TypeInfo(TArrayOfInt64URemotable),x,a); + f.EndScopeRead(); + AssertEquals(AR_LEN,a.Length); + + for i := 0 to Pred(AR_LEN) do + AssertTrue(VAL_AR[i]=a[i]); + + finally + a.Free(); + s.Free(); + end; +end; + +procedure TTestFormatter.Test_FloatSingleArray(); +const AR_LEN = 5; VAL_AR : array[0..(AR_LEN-1)] of Single = (-12.10,-4.45,100,200.58,180.3); +var + a : TArrayOfFloatSingleRemotable; + i : Integer; + f : IFormatterBase; + s : TMemoryStream; + x : string; +begin + a := TArrayOfFloatSingleRemotable.Create(); + try + AssertEquals(0,a.Length); + a.SetLength(0); + AssertEquals(0,a.Length); + + a.SetLength(AR_LEN); + AssertEquals(AR_LEN,a.Length); + + for i := 0 to Pred(AR_LEN) do + a[i] := VAL_AR[i]; + f := CreateFormatter(TypeInfo(TClass_B)); + f.BeginObject('Root',TypeInfo(TClass_B)); + f.Put('a',TypeInfo(TArrayOfFloatSingleRemotable),a); + f.EndScope(); + s := TMemoryStream.Create(); + f.SaveToStream(s); + FreeAndNil(a); + a := TArrayOfFloatSingleRemotable.Create(); + a.SetLength(0); + a.SetLength(0); + a.SetLength(0); + f := CreateFormatter(TypeInfo(TClass_B)); + s.Position := 0; + f.LoadFromStream(s); + x := 'Root'; + f.BeginObjectRead(x,TypeInfo(TClass_B)); + x := 'a'; + f.Get(TypeInfo(TArrayOfFloatSingleRemotable),x,a); + f.EndScopeRead(); + AssertEquals(AR_LEN,a.Length); + + for i := 0 to Pred(AR_LEN) do + AssertTrue(VAL_AR[i]=a[i]); + + finally + a.Free(); + s.Free(); + end; +end; + +procedure TTestFormatter.Test_FloatDoubleArray(); +const AR_LEN = 5; VAL_AR : array[0..(AR_LEN-1)] of Double = (-12.10,-4.45,100,200.58,180.3); +var + a : TArrayOfFloatDoubleRemotable; + i : Integer; + f : IFormatterBase; + s : TMemoryStream; + x : string; +begin + a := TArrayOfFloatDoubleRemotable.Create(); + try + AssertEquals(0,a.Length); + a.SetLength(0); + AssertEquals(0,a.Length); + + a.SetLength(AR_LEN); + AssertEquals(AR_LEN,a.Length); + + for i := 0 to Pred(AR_LEN) do + a[i] := VAL_AR[i]; + f := CreateFormatter(TypeInfo(TClass_B)); + f.BeginObject('Root',TypeInfo(TClass_B)); + f.Put('a',TypeInfo(TArrayOfFloatDoubleRemotable),a); + f.EndScope(); + s := TMemoryStream.Create(); + f.SaveToStream(s); + FreeAndNil(a); + a := TArrayOfFloatDoubleRemotable.Create(); + a.SetLength(0); + a.SetLength(0); + a.SetLength(0); + f := CreateFormatter(TypeInfo(TClass_B)); + s.Position := 0; + f.LoadFromStream(s); + x := 'Root'; + f.BeginObjectRead(x,TypeInfo(TClass_B)); + x := 'a'; + f.Get(TypeInfo(TArrayOfFloatDoubleRemotable),x,a); + f.EndScopeRead(); + AssertEquals(AR_LEN,a.Length); + + for i := 0 to Pred(AR_LEN) do + AssertTrue(VAL_AR[i]=a[i]); + + finally + a.Free(); + s.Free(); + end; +end; + +procedure TTestFormatter.Test_FloatExtendedArray(); +const AR_LEN = 5; VAL_AR : array[0..(AR_LEN-1)] of Extended = (-12.10,-4.45,100,200.58,180.3); +var + a : TArrayOfFloatExtendedRemotable; + i : Integer; + f : IFormatterBase; + s : TMemoryStream; + x : string; +begin + a := TArrayOfFloatExtendedRemotable.Create(); + try + AssertEquals(0,a.Length); + a.SetLength(0); + AssertEquals(0,a.Length); + + a.SetLength(AR_LEN); + AssertEquals(AR_LEN,a.Length); + + for i := 0 to Pred(AR_LEN) do + a[i] := VAL_AR[i]; + f := CreateFormatter(TypeInfo(TClass_B)); + f.BeginObject('Root',TypeInfo(TClass_B)); + f.Put('a',TypeInfo(TArrayOfFloatExtendedRemotable),a); + f.EndScope(); + s := TMemoryStream.Create(); + f.SaveToStream(s); + FreeAndNil(a); + a := TArrayOfFloatExtendedRemotable.Create(); + a.SetLength(0); + a.SetLength(0); + a.SetLength(0); + f := CreateFormatter(TypeInfo(TClass_B)); + s.Position := 0; + f.LoadFromStream(s); + x := 'Root'; + f.BeginObjectRead(x,TypeInfo(TClass_B)); + x := 'a'; + f.Get(TypeInfo(TArrayOfFloatExtendedRemotable),x,a); + f.EndScopeRead(); + AssertEquals(AR_LEN,a.Length); + + for i := 0 to Pred(AR_LEN) do + AssertTrue(VAL_AR[i]=a[i]); + + finally + a.Free(); + s.Free(); + end; +end; + +procedure TTestFormatter.Test_FloatCurrencyArray(); +const AR_LEN = 5; VAL_AR : array[0..(AR_LEN-1)] of Currency = (-12.10,-4.45,100,200.58,180.3); +var + a : TArrayOfFloatCurrencyRemotable; + i : Integer; + f : IFormatterBase; + s : TMemoryStream; + x : string; +begin + a := TArrayOfFloatCurrencyRemotable.Create(); + try + AssertEquals(0,a.Length); + a.SetLength(0); + AssertEquals(0,a.Length); + + a.SetLength(AR_LEN); + AssertEquals(AR_LEN,a.Length); + + for i := 0 to Pred(AR_LEN) do + a[i] := VAL_AR[i]; + f := CreateFormatter(TypeInfo(TClass_B)); + f.BeginObject('Root',TypeInfo(TClass_B)); + f.Put('a',TypeInfo(TArrayOfFloatCurrencyRemotable),a); + f.EndScope(); + s := TMemoryStream.Create(); + f.SaveToStream(s); + FreeAndNil(a); + a := TArrayOfFloatCurrencyRemotable.Create(); + a.SetLength(0); + a.SetLength(0); + a.SetLength(0); + f := CreateFormatter(TypeInfo(TClass_B)); + s.Position := 0; + f.LoadFromStream(s); + x := 'Root'; + f.BeginObjectRead(x,TypeInfo(TClass_B)); + x := 'a'; + f.Get(TypeInfo(TArrayOfFloatCurrencyRemotable),x,a); + f.EndScopeRead(); + AssertEquals(AR_LEN,a.Length); + + for i := 0 to Pred(AR_LEN) do + AssertTrue(VAL_AR[i]=a[i]); + + finally + a.Free(); + s.Free(); + end; +end; + +procedure TTestFormatter.Test_ComplexInt32S(); +const VAL_1 = 121076; VAL_2 : LongInt = -101276; +var + f : IFormatterBase; + s : TMemoryStream; + x : string; + a, b : TComplexInt32SContentRemotable; +begin + s := nil; + a := nil; + b := nil; + try + a := TComplexInt32SContentRemotable.Create(); + b := TComplexInt32SContentRemotable.Create(); + a.Value := VAL_1; + b.Value := VAL_2; + f := CreateFormatter(TypeInfo(TClass_Int)); + + f.BeginObject('Root',TypeInfo(TClass_Int)); + f.Put('a',TypeInfo(TComplexInt32SContentRemotable),a); + f.Put('b',TypeInfo(TComplexInt32SContentRemotable),b); + f.EndScope(); + FreeAndNil(a);FreeAndNil(b); + s := TMemoryStream.Create(); + f.SaveToStream(s); + + a := TComplexInt32SContentRemotable.Create(); + b := TComplexInt32SContentRemotable.Create(); + f := CreateFormatter(TypeInfo(TClass_Int)); + s.Position := 0; + f.LoadFromStream(s); + x := 'Root'; + f.BeginObjectRead(x,TypeInfo(TClass_Int)); + x := 'a'; + f.Get(TypeInfo(TComplexInt32SContentRemotable),x,a); + x := 'b'; + f.Get(TypeInfo(TComplexInt32SContentRemotable),x,b); + f.EndScopeRead(); + + AssertEquals(VAL_1,a.Value); + AssertEquals(VAL_2,b.Value); + finally + s.Free(); + FreeAndNil(a); + FreeAndNil(b); + end; +end; + + +{ TTestBinaryFormatter } + +function TTestBinaryFormatter.CreateFormatter(ARootType : PTypeInfo):IFormatterBase; +begin + Result := TBaseBinaryFormatter.Create() as IFormatterBase; + //Result.BeginObject('root',Nil); +end; + +{ TTestSOAPFormatter } + +function TTestSOAPFormatter.CreateFormatter(ARootType : PTypeInfo):IFormatterBase; +begin + Result := TSOAPBaseFormatter.Create() as IFormatterBase; + Result.BeginObject('Env',ARootType) +end; + +{ TClass_B } + +procedure TClass_B.SetObjProp(const AValue: TClass_A); +begin + FObjProp.Assign(AValue); +end; + +constructor TClass_B.Create(); +begin + inherited Create(); + FObjProp := TClass_A.Create(); +end; + +destructor TClass_B.Destroy(); +begin + FreeAndNil(FObjProp); + inherited Destroy(); +end; + +{ TTestArray } + +procedure TTestArray.Test_StringArray(); +const AR_LEN = 5; VAL_AR : array[0..(AR_LEN-1)] of string = ('AzErTy','QwErTy','123456','','1'); +var + a : TArrayOfStringRemotable; + i, j : Integer; +begin + a := TArrayOfStringRemotable.Create(); + try + AssertEquals('TypeInfo',PTypeInfo(TypeInfo(ansistring))^.Name,a.GetItemTypeInfo()^.Name); + AssertEquals('TypeInfo',Ord(PTypeInfo(TypeInfo(ansistring))^.Kind),Ord(a.GetItemTypeInfo()^.Kind)); + + AssertEquals(0,a.Length); + a.SetLength(0); + AssertEquals(0,a.Length); + + for i := 1 to AR_LEN do begin + a.SetLength(i); + AssertEquals('Length',i,a.Length); + for j := 0 to Pred(i) do + a[j] := VAL_AR[j]; + for j := 0 to Pred(i) do + AssertEquals('Item',VAL_AR[j],a[j]); + end; + + a.SetLength(0); + AssertEquals(0,a.Length); + finally + a.Free(); + end; +end; + +procedure TTestArray.Test_BooleanArray(); +const AR_LEN = 5; VAL_AR : array[0..(AR_LEN-1)] of Boolean = (True,True,False,True,False); +var + a : TArrayOfBooleanRemotable; + i, j : Integer; +begin + a := TArrayOfBooleanRemotable.Create(); + try + AssertEquals('TypeInfo',PTypeInfo(TypeInfo(Boolean))^.Name,a.GetItemTypeInfo()^.Name); + AssertEquals('TypeInfo',Ord(PTypeInfo(TypeInfo(Boolean))^.Kind),Ord(a.GetItemTypeInfo()^.Kind)); + + AssertEquals(0,a.Length); + a.SetLength(0); + AssertEquals(0,a.Length); + + for i := 1 to AR_LEN do begin + a.SetLength(i); + AssertEquals('Length',i,a.Length); + for j := 0 to Pred(i) do + a[j] := VAL_AR[j]; + for j := 0 to Pred(i) do + AssertEquals('Item',VAL_AR[j],a[j]); + end; + + a.SetLength(0); + AssertEquals(0,a.Length); + finally + a.Free(); + end; +end; + +procedure TTestArray.Test_Int8UArray(); +const AR_LEN = 5; VAL_AR : array[0..(AR_LEN-1)] of Byte = (12,34,100,200,180); +var + a : TArrayOfInt8URemotable; + i, j : Integer; +begin + a := TArrayOfInt8URemotable.Create(); + try + AssertEquals('TypeInfo',PTypeInfo(TypeInfo(Byte))^.Name,a.GetItemTypeInfo()^.Name); + AssertEquals('TypeInfo',Ord(PTypeInfo(TypeInfo(Byte))^.Kind),Ord(a.GetItemTypeInfo()^.Kind)); + + AssertEquals(0,a.Length); + a.SetLength(0); + AssertEquals(0,a.Length); + + for i := 1 to AR_LEN do begin + a.SetLength(i); + AssertEquals('Length',i,a.Length); + for j := 0 to Pred(i) do + a[j] := VAL_AR[j]; + for j := 0 to Pred(i) do + AssertEquals('Item',VAL_AR[j],a[j]); + end; + + a.SetLength(0); + AssertEquals(0,a.Length); + finally + a.Free(); + end; +end; + +procedure TTestArray.Test_Int8SArray(); +const AR_LEN = 5; VAL_AR : array[0..(AR_LEN-1)] of ShortInt = (-12,-34,100,200,180); +var + a : TArrayOfInt8SRemotable; + i, j : Integer; +begin + a := TArrayOfInt8SRemotable.Create(); + try + AssertEquals('TypeInfo',PTypeInfo(TypeInfo(ShortInt))^.Name,a.GetItemTypeInfo()^.Name); + AssertEquals('TypeInfo',Ord(PTypeInfo(TypeInfo(ShortInt))^.Kind),Ord(a.GetItemTypeInfo()^.Kind)); + + AssertEquals(0,a.Length); + a.SetLength(0); + AssertEquals(0,a.Length); + + for i := 1 to AR_LEN do begin + a.SetLength(i); + AssertEquals('Length',i,a.Length); + for j := 0 to Pred(i) do + a[j] := VAL_AR[j]; + for j := 0 to Pred(i) do + AssertEquals('Item',VAL_AR[j],a[j]); + end; + + a.SetLength(0); + AssertEquals(0,a.Length); + finally + a.Free(); + end; +end; + +procedure TTestArray.Test_Int16SArray(); +const AR_LEN = 5; VAL_AR : array[0..(AR_LEN-1)] of SmallInt = (-12,-34,100,200,180); +var + a : TArrayOfInt16SRemotable; + i, j : Integer; +begin + a := TArrayOfInt16SRemotable.Create(); + try + AssertEquals('TypeInfo',PTypeInfo(TypeInfo(SmallInt))^.Name,a.GetItemTypeInfo()^.Name); + AssertEquals('TypeInfo',Ord(PTypeInfo(TypeInfo(SmallInt))^.Kind),Ord(a.GetItemTypeInfo()^.Kind)); + + AssertEquals(0,a.Length); + a.SetLength(0); + AssertEquals(0,a.Length); + + for i := 1 to AR_LEN do begin + a.SetLength(i); + AssertEquals('Length',i,a.Length); + for j := 0 to Pred(i) do + a[j] := VAL_AR[j]; + for j := 0 to Pred(i) do + AssertEquals('Item',VAL_AR[j],a[j]); + end; + + a.SetLength(0); + AssertEquals(0,a.Length); + finally + a.Free(); + end; +end; + +procedure TTestArray.Test_Int16UArray(); +const AR_LEN = 5; VAL_AR : array[0..(AR_LEN-1)] of Word = (12,4,100,200,180); +var + a : TArrayOfInt16URemotable; + i, j : Integer; +begin + a := TArrayOfInt16URemotable.Create(); + try + AssertEquals('TypeInfo',PTypeInfo(TypeInfo(Word))^.Name,a.GetItemTypeInfo()^.Name); + AssertEquals('TypeInfo',Ord(PTypeInfo(TypeInfo(Word))^.Kind),Ord(a.GetItemTypeInfo()^.Kind)); + + AssertEquals(0,a.Length); + a.SetLength(0); + AssertEquals(0,a.Length); + + for i := 1 to AR_LEN do begin + a.SetLength(i); + AssertEquals('Length',i,a.Length); + for j := 0 to Pred(i) do + a[j] := VAL_AR[j]; + for j := 0 to Pred(i) do + AssertEquals('Item',VAL_AR[j],a[j]); + end; + + a.SetLength(0); + AssertEquals(0,a.Length); + finally + a.Free(); + end; +end; + +procedure TTestArray.Test_Int32UArray(); +const AR_LEN = 5; VAL_AR : array[0..(AR_LEN-1)] of LongWord = (12,4,100,200,180); +var + a : TArrayOfInt32URemotable; + i, j : Integer; +begin + a := TArrayOfInt32URemotable.Create(); + try + AssertEquals('TypeInfo',PTypeInfo(TypeInfo(LongWord))^.Name,a.GetItemTypeInfo()^.Name); + AssertEquals('TypeInfo',Ord(PTypeInfo(TypeInfo(LongWord))^.Kind),Ord(a.GetItemTypeInfo()^.Kind)); + + AssertEquals(0,a.Length); + a.SetLength(0); + AssertEquals(0,a.Length); + + for i := 1 to AR_LEN do begin + a.SetLength(i); + AssertEquals('Length',i,a.Length); + for j := 0 to Pred(i) do + a[j] := VAL_AR[j]; + for j := 0 to Pred(i) do + AssertEquals('Item',VAL_AR[j],a[j]); + end; + + a.SetLength(0); + AssertEquals(0,a.Length); + finally + a.Free(); + end; +end; + +procedure TTestArray.Test_Int32SArray(); +const AR_LEN = 5; VAL_AR : array[0..(AR_LEN-1)] of LongInt = (-12,-34,100,200,180); +var + a : TArrayOfInt32SRemotable; + i, j : Integer; +begin + a := TArrayOfInt32SRemotable.Create(); + try + AssertEquals('TypeInfo',PTypeInfo(TypeInfo(LongInt))^.Name,a.GetItemTypeInfo()^.Name); + AssertEquals('TypeInfo',Ord(PTypeInfo(TypeInfo(LongInt))^.Kind),Ord(a.GetItemTypeInfo()^.Kind)); + + AssertEquals(0,a.Length); + a.SetLength(0); + AssertEquals(0,a.Length); + + for i := 1 to AR_LEN do begin + a.SetLength(i); + AssertEquals('Length',i,a.Length); + for j := 0 to Pred(i) do + a[j] := VAL_AR[j]; + for j := 0 to Pred(i) do + AssertEquals('Item',VAL_AR[j],a[j]); + end; + + a.SetLength(0); + AssertEquals(0,a.Length); + finally + a.Free(); + end; +end; + +procedure TTestArray.Test_Int64SArray(); +const AR_LEN = 5; VAL_AR : array[0..(AR_LEN-1)] of Int64 = (-12,-34,100,200,180); +var + a : TArrayOfInt64SRemotable; + i, j : Integer; +begin + a := TArrayOfInt64SRemotable.Create(); + try + AssertEquals('TypeInfo',PTypeInfo(TypeInfo(Int64))^.Name,a.GetItemTypeInfo()^.Name); + AssertEquals('TypeInfo',Ord(PTypeInfo(TypeInfo(Int64))^.Kind),Ord(a.GetItemTypeInfo()^.Kind)); + + AssertEquals(0,a.Length); + a.SetLength(0); + AssertEquals(0,a.Length); + + for i := 1 to AR_LEN do begin + a.SetLength(i); + AssertEquals('Length',i,a.Length); + for j := 0 to Pred(i) do + a[j] := VAL_AR[j]; + for j := 0 to Pred(i) do + AssertEquals('Item',VAL_AR[j],a[j]); + end; + + a.SetLength(0); + AssertEquals(0,a.Length); + finally + a.Free(); + end; +end; + +procedure TTestArray.Test_Int64UArray(); +const AR_LEN = 5; VAL_AR : array[0..(AR_LEN-1)] of QWord = (12,4,100,200,180); +var + a : TArrayOfInt64URemotable; + i, j : Integer; +begin + a := TArrayOfInt64URemotable.Create(); + try + AssertEquals('TypeInfo',PTypeInfo(TypeInfo(QWord))^.Name,a.GetItemTypeInfo()^.Name); + AssertEquals('TypeInfo',Ord(PTypeInfo(TypeInfo(QWord))^.Kind),Ord(a.GetItemTypeInfo()^.Kind)); + + AssertEquals(0,a.Length); + a.SetLength(0); + AssertEquals(0,a.Length); + + for i := 1 to AR_LEN do begin + a.SetLength(i); + AssertEquals('Length',i,a.Length); + for j := 0 to Pred(i) do + a[j] := VAL_AR[j]; + for j := 0 to Pred(i) do + AssertTrue('Item',VAL_AR[j]=a[j]); + end; + + a.SetLength(0); + AssertEquals(0,a.Length); + finally + a.Free(); + end; +end; + +procedure TTestArray.Test_FloatSingleArray(); +const AR_LEN = 5; VAL_AR : array[0..(AR_LEN-1)] of Single = (-12.10,-4.45,100,200.58,180.3); +var + a : TArrayOfFloatSingleRemotable; + i, j : Integer; +begin + a := TArrayOfFloatSingleRemotable.Create(); + try + AssertEquals('TypeInfo',PTypeInfo(TypeInfo(Single))^.Name,a.GetItemTypeInfo()^.Name); + AssertEquals('TypeInfo',Ord(PTypeInfo(TypeInfo(Single))^.Kind),Ord(a.GetItemTypeInfo()^.Kind)); + + AssertEquals(0,a.Length); + a.SetLength(0); + AssertEquals(0,a.Length); + + for i := 1 to AR_LEN do begin + a.SetLength(i); + AssertEquals('Length',i,a.Length); + for j := 0 to Pred(i) do + a[j] := VAL_AR[j]; + for j := 0 to Pred(i) do + AssertTrue('Item',VAL_AR[j]=a[j]); + end; + + a.SetLength(0); + AssertEquals(0,a.Length); + finally + a.Free(); + end; +end; + +procedure TTestArray.Test_FloatDoubleArray(); +const AR_LEN = 5; VAL_AR : array[0..(AR_LEN-1)] of Double = (-12.10,-4.45,100,200.58,180.3); +var + a : TArrayOfFloatDoubleRemotable; + i, j : Integer; +begin + a := TArrayOfFloatDoubleRemotable.Create(); + try + AssertEquals('TypeInfo',PTypeInfo(TypeInfo(Double))^.Name,a.GetItemTypeInfo()^.Name); + AssertEquals('TypeInfo',Ord(PTypeInfo(TypeInfo(Double))^.Kind),Ord(a.GetItemTypeInfo()^.Kind)); + + AssertEquals(0,a.Length); + a.SetLength(0); + AssertEquals(0,a.Length); + + for i := 1 to AR_LEN do begin + a.SetLength(i); + AssertEquals('Length',i,a.Length); + for j := 0 to Pred(i) do + a[j] := VAL_AR[j]; + for j := 0 to Pred(i) do + AssertTrue('Item',VAL_AR[j]=a[j]); + end; + + a.SetLength(0); + AssertEquals(0,a.Length); + finally + a.Free(); + end; +end; + +procedure TTestArray.Test_FloatExtendedArray(); +const AR_LEN = 5; VAL_AR : array[0..(AR_LEN-1)] of Extended = (-12.10,-4.45,100,200.58,180.3); +var + a : TArrayOfFloatExtendedRemotable; + i, j : Integer; +begin + a := TArrayOfFloatExtendedRemotable.Create(); + try + AssertEquals('TypeInfo',PTypeInfo(TypeInfo(Extended))^.Name,a.GetItemTypeInfo()^.Name); + AssertEquals('TypeInfo',Ord(PTypeInfo(TypeInfo(Extended))^.Kind),Ord(a.GetItemTypeInfo()^.Kind)); + + AssertEquals(0,a.Length); + a.SetLength(0); + AssertEquals(0,a.Length); + + for i := 1 to AR_LEN do begin + a.SetLength(i); + AssertEquals('Length',i,a.Length); + for j := 0 to Pred(i) do + a[j] := VAL_AR[j]; + for j := 0 to Pred(i) do + AssertTrue('Item',VAL_AR[j]=a[j]); + end; + + a.SetLength(0); + AssertEquals(0,a.Length); + finally + a.Free(); + end; +end; + +procedure TTestArray.Test_FloatCurrencyArray(); +const AR_LEN = 5; VAL_AR : array[0..(AR_LEN-1)] of Currency = (-12.10,-4.45,100,200.58,180.3); +var + a : TArrayOfFloatCurrencyRemotable; + i, j : Integer; +begin + a := TArrayOfFloatCurrencyRemotable.Create(); + try + AssertEquals('TypeInfo',PTypeInfo(TypeInfo(Currency))^.Name,a.GetItemTypeInfo()^.Name); + AssertEquals('TypeInfo',Ord(PTypeInfo(TypeInfo(Currency))^.Kind),Ord(a.GetItemTypeInfo()^.Kind)); + + AssertEquals(0,a.Length); + a.SetLength(0); + AssertEquals(0,a.Length); + + for i := 1 to AR_LEN do begin + a.SetLength(i); + AssertEquals('Length',i,a.Length); + for j := 0 to Pred(i) do + a[j] := VAL_AR[j]; + for j := 0 to Pred(i) do + AssertTrue('Item',VAL_AR[j]=a[j]); + end; + + a.SetLength(0); + AssertEquals(0,a.Length); + finally + a.Free(); + end; +end; + +{ TTest_TBaseComplexRemotable } + +procedure TTest_TBaseComplexRemotable.Test_Assign(); +Var + a,b : TClass_B; +begin + b := nil; + a := TClass_B.Create(); + Try + a.Val_Bool := False; + a.Val_Enum := teThree; + a.Val_String := '123'; + a.ObjProp.Val_String := '456'; + a.ObjProp.Val_Enum := teFour; + a.ObjProp.Val_Bool := True; + a.ObjProp.Val_32S := 121076; + a.NonStored := 121076; + + b := TClass_B.Create(); + + b.Assign(a); + + AssertEquals(a.Val_Bool,b.Val_Bool); + AssertEquals(Ord(a.Val_Enum),Ord(b.Val_Enum)); + AssertEquals(a.Val_String,b.Val_String); + + AssertEquals(a.ObjProp.Val_Bool,b.ObjProp.Val_Bool); + AssertEquals(Ord(a.ObjProp.Val_Enum),Ord(b.ObjProp.Val_Enum)); + AssertEquals(a.ObjProp.Val_String,a.ObjProp.Val_String); + Finally + a.Free(); + b.Free(); + End; +end; + +{ TTestSOAPFormatterAttributes } + +function TTestSOAPFormatterAttributes.CreateFormatter(ARootType: PTypeInfo): IFormatterBase; +begin + Result := TSOAPBaseFormatter.Create() as IFormatterBase; + Result.BeginObject('Env',ARootType); + Result.SetSerializationStyle(ssAttibuteSerialization); +end; + +{ TTestBinaryFormatterAttributes } + +function TTestBinaryFormatterAttributes.CreateFormatter(ARootType: PTypeInfo): IFormatterBase; +begin + Result := TSOAPBaseFormatter.Create() as IFormatterBase; + Result.BeginObject('Env',ARootType); + Result.SetSerializationStyle(ssAttibuteSerialization); +end; + +{ TClass_CplxSimpleContent } + +constructor TClass_CplxSimpleContent.Create(); +begin + FVal_CplxInt64S := T_ComplexInt64SContent.Create(); + FVal_CplxInt64U := T_ComplexInt64UContent.Create(); + FVal_CplxInt32S := T_ComplexInt32SContent.Create(); + FVal_CplxInt32U := T_ComplexInt32UContent.Create(); + FVal_CplxInt16S := T_ComplexInt16SContent.Create(); + FVal_CplxInt16U := T_ComplexInt16UContent.Create(); + FVal_CplxInt8S := T_ComplexInt8SContent.Create(); + FVal_CplxInt8U := T_ComplexInt8UContent.Create(); +end; + +destructor TClass_CplxSimpleContent.Destroy(); +begin + FreeAndNil(FVal_CplxInt64S); + FreeAndNil(FVal_CplxInt64U); + FreeAndNil(FVal_CplxInt32U); + FreeAndNil(FVal_CplxInt32S); + FreeAndNil(FVal_CplxInt16U); + FreeAndNil(FVal_CplxInt16S); + FreeAndNil(FVal_CplxInt8U); + FreeAndNil(FVal_CplxInt8S); + inherited Destroy(); +end; + +{ TTest_TDateRemotable } + +procedure TTest_TDateRemotable.FormatDate(); +const sDATE = '1976-10-12T23:34:56'; +var + d : TDateTime; +begin + //'-'? yyyy '-' mm '-' dd 'T' hh ':' mm ':' ss ('.' s+)? (zzzzzz)? + d := EncodeDate(1976,10,12) + EncodeTime(23,34,56,0); + AssertTrue(AnsiPos(TDateRemotable.FormatDate(d),sDATE) = 1); +end; + +procedure TTest_TDateRemotable.ParseDate(); +const sDATE = '1976-10-12T23:34:56'; +var + s : string; + objd : TDateRemotable; + d : TDateTime; + y,m,dy : Word; + hh,mn,ss, ssss : Word; +begin + //'-'? yyyy '-' mm '-' dd 'T' hh ':' mm ':' ss ('.' s+)? (zzzzzz)? + s := '1976-10-12T23:34:56'; + d := TDateRemotable.ParseDate(s); + DecodeDate(d,y,m,dy); + AssertEquals('Year',y,1976); + AssertEquals('Month',m,10); + AssertEquals('Day',dy,12); + + DecodeTime(d,hh,mn,ss,ssss); + AssertEquals('Hour',hh,23); + AssertEquals('Minute',mn,34); + AssertEquals('Second',ss,56); + + objd := TDateRemotable.Create(); + try + objd.AsDate := d; + AssertEquals('Year',objd.Year,1976); + AssertEquals('Month',objd.Month,10); + AssertEquals('Day',objd.Day,12); + AssertEquals('Hour',objd.Hour,23); + AssertEquals('Minute',objd.Minute,34); + AssertEquals('Second',objd.Second,56); + finally + FreeAndNil(objd); + end; +end; + +{ TTest_TDurationRemotable } + +procedure TTest_TDurationRemotable.FormatDate(); +begin + Fail('Write me!'); +end; + +procedure TTest_TDurationRemotable.ParseDate(); +begin + Fail('Write me!'); +end; + +{ TTest_TTimeRemotable } + +procedure TTest_TTimeRemotable.FormatDate(); +begin + Fail('Write me!'); +end; + +procedure TTest_TTimeRemotable.ParseDate(); +begin + Fail('Write me!'); +end; + +initialization + RegisterStdTypes(); + GetTypeRegistry().Register(sXSD_NS,TypeInfo(TTestEnum),'TTestEnum').RegisterExternalPropertyName('teOne', '1'); + GetTypeRegistry().Register(sXSD_NS,TypeInfo(TClass_Int),'TClass_Int').RegisterExternalPropertyName('Val_8U','U8'); + GetTypeRegistry().Register(sXSD_NS,TypeInfo(TClass_Enum),'TClass_Enum'); + GetTypeRegistry().Register(sXSD_NS,TypeInfo(TClass_A),'TClass_A'); + GetTypeRegistry().Register(sXSD_NS,TypeInfo(TClass_B),'TClass_B'); + GetTypeRegistry().Register(sXSD_NS,TypeInfo(TClass_Float),'TClass_Float'); + + GetTypeRegistry().Register(sXSD_NS,TypeInfo(T_ComplexInt32SContent),'T_ComplexInt32SContent'); + GetTypeRegistry().Register(sXSD_NS,TypeInfo(T_ComplexInt32UContent),'T_ComplexInt32UContent'); + + GetTypeRegistry().Register(sXSD_NS,TypeInfo(T_ComplexInt16SContent),'T_ComplexInt16SContent'); + GetTypeRegistry().Register(sXSD_NS,TypeInfo(T_ComplexInt16UContent),'T_ComplexInt16UContent'); + + GetTypeRegistry().Register(sXSD_NS,TypeInfo(T_ComplexFloatExtendedContent),'T_ComplexFloatExtendedContent'); + GetTypeRegistry().Register(sXSD_NS,TypeInfo(T_ComplexFloatDoubleContent),'T_ComplexFloatDoubleContent'); + + TClass_CplxSimpleContent.RegisterAttributeProperty('Elt_Exemple'); + GetTypeRegistry().Register(sXSD_NS,TypeInfo(TClass_CplxSimpleContent),'TClass_CplxSimpleContent').RegisterExternalPropertyName('Elt_Exemple', 'published'); + + with GetTypeRegistry().Register(sWST_BASE_NS,TypeInfo(TEmbeddedArrayOfStringRemotable),'TEmbeddedArrayOfStringRemotable') do begin + RegisterExternalPropertyName(sARRAY_ITEM,'abc'); + RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded); + end; + + RegisterTest(TTestArray); + RegisterTest(TTestSOAPFormatter); + RegisterTest(TTestBinaryFormatter); + RegisterTest(TTest_TBaseComplexRemotable); + RegisterTest(TTestSOAPFormatterAttributes); + RegisterTest(TTestBinaryFormatterAttributes); + RegisterTest(TTest_TDateRemotable); + RegisterTest(TTest_TDurationRemotable); + RegisterTest(TTest_TTimeRemotable); +end. diff --git a/wst/tags/0.4/tests/test_suite/testmetadata_unit.pas b/wst/tags/0.4/tests/test_suite/testmetadata_unit.pas new file mode 100644 index 000000000..a4ea7f168 --- /dev/null +++ b/wst/tags/0.4/tests/test_suite/testmetadata_unit.pas @@ -0,0 +1,153 @@ +{ + This file is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This file is provide under modified LGPL licence + ( the files COPYING.modifiedLGPL and COPYING.LGPL). + + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +} + +unit testmetadata_unit; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, DOM, XMLWrite, + fpcunit, testutils, testregistry, + metadata_generator, binary_streamer, metadata_repository, parserdefs, + metadata_wsdl; + +type + + { TTestMetadata } + + TTestMetadata= class(TTestCase) + protected + function CreateSymbolTable():TSymbolTable; + published + procedure test_Metadata(); + end; + + +implementation + +{ TTestMetadata } + +function TTestMetadata.CreateSymbolTable(): TSymbolTable; +Var + inft : TInterfaceDefinition; +begin + Result := TSymbolTable.Create('test_unit_name'); + Result.Add(TTypeDefinition.Create('integer')); + Result.Add(TTypeDefinition.Create('string')); + Result.Add(TTypeDefinition.Create('double')); + + inft := TInterfaceDefinition.Create('service_1'); + Result.Add(inft); + inft.AddMethod('void_operation_proc',mtProcedure); + inft.AddMethod('void_operation_func',mtProcedure).AddParameter('result',pmOut,Result.ByName('integer') as TTypeDefinition); + + inft := TInterfaceDefinition.Create('service_2'); + Result.Add(inft); + with inft.AddMethod('dis_proc',mtProcedure) do begin + AddParameter('d',pmNone,Result.ByName('double') as TTypeDefinition); + AddParameter('i',pmConst,Result.ByName('integer') as TTypeDefinition); + AddParameter('s',pmOut,Result.ByName('string') as TTypeDefinition); + end; + with inft.AddMethod('sid_func',mtFunction) do begin + AddParameter('s',pmConst,Result.ByName('string') as TTypeDefinition); + AddParameter('i',pmVar,Result.ByName('integer') as TTypeDefinition); + AddParameter('d',pmOut,Result.ByName('double') as TTypeDefinition); + end; +end; + +procedure PrintWSDL(ARep : PServiceRepository); +var + locDoc : TXMLDocument; + strm : TMemoryStream; + s : string; +begin + strm := nil;; + locDoc := TXMLDocument.Create(); + try + GenerateWSDL(ARep,locDoc); + strm := TMemoryStream.Create(); + WriteXMLFile(locDoc,strm); + SetLength(s,strm.Size); + Move(strm.Memory^,s[1],strm.Size); + WriteLn('*******************************************************'); + WriteLn(s); + WriteLn('*******************************************************'); + finally + locDoc.Free(); + strm.Free(); + end; +end; + +procedure TTestMetadata.test_Metadata(); +var + st : TSymbolTable; + mg : TMetadataGenerator; + wtr : IDataStore; + strm : TMemoryStream; + + rp : PServiceRepository; + ps : PService; + po : PServiceOperation; + pop : POperationParam; +begin + strm := nil; + mg := nil; + rp := nil; + st := CreateSymbolTable(); + try + strm := TMemoryStream.Create(); + wtr := CreateBinaryWriter(strm); + mg := TMetadataGenerator.Create(st,wtr); + mg.Execute(); + wtr := nil; + strm.Position := 0; + + AssertTrue(strm.Size>10); + AssertEquals('symbol count',2,LoadRepositoryData(strm,rp)); + AssertEquals('unit name','test_unit_name',rp^.Name); + AssertEquals('services count',2,rp^.ServicesCount); + AssertNotNull('services pointer',rp^.Services); + + ps := rp^.Services; + AssertEquals('service name','service_1',ps^.Name); + AssertEquals('operations count',2,ps^.OperationsCount); + AssertNotNull('operations pointer',ps^.Operations); + po := ps^.Operations; + AssertEquals('operation name','void_operation_proc',po^.Name); + AssertEquals('params count',0,po^.ParamsCount); + AssertNull('params pointer',po^.Params); + Inc(po); + AssertEquals('operation name','void_operation_func',po^.Name); + AssertEquals('params count',1,po^.ParamsCount); + AssertNotNull('params pointer',po^.Params); + pop := po^.Params; + AssertEquals('param name','result',pop^.Name); + AssertEquals('param type name','integer',pop^.TypeName); + AssertEquals('param modifier',ord(pmOut),ord(pop^.Modifier)); + + rp^.NameSpace := 'http://test_name_space/'; + //PrintWSDL(rp); + finally + mg.Free(); + st.Free(); + strm.Free(); + ClearRepositoryData(rp); + end; +end; + +initialization + RegisterTest(TTestMetadata); + +end. diff --git a/wst/tags/0.4/tests/test_suite/wst_test_suite.lpi b/wst/tags/0.4/tests/test_suite/wst_test_suite.lpi new file mode 100644 index 000000000..a0f0828ef --- /dev/null +++ b/wst/tags/0.4/tests/test_suite/wst_test_suite.lpi @@ -0,0 +1,465 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wst/tags/0.4/tests/test_suite/wst_test_suite.lpr b/wst/tags/0.4/tests/test_suite/wst_test_suite.lpr new file mode 100644 index 000000000..784583a89 --- /dev/null +++ b/wst/tags/0.4/tests/test_suite/wst_test_suite.lpr @@ -0,0 +1,122 @@ +program wst_test_suite; + +{$mode objfpc}{$H+} + +uses + custapp, classes, sysutils, fpcunit, testreport, testregistry, + TestFormatter_unit, testmetadata_unit, + server_service_soap, soap_formatter, base_binary_formatter, + base_service_intf, base_soap_formatter, binary_formatter, binary_streamer, + server_binary_formatter, metadata_repository, + metadata_generator, parserdefs, server_service_intf, metadata_wsdl, + test_parserdef; + +Const + ShortOpts = 'alh'; + Longopts : Array[1..5] of String = ( + 'all','list','format:','suite:','help'); + Version = 'Version 0.1'; + +Type + TTestRunner = Class(TCustomApplication) + private + FXMLResultsWriter: TXMLResultsWriter; + protected + procedure DoRun ; Override; + procedure doTestRun(aTest: TTest); virtual; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + end; + +constructor TTestRunner.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FXMLResultsWriter := TXMLResultsWriter.Create; +end; + +destructor TTestRunner.Destroy; +begin + FXMLResultsWriter.Free; +end; + +procedure TTestRunner.doTestRun(aTest: TTest); +var + testResult: TTestResult; +begin + testResult := TTestResult.Create; + try + testResult.AddListener(FXMLResultsWriter); + FXMLResultsWriter.WriteHeader; + aTest.Run(testResult); + FXMLResultsWriter.WriteResult(testResult); + finally + testResult.Free; + end; +end; + +procedure TTestRunner.DoRun; +var + I : Integer; + S : String; +begin + S:=CheckOptions(ShortOpts,LongOpts); + If (S<>'') then + Writeln(S); + if HasOption('h', 'help') or (ParamCount = 0) then + begin + writeln(Title); + writeln(Version); + writeln('Usage: '); + writeln('-l or --list to show a list of registered tests'); + writeln('default format is xml, add --format=latex to output the list as latex source'); + writeln('-a or --all to run all the tests and show the results in xml format'); + writeln('The results can be redirected to an xml file,'); + writeln('for example: ./testrunner --all > results.xml'); + writeln('use --suite=MyTestSuiteName to run only the tests in a single test suite class'); + end; + if HasOption('l', 'list') then + begin + if HasOption('format') then + begin + if GetOptionValue('format') = 'latex' then + writeln(GetSuiteAsLatex(GetTestRegistry)) + else + writeln(GetSuiteAsXML(GetTestRegistry)); + end + else + writeln(GetSuiteAsXML(GetTestRegistry)); + end; + if HasOption('a', 'all') then + begin + doTestRun(GetTestRegistry) + end + else + if HasOption('suite') then + begin + S := ''; + S:=GetOptionValue('suite'); + if S = '' then + for I := 0 to GetTestRegistry.Tests.count - 1 do + writeln(GetTestRegistry[i].TestName) + else + for I := 0 to GetTestRegistry.Tests.count - 1 do + if GetTestRegistry[i].TestName = S then + begin + doTestRun(GetTestRegistry[i]); + end; + end; + Terminate; +end; + +Var + App : TTestRunner; + +begin + App:=TTestRunner.Create(Nil); + App.Initialize; + App.Title := 'FPCUnit Console Test Case runner.'; + App.Run; + App.Free; +end. + diff --git a/wst/tags/0.4/ws_helper/COPYING.GPL b/wst/tags/0.4/ws_helper/COPYING.GPL new file mode 100644 index 000000000..c79e32906 --- /dev/null +++ b/wst/tags/0.4/ws_helper/COPYING.GPL @@ -0,0 +1,340 @@ + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/wst/tags/0.4/ws_helper/command_line_parser.pas b/wst/tags/0.4/ws_helper/command_line_parser.pas new file mode 100644 index 000000000..957735b08 --- /dev/null +++ b/wst/tags/0.4/ws_helper/command_line_parser.pas @@ -0,0 +1,84 @@ +{ + This unit is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +} + +unit command_line_parser; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils; + +Type + + TComandLineOption = ( + cloInterface, cloProxy, cloImp, cloBinder, + cloOutPutDirRelative, cloOutPutDirAbsolute + ); + TComandLineOptions = set of TComandLineOption; + + function ParseCmdLineOptions(out AAppOptions : TComandLineOptions):Integer; + function GetOptionArg(const AOption : TComandLineOption):string; + +implementation +uses getopts; + +Var + OptionsArgsMAP : Array[TComandLineOption] of string; + +function GetOptionArg(const AOption : TComandLineOption):string; +begin + Result := OptionsArgsMAP[AOption]; +end; + +function ParseCmdLineOptions(out AAppOptions : TComandLineOptions):Integer; +var + c : Char; +begin + AAppOptions := []; + c := #0; + repeat + c := GetOpt('u:pibo:a:'); + case c of + 'u' : + begin + Include(AAppOptions,cloInterface); + OptionsArgsMAP[cloInterface] := OptArg; + end; + 'p' : Include(AAppOptions,cloProxy); + 'i' : Include(AAppOptions,cloImp); + 'b' : Include(AAppOptions,cloBinder); + 'o' : + Begin + Include(AAppOptions,cloOutPutDirRelative); + OptionsArgsMAP[cloOutPutDirRelative] := OptArg; + End; + 'a' : + Begin + Include(AAppOptions,cloOutPutDirAbsolute); + OptionsArgsMAP[cloOutPutDirAbsolute] := OptArg; + End; + end; + until ( c = EndOfOptions ); + Result := OptInd; +end; + +end. + diff --git a/wst/tags/0.4/ws_helper/generator.pas b/wst/tags/0.4/ws_helper/generator.pas new file mode 100644 index 000000000..de21b6269 --- /dev/null +++ b/wst/tags/0.4/ws_helper/generator.pas @@ -0,0 +1,2051 @@ +{ + This unit is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +} + + +unit generator; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, + parserdefs, source_utils; + +const + sWST_EXTENSION = 'wst'; + +type + + { TBaseGenerator } + + TBaseGenerator = class + Private + FSrcMngr : ISourceManager; + FCurrentStream : ISourceStream; + FSymbolTable: TSymbolTable; + Protected + procedure SetCurrentStream(AStream : ISourceStream); + procedure Indent(); + function IncIndent():Integer; + function DecIndent():Integer; + procedure BeginAutoIndent(); + procedure EndAutoIndent(); + procedure Write(AText : String);overload; + procedure Write(AText : String; Const AArgs : array of const);overload; + procedure WriteLn(AText : String);overload; + procedure WriteLn(AText : String; Const AArgs : array of const);overload; + procedure NewLine(); + + function ExtractserviceName(AIntf : TInterfaceDefinition):String; + Public + constructor Create( + ASymTable : TSymbolTable; + ASrcMngr : ISourceManager + ); + procedure Execute();virtual;abstract; + property SymbolTable : TSymbolTable Read FSymbolTable; + property SrcMngr : ISourceManager Read FSrcMngr; + End; + + { TProxyGenerator } + + TProxyGenerator = class(TBaseGenerator) + Private + FDecStream : ISourceStream; + FDecProcStream : ISourceStream; + FImpStream : ISourceStream; + + function GenerateClassName(AIntf : TInterfaceDefinition):String; + + procedure GenerateUnitHeader(); + procedure GenerateUnitImplementationHeader(); + procedure GenerateUnitImplementationFooter(); + + procedure GenerateProxyIntf(AIntf : TInterfaceDefinition); + procedure GenerateProxyImp(AIntf : TInterfaceDefinition); + + function GetDestUnitName():string; + Public + constructor Create( + ASymTable : TSymbolTable; + ASrcMngr : ISourceManager + ); + procedure Execute();override; + End; + + { TStubGenerator } + + TBinderGenerator = class(TBaseGenerator) + Private + FDecStream : ISourceStream; + FImpStream : ISourceStream; + + function GenerateClassName(AIntf : TInterfaceDefinition):String; + + procedure GenerateUnitHeader(); + procedure GenerateUnitImplementationHeader(); + procedure GenerateUnitImplementationFooter(); + + procedure GenerateIntf(AIntf : TInterfaceDefinition); + procedure GenerateImp(AIntf : TInterfaceDefinition); + + function GetDestUnitName():string; + Public + constructor Create( + ASymTable : TSymbolTable; + ASrcMngr : ISourceManager + ); + procedure Execute();override; + End; + + { TImplementationGenerator } + + TImplementationGenerator = class(TBaseGenerator) + Private + FDecStream : ISourceStream; + FImpStream : ISourceStream; + + function GenerateClassName(AIntf : TInterfaceDefinition):String; + + procedure GenerateUnitHeader(); + procedure GenerateUnitImplementationHeader(); + procedure GenerateUnitImplementationFooter(); + + procedure GenerateIntf(AIntf : TInterfaceDefinition); + procedure GenerateImp(AIntf : TInterfaceDefinition); + + function GetDestUnitName():string; + Public + constructor Create( + ASymTable : TSymbolTable; + ASrcMngr : ISourceManager + ); + procedure Execute();override; + End; + + { TInftGenerator } + + TInftGenerator = class(TBaseGenerator) + private + FDecStream : ISourceStream; + FImpStream : ISourceStream; + FImpTempStream : ISourceStream; + FImpLastStream : ISourceStream; + private + function GenerateIntfName(AIntf : TInterfaceDefinition):string; + + procedure GenerateUnitHeader(); + procedure GenerateUnitImplementationHeader(); + procedure GenerateUnitImplementationFooter(); + + procedure GenerateIntf(AIntf : TInterfaceDefinition); + procedure GenerateTypeAlias(ASymbol : TTypeAliasDefinition); + procedure GenerateClass(ASymbol : TClassTypeDefinition); + procedure GenerateEnum(ASymbol : TEnumTypeDefinition); + procedure GenerateArray(ASymbol : TArrayDefinition); + + procedure GenerateCustomMetadatas(); + function GetDestUnitName():string; + public + constructor Create( + ASymTable : TSymbolTable; + ASrcMngr : ISourceManager + ); + procedure Execute();override; + end; + + + +implementation +uses parserutils, Contnrs; + +Const sPROXY_BASE_CLASS = 'TBaseProxy'; + sBINDER_BASE_CLASS = 'TBaseServiceBinder'; + sIMP_BASE_CLASS = 'TBaseServiceImplementation'; + sSERIALIZER_CLASS = 'IFormatterClient'; + //RETURN_PARAM_NAME = 'return'; + RETURN_VAL_NAME = 'returnVal'; + sNAME_SPACE = 'sNAME_SPACE'; + sUNIT_NAME = 'sUNIT_NAME'; + + sPRM_NAME = 'strPrmName'; + sLOC_SERIALIZER = 'locSerializer'; + +{ TProxyGenerator } + +function TProxyGenerator.GenerateClassName(AIntf: TInterfaceDefinition): String; +begin + Result := ExtractserviceName(AIntf); + Result := Format('T%s_Proxy',[Result]); +end; + +procedure TProxyGenerator.GenerateUnitHeader(); +begin + SetCurrentStream(FDecStream); + WriteLn('{'); + WriteLn('This unit has been produced by ws_helper.'); + WriteLn(' Input unit name : "%s".',[SymbolTable.Name]); + WriteLn(' This unit name : "%s".',[GetDestUnitName()]); + WriteLn(' Date : "%s".',[DateTimeToStr(Now())]); + WriteLn('}'); + WriteLn(''); + WriteLn('Unit %s;',[GetDestUnitName()]); + WriteLn('{$IFDEF FPC} {$mode objfpc}{$H+} {$ENDIF}'); + WriteLn('Interface'); + WriteLn(''); + WriteLn('Uses SysUtils, Classes, TypInfo, base_service_intf, service_intf, %s;',[SymbolTable.Name]); + WriteLn(''); + WriteLn('Type'); + WriteLn(''); +end; + +procedure TProxyGenerator.GenerateUnitImplementationHeader(); +begin + SetCurrentStream(FImpStream); + WriteLn(''); + WriteLn('Implementation'); + WriteLn('uses wst_resources_imp, metadata_repository;'); +end; + +procedure TProxyGenerator.GenerateUnitImplementationFooter(); +var + s :string; +begin + SetCurrentStream(FImpStream); + NewLine(); + WriteLn('initialization'); + WriteLn(' {$i %s.%s}',[SymbolTable.Name,sWST_EXTENSION]); + NewLine(); + s := Format('Register_%s_ServiceMetadata',[SymbolTable.Name]); + WriteLn(' {$IF DECLARED(%s)}',[s]); + WriteLn(' %s();',[s]); + WriteLn(' {$IFEND}'); + WriteLn('End.'); +end; + +constructor TProxyGenerator.Create( + ASymTable : TSymbolTable; + ASrcMngr : ISourceManager +); +begin + Inherited Create(ASymTable,ASrcMngr); + FDecStream := SrcMngr.CreateItem(GetDestUnitName() + '.dec'); + FDecProcStream := SrcMngr.CreateItem(GetDestUnitName() + '.dec_proc'); + FImpStream := SrcMngr.CreateItem(GetDestUnitName() + '.imp'); +end; + +procedure TProxyGenerator.Execute(); +Var + i,c : Integer; + intf : TInterfaceDefinition; +begin + GenerateUnitHeader(); + GenerateUnitImplementationHeader(); + c := Pred(SymbolTable.Count); + For i := 0 To c Do Begin + If SymbolTable.Item[i] Is TInterfaceDefinition Then Begin + intf := SymbolTable.Item[i] As TInterfaceDefinition; + GenerateProxyIntf(intf); + GenerateProxyImp(intf); + End; + End; + GenerateUnitImplementationFooter(); + FSrcMngr.Merge(GetDestUnitName() + '.pas',[FDecStream,FDecProcStream,FImpStream]); + FDecStream := Nil; + FImpStream := Nil; +end; + +function TProxyGenerator.GetDestUnitName(): string; +begin + Result := Format('%s_proxy',[SymbolTable.Name]); +end; + +procedure TProxyGenerator.GenerateProxyIntf(AIntf: TInterfaceDefinition); + + procedure WriteDec(); + begin + Indent(); + WriteLn('%s=class(%s,%s)',[GenerateClassName(AIntf),sPROXY_BASE_CLASS,AIntf.Name]); + FDecProcStream.IncIndent(); + 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]); + finally + FDecProcStream.DecIndent(); + end; + end; + + procedure WriteMethod(AMthd : TMethodDefinition); + Var + prmCnt,k : Integer; + prm : TParameterDefinition; + Begin + Indent(); + prmCnt := AMthd.ParameterCount; + If ( AMthd.MethodType = mtProcedure ) Then + Write('procedure ') + Else Begin + Write('function '); + Dec(prmCnt); + End; + Write('%s(',[AMthd.Name]); + + If ( prmCnt > 0 ) Then Begin + IncIndent(); + For k := 0 To Pred(prmCnt) Do Begin + prm := AMthd.Parameter[k]; + If (k > 0 ) Then + Write('; '); + NewLine(); + Indent(); + Write('%s %s : %s',[ParameterModifierMAP[prm.Modifier],prm.Name,prm.DataType.Name]); + End; + DecIndent(); + NewLine(); + Indent(); + End; + + Write(')'); + If ( AMthd.MethodType = mtFunction ) Then Begin + Write(':%s',[AMthd.Parameter[prmCnt].DataType.Name]); + End; + WriteLn(';'); + End; + + procedure WriteMethods(); + Var + k : Integer; + begin + If ( AIntf.MethodCount = 0 ) Then + Exit; + //IncIndent(); + Indent(); + WriteLn('Protected'); + IncIndent(); + Indent();WriteLn('class function GetServiceType() : PTypeInfo;override;'); + For k := 0 To Pred(AIntf.MethodCount) Do + WriteMethod(AIntf.Method[k]); + DecIndent(); + //DecIndent(); + end; + +begin + SetCurrentStream(FDecStream); + NewLine(); + IncIndent(); + WriteDec(); + WriteMethods(); + Indent(); WriteLn('End;'); + DecIndent(); +end; + +procedure TProxyGenerator.GenerateProxyImp(AIntf: TInterfaceDefinition); +Var + strClassName : String; + + procedure WriteDec(); + begin + NewLine(); + WriteLn('Function wst_CreateInstance_%s(const AFormat : string; const ATransport : string):%s;',[AIntf.Name,AIntf.Name]); + WriteLn('Begin'); + IncIndent(); + try + 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]) + ] + ); + finally + DecIndent(); + end; + WriteLn('End;'); + NewLine(); + If ( AIntf.MethodCount > 0 ) Then + WriteLn('{ %s implementation }',[strClassName]); + end; + + procedure WriteMethodDec(AMthd : TMethodDefinition); + Var + prmCnt,k : Integer; + prm : TParameterDefinition; + Begin + prmCnt := AMthd.ParameterCount; + If ( AMthd.MethodType = mtProcedure ) Then + Write('procedure ') + Else Begin + Write('function '); + Dec(prmCnt); + End; + Write('%s.%s(',[strClassName,AMthd.Name]); + + If ( prmCnt > 0 ) Then Begin + IncIndent(); + For k := 0 To Pred(prmCnt) Do Begin + prm := AMthd.Parameter[k]; + If (k > 0 ) Then + Write('; '); + NewLine(); + Indent(); + Write('%s %s : %s',[ParameterModifierMAP[prm.Modifier],prm.Name,prm.DataType.Name]); + End; + DecIndent(); + NewLine(); + Indent(); + End; + + Write(')'); + If ( AMthd.MethodType = mtFunction ) Then Begin + Write(':%s',[AMthd.Parameter[prmCnt].DataType.Name]); + End; + WriteLn(';'); + End; + + procedure WriteMethodImp(AMthd : TMethodDefinition); + Var + prmCnt,k : Integer; + prm : TParameterDefinition; + Begin + IncIndent(); + WriteLn('Var'); + + Indent();WriteLn('%s : %s;',[sLOC_SERIALIZER,sSERIALIZER_CLASS]); + Indent();WriteLn('%s : %s;',[sPRM_NAME,'string']); + + WriteLn('Begin'); + + Indent();WriteLn('%s := GetSerializer();',[sLOC_SERIALIZER]); + Indent();WriteLn('Try');IncIndent(); + + Indent();WriteLn('%s.BeginCall(''%s'', GetTarget(),(Self as ICallContext));',[sLOC_SERIALIZER,AMthd.ExternalName]); + IncIndent(); + prmCnt := AMthd.ParameterCount; + If ( AMthd.MethodType = mtFunction ) Then + Dec(prmCnt); + For k := 0 To Pred(prmCnt) Do Begin + prm := AMthd.Parameter[k]; + If ( prm.Modifier <> pmOut ) Then Begin + Indent();WriteLn('%s.Put(%s, TypeInfo(%s), %s);',[sLOC_SERIALIZER,QuotedStr(prm.ExternalName),prm.DataType.Name,prm.Name]); + End; + End; + DecIndent(); + Indent();WriteLn('%s.EndCall();',[sLOC_SERIALIZER]); + + WriteLn(''); + Indent();WriteLn('MakeCall();'); + WriteLn(''); + + Indent();WriteLn('%s.BeginCallRead((Self as ICallContext));',[sLOC_SERIALIZER]); + IncIndent(); + k:= Pred(AMthd.ParameterCount); + If ( AMthd.MethodType = mtFunction ) Then Begin + prm := AMthd.Parameter[k]; + //Indent();WriteLn('%s := TypeInfo(%s);',[sRES_TYPE_INFO,prm.DataType.Name]); + if prm.DataType.NeedFinalization() then begin + if prm.DataType.InheritsFrom(TClassTypeDefinition) or + prm.DataType.InheritsFrom(TArrayDefinition) + then begin + Indent();WriteLn('TObject(Result) := Nil;'); + end else begin + Indent();WriteLn('If ( PTypeInfo(TypeInfo(%s))^.Kind in [tkClass,tkInterface] ) Then',[prm.DataType.Name]); + IncIndent(); + Indent();WriteLn('Pointer(Result) := Nil;'); + DecIndent(); + end; + end; + Indent();WriteLn('%s := %s;',[sPRM_NAME,QuotedStr(prm.ExternalName)]);//Indent();WriteLn('%s := %s;',[sPRM_NAME,QuotedStr(RETURN_PARAM_NAME)]); + Indent();WriteLn('%s.Get(TypeInfo(%s), %s, %s);',[sLOC_SERIALIZER,prm.DataType.Name,sPRM_NAME,'Result']); + End; + //-------------------------------- + for k := 0 to Pred(prmCnt) do begin + prm := AMthd.Parameter[k]; + if ( prm.Modifier = pmOut ) then begin + if prm.DataType.NeedFinalization() then begin + if prm.DataType.InheritsFrom(TClassTypeDefinition) or + prm.DataType.InheritsFrom(TArrayDefinition) + then begin + Indent();WriteLn('TObject(%s) := Nil;',[prm.Name]); + end else begin + Indent();WriteLn('If ( PTypeInfo(TypeInfo(%s))^.Kind in [tkClass,tkInterface] ) Then',[prm.DataType.Name]); + IncIndent(); + Indent();WriteLn('Pointer(%s) := Nil;',[prm.Name]); + DecIndent(); + end; + end; + end; + end; + //-------------------------------- + + For k := 0 To Pred(prmCnt) Do Begin + prm := AMthd.Parameter[k]; + If ( prm.Modifier In [pmVar, pmOut] ) Then Begin + Indent();WriteLn('%s := %s;',[sPRM_NAME,QuotedStr(prm.ExternalName)]); + Indent();WriteLn('%s.Get(TypeInfo(%s), %s, %s);',[sLOC_SERIALIZER,prm.DataType.Name,sPRM_NAME,prm.Name]); + End; + End; + DecIndent(); + + + WriteLn(''); + DecIndent(); + Indent();WriteLn('Finally'); + IncIndent(); + Indent();WriteLn('%s.Clear();',[sLOC_SERIALIZER]); + DecIndent(); + Indent();WriteLn('End;');DecIndent(); + + WriteLn('End;'); + End; + + procedure WriteTypeInfoMethod(); + begin + NewLine(); + WriteLn('class function %s.GetServiceType() : PTypeInfo;',[strClassName]); + WriteLn('begin'); + IncIndent(); + Indent(); WriteLn('result := TypeInfo(%s);',[AIntf.Name]); + DecIndent(); + WriteLn('end;'); + NewLine(); + end; + + procedure WriteMethods(); + Var + k : Integer; + begin + WriteTypeInfoMethod(); + For k := 0 To Pred(AIntf.MethodCount) Do Begin + WriteMethodDec(AIntf.Method[k]); + WriteMethodImp(AIntf.Method[k]); + WriteLn(''); + End; + end; + +begin + SetCurrentStream(FImpStream); + IncIndent(); + While ( DecIndent() > 0 ) Do + ; + strClassName := GenerateClassName(AIntf); + NewLine(); + WriteDec(); + WriteMethods(); +end; + + +{ TBaseGenerator } + +procedure TBaseGenerator.SetCurrentStream(AStream: ISourceStream); +begin + FCurrentStream := AStream; +end; + +procedure TBaseGenerator.Indent(); +begin + FCurrentStream.Indent(); +end; + +function TBaseGenerator.IncIndent():Integer; +begin + Result := FCurrentStream.IncIndent(); +end; + +function TBaseGenerator.DecIndent():Integer; +begin + Result := FCurrentStream.DecIndent(); +end; + +procedure TBaseGenerator.BeginAutoIndent(); +begin + FCurrentStream.BeginAutoIndent(); +end; + +procedure TBaseGenerator.EndAutoIndent(); +begin + FCurrentStream.EndAutoIndent(); +end; + +procedure TBaseGenerator.Write(AText: String); +begin + FCurrentStream.Write(AText); +end; + +procedure TBaseGenerator.Write(AText: String; const AArgs: array of const); +begin + Write(Format(AText,AArgs)); +end; + +procedure TBaseGenerator.WriteLn(AText: String); +begin + Write(AText+sNEW_LINE); +end; + +procedure TBaseGenerator.WriteLn(AText: String; const AArgs: array of const); +begin + Write(AText+sNEW_LINE,AArgs); +end; + +procedure TBaseGenerator.NewLine(); +begin + WriteLn(''); +end; + +function TBaseGenerator.ExtractserviceName(AIntf: TInterfaceDefinition): String; +begin + Result := AIntf.Name; + If upCase(Result[1]) = 'I' Then + Delete(Result,1,1); +end; + +constructor TBaseGenerator.Create(ASymTable: TSymbolTable; ASrcMngr: ISourceManager); +begin + Assert(Assigned(ASymTable)); + Assert(Assigned(ASrcMngr)); + FSrcMngr :=ASrcMngr; + FCurrentStream := Nil; + FSymbolTable := ASymTable; +end; + +{ TBinderGenerator } + +function TBinderGenerator.GenerateClassName(AIntf: TInterfaceDefinition): String; +begin + Result := ExtractserviceName(AIntf); + Result := Format('T%s_ServiceBinder',[Result]); +end; + +procedure TBinderGenerator.GenerateUnitHeader(); +begin + SetCurrentStream(FDecStream); + WriteLn('{'); + WriteLn('This unit has been produced by ws_helper.'); + WriteLn(' Input unit name : "%s".',[SymbolTable.Name]); + WriteLn(' This unit name : "%s".',[GetDestUnitName()]); + WriteLn(' Date : "%s".',[DateTimeToStr(Now())]); + WriteLn('}'); + + WriteLn('unit %s;',[GetDestUnitName()]); + WriteLn('{$IFDEF FPC} {$mode objfpc}{$H+} {$ENDIF}'); + WriteLn('interface'); + WriteLn(''); + WriteLn('uses SysUtils, Classes, base_service_intf, server_service_intf, %s;',[SymbolTable.Name]); + WriteLn(''); + WriteLn('type'); + WriteLn(''); +end; + +procedure TBinderGenerator.GenerateUnitImplementationHeader(); +begin + SetCurrentStream(FImpStream); + WriteLn(''); + WriteLn('Implementation'); + WriteLn('uses TypInfo, wst_resources_imp,metadata_repository;'); +end; + +procedure TBinderGenerator.GenerateUnitImplementationFooter(); +var + s :string; +begin + NewLine(); + WriteLn('initialization'); + NewLine(); + s := Format('Register_%s_NameSpace',[SymbolTable.Name]); + WriteLn(' {$IF DECLARED(%s)}',[s]); + WriteLn(' %s();',[s]); + WriteLn(' {$ENDIF}'); + NewLine(); + WriteLn(' {$i %s.%s}',[SymbolTable.Name,sWST_EXTENSION]); + NewLine(); + WriteLn('End.'); +end; + +procedure TBinderGenerator.GenerateIntf(AIntf: TInterfaceDefinition); + procedure WriteDec(); + begin + Indent(); + WriteLn('%s=class(%s)',[GenerateClassName(AIntf),sBINDER_BASE_CLASS]); + end; + + procedure WriteConstructor(); + Begin + Indent(); + WriteLn('constructor Create();') + End; + + procedure WriteMethod(AMthd : TMethodDefinition); + Begin + Indent(); + WriteLn('procedure %sHandler(AFormatter:IFormatterResponse);',[AMthd.Name]) + End; + + procedure WriteMethods(); + Var + k : Integer; + begin + If ( AIntf.MethodCount = 0 ) Then + Exit; + Indent();WriteLn('Protected'); + IncIndent(); + For k := 0 To Pred(AIntf.MethodCount) Do + WriteMethod(AIntf.Method[k]); + DecIndent(); + + Indent();WriteLn('Public'); + Indent();WriteConstructor(); + end; + + procedure GenerateFactoryClass(); + Begin + NewLine(); + IncIndent();BeginAutoIndent(); + WriteLn('T%s_ServiceBinderFactory = class(TInterfacedObject,IItemFactory)',[ExtractserviceName(AIntf)]); + WriteLn('protected'); + + IncIndent(); + WriteLn('function CreateInstance():IInterface;'); + DecIndent(); + WriteLn('End;'); + DecIndent();EndAutoIndent(); + End; + + procedure GenerateRegistrationProc(); + Begin + NewLine(); + BeginAutoIndent(); + IncIndent(); + WriteLn('procedure Server_service_Register%sService();',[ExtractserviceName(AIntf)]); + DecIndent(); + EndAutoIndent(); + End; + +begin + SetCurrentStream(FDecStream); + NewLine(); + IncIndent(); + WriteDec(); + WriteMethods(); + Indent();WriteLn('End;'); + DecIndent(); + + GenerateFactoryClass(); + GenerateRegistrationProc(); +end; + +procedure TBinderGenerator.GenerateImp(AIntf: TInterfaceDefinition); +Var + strClassName : String; + + procedure WriteDec(); + begin + If ( AIntf.MethodCount > 0 ) Then + WriteLn('{ %s implementation }',[strClassName]); + end; + + procedure WriteMethodDec(AMthd : TMethodDefinition); + Begin + WriteLn('procedure %s.%sHandler(AFormatter:IFormatterResponse);',[strClassName,AMthd.Name]); + End; + + procedure WriteMethodImp(AMthd : TMethodDefinition); + Var + prmCnt,k : Integer; + prm : TParameterDefinition; + strBuff : string; + Begin + prmCnt := AMthd.ParameterCount; + If ( AMthd.MethodType = mtFunction ) Then + Dec(prmCnt); + + WriteLn('Var'); + IncIndent();BeginAutoIndent(); + WriteLn('cllCntrl : ICallControl;'); + WriteLn('tmpObj : %s;',[AIntf.Name]); + WriteLn('callCtx : ICallContext;'); + If ( prmCnt > 0 ) Or ( AMthd.MethodType = mtFunction ) Then Begin + WriteLn('%s : string;',[sPRM_NAME]); + WriteLn('procName,trgName : string;'); + End; + If ( prmCnt > 0 ) Then Begin + For k := 0 To Pred(prmCnt) Do Begin + prm := AMthd.Parameter[k]; + WriteLn('%s : %s;',[prm.Name,prm.DataType.Name]); + End; + End; + If ( AMthd.MethodType = mtFunction ) Then Begin + WriteLn('%s : %s;',[RETURN_VAL_NAME,AMthd.Parameter[prmCnt].DataType.Name]); + //WriteLn('%s : %s;',[sLOC_TYPE_INFO,'PTypeInfo']); + End; + DecIndent();EndAutoIndent(); + + WriteLn('Begin'); + IncIndent();BeginAutoIndent(); + + WriteLn('callCtx := GetCallContext();'); + If ( AMthd.MethodType = mtFunction ) Then Begin + prm := AMthd.Parameter[prmCnt]; + If prm.DataType.NeedFinalization() Then Begin + if prm.DataType.InheritsFrom(TClassTypeDefinition) then begin + WriteLn('TObject(%s) := Nil;',[RETURN_VAL_NAME]); + end else begin + WriteLn('If ( PTypeInfo(TypeInfo(%s))^.Kind in [tkClass,tkInterface] ) Then',[prm.DataType.Name]); + IncIndent(); + WriteLn('Pointer(%s) := Nil;',[RETURN_VAL_NAME]); + DecIndent(); + end; + End; + End; + + For k := 0 To Pred(prmCnt) Do Begin + prm := AMthd.Parameter[k]; + If prm.DataType.NeedFinalization() Then Begin + if prm.DataType.InheritsFrom(TClassTypeDefinition) then begin + WriteLn('TObject(%s) := Nil;',[prm.Name]); + end else begin + WriteLn('If ( PTypeInfo(TypeInfo(%s))^.Kind in [tkClass,tkObject,tkInterface] ) Then',[prm.DataType.Name]); + IncIndent(); + WriteLn('Pointer(%s) := Nil;',[prm.Name]); + DecIndent(); + end; + End; + End; + + NewLine(); + For k := 0 To Pred(prmCnt) Do Begin + prm := AMthd.Parameter[k]; + Write('%s := %s;',[sPRM_NAME,QuotedStr(prm.ExternalName)]); + WriteLn('AFormatter.Get(TypeInfo(%s),%s,%s);',[prm.DataType.Name,sPRM_NAME,prm.Name]); + If prm.DataType.NeedFinalization() Then Begin + if prm.DataType.InheritsFrom(TClassTypeDefinition) then begin + WriteLn('If Assigned(Pointer(%s)) Then',[prm.Name]); + IncIndent(); + WriteLn('callCtx.AddObjectToFree(TObject(%s));',[prm.Name]); + DecIndent(); + end else begin + WriteLn('If ( PTypeInfo(TypeInfo(%s))^.Kind = tkClass ) And Assigned(Pointer(%s)) Then',[prm.DataType.Name,prm.Name]); + IncIndent(); + WriteLn('callCtx.AddObjectToFree(TObject(%s));',[prm.Name]); + DecIndent(); + end; + End; + End; + + NewLine(); + WriteLn('tmpObj := Self.GetFactory().CreateInstance() as %s;',[AIntf.Name]); + WriteLn('if Supports(tmpObj,ICallControl,cllCntrl) then'); + Indent();WriteLn('cllCntrl.SetCallContext(GetCallContext());'); + NewLine(); + + If ( AMthd.MethodType = mtFunction ) Then + Write('%s := tmpObj.%s(',[RETURN_VAL_NAME,AMthd.Name]) + Else + Write('tmpObj.%s(',[AMthd.Name]); + strBuff := ''; + For k := 0 To Pred(prmCnt) Do Begin + prm := AMthd.Parameter[k]; + strBuff := strBuff + Format('%s,',[prm.Name]); + End; + If ( prmCnt > 0 ) Then + Delete(strBuff,Length(strBuff),1); + strBuff := strBuff + ');'; + EndAutoIndent(); + WriteLn(strBuff); + BeginAutoIndent(); + + If ( AMthd.MethodType = mtFunction ) Then Begin + prm := AMthd.Parameter[prmCnt]; + If prm.DataType.NeedFinalization() Then Begin + if prm.DataType.InheritsFrom(TClassTypeDefinition) then + WriteLn('If Assigned(TObject(%s)) Then',[RETURN_VAL_NAME]) + else + WriteLn('If ( PTypeInfo(TypeInfo(%s))^.Kind = tkClass ) And Assigned(Pointer(%s)) Then',[prm.DataType.Name,RETURN_VAL_NAME]); + IncIndent(); + WriteLn('callCtx.AddObjectToFree(TObject(%s));',[RETURN_VAL_NAME]); + DecIndent(); + End; + End; + NewLine(); + + WriteLn('procName := AFormatter.GetCallProcedureName();'); + WriteLn('trgName := AFormatter.GetCallTarget();'); + WriteLn('AFormatter.Clear();'); + + WriteLn('AFormatter.BeginCallResponse(procName,trgName);'); + IncIndent(); + if ( AMthd.MethodType = mtFunction ) then begin + //WriteLn('AFormatter.Put(%s,TypeInfo(%s),%s);',[QuotedStr(RETURN_PARAM_NAME),AMthd.Parameter[prmCnt].DataType.Name,RETURN_VAL_NAME]); + WriteLn('AFormatter.Put(%s,TypeInfo(%s),%s);',[QuotedStr(prm.ExternalName),AMthd.Parameter[prmCnt].DataType.Name,RETURN_VAL_NAME]); + end; + For k := 0 To Pred(prmCnt) Do Begin + prm := AMthd.Parameter[k]; + If ( prm.Modifier In [pmOut,pmVar] ) Then + WriteLn('AFormatter.Put(%s,TypeInfo(%s),%s);',[QuotedStr(prm.ExternalName),prm.DataType.Name,prm.Name]); + End; + DecIndent(); + WriteLn('AFormatter.EndCallResponse();'); + NewLine(); + WriteLn('callCtx := Nil;'); + + DecIndent();EndAutoIndent(); + WriteLn('End;'); + End; + + procedure WriteConstructor(); + Var + k : Integer; + mtd : TMethodDefinition; + Begin + NewLine(); + WriteLn('constructor %s.Create();',[strClassName]); + WriteLn('Begin'); + IncIndent(); + BeginAutoIndent(); + WriteLn('Inherited Create(GetServiceImplementationRegistry().FindFactory(%s));',[QuotedStr(AIntf.Name)]); + For k := 0 To Pred(AIntf.MethodCount) Do Begin + mtd := AIntf.Method[k]; + WriteLn('RegisterVerbHandler(%s,@%sHandler);',[QuotedStr(mtd.Name),mtd.Name]); + End; + EndAutoIndent(); + DecIndent(); + WriteLn('End;'); + NewLine(); + End; + + procedure WriteMethods(); + Var + k : Integer; + begin + For k := 0 To Pred(AIntf.MethodCount) Do Begin + WriteMethodDec(AIntf.Method[k]); + WriteMethodImp(AIntf.Method[k]); + WriteLn(''); + End; + WriteConstructor(); + end; + + procedure GenerateFactoryClass(); + Var + strBuff : string; + Begin + NewLine(); + BeginAutoIndent(); + strBuff := Format('T%s_ServiceBinderFactory',[ExtractserviceName(AIntf)]); + WriteLn('{ %s }',[strBuff]); + WriteLn('function %s.CreateInstance():IInterface;',[strBuff]); + WriteLn('Begin'); + IncIndent(); + WriteLn('Result := %s.Create() as IInterface;',[strClassName]); + DecIndent(); + WriteLn('End;'); + EndAutoIndent(); + End; + + procedure GenerateRegistrationProc(); + Var + strBuff : string; + Begin + NewLine(); + BeginAutoIndent(); + strBuff := ExtractserviceName(AIntf); + NewLine(); + WriteLn('procedure Server_service_Register%sService();',[strBuff]); + WriteLn('Begin'); + IncIndent(); + WriteLn('GetServerServiceRegistry().Register(%s,T%s_ServiceBinderFactory.Create() as IItemFactory);',[QuotedStr(AIntf.Name),strBuff]); + DecIndent(); + WriteLn('End;'); + EndAutoIndent(); + End; + +begin + SetCurrentStream(FImpStream); + IncIndent(); + While ( DecIndent() > 0 ) Do + ; + strClassName := GenerateClassName(AIntf); + NewLine(); + WriteDec(); + WriteMethods(); + + GenerateFactoryClass(); + GenerateRegistrationProc(); +end; + +function TBinderGenerator.GetDestUnitName(): string; +begin + Result := Format('%s_binder',[SymbolTable.Name]); +end; + +constructor TBinderGenerator.Create(ASymTable: TSymbolTable;ASrcMngr: ISourceManager); +begin + Inherited Create(ASymTable,ASrcMngr); + FDecStream := SrcMngr.CreateItem(GetDestUnitName() + '.dec'); + FImpStream := SrcMngr.CreateItem(GetDestUnitName() + '.imp'); +end; + +procedure TBinderGenerator.Execute(); +Var + i,c : Integer; + intf : TInterfaceDefinition; +begin + GenerateUnitHeader(); + GenerateUnitImplementationHeader(); + c := Pred(SymbolTable.Count); + For i := 0 To c Do Begin + If SymbolTable.Item[i] Is TInterfaceDefinition Then Begin + intf := SymbolTable.Item[i] As TInterfaceDefinition; + GenerateIntf(intf); + GenerateImp(intf); + End; + End; + GenerateUnitImplementationFooter(); + FSrcMngr.Merge(GetDestUnitName() + '.pas',[FDecStream,FImpStream]); + FDecStream := Nil; + FImpStream := Nil; +end; + +{ TImplementationGenerator } + +function TImplementationGenerator.GenerateClassName(AIntf: TInterfaceDefinition): String; +begin + Result := ExtractserviceName(AIntf); + Result := Format('T%s_ServiceImp',[Result]); +end; + +procedure TImplementationGenerator.GenerateUnitHeader(); +begin + SetCurrentStream(FDecStream); + WriteLn('{'); + WriteLn('This unit has been produced by ws_helper.'); + WriteLn(' Input unit name : "%s".',[SymbolTable.Name]); + WriteLn(' This unit name : "%s".',[GetDestUnitName()]); + WriteLn(' Date : "%s".',[DateTimeToStr(Now())]); + WriteLn('}'); + + WriteLn('Unit %s;',[GetDestUnitName()]); + WriteLn('{$IFDEF FPC} {$mode objfpc}{$H+} {$ENDIF}'); + WriteLn('Interface'); + WriteLn(''); + WriteLn('Uses SysUtils, Classes, '); + WriteLn(' base_service_intf, server_service_intf, server_service_imputils, %s;',[SymbolTable.Name]); + WriteLn(''); + WriteLn('Type'); + WriteLn(''); +end; + +procedure TImplementationGenerator.GenerateUnitImplementationHeader(); +begin + SetCurrentStream(FImpStream); + WriteLn(''); + WriteLn('Implementation'); +end; + +procedure TImplementationGenerator.GenerateUnitImplementationFooter(); +begin + NewLine(); + WriteLn('End.'); +end; + +procedure TImplementationGenerator.GenerateIntf(AIntf: TInterfaceDefinition); + procedure WriteDec(); + begin + Indent(); + WriteLn('%s=class(%s,%s)',[GenerateClassName(AIntf),sIMP_BASE_CLASS,AIntf.Name]); + end; + + procedure WriteMethod(AMthd : TMethodDefinition); + Var + prmCnt,k : Integer; + prm : TParameterDefinition; + Begin + Indent(); + prmCnt := AMthd.ParameterCount; + If ( AMthd.MethodType = mtProcedure ) Then + Write('procedure ') + Else Begin + Write('function '); + Dec(prmCnt); + End; + Write('%s(',[AMthd.Name]); + + If ( prmCnt > 0 ) Then Begin + IncIndent(); + For k := 0 To Pred(prmCnt) Do Begin + prm := AMthd.Parameter[k]; + If (k > 0 ) Then + Write('; '); + NewLine(); + Indent(); + Write('%s %s : %s',[ParameterModifierMAP[prm.Modifier],prm.Name,prm.DataType.Name]); + End; + DecIndent(); + NewLine(); + Indent(); + End; + + Write(')'); + If ( AMthd.MethodType = mtFunction ) Then Begin + Write(':%s',[AMthd.Parameter[prmCnt].DataType.Name]); + End; + WriteLn(';'); + End; + + procedure WriteMethods(); + Var + k : Integer; + begin + If ( AIntf.MethodCount = 0 ) Then + Exit; + Indent();WriteLn('Protected'); + IncIndent(); + For k := 0 To Pred(AIntf.MethodCount) Do + WriteMethod(AIntf.Method[k]); + DecIndent(); + end; + + procedure GenerateRegistrationProc(); + Begin + NewLine(); + BeginAutoIndent(); + IncIndent(); + WriteLn('procedure Register%sImplementationFactory();',[ExtractserviceName(AIntf)]); + DecIndent(); + EndAutoIndent(); + End; + +begin + SetCurrentStream(FDecStream); + NewLine(); + IncIndent(); + WriteDec(); + WriteMethods(); + Indent(); WriteLn('End;'); + NewLine(); + DecIndent(); + + GenerateRegistrationProc(); +end; + +procedure TImplementationGenerator.GenerateImp(AIntf: TInterfaceDefinition); +Var + strClassName : String; + + procedure WriteDec(); + begin + If ( AIntf.MethodCount > 0 ) Then + WriteLn('{ %s implementation }',[strClassName]); + end; + + procedure WriteMethodDec(AMthd : TMethodDefinition); + Var + prmCnt,k : Integer; + prm : TParameterDefinition; + Begin + prmCnt := AMthd.ParameterCount; + If ( AMthd.MethodType = mtProcedure ) Then + Write('procedure ') + Else Begin + Write('function '); + Dec(prmCnt); + End; + Write('%s.%s(',[strClassName,AMthd.Name]); + + If ( prmCnt > 0 ) Then Begin + IncIndent(); + For k := 0 To Pred(prmCnt) Do Begin + prm := AMthd.Parameter[k]; + If (k > 0 ) Then + Write('; '); + NewLine(); + Indent(); + Write('%s %s : %s',[ParameterModifierMAP[prm.Modifier],prm.Name,prm.DataType.Name]); + End; + DecIndent(); + NewLine(); + Indent(); + End; + + Write(')'); + If ( AMthd.MethodType = mtFunction ) Then Begin + Write(':%s',[AMthd.Parameter[prmCnt].DataType.Name]); + End; + WriteLn(';'); + End; + + procedure WriteMethodImp(AMthd : TMethodDefinition); + Begin + WriteLn('Begin'); + WriteLn('// your code here'); + WriteLn('End;'); + End; + + procedure WriteMethods(); + Var + k : Integer; + begin + For k := 0 To Pred(AIntf.MethodCount) Do Begin + WriteMethodDec(AIntf.Method[k]); + WriteMethodImp(AIntf.Method[k]); + WriteLn(''); + End; + end; + + procedure GenerateRegistrationProc(); + Var + strBuff : string; + Begin + NewLine(); + BeginAutoIndent(); + strBuff := ExtractserviceName(AIntf); + NewLine(); + WriteLn('procedure Register%sImplementationFactory();',[strBuff]); + WriteLn('Begin'); + IncIndent(); + WriteLn('GetServiceImplementationRegistry().Register(%s,TImplementationFactory.Create(%s) as IServiceImplementationFactory);',[QuotedStr(AIntf.Name),strClassName]); + DecIndent(); + WriteLn('End;'); + EndAutoIndent(); + End; + +begin + SetCurrentStream(FImpStream); + IncIndent(); + While ( DecIndent() > 0 ) Do + ; + strClassName := GenerateClassName(AIntf); + NewLine(); + WriteDec(); + WriteMethods(); + + GenerateRegistrationProc(); +end; + +function TImplementationGenerator.GetDestUnitName(): string; +begin + Result := Format('%s_imp',[SymbolTable.Name]); +end; + +constructor TImplementationGenerator.Create(ASymTable: TSymbolTable;ASrcMngr: ISourceManager); +begin + Inherited Create(ASymTable,ASrcMngr); + FDecStream := SrcMngr.CreateItem(GetDestUnitName() + '.dec'); + FImpStream := SrcMngr.CreateItem(GetDestUnitName() + '.imp'); +end; + +procedure TImplementationGenerator.Execute(); +Var + i,c : Integer; + intf : TInterfaceDefinition; +begin + GenerateUnitHeader(); + GenerateUnitImplementationHeader(); + c := Pred(SymbolTable.Count); + For i := 0 To c Do Begin + If SymbolTable.Item[i] Is TInterfaceDefinition Then Begin + intf := SymbolTable.Item[i] As TInterfaceDefinition; + GenerateIntf(intf); + GenerateImp(intf); + End; + End; + GenerateUnitImplementationFooter(); + FSrcMngr.Merge(GetDestUnitName() + '.pas',[FDecStream,FImpStream]); + FDecStream := Nil; + FImpStream := Nil; +end; + +{ TInftGenerator } + +function TInftGenerator.GenerateIntfName(AIntf: TInterfaceDefinition): string; +begin + Result := ExtractserviceName(AIntf); +end; + +procedure TInftGenerator.GenerateUnitHeader(); +begin + SetCurrentStream(FDecStream); + WriteLn('{'); + WriteLn('This unit has been produced by ws_helper.'); + WriteLn(' Input unit name : "%s".',[SymbolTable.Name]); + WriteLn(' This unit name : "%s".',[GetDestUnitName()]); + WriteLn(' Date : "%s".',[DateTimeToStr(Now())]); + WriteLn('}'); + + WriteLn('unit %s;',[GetDestUnitName()]); + WriteLn('{$IFDEF FPC} {$mode objfpc}{$H+} {$ENDIF}'); + WriteLn('interface'); + WriteLn(''); + WriteLn('uses SysUtils, Classes, TypInfo, base_service_intf, service_intf;'); + WriteLn(''); + WriteLn('const'); + + IncIndent(); + Indent();WriteLn('sNAME_SPACE = %s;',[QuotedStr(FSymbolTable.ExternalName)]); + Indent();WriteLn('sUNIT_NAME = %s;',[QuotedStr(FSymbolTable.Name)]); + DecIndent(); + + WriteLn(''); + WriteLn('type'); + WriteLn(''); +end; + +procedure TInftGenerator.GenerateUnitImplementationHeader(); +begin + SetCurrentStream(FImpStream); + WriteLn(''); + WriteLn('Implementation'); + WriteLn('uses metadata_repository;'); + FImpTempStream.WriteLn('initialization'); +end; + +procedure TInftGenerator.GenerateUnitImplementationFooter(); +begin + SetCurrentStream(FImpStream); + NewLine(); + NewLine(); + FImpTempStream.NewLine(); + FImpLastStream.NewLine(); + FImpLastStream.WriteLn('End.'); +end; + +procedure TInftGenerator.GenerateIntf(AIntf: TInterfaceDefinition); + + procedure WriteDec(); + begin + Indent(); + WriteLn('%s = interface(IInvokable)',[GenerateIntfName(AIntf)]); + if not IsStrEmpty(AIntf.InterfaceGUID) then begin + Indent();Indent();WriteLn('[%s]',[QuotedStr(AIntf.InterfaceGUID)]); + end; + end; + + procedure WriteMethod(AMthd : TMethodDefinition); + Var + prmCnt,k : Integer; + prm : TParameterDefinition; + Begin + Indent(); + prmCnt := AMthd.ParameterCount; + If ( AMthd.MethodType = mtProcedure ) Then + Write('procedure ') + Else Begin + Write('function '); + Dec(prmCnt); + End; + Write('%s(',[AMthd.Name]); + + If ( prmCnt > 0 ) Then Begin + IncIndent(); + For k := 0 To Pred(prmCnt) Do Begin + prm := AMthd.Parameter[k]; + If (k > 0 ) Then + Write('; '); + NewLine(); + Indent(); + Write('%s %s : %s',[ParameterModifierMAP[prm.Modifier],prm.Name,prm.DataType.Name]); + End; + DecIndent(); + NewLine(); + Indent(); + End; + + Write(')'); + If ( AMthd.MethodType = mtFunction ) Then Begin + Write(':%s',[AMthd.Parameter[prmCnt].DataType.Name]); + End; + WriteLn(';'); + End; + + procedure WriteMethods(); + Var + k : Integer; + begin + If ( AIntf.MethodCount = 0 ) Then + Exit; + IncIndent(); + For k := 0 To Pred(AIntf.MethodCount) Do + WriteMethod(AIntf.Method[k]); + DecIndent(); + end; + +begin + SetCurrentStream(FDecStream); + NewLine(); + IncIndent(); + WriteDec(); + WriteMethods(); + Indent(); WriteLn('end;'); + DecIndent(); +end; + +procedure TInftGenerator.GenerateTypeAlias(ASymbol: TTypeAliasDefinition); +begin + try + SetCurrentStream(FDecStream); + NewLine(); + IncIndent(); + Indent(); + WriteLn('%s = type %s;',[ASymbol.Name,ASymbol.BaseType.Name]); + DecIndent(); + except + on e : Exception do + System.WriteLn('TInftGenerator.GenerateTypeAlias()=', ASymbol.Name, ' ;; ', e.Message); + end; +end; + +procedure TInftGenerator.GenerateClass(ASymbol: TClassTypeDefinition); +var + locClassPropNbr, locStoredPropsNbr, locArrayPropsNbr : Integer; + loc_BaseComplexSimpleContentRemotable : TClassTypeDefinition; + + procedure Prepare(); + var + k : Integer; + p : TPropertyDefinition; + begin + locClassPropNbr := 0; + locStoredPropsNbr := 0; + locArrayPropsNbr := 0; + for k := 0 to Pred(ASymbol.PropertyCount) do begin + p := ASymbol.Properties[k]; + if ( p.StorageOption = soOptional ) then + Inc(locStoredPropsNbr); + if p.DataType.InheritsFrom(TClassTypeDefinition) then + Inc(locClassPropNbr); + if p.DataType.InheritsFrom(TArrayDefinition) then + Inc(locArrayPropsNbr); + end; + locClassPropNbr := locClassPropNbr + locArrayPropsNbr; + end; + + procedure WriteDec(); + var + s : string; + begin + if Assigned(ASymbol.Parent) then begin + {if ASymbol.Parent.InheritsFrom(TNativeSimpleTypeDefinition) and + Assigned(TNativeSimpleTypeDefinition(ASymbol.Parent).BoxedType) + then begin + s := Format('%s',[TNativeSimpleTypeDefinition(ASymbol.Parent).BoxedType.Name]); + end else begin + s := Format('%s',[ASymbol.Parent.Name]); + end;} + s := Format('%s',[ASymbol.Parent.Name]); + end else begin + s := 'XX';//'TBaseComplexRemotable'; + end; + Indent(); + WriteLn('%s = class(%s)',[ASymbol.Name,s]); + end; + + procedure WritePropertyField(AProp : TPropertyDefinition); + begin + Indent(); + WriteLn('F%s : %s;',[AProp.Name,AProp.DataType.Name]); + End; + + procedure WriteProperty(AProp : TPropertyDefinition); + var + propName, locStore : string; + begin + propName := AProp.Name; + case AProp.StorageOption of + soAlways : locStore := ''; + soNever : locStore := ' stored False'; + soOptional : locStore := Format(' stored Has%s',[AProp.Name]); + end; + Indent(); + WriteLn('property %s : %s read F%s write F%s%s;',[propName,AProp.DataType.Name,propName,propName,locStore]); + if not AnsiSameText(AProp.Name,AProp.ExternalName) then begin + FImpLastStream.Indent(); + FImpLastStream.WriteLn('GetTypeRegistry().ItemByTypeInfo[TypeInfo(%s)].RegisterExternalPropertyName(%s,%s);',[ASymbol.Name,QuotedStr(AProp.Name),QuotedStr(AProp.ExternalName)]); + end; + if AProp.IsAttribute then begin + FImpLastStream.Indent(); + FImpLastStream.WriteLn('%s.RegisterAttributeProperty(%s);',[ASymbol.Name,QuotedStr(AProp.Name)]); + end; + end; + + procedure WriteProperties(); + Var + k : Integer; + p : TPropertyDefinition; + begin + If ( ASymbol.PropertyCount > 0 ) Then begin + Indent(); + WriteLn('private'); + IncIndent(); + for k := 0 to Pred(ASymbol.PropertyCount) do begin + p := ASymbol.Properties[k]; + WritePropertyField(p); + end; + DecIndent(); + // + if ( locStoredPropsNbr > 0 ) then begin + Indent(); + WriteLn('private'); + IncIndent(); + for k := 0 to Pred(ASymbol.PropertyCount) do begin + p := ASymbol.Properties[k]; + if ( p.StorageOption = soOptional ) then begin + Indent(); + WriteLn('function Has%s() : Boolean;',[p.Name]); + end; + end; + DecIndent(); + end; + // + if ( locArrayPropsNbr > 0 ) or ( locClassPropNbr > 0 ) then begin + Indent(); + WriteLn('public'); + end; + if ( locArrayPropsNbr > 0 ) then begin + IncIndent(); + Indent(); WriteLn('constructor Create();override;'); + DecIndent(); + end; + + if ( locClassPropNbr > 0 ) then begin + IncIndent(); + Indent(); WriteLn('destructor Destroy();override;'); + DecIndent(); + end; + // + Indent(); + WriteLn('published'); + IncIndent(); + For k := 0 To Pred(ASymbol.PropertyCount) Do + WriteProperty(ASymbol.Properties[k]); + DecIndent(); + end; + end; + + procedure WriteImp(); + var + k : Integer; + p : TPropertyDefinition; + begin + if ( locClassPropNbr > 0 ) or ( locStoredPropsNbr > 0 ) then begin + NewLine(); + WriteLn('{ %s }',[ASymbol.Name]); + + if ( locArrayPropsNbr > 0 ) then begin + NewLine(); + WriteLn('constructor %s.Create();',[ASymbol.Name]); + WriteLn('begin'); + IncIndent(); + Indent(); + WriteLn('inherited Create();'); + for k := 0 to Pred(ASymbol.PropertyCount) do begin + p := ASymbol.Properties[k]; + if p.DataType.InheritsFrom(TArrayDefinition) then begin + Indent(); + WriteLn('F%s := %s.Create();',[p.Name,p.DataType.Name]); + end; + end; + DecIndent(); + WriteLn('end;'); + end; + + if ( locClassPropNbr > 0 ) then begin + NewLine(); + WriteLn('destructor %s.Destroy();',[ASymbol.Name]); + WriteLn('begin'); + IncIndent(); + for k := 0 to Pred(ASymbol.PropertyCount) do begin + p := ASymbol.Properties[k]; + if p.DataType.InheritsFrom(TClassTypeDefinition) then begin + Indent(); + WriteLn('if Assigned(F%s) then',[p.Name]); + IncIndent(); + Indent(); + WriteLn('FreeAndNil(F%s);',[p.Name]) ; + DecIndent(); + end; + end; + Indent(); + WriteLn('inherited Destroy();'); + DecIndent(); + WriteLn('end;'); + end; + + if ( locStoredPropsNbr > 0 ) then begin + for k := 0 to Pred(ASymbol.PropertyCount) do begin + p := ASymbol.Properties[k]; + if ( p.StorageOption = soOptional ) then begin + NewLine(); + WriteLn('function %s.Has%s() : Boolean;',[ASymbol.Name,p.Name]); + WriteLn('begin'); + IncIndent(); + Indent(); + WriteLn('Result := True;'); + DecIndent(); + WriteLn('end;'); + end; + end; + end; + + end; + end; + +begin + Prepare(); + try + loc_BaseComplexSimpleContentRemotable := FSymbolTable.ByName('TBaseComplexSimpleContentRemotable') as TClassTypeDefinition; + SetCurrentStream(FDecStream); + NewLine(); + IncIndent(); + WriteDec(); + WriteProperties(); + Indent(); WriteLn('end;'); + DecIndent(); + + FImpTempStream.Indent(); + FImpTempStream.WriteLn('GetTypeRegistry().Register(%s,TypeInfo(%s),%s);',[sNAME_SPACE,ASymbol.Name,QuotedStr(ASymbol.ExternalName)]); + + SetCurrentStream(FImpStream); + WriteImp(); + except + on e : Exception do + System.WriteLn('TInftGenerator.GenerateClass()=', ASymbol.Name, ' ;; ', e.Message); + end; +end; + +procedure TInftGenerator.GenerateEnum(ASymbol: TEnumTypeDefinition); +var + itm : TEnumItemDefinition; + i : Integer; +begin + try + SetCurrentStream(FDecStream); + NewLine(); + IncIndent(); + Indent();WriteLn('%s = ( ',[ASymbol.Name]); + + FImpTempStream.Indent(); + FImpTempStream.WriteLn('GetTypeRegistry().Register(%s,TypeInfo(%s),%s);',[sNAME_SPACE,ASymbol.Name,QuotedStr(ASymbol.ExternalName)]); + + IncIndent(); + for i := 0 to Pred(ASymbol.ItemCount) do begin + itm := ASymbol.Item[i]; + Indent(); + if ( i > 0 ) then + WriteLn(',%s',[itm.Name]) + else + WriteLn('%s',[itm.Name]); + if not AnsiSameText(itm.Name,itm.ExternalName) then begin + FImpTempStream.Indent(); + FImpTempStream.WriteLn('GetTypeRegistry().ItemByTypeInfo[TypeInfo(%s)].RegisterExternalPropertyName(%s,%s);',[ASymbol.Name,QuotedStr(itm.Name),QuotedStr(itm.ExternalName)]); + end; + end; + DecIndent(); + Indent(); WriteLn(');'); + DecIndent(); + except + on e : Exception do + System.WriteLn('TInftGenerator.GenerateClass()=', ASymbol.Name, ' ;; ', e.Message); + end; +end; + +procedure TInftGenerator.GenerateArray(ASymbol: TArrayDefinition); + + procedure WriteObjectArray(); + begin + SetCurrentStream(FDecStream); + NewLine(); + IncIndent(); + BeginAutoIndent(); + try + WriteLn('%s = class(TBaseObjectArrayRemotable)',[ASymbol.Name]); + WriteLn('private'); + Indent();WriteLn('function GetItem(AIndex: Integer): %s;',[ASymbol.ItemType.Name]); + WriteLn('public'); + Indent();WriteLn('class function GetItemClass():TBaseRemotableClass;override;'); + Indent();WriteLn('property Item[AIndex:Integer] : %s Read GetItem;Default;',[ASymbol.ItemType.Name]); + WriteLn('end;'); + finally + EndAutoIndent(); + DecIndent(); + end; + + SetCurrentStream(FImpStream); + NewLine(); + WriteLn('{ %s }',[ASymbol.Name]); + + NewLine(); + WriteLn('function %s.GetItem(AIndex: Integer): %s;',[ASymbol.Name,ASymbol.ItemType.Name]); + WriteLn('begin'); + IncIndent(); + Indent();WriteLn('Result := Inherited GetItem(AIndex) As %s;',[ASymbol.ItemType.Name]); + DecIndent(); + WriteLn('end;'); + + NewLine(); + WriteLn('class function %s.GetItemClass(): TBaseRemotableClass;',[ASymbol.Name]); + WriteLn('begin'); + IncIndent(); + Indent();WriteLn('Result:= %s;',[ASymbol.ItemType.Name]); + DecIndent(); + WriteLn('end;'); + end; + + procedure WriteSimpleTypeArray(); + begin + SetCurrentStream(FDecStream); + NewLine(); + IncIndent(); + BeginAutoIndent(); + try + WriteLn('%s = class(TBaseSimpleTypeArrayRemotable)',[ASymbol.Name]); + WriteLn('private'); + Indent();WriteLn('FData : array of %s;',[ASymbol.ItemType.Name]); + WriteLn('private'); + Indent();WriteLn('function GetItem(AIndex: Integer): %s;',[ASymbol.ItemType.Name]); + Indent();WriteLn('procedure SetItem(AIndex: Integer; const AValue: %s);',[ASymbol.ItemType.Name]); + WriteLn('protected'); + Indent();WriteLn('function GetLength():Integer;override;'); + Indent();WriteLn('procedure SaveItem(AStore : IFormatterBase;const AName : String;const AIndex : Integer);override;'); + Indent();WriteLn('procedure LoadItem(AStore : IFormatterBase;const AIndex : Integer);override;'); + WriteLn('public'); + Indent();WriteLn('class function GetItemTypeInfo():PTypeInfo;override;'); + Indent();WriteLn('procedure SetLength(const ANewSize : Integer);override;'); + Indent();WriteLn('property Item[AIndex:Integer] : %s read GetItem write SetItem; default;',[ASymbol.ItemType.Name]); + WriteLn('end;'); + finally + EndAutoIndent(); + DecIndent(); + end; + + SetCurrentStream(FImpStream); + NewLine(); + WriteLn('{ %s }',[ASymbol.Name]); + + NewLine(); + WriteLn('function %s.GetItem(AIndex: Integer): %s;',[ASymbol.Name,ASymbol.ItemType.Name]); + WriteLn('begin'); + IncIndent(); + Indent();WriteLn('CheckIndex(AIndex);'); + Indent();WriteLn('Result := FData[AIndex];'); + DecIndent(); + WriteLn('end;'); + + NewLine(); + WriteLn('procedure %s.SetItem(AIndex: Integer;const AValue: %S);',[ASymbol.Name,ASymbol.ItemType.Name]); + WriteLn('begin'); + IncIndent(); + Indent();WriteLn('CheckIndex(AIndex);'); + Indent();WriteLn('FData[AIndex] := AValue;'); + DecIndent(); + WriteLn('end;'); + + NewLine(); + WriteLn('function %s.GetLength(): Integer;',[ASymbol.Name]); + WriteLn('begin'); + IncIndent(); + Indent();WriteLn('Result := System.Length(FData);'); + DecIndent(); + WriteLn('end;'); + + NewLine(); + WriteLn('procedure %s.SaveItem(AStore: IFormatterBase;const AName: String; const AIndex: Integer);',[ASymbol.Name]); + WriteLn('begin'); + IncIndent(); + Indent();WriteLn('AStore.Put(%s,TypeInfo(%s),FData[AIndex]);',[QuotedStr(ASymbol.ItemName),ASymbol.ItemType.Name]); + DecIndent(); + WriteLn('end;'); + + NewLine(); + IncIndent(); + WriteLn('procedure %s.LoadItem(AStore: IFormatterBase;const AIndex: Integer);',[ASymbol.Name]); + WriteLn('var'); + Indent();WriteLn('sName : string;'); + WriteLn('begin'); + Indent();WriteLn('sName := %s;',[QuotedStr(ASymbol.ItemName)]); + Indent();WriteLn('AStore.Get(TypeInfo(%s),sName,FData[AIndex]);',[ASymbol.ItemType.Name]); + DecIndent(); + WriteLn('end;'); + + NewLine(); + WriteLn('class function %s.GetItemTypeInfo(): PTypeInfo;',[ASymbol.Name]); + WriteLn('begin'); + IncIndent(); + Indent();WriteLn('Result := TypeInfo(%s);',[ASymbol.ItemType.Name]); + DecIndent(); + WriteLn('end;'); + + NewLine(); + IncIndent(); + WriteLn('procedure %s.SetLength(const ANewSize: Integer);',[ASymbol.Name]); + WriteLn('var'); + Indent();WriteLn('i : Integer;'); + WriteLn('begin'); + Indent();WriteLn('if ( ANewSize < 0 ) then'); + Indent();Indent();WriteLn('i := 0'); + Indent();WriteLn('else'); + Indent();Indent();WriteLn('i := ANewSize;'); + Indent();WriteLn('System.SetLength(FData,i);'); + DecIndent(); + WriteLn('end;'); + end; + +var + classItemArray : Boolean; +begin + classItemArray := ( ASymbol.ItemType is TClassTypeDefinition ) or + ( ASymbol.ItemType is TArrayDefinition ) ; + + if classItemArray then begin + WriteObjectArray(); + end else begin + WriteSimpleTypeArray(); + end; + + FImpTempStream.Indent(); + FImpTempStream.WriteLn('GetTypeRegistry().Register(%s,TypeInfo(%s),%s);',[sNAME_SPACE,ASymbol.Name,QuotedStr(ASymbol.ExternalName)]); + if ( ASymbol.ItemName <> ASymbol.ItemExternalName ) then begin + FImpTempStream.Indent(); + FImpTempStream.WriteLn( + 'GetTypeRegistry().ItemByTypeInfo[TypeInfo(%s)].RegisterExternalPropertyName(sARRAY_ITEM,%s);', + [ASymbol.Name,QuotedStr(ASymbol.ItemExternalName)] + ); + end; + if ( ASymbol.Style = asEmbeded ) then begin + FImpTempStream.Indent(); + FImpTempStream.WriteLn( + 'GetTypeRegistry().ItemByTypeInfo[TypeInfo(%s)].RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded);', + [ASymbol.Name,QuotedStr(ASymbol.ItemExternalName)] + ); + end; +end; + +procedure TInftGenerator.GenerateCustomMetadatas(); + + procedure WriteOperationDatas(AInftDef : TInterfaceDefinition; AOp : TMethodDefinition); + var + k : Integer; + pl : TStrings; + begin + pl := AOp.Properties; + for k := 0 to Pred(pl.Count) do begin + if not IsStrEmpty(pl.ValueFromIndex[k]) then begin + Indent();WriteLn('mm.SetOperationCustomData('); + IncIndent(); + Indent(); WriteLn('%s,',[sUNIT_NAME]); + Indent(); WriteLn('%s,',[QuotedStr(AInftDef.Name)]); + Indent(); WriteLn('%s,',[QuotedStr(AOp.Name)]); + Indent(); WriteLn('%s,',[QuotedStr(pl.Names[k])]); + Indent(); WriteLn('%s' ,[QuotedStr(pl.ValueFromIndex[k])]); + DecIndent(); + Indent();WriteLn(');'); + end; + end; + end; + + procedure WriteServiceDatas(AIntf : TInterfaceDefinition); + var + k : Integer; + begin + if not IsStrEmpty(AIntf.Address) then begin + Indent();WriteLn('mm.SetServiceCustomData('); + IncIndent(); + Indent(); WriteLn('%s,',[sUNIT_NAME]); + Indent(); WriteLn('%s,',[QuotedStr(AIntf.Name)]); + Indent(); WriteLn('%s,',[QuotedStr('TRANSPORT_Address')]); + Indent(); WriteLn('%s' ,[QuotedStr(AIntf.Address)]); + DecIndent(); + Indent();WriteLn(');'); + end; + + if ( AIntf.BindingStyle = bsRPC ) then begin + Indent();WriteLn('mm.SetServiceCustomData('); + IncIndent(); + Indent(); WriteLn('%s,',[sUNIT_NAME]); + Indent(); WriteLn('%s,',[QuotedStr(AIntf.Name)]); + Indent(); WriteLn('%s,',[QuotedStr('FORMAT_Style')]); + Indent(); WriteLn('%s' ,[QuotedStr('rpc')]); + DecIndent(); + Indent();WriteLn(');'); + end else if ( AIntf.BindingStyle = bsDocument ) then begin + Indent();WriteLn('mm.SetServiceCustomData('); + IncIndent(); + Indent(); WriteLn('%s,',[sUNIT_NAME]); + Indent(); WriteLn('%s,',[QuotedStr(AIntf.Name)]); + Indent(); WriteLn('%s,',[QuotedStr('FORMAT_Style')]); + Indent(); WriteLn('%s' ,[QuotedStr('document')]); + DecIndent(); + Indent();WriteLn(');'); + end; + + for k := 0 to Pred(AIntf.MethodCount) do begin + WriteOperationDatas(AIntf,AIntf.Method[k]); + end; + end; + +var + i : Integer; +begin + SetCurrentStream(FImpStream); + IncIndent(); + + NewLine();NewLine(); + WriteLn('procedure Register_%s_ServiceMetadata();',[SymbolTable.Name]); + WriteLn('var'); + Indent(); WriteLn('mm : IModuleMetadataMngr;'); + WriteLn('begin'); + Indent();WriteLn('mm := GetModuleMetadataMngr();'); + Indent();WriteLn('mm.SetRepositoryNameSpace(%s, %s);',[sUNIT_NAME,sNAME_SPACE]); + for i := 0 to Pred(SymbolTable.Count) do begin + if SymbolTable.Item[i] is TInterfaceDefinition then begin + WriteServiceDatas(SymbolTable.Item[i] as TInterfaceDefinition); + end; + end; + + WriteLn('end;'); + DecIndent(); +end; + +function TInftGenerator.GetDestUnitName(): string; +begin + Result := SymbolTable.Name; +end; + +constructor TInftGenerator.Create( + ASymTable : TSymbolTable; + ASrcMngr : ISourceManager +); +begin + inherited Create(ASymTable,ASrcMngr); + FDecStream := SrcMngr.CreateItem(GetDestUnitName() + '.dec'); + FImpStream := SrcMngr.CreateItem(GetDestUnitName() + '.imp'); + FImpTempStream := SrcMngr.CreateItem(GetDestUnitName() + '.tmp_imp'); + FImpLastStream := SrcMngr.CreateItem(GetDestUnitName() + '.tmp_imp_last'); + FImpTempStream.IncIndent(); + FImpLastStream.IncIndent(); +end; + +procedure TInftGenerator.Execute(); +var + i,c, j, k : Integer; + clssTyp : TClassTypeDefinition; + gnrClssLst : TObjectList; + objLst : TObjectList; +begin + objLst := nil; + gnrClssLst := TObjectList.Create(False); + try + GenerateUnitHeader(); + GenerateUnitImplementationHeader(); + c := Pred(SymbolTable.Count); + + SetCurrentStream(FDecStream); + IncIndent(); + for i := 0 to c do begin + if SymbolTable.Item[i] is TForwardTypeDefinition then begin + WriteLn('// %s = unable to resolve this symbol.',[SymbolTable.Item[i].Name]); + end; + end; + DecIndent(); + + IncIndent(); + for i := 0 to c do begin + if ( SymbolTable.Item[i] is TClassTypeDefinition ) or + ( SymbolTable.Item[i] is TArrayDefinition ) + then begin + Indent(); + WriteLn('%s = class;',[SymbolTable.Item[i].Name]); + end; + end; + DecIndent(); + + for i := 0 to c do begin + if SymbolTable.Item[i] is TEnumTypeDefinition then begin + GenerateEnum(SymbolTable.Item[i] as TEnumTypeDefinition); + end; + end; + + for i := 0 to c do begin + if SymbolTable.Item[i] is TTypeAliasDefinition then begin + GenerateTypeAlias(SymbolTable.Item[i] as TTypeAliasDefinition); + end; + end; + + objLst := TObjectList.Create(); + objLst.OwnsObjects := False; + for i := 0 to c do begin + if SymbolTable.Item[i].InheritsFrom(TClassTypeDefinition) then begin + clssTyp := SymbolTable.Item[i] as TClassTypeDefinition; + if ( gnrClssLst.IndexOf(clssTyp) = -1 ) then begin + while ( objLst.Count > 0 ) do begin + objLst.Clear(); + end; + while Assigned(clssTyp) do begin + objLst.Add(clssTyp); + if Assigned(clssTyp.Parent) and clssTyp.Parent.InheritsFrom(TClassTypeDefinition) then begin + clssTyp := clssTyp.Parent as TClassTypeDefinition; + end else begin + clssTyp := nil; + end; + end; + + k := Pred(objLst.Count); + for j := 0 to k do begin + clssTyp := objLst[k-j] as TClassTypeDefinition; + if ( gnrClssLst.IndexOf(clssTyp) = -1 ) then begin + if ( FSymbolTable.IndexOf(clssTyp) <> -1 ) then begin + GenerateClass(clssTyp); + gnrClssLst.Add(clssTyp); + end; + end; + end; + end; + end; + end; + + for i := 0 to c do begin + if SymbolTable.Item[i] is TArrayDefinition then begin + GenerateArray(SymbolTable.Item[i] as TArrayDefinition); + end; + end; + + for i := 0 to c do begin + if SymbolTable.Item[i] is TInterfaceDefinition then begin + GenerateIntf(SymbolTable.Item[i] as TInterfaceDefinition); + end; + end; + + NewLine(); + IncIndent(); + Indent(); WriteLn('procedure Register_%s_ServiceMetadata();',[SymbolTable.Name]); + DecIndent(); + GenerateCustomMetadatas(); + + GenerateUnitImplementationFooter(); + FSrcMngr.Merge(GetDestUnitName() + '.pas',[FDecStream,FImpStream,FImpTempStream,FImpLastStream]); + FDecStream := nil; + FImpStream := nil; + FImpTempStream := nil; + finally + FreeAndNil(objLst); + FreeAndNil(gnrClssLst); + end; +end; + +end. diff --git a/wst/tags/0.4/ws_helper/metadata_generator.pas b/wst/tags/0.4/ws_helper/metadata_generator.pas new file mode 100644 index 000000000..4cfe1df87 --- /dev/null +++ b/wst/tags/0.4/ws_helper/metadata_generator.pas @@ -0,0 +1,127 @@ +{ + This unit is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +} + +unit metadata_generator; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, + parserdefs, binary_streamer; + +const + sWST_META = 'WST_METADATA_0.2.2.0'; + +type + + { TMetadataGenerator } + + TMetadataGenerator = class + private + FStream : IDataStore; + FSymbolTable: TSymbolTable; + + procedure GenerateHeader(); + procedure GenerateIntfMetadata(AIntf : TInterfaceDefinition); + public + constructor Create( + ASymTable : TSymbolTable; + ADstStream : IDataStore + ); + procedure Execute(); + end; + + +implementation + +{ TMetadataGenerator } + +procedure TMetadataGenerator.GenerateHeader(); +var + c, i, k : LongInt; +begin + FStream.WriteStr(sWST_META); + FStream.WriteStr(FSymbolTable.Name); + k := 0; + c := FSymbolTable.Count; + for i := 0 to pred(c) do begin + if FSymbolTable.Item[i] is TInterfaceDefinition then + inc(k); + end; + FStream.WriteInt8U(k); +end; + +procedure TMetadataGenerator.GenerateIntfMetadata(AIntf: TInterfaceDefinition); + + procedure WriteMethod(AMeth:TMethodDefinition); + + procedure WriteParam(APrm : TParameterDefinition); + begin + FStream.WriteStr(APrm.ExternalName); + FStream.WriteStr(APrm.DataType.ExternalName); + FStream.WriteEnum(Ord(APrm.Modifier)); + end; + + var + j, k : LongInt; + begin + k := AMeth.ParameterCount; + FStream.WriteStr(AMeth.Name); + FStream.WriteInt8U(k); + for j := 0 to pred(k) do + WriteParam(AMeth.Parameter[j]); + end; + +var + i, c : LongInt; +begin + FStream.WriteStr(AIntf.Name); + c := AIntf.MethodCount; + FStream.WriteInt8U(c); + for i := 0 to pred(c) do + WriteMethod(AIntf.Method[i]); +end; + +constructor TMetadataGenerator.Create(ASymTable: TSymbolTable;ADstStream: IDataStore); +begin + Assert(Assigned(ASymTable)); + Assert(Assigned(ADstStream)); + FSymbolTable := ASymTable; + FStream := ADstStream; +end; + +procedure TMetadataGenerator.Execute(); +Var + i,c : Integer; + intf : TInterfaceDefinition; +begin + GenerateHeader(); + c := Pred(FSymbolTable.Count); + for i := 0 to c do begin + if FSymbolTable.Item[i] is TInterfaceDefinition then begin + intf := FSymbolTable.Item[i] as TInterfaceDefinition; + GenerateIntfMetadata(intf); + end; + end; +end; + +end. + diff --git a/wst/tags/0.4/ws_helper/parserdefs.pas b/wst/tags/0.4/ws_helper/parserdefs.pas new file mode 100644 index 000000000..0f9e18af1 --- /dev/null +++ b/wst/tags/0.4/ws_helper/parserdefs.pas @@ -0,0 +1,1337 @@ +{ + This unit is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +} + + +unit parserdefs; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, Contnrs; + +Type + + ESymbolException = class(Exception) + End; + + TSymbolTable = class; + TTypeDefinition = class; + TForwardTypeDefinition = class; + + { TAbstractSymbolDefinition } + + TAbstractSymbolDefinition = class + private + FName: String; + FExternalAlias : string; + protected + procedure SetName(const AName : string);virtual; + procedure FixForwardTypeDefinitions( + AFrw : TForwardTypeDefinition; + Atype : TTypeDefinition + );virtual; + Public + constructor Create(Const AName : String); + procedure RegisterExternalAlias(const AExternalName : String); + function SameName(const AName : string) : Boolean;virtual; + Property Name : String Read FName; + Property ExternalName : String Read FExternalAlias; + End; + + TAbstractSymbolDefinitionClass = class of TAbstractSymbolDefinition; + + TPascalTokenDefinition = class(TAbstractSymbolDefinition) + end; + + TSymbolTableChange = ( stcAdding, stcDeleting ); + ISymbolTableChangeListner = interface + ['{0147E0EE-FF1A-4CFA-BD71-3F8E90494EC9}'] + procedure NotifyChange( + ASender : TSymbolTable; + AItem : TAbstractSymbolDefinition; + const AEvent : TSymbolTableChange + ); + end; + + { TAbstractConstantDefinition } + + TAbstractConstantDefinition = class(TAbstractSymbolDefinition) end; + + TSimpleConstantType = ( sctString, sctInteger ); + TSimpleConstantBuffer = record + case DataType : TSimpleConstantType of + sctInteger : ( IntValue : Integer; ); + sctString : ( StrValue : string[255]; ); + end; + + { TSimpleConstantDefinition } + + TSimpleConstantDefinition = class(TAbstractConstantDefinition) + private + FValue: TSimpleConstantBuffer; + public + constructor Create(const AName : string; const AValue : string);overload; + constructor Create(const AName : string; const AValue : Integer);overload; + property Value : TSimpleConstantBuffer read FValue; + end; + + { TTypeDefinition } + + TTypeDefinition = class(TAbstractSymbolDefinition) + public + function NeedFinalization():Boolean;virtual; + end; + + TAnyTypeDefinition = class(TTypeDefinition) + end; + + { TTypeAliasDefinition } + + TTypeAliasDefinition = class(TTypeDefinition) + private + FBaseType: TTypeDefinition; + protected + procedure FixForwardTypeDefinitions( + AFrw : TForwardTypeDefinition; + Atype : TTypeDefinition + );override; + public + constructor Create(const AName : string; ABaseType : TTypeDefinition); + property BaseType : TTypeDefinition read FBaseType; + end; + + { TSimpleTypeDefinition } + + TSimpleTypeDefinition = class(TTypeDefinition) + public + function NeedFinalization():Boolean;override; + end; + + { TForwardTypeDefinition } + + TForwardTypeDefinition = class(TTypeDefinition) + end; + + TArrayStyle = ( asScoped, asEmbeded ); + + { TArrayDefinition } + + TArrayDefinition = class(TTypeDefinition) + private + FItemExternalName: string; + FItemName: string; + FItemType: TTypeDefinition; + FStyle: TArrayStyle; + protected + procedure FixForwardTypeDefinitions( + AFrw : TForwardTypeDefinition; + Atype : TTypeDefinition + );override; + public + constructor Create( + const AName : string; + AItemType : TTypeDefinition; + const AItemName, + AItemExternalName : string; + const AStyle : TArrayStyle + ); + function NeedFinalization():Boolean;override; + property ItemName : string read FItemName; + property ItemType : TTypeDefinition read FItemType; + property ItemExternalName : string read FItemExternalName; + property Style : TArrayStyle read FStyle; + end; + + TEnumTypeDefinition = class; + + { TEnumItemDefinition } + + TEnumItemDefinition = class(TAbstractSymbolDefinition) + private + FEnumType: TEnumTypeDefinition; + FOrder: Integer; + protected + procedure FixForwardTypeDefinitions( + AFrw : TForwardTypeDefinition; + Atype : TTypeDefinition + );override; + Public + constructor Create( + Const AName : String; + AEnumType : TEnumTypeDefinition; + Const AOrder : Integer + ); + Property Order : Integer Read FOrder; + property EnumType : TEnumTypeDefinition read FEnumType; + End; + + { TEnumTypeDefinition } + + TEnumTypeDefinition = class(TTypeDefinition) + Private + FItemList : TObjectList; + private + function GetItem(Index: Integer): TEnumItemDefinition; + function GetItemCount: Integer; + Public + constructor Create(Const AName : String); + destructor Destroy();override; + function NeedFinalization():Boolean;override; + Procedure AddItem(AItem:TEnumItemDefinition); + function FindItem(Const AName:String):TEnumItemDefinition; + Property ItemCount : Integer Read GetItemCount; + Property Item[Index:Integer]:TEnumItemDefinition Read GetItem; + End; + + TStorageOption = ( soAlways, soOptional, soNever ); + + { TPropertyDefinition } + + TPropertyDefinition = class(TAbstractSymbolDefinition) + private + FDataType: TTypeDefinition; + FIsAttribute: Boolean; + FStorageOption: TStorageOption; + protected + procedure FixForwardTypeDefinitions( + AFrw : TForwardTypeDefinition; + Atype : TTypeDefinition + );override; + public + constructor Create( + Const AName : String; + ADataType : TTypeDefinition + ); + property DataType : TTypeDefinition Read FDataType; + property IsAttribute : Boolean read FIsAttribute write FIsAttribute; + property StorageOption : TStorageOption read FStorageOption write FStorageOption; + End; + + { TClassTypeDefinition } + + TClassTypeDefinition = class(TTypeDefinition) + private + FParent: TTypeDefinition; + FPropertyList : TObjectList; + private + function GetProperty(const Index : Integer): TPropertyDefinition; + function GetPropertyCount: Integer; + protected + procedure FixForwardTypeDefinitions( + AFrw : TForwardTypeDefinition; + Atype : TTypeDefinition + );override; + public + constructor Create(Const AName : String); + destructor Destroy();override; + function NeedFinalization():Boolean;override; + function IsDescendantOf(ABaseType : TTypeDefinition) : Boolean; + procedure SetParent(const AValue: TTypeDefinition); + function AddProperty( + Const AName : String; + ADataType : TTypeDefinition + ) : TPropertyDefinition; + function IndexOfProperty(const AName : string):Integer; + property Parent : TTypeDefinition read FParent; + property PropertyCount : Integer read GetPropertyCount; + property Properties[const Index : Integer] : TPropertyDefinition read GetProperty; + end; + + TClassTypeDefinitionClass = class of TClassTypeDefinition; + + TNativeClassTypeDefinition = class(TClassTypeDefinition) + end; + + { TNativeSimpleTypeDefinition } + + TNativeSimpleTypeDefinition = class(TSimpleTypeDefinition) + private + FBoxedType: TNativeClassTypeDefinition; + public + procedure SetBoxedType(ABoxedType : TNativeClassTypeDefinition); + property BoxedType : TNativeClassTypeDefinition read FBoxedType; + end; + + TParameterModifier = ( pmNone, pmConst, pmVar, pmOut ); + + { TParameterDefinition } + + TParameterDefinition = class(TAbstractSymbolDefinition) + private + FDataType: TTypeDefinition; + FModifier: TParameterModifier; + protected + procedure SetModifier(const AModifier : TParameterModifier); + procedure FixForwardTypeDefinitions( + AFrw : TForwardTypeDefinition; + Atype : TTypeDefinition + );override; + Public + constructor Create( + Const AName : String; + Const AModifier : TParameterModifier; + ADataType : TTypeDefinition + ); + property Modifier : TParameterModifier Read FModifier; + property DataType : TTypeDefinition Read FDataType; + End; + + TMethodType = ( mtProcedure, mtFunction ); +Const + ParameterModifierMAP : Array[TParameterModifier] Of String = + ( '', 'Const', 'Var', 'Out' ); +Type + + { TMethodDefinition } + + TMethodDefinition = class(TAbstractSymbolDefinition) + private + FMethodType: TMethodType; + FParameterList : TObjectList; + FProperties: TStrings; + private + function GetParameter(Index: Integer): TParameterDefinition; + function GetParameterCount: Integer; + protected + procedure SetMethodType( AMethodType : TMethodType ); + procedure FixForwardTypeDefinitions( + AFrw : TForwardTypeDefinition; + Atype : TTypeDefinition + );override; + Public + constructor Create(Const AName : String; Const AMethodType : TMethodType); + destructor Destroy();override; + function AddParameter( + Const AName : String; + Const AModifier : TParameterModifier; + ADataType : TTypeDefinition + ):TParameterDefinition; + function GetParameterIndex(Const AName : String):Integer; + function FindParameter(Const AName : String):TParameterDefinition; + property MethodType : TMethodType Read FMethodType; + property ParameterCount : Integer Read GetParameterCount; + property Parameter[Index:Integer] : TParameterDefinition Read GetParameter; + property Properties : TStrings read FProperties; + End; + + TBindingStyle = ( bsDocument, bsRPC, bsUnknown ); + + { TInterfaceDefinition } + + TInterfaceDefinition = class(TAbstractSymbolDefinition) + Private + FInterfaceGUID: string; + FMethodList : TObjectList; + private + FAddress: string; + FBindingStyle: TBindingStyle; + function GetMethod(Index: Integer): TMethodDefinition; + function GetMethodCount: Integer; + protected + procedure FixForwardTypeDefinitions( + AFrw : TForwardTypeDefinition; + Atype : TTypeDefinition + );override; + Public + constructor Create(Const AName : String); + destructor Destroy();override; + function GetMethodIndex(Const AName : String):Integer; + function FindMethod(Const AName : String):TMethodDefinition; + function AddMethod( + Const AName : String; + Const AMethodType : TMethodType + ):TMethodDefinition; + function AddMethod(AMthd : TMethodDefinition):TMethodDefinition; + Property MethodCount : Integer Read GetMethodCount; + Property Method[Index:Integer] : TMethodDefinition Read GetMethod; + property InterfaceGUID : string read FInterfaceGUID write FInterfaceGUID; + property Address : string read FAddress write FAddress; + property BindingStyle : TBindingStyle read FBindingStyle write FBindingStyle; + End; + + { TSymbolTable } + + TSymbolTable = class(TAbstractSymbolDefinition) + Private + FList : TObjectList; + FLinkedTables : TObjectList; + FListners : IInterfaceList; + private + procedure CheckIndex(Const AIndex : Integer); + function GetCount: Integer; + function GetItem(Index: Integer): TAbstractSymbolDefinition; + function GetLinkedTableCount: Integer; + function GetLinkedTables(Index : Integer): TSymbolTable; + procedure SetName(const AValue: String); + procedure ReorderClass(ASym : TClassTypeDefinition); + protected + procedure NotifyChange( + ASender : TSymbolTable; + AItem : TAbstractSymbolDefinition; + const AEvent : TSymbolTableChange + ); + procedure FixForwardTypeDefinitions( + AFrw : TForwardTypeDefinition; + Atype : TTypeDefinition + );override; + Public + constructor Create(Const AName : String); + destructor Destroy();override; + procedure Clear(); + function Add(ASym : TAbstractSymbolDefinition):Integer; + procedure Delete(ASym : TAbstractSymbolDefinition); + function IndexOf(Const AName : String):Integer;overload; + function IndexOf( + const AName : string; + const AMinClass : TAbstractSymbolDefinitionClass + ):Integer;overload; + function IndexOf(ASym : TAbstractSymbolDefinition):Integer;overload; + function Find(Const AName : String):TAbstractSymbolDefinition;overload; + function Find( + const AName : string; + const AMinClass : TAbstractSymbolDefinitionClass + ):TAbstractSymbolDefinition;overload; + function ByName(Const AName : String):TAbstractSymbolDefinition; + procedure RegisterListner(AListner : ISymbolTableChangeListner); + procedure UnregisterListner(AListner : ISymbolTableChangeListner); + Property Name : String Read FName Write SetName; + Property Count : Integer Read GetCount; + Property Item[Index:Integer] : TAbstractSymbolDefinition Read GetItem;default; + property LinkedTables[Index : Integer] : TSymbolTable read GetLinkedTables; + property LinkedTableCount : Integer read GetLinkedTableCount; + End; + + + //function CreateSystemSymbolTable() : TSymbolTable; + procedure AddSystemSymbol(ADest : TSymbolTable); + procedure AddSoapencSymbol(ADest : TSymbolTable); + function CreateWstInterfaceSymbolTable() : TSymbolTable; + function IsReservedKeyWord(const AValue : string):Boolean ; + +implementation +uses StrUtils, parserutils; + +const LANGAGE_TOKEN : array[0..107] of string = ( + 'ABSTRACT', 'AND', 'ARRAY', 'AS', 'ASM', + 'BEGIN', 'BOOLEAN', 'BYTE', + 'CASE', 'CDECL', 'CHAR', 'CLASS', 'COMP', 'CONST', 'CONSTRUCTOR', 'CONTAINS', 'CURRENCY', + 'DEFAULT', 'DESTRUCTOR', 'DIV', 'DO', 'DOUBLE', 'DOWNTO', 'DYNAMIC', + 'END', 'EXPORT', 'EXPORTS', 'EXTERNAL', + 'FAR', 'FILE', 'FINALLY', 'FOR', 'FORWARD', 'FUNCTION', 'GOTO', + 'ELSE', 'EXCEPT', 'EXTENDED', + 'IF', 'IMPLEMENTATION', 'IMPLEMENTS', 'IN', 'INHERITED', 'INT64', 'INITIALIZATION', + 'INTEGER', 'INTERFACE', 'IS', + 'LABEL', 'LIBRARY', 'LOCAL', 'LONGINT', 'LONGWORD', + 'MOD', 'NEAR', 'NIL', 'NODEFAULT', 'NOT', + 'OBJECT', 'OF', 'OLEVARIANT', 'OR', 'OUT', 'OVERLOAD', 'OVERRIDE', + 'PACKAGE', 'PACKED', 'PASCAL', 'PCHAR', 'PRIVATE', 'PROCEDURE', 'PROGRAM', 'PUBLISHED', + 'RAISE', 'READ', 'REAL', 'RECORD', 'REGISTER', 'REINTRODUCE', 'REPEAT', 'REQUIRES', 'RESULT', + 'SAFECALL', 'SET', 'SHL', 'SHORTINT', 'SHR', 'SINGLE', 'SMALLINT', 'STDCALL', 'STORED', + 'THEN', 'TO', 'TRY', 'TYPE', 'UNIT', 'UNTIL', 'USES', + 'VAR', 'VARARGS', 'VARIANT', 'VIRTUAL', 'WHILE', 'WIDECHAR', 'WITH', 'WORD', 'WRITE', 'XOR' +); +const WST_RESERVED_TOKEN : array[0..1] of string = ( 'Item', 'Item' ); +function IsReservedKeyWord(const AValue : string):Boolean ; +begin + Result := AnsiMatchText(AValue,LANGAGE_TOKEN) or + AnsiMatchText(AValue,WST_RESERVED_TOKEN); +end; + +{ TAbstractSymbolDefinition } + +constructor TAbstractSymbolDefinition.Create(const AName: String); +begin + Assert(Not IsStrEmpty(AName)); + FName := AName; + FExternalAlias := FName; +end; + +procedure TAbstractSymbolDefinition.RegisterExternalAlias(const AExternalName : String); +begin + FExternalAlias := AExternalName; +end; + +function TAbstractSymbolDefinition.SameName(const AName: string): Boolean; +begin + Result := AnsiSameText(AName,Self.Name) or AnsiSameText(AName,Self.ExternalName); +end; + +procedure TAbstractSymbolDefinition.SetName(const AName: string); +begin + FName := AName; +end; + +procedure TAbstractSymbolDefinition.FixForwardTypeDefinitions( + AFrw : TForwardTypeDefinition; + Atype : TTypeDefinition +); +begin + +end; + +{ TParameterDefinition } + +procedure TParameterDefinition.SetModifier(const AModifier: TParameterModifier); +begin + FModifier := AModifier; +end; + +procedure TParameterDefinition.FixForwardTypeDefinitions( + AFrw : TForwardTypeDefinition; + Atype : TTypeDefinition +); +begin + if ( FDataType = AFrw ) then + FDataType := Atype; +end; + +constructor TParameterDefinition.Create( + const AName: String; + const AModifier: TParameterModifier; + ADataType: TTypeDefinition +); +begin + Inherited Create(AName); + Assert(Assigned(ADataType)); + FModifier := AModifier; + FDataType := ADataType; +end; + +{ TMethodDefinition } + +function TMethodDefinition.GetParameter(Index: Integer): TParameterDefinition; +begin + Result := FParameterList[Index] As TParameterDefinition; +end; + +function TMethodDefinition.GetParameterCount: Integer; +begin + Result := FParameterList.Count; +end; + +procedure TMethodDefinition.SetMethodType(AMethodType: TMethodType); +begin + FMethodType := AMethodType; +end; + +procedure TMethodDefinition.FixForwardTypeDefinitions( + AFrw : TForwardTypeDefinition; + Atype : TTypeDefinition +); +var + i : Integer; +begin + for i := 0 to Pred(ParameterCount) do + Parameter[i].FixForwardTypeDefinitions(AFrw, Atype); +end; + +constructor TMethodDefinition.Create( + const AName: String; + const AMethodType: TMethodType +); +begin + Inherited Create(AName); + FMethodType := AMethodType; + FParameterList := TObjectList.create(True); + FProperties := TStringList.Create(); +end; + +destructor TMethodDefinition.Destroy(); +begin + FreeAndNil(FProperties); + FreeAndNil(FParameterList); + inherited Destroy(); +end; + +function TMethodDefinition.AddParameter( + Const AName : String; + Const AModifier : TParameterModifier; + ADataType : TTypeDefinition +): TParameterDefinition; +begin + If ( GetParameterIndex(AName) = -1 ) Then Begin + Result := TParameterDefinition.Create(AName,AModifier,ADataType); + FParameterList.Add(Result); + End Else Begin + Raise ESymbolException.CreateFmt('Duplicated parameter : %s.%s',[Name,AName]); + End; +end; + +function TMethodDefinition.GetParameterIndex(const AName: String): Integer; +begin + For Result := 0 To Pred(ParameterCount) Do + If AnsiSameText(AName,Parameter[Result].Name) Then + Exit; + Result := -1; +end; + +function TMethodDefinition.FindParameter( + const AName: String +): TParameterDefinition; +Var + i : Integer; +begin + i := GetParameterIndex(AName); + If ( i > -1 ) Then + Result := Parameter[i] + Else + Result := Nil; +end; + +{ TInterfaceDefinition } + +function TInterfaceDefinition.GetMethod(Index: Integer): TMethodDefinition; +begin + Result := FMethodList[Index] As TMethodDefinition; +end; + +function TInterfaceDefinition.GetMethodCount: Integer; +begin + Result := FMethodList.Count; +end; + +procedure TInterfaceDefinition.FixForwardTypeDefinitions( + AFrw : TForwardTypeDefinition; + Atype : TTypeDefinition +); +var + i : Integer; +begin + for i := 0 to Pred(MethodCount) do + Method[i].FixForwardTypeDefinitions(AFrw, Atype); +end; + +constructor TInterfaceDefinition.Create(const AName: String); +begin + Inherited Create(AName); + FMethodList := TObjectList.create(True); +end; + +destructor TInterfaceDefinition.Destroy(); +begin + FreeAndNil(FMethodList); + inherited Destroy(); +end; + +function TInterfaceDefinition.GetMethodIndex(const AName: String): Integer; +begin + For Result := 0 To Pred(MethodCount) Do + If AnsiSameText(AName,Method[Result].Name) Then + Exit; + Result := -1; +end; + +function TInterfaceDefinition.FindMethod(const AName: String): TMethodDefinition; +Var + i : Integer; +begin + i := GetMethodIndex(AName); + If ( i > -1 ) Then + Result := Method[i] + Else + Result := Nil; +end; + +function TInterfaceDefinition.AddMethod( + Const AName : String; + Const AMethodType : TMethodType +):TMethodDefinition; +begin + if ( GetMethodIndex(Name) = -1 ) then begin + Result := AddMethod(TMethodDefinition.Create(AName,AMethodType)); + end else begin + raise ESymbolException.CreateFmt('Duplicated methode : %s.%s',[Name,AName]); + end; +end; + +function TInterfaceDefinition.AddMethod(AMthd: TMethodDefinition): TMethodDefinition; +begin + if ( GetMethodIndex(AMthd.Name) = -1 ) then begin + Result := AMthd; + FMethodList.Add(Result); + end else begin + raise ESymbolException.CreateFmt('Duplicated methode : %s.%s',[Name,AMthd.Name]); + end; +end; + +{ TSymbolTable } + +procedure TSymbolTable.CheckIndex(const AIndex: Integer); +begin + If ( AIndex < 0 ) Or ( AIndex >= Count ) Then + Raise ESymbolException.CreateFmt('Invalid Table Index : %d',[AIndex]); +end; + +function TSymbolTable.GetCount: Integer; +begin + Result := FList.Count; +end; + +function TSymbolTable.GetItem(Index: Integer): TAbstractSymbolDefinition; +begin + CheckIndex(Index); + Result := FList[Index] As TAbstractSymbolDefinition; +end; + +function TSymbolTable.GetLinkedTableCount: Integer; +begin + Result := FLinkedTables.Count; +end; + +function TSymbolTable.GetLinkedTables(Index : Integer): TSymbolTable; +begin + Result := FLinkedTables[Index] as TSymbolTable; +end; + +procedure TSymbolTable.SetName(const AValue: String); +begin + if ( FName = AValue ) then + Exit; + FName := AValue; +end; + +procedure TSymbolTable.ReorderClass(ASym: TClassTypeDefinition); +var + i ,j : Integer; + locSymb : TClassTypeDefinition; +begin + locSymb := ASym; + while True do begin + if not Assigned(locSymb.Parent) then + Exit; + i := FList.IndexOf(locSymb); + if ( i < 0 ) then + Exit; + j := FList.IndexOf(locSymb.Parent); + if ( j < 0 ) then + Exit; + //if ( i > j ) then + //Exit; + if ( i < j ) then + FList.Exchange(i,j); + if not locSymb.Parent.InheritsFrom(TClassTypeDefinition) then + Exit; + locSymb := locSymb.Parent as TClassTypeDefinition; + end; +end; + +procedure TSymbolTable.NotifyChange( + ASender : TSymbolTable; + AItem : TAbstractSymbolDefinition; + const AEvent : TSymbolTableChange +); +var + i : Integer; +begin + for i := 0 to Pred(FListners.Count) do + (FListners[i] as ISymbolTableChangeListner).NotifyChange(ASender,AItem,AEvent); +end; + +procedure TSymbolTable.FixForwardTypeDefinitions( + AFrw : TForwardTypeDefinition; + Atype : TTypeDefinition +); +var + i : Integer; +begin + for i := 0 to Pred(Count) do + Item[i].FixForwardTypeDefinitions(AFrw, Atype); +end; + +constructor TSymbolTable.Create(Const AName : String); +begin + Inherited Create(AName); + FList := TObjectList.Create(True); + FLinkedTables := TObjectList.Create(False); + FListners := TInterfaceList.Create(); +end; + +destructor TSymbolTable.Destroy(); +begin + if Assigned(FList) then + Clear(); + FreeAndNil(FList); + FreeAndNil(FLinkedTables); + FListners := nil; + inherited Destroy(); +end; + +procedure TSymbolTable.Clear(); +var + i : Integer; +begin + FLinkedTables.Clear(); + for i := 0 to Pred(FList.Count) do + Delete(FList[0] as TAbstractSymbolDefinition); +end; + +function TSymbolTable.Add(ASym: TAbstractSymbolDefinition): Integer; +var + i : Integer; + locNeedFix : Boolean; + frwdTyp : TForwardTypeDefinition; +begin + Result := IndexOf(ASym); + If ( Result = -1 ) Then Begin + locNeedFix := False; + i := IndexOf(ASym.Name); + if ( i <> -1 ) then begin + if Item[i].InheritsFrom(TForwardTypeDefinition) and + ( not ASym.InheritsFrom(TForwardTypeDefinition) ) + then + locNeedFix := True + else + raise ESymbolException.CreateFmt('Duplicated symbol name %s : ( %s/%s ), ( %s/%s )',[ASym.Name,Item[i].ClassName,Item[i].ExternalName,ASym.ClassName,ASym.ExternalName]); + end; + NotifyChange(Self,ASym,stcAdding); + Result := FList.Add(ASym); + if ASym.InheritsFrom(TSymbolTable) then + FLinkedTables.Add(ASym); + if locNeedFix then begin + frwdTyp := Item[i] as TForwardTypeDefinition; + FixForwardTypeDefinitions( frwdTyp, (ASym as TTypeDefinition ) ); + FList.Exchange(i,Result); + Delete(frwdTyp); + end; + Result := IndexOf(ASym); + End; +end; + +procedure TSymbolTable.Delete(ASym: TAbstractSymbolDefinition); +var + i : Integer; +begin + if Assigned(ASym) then begin + i := FList.IndexOf(ASym); + if ( i >= 0 ) then begin + NotifyChange(Self,ASym,stcDeleting); + FList.Delete(i); + end; + end; +end; + +function TSymbolTable.IndexOf(const AName: String): Integer; +begin + for Result := 0 to Pred(Count) do + if Item[Result].SameName(AName) then + Exit; + Result := -1; +end; + +function TSymbolTable.IndexOf( + const AName : string; + const AMinClass : TAbstractSymbolDefinitionClass +): Integer; +var + syb : TAbstractSymbolDefinition; +begin + for Result := 0 to Pred(Count) do begin + syb := Item[Result]; + if syb.SameName(AName) and syb.InheritsFrom(AMinClass) then + Exit; + end; + Result := -1; +end; + +function TSymbolTable.IndexOf(ASym: TAbstractSymbolDefinition): Integer; +begin + Result := FList.IndexOf(ASym); +end; + +function TSymbolTable.Find(const AName: String): TAbstractSymbolDefinition; +Var + i : Integer; +begin + i := IndexOf(AName); + if ( i > -1 ) then begin + Result := Item[i] + end else begin + for i := 0 to Pred(LinkedTableCount) do begin + Result := LinkedTables[i].Find(AName); + if Assigned(Result) then + Exit; + end; + Result := Nil; + end; +end; + +function TSymbolTable.Find( + const AName : string; + const AMinClass : TAbstractSymbolDefinitionClass +): TAbstractSymbolDefinition; +var + i : Integer; +begin + i := IndexOf(AName,AMinClass); + if ( i > -1 ) then begin + Result := Item[i] + end else begin + for i := 0 to Pred(LinkedTableCount) do begin + Result := LinkedTables[i].Find(AName,AMinClass); + if Assigned(Result) then + Exit; + end; + Result := Nil; + end; +end; + +function TSymbolTable.ByName(const AName: String): TAbstractSymbolDefinition; +begin + Result := Find(AName); + If Not Assigned(Result) Then + Raise ESymbolException.CreateFmt('No such Symbol : %s',[AName]); +end; + +procedure TSymbolTable.RegisterListner(AListner: ISymbolTableChangeListner); +begin + if Assigned(AListner) and ( FListners.IndexOf(AListner) < 0 ) then + FListners.Add(AListner); +end; + +procedure TSymbolTable.UnregisterListner(AListner: ISymbolTableChangeListner); +begin + if Assigned(AListner) and ( FListners.IndexOf(AListner) >= 0 ) then + FListners.Remove(AListner); +end; + +{ TEnumItemDefinition } + +procedure TEnumItemDefinition.FixForwardTypeDefinitions( + AFrw : TForwardTypeDefinition; + Atype : TTypeDefinition +); +begin + if ( TObject(AFrw) = TObject(FEnumType) ) then + FEnumType := Atype as TEnumTypeDefinition; +end; + +constructor TEnumItemDefinition.Create( + const AName : string; + AEnumType : TEnumTypeDefinition; + const AOrder : Integer +); +begin + Assert(Assigned(AEnumType)); + inherited Create(AName); + FOrder := AOrder; + FEnumType := AEnumType; +end; + +{ TEnumTypeDefinition } + +function TEnumTypeDefinition.GetItem(Index: Integer): TEnumItemDefinition; +begin + Result := FItemList[Index] As TEnumItemDefinition; +end; + +function TEnumTypeDefinition.GetItemCount: Integer; +begin + Result := FItemList.Count; +end; + +constructor TEnumTypeDefinition.Create(const AName: String); +begin + Inherited Create(AName); + FItemList := TObjectList.Create(False); +end; + +destructor TEnumTypeDefinition.Destroy(); +begin + FItemList.Free(); + inherited Destroy(); +end; + +function TEnumTypeDefinition.NeedFinalization(): Boolean; +begin + Result := False; +end; + +procedure TEnumTypeDefinition.AddItem(AItem:TEnumItemDefinition); +Begin + If ( FItemList.IndexOf(AItem) = -1 ) Then + FItemList.Add(AItem); +end; + +function TEnumTypeDefinition.FindItem(const AName: String): TEnumItemDefinition; +Var + i,c : Integer; +begin + c := Pred(ItemCount); + For i := 0 To c Do Begin + If AnsiSameText(AName,Item[i].Name) Then Begin + Result := Item[i]; + Exit; + End; + End; + Result := Nil; +end; + +{ TTypeDefinition } +const SIMPLE_TYPES : Array[0..14] Of array[0..2] of string = ( + ('string', 'TComplexStringContentRemotable', 'string'), + ('integer', 'TComplexInt32SContentRemotable', 'int'), + ('LongWord', 'TComplexInt32UContentRemotable', 'unsignedInt' ), + ('SmallInt', 'TComplexInt16SContentRemotable', 'short'), + ('ShortInt', 'TComplexInt8SContentRemotable', 'byte'), + ('char', '', ''), + ('boolean', 'TComplexBooleanContentRemotable', 'boolean'), + ('Byte', 'TComplexInt8UContentRemotable', 'unsignedByte'), + ('Word', 'TComplexInt16UContentRemotable', 'unsignedShort'), + ('Longint', 'TComplexInt32SContentRemotable', 'int'), + ('Int64', 'TComplexInt64SContentRemotable', 'long'), + ('Qword', 'TComplexInt64UContentRemotable', 'unsignedLong'), + ('Single', 'TComplexFloatSingleContentRemotable', 'single'), + ('Double', 'TComplexFloatDoubleContentRemotable', 'double'), + ('Extended', 'TComplexFloatExtendedContentRemotable', 'decimal') + ); + +function TTypeDefinition.NeedFinalization(): Boolean; +var + i : Integer; +begin + for i := Low(SIMPLE_TYPES) to High(SIMPLE_TYPES) do begin + if AnsiSameText(SIMPLE_TYPES[i][0],Name) then begin + Result := True; + Exit; + end; + end; + Result := False; +end; + +{ TClassTypeDefinition } + +procedure TClassTypeDefinition.SetParent(const AValue: TTypeDefinition); +begin + if ( AValue = Self ) then begin + raise ESymbolException.Create('A class can not be its parent.'); + end; + if ( FParent = AValue ) then begin + Exit; + end; + FParent := AValue; +end; + +function TClassTypeDefinition.AddProperty( + const AName : String; + ADataType : TTypeDefinition +): TPropertyDefinition; +var + i : Integer; +begin + if not Assigned(ADataType) then + raise ESymbolException.CreateFmt('Property data type not provided : "%s".',[AName]); + i := IndexOfProperty(AName); + if ( i = -1 ) then + i := FPropertyList.Add(TPropertyDefinition.Create(AName,ADataType)); + Result := FPropertyList[i] as TPropertyDefinition; +end; + +function TClassTypeDefinition.IndexOfProperty(const AName: string): Integer; +begin + for Result := 0 to Pred(PropertyCount) do begin + if AnsiSameText(AName,Properties[Result].Name) then + Exit; + end; + Result := -1; +end; + +function TClassTypeDefinition.GetProperty(const Index : Integer): TPropertyDefinition; +begin + Result := FPropertyList[Index] as TPropertyDefinition; +end; + +function TClassTypeDefinition.GetPropertyCount: Integer; +begin + Result := FPropertyList.Count; +end; + +procedure TClassTypeDefinition.FixForwardTypeDefinitions( + AFrw : TForwardTypeDefinition; + Atype : TTypeDefinition +); +var + i : Integer; +begin + if ( FParent = AFrw ) then + FParent := Atype; + for i := 0 to Pred(PropertyCount) do begin + Properties[i].FixForwardTypeDefinitions(AFrw,Atype); + end; +end; + +constructor TClassTypeDefinition.Create(const AName: String); +begin + inherited Create(AName); + FPropertyList := TObjectList.Create(True); +end; + +destructor TClassTypeDefinition.Destroy(); +begin + FreeAndNil(FPropertyList); + inherited Destroy(); +end; + +function TClassTypeDefinition.NeedFinalization(): Boolean; +begin + Result := True; +end; + +function TClassTypeDefinition.IsDescendantOf(ABaseType: TTypeDefinition): Boolean; +var + tmpDef : TTypeDefinition; +begin + tmpDef := Self; + while Assigned(tmpDef) do begin + if ( tmpDef = ABaseType ) then begin + Result := True; + Exit; + end; + if tmpDef is TClassTypeDefinition then begin + tmpDef := (tmpDef as TClassTypeDefinition).Parent; + end else begin + tmpDef := nil; + end; + end; + Result := False; +end; + + +{ TPropertyDefinition } + +procedure TPropertyDefinition.FixForwardTypeDefinitions( + AFrw : TForwardTypeDefinition; + Atype : TTypeDefinition +); +begin + if ( FDataType = AFrw ) then + FDataType := Atype; +end; + +constructor TPropertyDefinition.Create( + const AName : String; + ADataType : TTypeDefinition +); +begin + inherited Create(AName); + FDataType := ADataType; +end; + +{ TSimpleTypeDefinition } + +function TSimpleTypeDefinition.NeedFinalization(): Boolean; +begin + Result := False; +end; + +procedure AddSystemSymbol(ADest: TSymbolTable); +var + i : Integer; + splTyp : TNativeSimpleTypeDefinition; + syb : TNativeClassTypeDefinition; + s : string; +begin + for i := Low(SIMPLE_TYPES) to High(SIMPLE_TYPES) do begin + splTyp := TNativeSimpleTypeDefinition.Create(SIMPLE_TYPES[i][0]); + ADest.Add(splTyp); + s := SIMPLE_TYPES[i][1]; + if not IsStrEmpty(s) then begin + syb := ADest.Find(SIMPLE_TYPES[i][1]) as TNativeClassTypeDefinition; + if not Assigned(syb) then begin + syb := TNativeClassTypeDefinition.Create(SIMPLE_TYPES[i][1]); + end; + ADest.Add(syb); + //syb.RegisterExternalAlias(SIMPLE_TYPES[i][2]); + splTyp.SetBoxedType(syb); + end; + end; + for i := Low(SIMPLE_TYPES) to High(SIMPLE_TYPES) do begin + splTyp := ADest.ByName(SIMPLE_TYPES[i][0]) as TNativeSimpleTypeDefinition; + if not IsStrEmpty(SIMPLE_TYPES[i][2]) then begin + splTyp.RegisterExternalAlias(SIMPLE_TYPES[i][2]); + end; + end; +end; + +procedure AddSoapencSymbol(ADest: TSymbolTable); +var + locSymTable : TSymbolTable; +begin + locSymTable := TSymbolTable.Create('soapenc'); + ADest.Add(locSymTable); + locSymTable.RegisterExternalAlias('http://schemas.xmlsoap.org/soap/encoding/'); + locSymTable.Add(TAnyTypeDefinition.Create('any')); +end; + +function CreateWstInterfaceSymbolTable() : TSymbolTable; + function AddClassDef( + ATable : TSymbolTable; + const AClassName, + AParentName : string; + const AClassType : TClassTypeDefinition = nil + ):TClassTypeDefinition; + begin + if Assigned(AClassType) then begin + Result := AClassType.Create(AClassName); + end else begin + Result := TClassTypeDefinition.Create(AClassName); + end; + if not IsStrEmpty(AParentName) then + Result.SetParent(ATable.ByName(AParentName) as TClassTypeDefinition); + ATable.Add(Result); + end; + +var + loc_TBaseComplexSimpleContentRemotable : TClassTypeDefinition; + locTyp : TTypeDefinition; +begin + Result := TSymbolTable.Create('base_service_intf'); + try + AddSystemSymbol(Result); + AddClassDef(Result,'TBaseRemotable',''); + AddClassDef(Result,'TAbstractSimpleRemotable','TBaseRemotable'); + AddClassDef(Result,'TDateRemotable','TAbstractSimpleRemotable').RegisterExternalAlias('dateTime'); + AddClassDef(Result,'TDurationRemotable','TAbstractSimpleRemotable').RegisterExternalAlias('duration'); + AddClassDef(Result,'TTimeRemotable','TAbstractSimpleRemotable').RegisterExternalAlias('time'); + + AddClassDef(Result,'TAbstractComplexRemotable','TBaseRemotable'); + loc_TBaseComplexSimpleContentRemotable := AddClassDef(Result,'TBaseComplexSimpleContentRemotable','TAbstractComplexRemotable'); + (Result.ByName('TComplexInt16SContentRemotable') as TClassTypeDefinition).SetParent(loc_TBaseComplexSimpleContentRemotable); + (Result.ByName('TComplexFloatDoubleContentRemotable') as TClassTypeDefinition).SetParent(loc_TBaseComplexSimpleContentRemotable); + + AddClassDef(Result,'TBaseComplexRemotable','TAbstractComplexRemotable'); + AddClassDef(Result,'THeaderBlock','TBaseComplexRemotable'); + AddClassDef(Result,'TBaseArrayRemotable','TAbstractComplexRemotable'); + AddClassDef(Result,'TBaseObjectArrayRemotable','TBaseArrayRemotable'); + AddClassDef(Result,'TBaseSimpleTypeArrayRemotable','TBaseArrayRemotable'); + AddClassDef(Result,'TArrayOfStringRemotable','TBaseSimpleTypeArrayRemotable'); + AddClassDef(Result,'TArrayOfBooleanRemotable','TBaseSimpleTypeArrayRemotable'); + AddClassDef(Result,'TArrayOfInt8URemotable','TBaseSimpleTypeArrayRemotable'); + AddClassDef(Result,'TArrayOfInt8SRemotable','TBaseSimpleTypeArrayRemotable'); + AddClassDef(Result,'TArrayOfInt16SRemotable','TBaseSimpleTypeArrayRemotable'); + AddClassDef(Result,'TArrayOfInt16URemotable','TBaseSimpleTypeArrayRemotable'); + AddClassDef(Result,'TArrayOfInt32URemotable','TBaseSimpleTypeArrayRemotable'); + AddClassDef(Result,'TArrayOfInt32SRemotable','TBaseSimpleTypeArrayRemotable'); + AddClassDef(Result,'TArrayOfInt64SRemotable','TBaseSimpleTypeArrayRemotable'); + AddClassDef(Result,'TArrayOfInt64URemotable','TBaseSimpleTypeArrayRemotable'); + AddClassDef(Result,'TArrayOfFloatSingleRemotable','TBaseSimpleTypeArrayRemotable'); + AddClassDef(Result,'TArrayOfFloatDoubleRemotable','TBaseSimpleTypeArrayRemotable'); + AddClassDef(Result,'TArrayOfFloatExtendedRemotable','TBaseSimpleTypeArrayRemotable'); + AddClassDef(Result,'TArrayOfFloatCurrencyRemotable','TBaseSimpleTypeArrayRemotable'); + + locTyp := TTypeAliasDefinition.Create('token',Result.ByName('string') as TTypeDefinition); + Result.Add(locTyp); + locTyp := TTypeAliasDefinition.Create('anyURI',Result.ByName('string') as TTypeDefinition); + Result.Add(locTyp); + locTyp := TTypeAliasDefinition.Create('float',Result.ByName('Single') as TTypeDefinition); + Result.Add(locTyp); + locTyp := TTypeAliasDefinition.Create('nonNegativeInteger',Result.ByName('LongWord') as TTypeDefinition); + Result.Add(locTyp); + locTyp := TTypeAliasDefinition.Create('positiveInteger',Result.ByName('nonNegativeInteger') as TTypeDefinition); + Result.Add(locTyp); + + locTyp := TTypeAliasDefinition.Create('base64Binary',Result.ByName('string') as TTypeDefinition); + Result.Add(locTyp); + + except //base64Binary + FreeAndNil(Result); + raise; + end; +end; + +{ TTypeAliasDefinition } + +procedure TTypeAliasDefinition.FixForwardTypeDefinitions( + AFrw: TForwardTypeDefinition; + Atype: TTypeDefinition +); +begin + if ( FBaseType = AFrw ) then + FBaseType := Atype; +end; + +constructor TTypeAliasDefinition.Create( + const AName : string; + ABaseType : TTypeDefinition +); +begin + Assert(Assigned(ABaseType)); + inherited Create(AName); + FBaseType := ABaseType; +end; + +{ TSimpleConstantDefinition } + +constructor TSimpleConstantDefinition.Create(const AName: string;const AValue: string); +begin + inherited Create(AName); + FValue.DataType := sctString; + FValue.StrValue := AValue; +end; + +constructor TSimpleConstantDefinition.Create(const AName: string;const AValue: Integer); +begin + inherited Create(AName); + FValue.DataType := sctInteger; + FValue.IntValue := AValue; +end; + +{ TArrayDefinition } + +procedure TArrayDefinition.FixForwardTypeDefinitions( + AFrw: TForwardTypeDefinition; + Atype: TTypeDefinition +); +begin + if ( FItemType = AFrw ) then + FItemType := Atype; +end; + +constructor TArrayDefinition.Create( + const AName : string; + AItemType : TTypeDefinition; + const AItemName, + AItemExternalName : string; + const AStyle : TArrayStyle +); +begin + Assert(Assigned(AItemType)); + inherited Create(AName); + FStyle := AStyle; + FItemType := AItemType; + FItemName := AItemName; + FItemExternalName := AItemExternalName; + if IsStrEmpty(FItemExternalName) then + FItemExternalName := FItemName; +end; + +function TArrayDefinition.NeedFinalization(): Boolean; +begin + Result := True; +end; + +{ TNativeSimpleTypeDefinition } + +procedure TNativeSimpleTypeDefinition.SetBoxedType(ABoxedType: TNativeClassTypeDefinition); +begin + FBoxedType := ABoxedType; +end; + +end. diff --git a/wst/tags/0.4/ws_helper/parserutils.pas b/wst/tags/0.4/ws_helper/parserutils.pas new file mode 100644 index 000000000..d3434dfe5 --- /dev/null +++ b/wst/tags/0.4/ws_helper/parserutils.pas @@ -0,0 +1,68 @@ +{ + This unit is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +} + +unit parserutils; + +{$mode objfpc}{$H+} + +interface + +uses + SysUtils; + +const + sNEW_LINE = {$ifndef Unix}#13#10{$else}#10{$endif}; + + function IsStrEmpty(Const AStr : String):Boolean; + function ExtractIdentifier(const AValue : string) : string ; + +implementation + +function IsStrEmpty(Const AStr : String):Boolean; +begin + Result := ( Length(Trim(AStr)) = 0 ); +end; + +function ExtractIdentifier(const AValue : string) : string ; +var + i, c : Integer; + s : string; +begin + Result := ''; + s := Trim(AValue); + c := Length(s); + if ( c > 0 ) then begin + if not ( s[1] in ['A'..'Z', 'a'..'z', '_'] ) then begin + Result := '_'; + end; + for i := 1 to c do begin + if ( s[i] in ['A'..'Z', 'a'..'z', '0'..'9', '_'] ) then begin + Result := Result + s[i]; + end else begin + if ( Length(Result) > 0 ) and ( Result[Length(Result)] <> '_' ) then begin + Result := Result + '_'; + end; + end; + end; + end; +end; + + +end. + diff --git a/wst/tags/0.4/ws_helper/source_utils.pas b/wst/tags/0.4/ws_helper/source_utils.pas new file mode 100644 index 000000000..8e6e6a0fe --- /dev/null +++ b/wst/tags/0.4/ws_helper/source_utils.pas @@ -0,0 +1,307 @@ +{ + This unit is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +} + +unit source_utils; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils; + +Type + + EsourceException = class(Exception) + End; + + ISourceStream = Interface + function GetFileName():string; + procedure SaveToFile(const APath : string); + procedure Indent(); + function IncIndent():Integer; + function DecIndent():Integer; + procedure Write(AText : String);overload; + procedure Write(AText : String; Const AArgs : array of const);overload; + procedure WriteLn(AText : String);overload; + procedure WriteLn(AText : String; Const AArgs : array of const);overload; + procedure NewLine(); + procedure BeginAutoIndent(); + procedure EndAutoIndent(); + End; + + ISourceManager = Interface + function CreateItem(const AFileName : string):ISourceStream; + function Find(const AFileName : string):ISourceStream; + function Merge( + const AFinalFileName : string; + const ASourceList : array of ISourceStream + ) : ISourceStream; + procedure SaveToFile(const APath : string); + End; + + function CreateSourceManager():ISourceManager; + +implementation +uses StrUtils, parserutils; + +Type + + ISavableSourceStream = Interface(ISourceStream) + procedure SaveToStream(AStream : TStream); + procedure SaveToFile(const APath : string); + function GetStream(): TStream; + End; + + { TSourceStream } + + TSourceStream = class(TInterfacedObject,ISavableSourceStream) + Private + FStream : TMemoryStream; + FIndentCount : Integer; + FAutoIndentCount : Integer; + FFileName : string; + Protected + function GetFileName():string; + procedure SaveToStream(AStream : TStream); + function GetStream(): TStream; + procedure SaveToFile(const APath : string); + procedure Indent(); + function IncIndent():Integer; + function DecIndent():Integer; + procedure Write(AText : String);overload; + procedure Write(AText : String; Const AArgs : array of const);overload; + procedure WriteLn(AText : String);overload; + procedure WriteLn(AText : String; Const AArgs : array of const);overload; + procedure NewLine(); + procedure BeginAutoIndent(); + procedure EndAutoIndent(); + function IsInAutoInden():Boolean; + Public + constructor Create(const AFileName:string); + destructor Destroy();override; + End; + + { TSourceManager } + + TSourceManager = class(TInterfacedObject,ISourceManager) + Private + FList : IInterfaceList; + Private + procedure Error(AText : String);overload; + procedure Error(AText : String; Const AArgs : array of const);overload; + + function GetCount():Integer; + function GetItem(const AIndex:Integer):ISourceStream; + Protected + function CreateItem(const AFileName : string):ISourceStream; + function Find(const AFileName : string):ISourceStream; + procedure SaveToFile(const APath : string); + function Merge( + const AFinalFileName : string; + const ASourceList : array of ISourceStream + ) : ISourceStream; + Public + constructor Create(); + End; + +function CreateSourceManager():ISourceManager; +begin + Result := TSourceManager.Create() as ISourceManager; +end; + +{ TSourceManager } + +procedure TSourceManager.Error(AText: String); +begin + Raise EsourceException.Create(AText); +end; + +procedure TSourceManager.Error(AText: String; const AArgs: array of const); +begin + Raise EsourceException.CreateFmt(AText,AArgs); +end; + +function TSourceManager.GetCount(): Integer; +begin + Result := FList.Count; +end; + +function TSourceManager.GetItem(const AIndex: Integer): ISourceStream; +begin + Result := FList[AIndex] as ISourceStream; +end; + +function TSourceManager.CreateItem(const AFileName: string): ISourceStream; +begin + If Assigned(Find(AFileName)) Then + Error('A file named "%s" allready exists.',[AFileName]); + Result := TSourceStream.Create(AFileName) as ISourceStream; + FList.Add(Result); +end; + +function TSourceManager.Find(const AFileName: string): ISourceStream; +Var + i : Integer; + s : string; +begin + s := LowerCase(AFileName); + For i := 0 To Pred(GetCount()) Do Begin + Result := GetItem(i); + If AnsiSameText(s,Result.GetFileName()) Then + Exit; + End; + Result := Nil; +end; + +procedure TSourceManager.SaveToFile(const APath: string); +Var + i : Integer; +begin + For i := 0 To Pred(GetCount()) Do Begin + (GetItem(i) As ISavableSourceStream).SaveToFile(APath); + End; +end; + +function TSourceManager.Merge(const AFinalFileName: string;const ASourceList: array of ISourceStream): ISourceStream; +Var + i : Integer; + s : TStream; +begin + Result := CreateItem(AFinalFileName); + s := (Result as ISavableSourceStream).GetStream(); + For i := Low(ASourceList) To High(ASourceList) Do Begin + (ASourceList[i] as ISavableSourceStream).SaveToStream(s); + FList.Remove(ASourceList[i]); + End; +end; + +constructor TSourceManager.Create(); +begin + FList := TInterfaceList.Create() as IInterfaceList; +end; + +{ TSourceStream } + +function TSourceStream.GetFileName(): string; +begin + Result := FFileName; +end; + +procedure TSourceStream.SaveToStream(AStream: TStream); +begin + AStream.CopyFrom(FStream,0); +end; + +function TSourceStream.GetStream(): TStream; +begin + Result := FStream; +end; + +procedure TSourceStream.SaveToFile(const APath: string); +begin + FStream.SaveToFile(IncludeTrailingPathDelimiter(APath) + GetFileName()); +end; + +procedure TSourceStream.Indent(); +Const INDENT_STR = ' '; +Var + s : string; +begin + If ( FIndentCount > 0 ) Then Begin + s := DupeString(INDENT_STR,FIndentCount); + FStream.Write(s[1],Length(s)); + End; +end; + +function TSourceStream.IncIndent():Integer; +begin + Inc(FIndentCount); + Result := FIndentCount; +end; + +function TSourceStream.DecIndent():Integer; +begin + Assert(FIndentCount>0); + Dec(FIndentCount); + Result := FIndentCount; +end; + +procedure TSourceStream.Write(AText: String); +Var + i : Integer; +begin + If IsInAutoInden() Then + Indent(); + i := Length(AText); + If ( i > 0 ) Then + FStream.Write(AText[1],i); +end; + +procedure TSourceStream.Write(AText: String; const AArgs: array of const); +begin + Write(Format(AText,AArgs)); +end; + +procedure TSourceStream.WriteLn(AText: String); +begin + Write(AText+sNEW_LINE); +end; + +procedure TSourceStream.WriteLn(AText: String; const AArgs: array of const); +begin + Write(AText+sNEW_LINE,AArgs); +end; + +procedure TSourceStream.NewLine(); +begin + WriteLn(''); +end; + +procedure TSourceStream.BeginAutoIndent(); +begin + Inc(FAutoIndentCount); +end; + +procedure TSourceStream.EndAutoIndent(); +begin + Assert(FAutoIndentCount>0); + Dec(FAutoIndentCount); +end; + +function TSourceStream.IsInAutoInden(): Boolean; +begin + Result := ( FAutoIndentCount > 0 ); +end; + +constructor TSourceStream.Create(const AFileName: string); +begin + FFileName := AFileName; + FStream := TMemoryStream.Create(); + FIndentCount := 0; + FAutoIndentCount := 0; +end; + +destructor TSourceStream.Destroy(); +begin + FreeAndNil(FStream); + inherited Destroy(); +end; + +end. diff --git a/wst/tags/0.4/ws_helper/test_CALCULATOR.bat b/wst/tags/0.4/ws_helper/test_CALCULATOR.bat new file mode 100644 index 000000000..7c236a7e1 --- /dev/null +++ b/wst/tags/0.4/ws_helper/test_CALCULATOR.bat @@ -0,0 +1 @@ +C:\Programmes\lazarus\wst\ws_helper\ws_helper -u -i -p -b -a"C:\Programmes\lazarus\wst\tests\files" "C:\Programmes\lazarus\wst\tests\files\CALCULATOR.wsdl" >test_res_CALCULATOR.txt \ No newline at end of file diff --git a/wst/tags/0.4/ws_helper/test_ebay.bat b/wst/tags/0.4/ws_helper/test_ebay.bat new file mode 100644 index 000000000..e65bc8622 --- /dev/null +++ b/wst/tags/0.4/ws_helper/test_ebay.bat @@ -0,0 +1 @@ +C:\Programmes\lazarus\wst\ws_helper\ws_helper -uA -i -p -b -a"C:\Programmes\lazarus\wst\tests\files" "C:\Programmes\lazarus\utils\eBayLast\eBayWSDL.WSDL" >test_res_eBayWSDL.txt \ No newline at end of file diff --git a/wst/tags/0.4/ws_helper/test_googleSearch.bat b/wst/tags/0.4/ws_helper/test_googleSearch.bat new file mode 100644 index 000000000..700e44eac --- /dev/null +++ b/wst/tags/0.4/ws_helper/test_googleSearch.bat @@ -0,0 +1 @@ +C:\Programmes\lazarus\wst\ws_helper\ws_helper -u -i -p -b -a"C:\Programmes\lazarus\wst\tests\files" "C:\Programmes\lazarus\utils\googleapi\GoogleSearch.wsdl" >test_res_GoogleSearch.txt \ No newline at end of file diff --git a/wst/tags/0.4/ws_helper/test_metadata.bat b/wst/tags/0.4/ws_helper/test_metadata.bat new file mode 100644 index 000000000..1263aefa7 --- /dev/null +++ b/wst/tags/0.4/ws_helper/test_metadata.bat @@ -0,0 +1 @@ +C:\Programmes\lazarus\wst\ws_helper\ws_helper -u -i -p -b -a"C:\Programmes\lazarus\wst\tests\files" "C:\Programmes\lazarus\wst\tests\files\metadata_service.wsdl" >test_res_metadata_service.txt \ No newline at end of file diff --git a/wst/tags/0.4/ws_helper/ws_helper.lpi b/wst/tags/0.4/ws_helper/ws_helper.lpi new file mode 100644 index 000000000..201498085 --- /dev/null +++ b/wst/tags/0.4/ws_helper/ws_helper.lpi @@ -0,0 +1,536 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wst/tags/0.4/ws_helper/ws_helper.pas b/wst/tags/0.4/ws_helper/ws_helper.pas new file mode 100644 index 000000000..3661ce39c --- /dev/null +++ b/wst/tags/0.4/ws_helper/ws_helper.pas @@ -0,0 +1,251 @@ +{ + This unit is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +} + + +program ws_helper; + +{$mode objfpc}{$H+} + +uses + Classes, SysUtils, wst_resources_utils, + parserdefs, ws_parser, generator, parserutils, source_utils, + command_line_parser, metadata_generator, binary_streamer, + DOM, xmlread, wsdl2pas_imp; + +resourcestring + sUSAGE = 'ws_helper [-uMODE] [-p] [-b] [-i] [-oPATH] 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 + + ' -p Generate service proxy' + sNEW_LINE + + ' -b Generate service binder' + sNEW_LINE + + ' -i Generate service minimal implementation' + sNEW_LINE + + ' -o PATH Relative output directory' + sNEW_LINE + + ' -a PATH Absolute output directory' + sNEW_LINE; + sCOPYRIGHT = 'ws_helper, Web Service Toolkit 0.4 Copyright (c) 2006, 2007 by Inoussa OUEDRAOGO'; + +const + sWST_META = 'wst_meta'; + +type + TSourceFileType = ( sftPascal, sftWSDL ); + +Var + inFileName,outPath,errStr : string; + srcMngr : ISourceManager; + AppOptions : TComandLineOptions; + NextParam : Integer; + sourceType : TSourceFileType; + symtable : TSymbolTable; + parserMode : TParserMode; + + function ProcessCmdLine():boolean; + begin + NextParam := ParseCmdLineOptions(AppOptions); + if ( NextParam <= Paramcount ) then begin + inFileName := ParamStr(NextParam); + end; + Result := FileExists(ExpandFileName(inFileName)); + if AnsiSameText(ExtractFileExt(inFileName),'.PAS') or + AnsiSameText(ExtractFileExt(inFileName),'.PP') + then begin + sourceType := sftPascal; + end else if AnsiSameText(ExtractFileExt(inFileName),'.WSDL') then begin + sourceType := sftWSDL; + end; + if Result then begin + if ( AppOptions = [] ) then begin + Include(AppOptions,cloProxy); + end; + end else begin + errStr := Format('File not Found : "%s"',[inFileName]); + end; + if ( cloOutPutDirAbsolute in AppOptions ) then begin + outPath := Trim(GetOptionArg(cloOutPutDirAbsolute)); + end else begin + outPath := ExtractFilePath(inFileName); + if ( cloOutPutDirRelative in AppOptions ) then begin + outPath := outPath + Trim(GetOptionArg(cloOutPutDirRelative)); + end; + end; + outPath := IncludeTrailingPathDelimiter(outPath); + parserMode := pmUsedTypes; + if AnsiSameText('A',Trim(GetOptionArg(cloInterface))) then begin + parserMode := pmAllTypes; + end; + end; + + function GenerateSymbolTable() : Boolean ; + + procedure ParsePascalFile(); + var + s : TFileStream; + p : TPascalParser; + begin + s := nil; + p := nil; + try + s := TFileStream.Create(inFileName,fmOpenRead); + p := TPascalParser.Create(s,symtable); + if not p.Parse() then + p.Error('"%s" at line %d',[p.ErrorMessage,p.SourceLine]); + finally + FreeAndNil(p); + FreeAndNil(s); + end; + end; + + procedure ParseWsdlFile(); + var + locDoc : TXMLDocument; + prsr : TWsdlParser; + begin + prsr := nil; + ReadXMLFile(locDoc,inFileName); + try + prsr := TWsdlParser.Create(locDoc,symtable); + prsr.Parse(parserMode); + finally + FreeAndNil(prsr); + FreeAndNil(locDoc); + end; + end; + + begin + try + WriteLn('Parsing the file : ', inFileName); + case sourceType of + sftPascal : ParsePascalFile(); + sftWSDL : ParseWsdlFile(); + end; + Result := True; + except + on e : Exception do begin + Result := False; + errStr := e.Message; + end; + end; + end; + + function ProcessFile():Boolean; + Var + mtdaFS: TMemoryStream; + g : TBaseGenerator; + mg : TMetadataGenerator; + rsrcStrm : TMemoryStream; + begin + Result := False; + rsrcStrm := nil; + mtdaFS := nil; + mg := nil; + g := Nil; + try + try + if ( cloInterface in AppOptions ) then begin + WriteLn('Interface file generation...'); + g := TInftGenerator.Create(symtable,srcMngr); + g.Execute(); + FreeAndNil(g); + end; + + If ( cloProxy in AppOptions ) Then Begin + WriteLn('Proxy file generation...'); + g := TProxyGenerator.Create(symtable,srcMngr); + g.Execute(); + FreeAndNil(g); + End; + + If ( cloBinder in AppOptions ) Then Begin + WriteLn('Binder file generation...'); + g := TBinderGenerator.Create(symtable,srcMngr); + g.Execute(); + FreeAndNil(g); + End; + + If ( cloImp in AppOptions ) Then Begin + WriteLn('Implementation file generation...'); + g := TImplementationGenerator.Create(symtable,srcMngr); + g.Execute(); + FreeAndNil(g); + End; + + if ( [cloBinder,cloProxy]*AppOptions <> [] ) then begin + WriteLn('Metadata file generation...'); + mtdaFS := TMemoryStream.Create(); + mg := TMetadataGenerator.Create(symtable,CreateBinaryWriter(mtdaFS)); + mg.Execute(); + mtdaFS.SaveToFile(ChangeFileExt(inFileName,'.' + sWST_META)); + rsrcStrm := TMemoryStream.Create(); + mtdaFS.Position := 0; + BinToWstRessource(UpperCase(symtable.Name),mtdaFS,rsrcStrm); + rsrcStrm.SaveToFile(outPath + ChangeFileExt(ExtractFileName(inFileName),'.' + sWST_EXTENSION)); + end; + + Result := True; + except + on E : Exception do begin + Result := False; + errStr := E.Message; + end; + end; + finally + rsrcStrm.Free(); + mg.Free();; + mtdaFS.Free();; + g.Free(); + end; + end; + + +begin + symtable := nil; + try + try + Writeln(sCOPYRIGHT); + If ( ParamCount = 0 ) Then Begin + WriteLn(sUSAGE); + Exit; + End; + + if not ProcessCmdLine() then begin + WriteLn(errStr); + Exit; + end; + symtable := TSymbolTable.Create(ChangeFileExt(ExtractFileName(inFileName),'')); + srcMngr := CreateSourceManager(); + + if not GenerateSymbolTable() then begin + WriteLn(errStr); + Exit; + end; + + If Not ProcessFile() Then Begin + WriteLn(errStr); + Exit; + End; + + srcMngr.SaveToFile(outPath); + WriteLn(Format('File "%s" parsed succesfully.',[inFileName])); + except + on e:exception Do + Writeln('Exception : ' + e.Message) + end; + finally + FreeAndNil(symtable); + end; +end. diff --git a/wst/tags/0.4/ws_helper/ws_helper.rst b/wst/tags/0.4/ws_helper/ws_helper.rst new file mode 100644 index 000000000..ab04eb91d --- /dev/null +++ b/wst/tags/0.4/ws_helper/ws_helper.rst @@ -0,0 +1,15 @@ + +# hash value = 13585 +ws_helper.sversion='2.1' + + +# hash value = 71138986 +ws_helper.susage='ws_helper [-p] [-b] [-i] [-oPATH] inputFilename'#13#10' '+ +' -p Generate service proxy'#13#10' -b Generate service binder'#13#10' '+ +' -i Generate service minimal implementation'#13#10' -o PATH Output d'+ +'irectory'#13#10 + +# hash value = 89842783 +ws_helper.scopyright='ws_helper, Web Service Toolkit 2.2 Copyright (c) 20'+ +'06 by Inoussa OUEDRAOGO' + diff --git a/wst/tags/0.4/ws_helper/ws_parser.pas b/wst/tags/0.4/ws_helper/ws_parser.pas new file mode 100644 index 000000000..a99fb87c1 --- /dev/null +++ b/wst/tags/0.4/ws_helper/ws_parser.pas @@ -0,0 +1,487 @@ +{ + This unit is part of the Web Service Toolkit + Copyright (c) 2006 by Inoussa OUEDRAOGO + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +} + +unit ws_parser; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, + parserdefs; + +Type + EParserException = class(Exception) + End; + + { TPascalParser } + + TPascalParser = class + private + FStream : TStream; + FTokenizer : TParser; + FErrorMessage : String; + FSymbolTable : TSymbolTable; + FCurrentSymbol : TAbstractSymbolDefinition; + private + Property Tokenizer : TParser Read FTokenizer; + procedure SetErrorMessage(Const AValue : String); + procedure CheckCurrentString(Const AString : String); + private + procedure BeginParsing(); + procedure EndParsing(); + function GetSourceLine: Integer; + function ReadUntil(Const AText : String; Const ARaiseException : Boolean):Boolean; + procedure SkipComment(); + function NextToken(): Char; + Private + procedure ParseHeader(); + procedure ParseInterfaceSection(); + procedure ParseUses(); + procedure ParseTypeDeclaration(); + procedure ParseInterfaceType(Const AName : String); + procedure ParseEnumType(Const AName : String); + procedure ParseClassType(Const AName : String); + public + constructor Create(AStream : TStream; ASymbolTable : TSymbolTable); + destructor Destroy();override; + procedure Error(Const AMsg : String);overload; + procedure Error(Const AMsg : String; Const AArgs : Array of const);overload; + function Parse():Boolean; + property SourceLine: Integer read GetSourceLine; + property ErrorMessage : String read FErrorMessage; + property SymbolTable : TSymbolTable Read FSymbolTable; + End; + + +implementation + +Type + TPascalToken = ( + ptNone, + ptUnit, ptInterface, ptUses, ptType, + ptImplementation, ptEnd, + ptProcedure, ptFunction, + ptSemicolon, ptComma, ptPeriod, ptEqual, ptColon, + ptLeftParenthesis, ptRigthParenthesis, + ptLeftSquareBracket, ptRigthSquareBracket, + ptConst, ptVar, ptOut, + ptClass + ); +Const + PascalTokenStrMAP : Array[TPascalToken] Of String = ( + '', + 'UNIT', 'INTERFACE', 'USES', 'TYPE', + 'IMPLEMENTATION', 'END', + 'PROCEDURE', 'FUNCTION', + ';', ',', '.', '=', ':', + '(', ')', + '[', ']', + 'CONST', 'VAR', 'OUT', + 'CLASS' + ); + +function GetPascalTokenStr(Const AToken:TPascalToken):String; +begin + Result := PascalTokenStrMAP[AToken]; +end; + +function GetPascalTokenFromStr(Const ATokenStr:String):TPascalToken; +begin + Result := Succ(ptNone); + For Result := Result To High(TPascalToken) Do Begin + If AnsiSameText(ATokenStr,PascalTokenStrMAP[Result]) Then + Exit; + End; + Result := ptNone; +end; + +{ TPascalParser } + +procedure TPascalParser.SetErrorMessage(const AValue: String); +begin + FErrorMessage := AValue; +end; + +procedure TPascalParser.Error(const AMsg: String); +begin + Raise EParserException.Create(AMsg); +end; + +procedure TPascalParser.Error(const AMsg: String; const AArgs: array of const); +begin + Raise EParserException.CreateFmt(AMsg,AArgs); +end; + +procedure TPascalParser.CheckCurrentString(const AString: String); +begin + If Not AnsiSameText(Tokenizer.TokenString,AString) Then + Error('"%s" expected.',[AString]); +end; + +procedure TPascalParser.BeginParsing(); +begin + +end; + +procedure TPascalParser.EndParsing(); +begin + +end; + +function TPascalParser.GetSourceLine: Integer; +begin + Result := Tokenizer.SourceLine; +end; + +function TPascalParser.ReadUntil(Const AText : String; Const ARaiseException : Boolean):Boolean; +begin + While ( Tokenizer.Token <> toEOF ) And ( Not AnsiSameText(Tokenizer.TokenString,AText) ) Do + Tokenizer.NextToken(); + Result := AnsiSameText(Tokenizer.TokenString,AText); + If ARaiseException And ( Not Result ) Then + Error('"%s" not found.',[AText]); +end; + +procedure TPascalParser.SkipComment(); +const L_C = '{'; R_C = '}'; +begin + While ( FTokenizer.TokenString = L_C ) do begin + ReadUntil(R_C,False); + FTokenizer.NextToken(); + end; +end; + +function TPascalParser.NextToken(): Char; +begin + SkipComment(); + Result := FTokenizer.NextToken(); + SkipComment(); +end; + +procedure TPascalParser.ParseHeader(); +begin // Unit UnitName; + SkipComment(); + Tokenizer.CheckTokenSymbol(GetPascalTokenStr(ptUnit)); + NextToken(); + Tokenizer.CheckToken(toSymbol); + FSymbolTable.Name := Tokenizer.TokenString; + NextToken(); + CheckCurrentString(GetPascalTokenStr(ptSemicolon)); + + NextToken(); +end; + +procedure TPascalParser.ParseInterfaceSection(); +begin + ReadUntil(GetPascalTokenStr(ptInterface),True); + Tokenizer.CheckTokenSymbol(GetPascalTokenStr(ptInterface)); + NextToken(); + Tokenizer.CheckToken(toSymbol); + If Tokenizer.TokenSymbolIs(GetPascalTokenStr(ptUses)) Then + ParseUses(); + ReadUntil(GetPascalTokenStr(ptType),True); + Tokenizer.CheckToken(toSymbol); + If Tokenizer.TokenSymbolIs(GetPascalTokenStr(ptType)) Then Begin + NextToken(); + Repeat + ParseTypeDeclaration(); + Until ( Tokenizer.Token = toEOF ) Or + Tokenizer.TokenSymbolIs(GetPascalTokenStr(ptImplementation)) Or + Tokenizer.TokenSymbolIs(GetPascalTokenStr(ptProcedure)) Or + Tokenizer.TokenSymbolIs(GetPascalTokenStr(ptFunction)); + End; +end; + +procedure TPascalParser.ParseUses(); +begin + Tokenizer.CheckTokenSymbol(GetPascalTokenStr(ptUses)); + NextToken(); + Repeat + Tokenizer.CheckToken(toSymbol); //UnitName + NextToken(); + If AnsiSameText(Tokenizer.TokenString,GetPascalTokenStr(ptSemicolon)) Then + Break; + CheckCurrentString(GetPascalTokenStr(ptComma)); + NextToken(); + Until ( Tokenizer.Token = toEOF ) Or AnsiSameText(Tokenizer.TokenString,GetPascalTokenStr(ptSemicolon)); + CheckCurrentString(GetPascalTokenStr(ptSemicolon)); + NextToken(); +end; + +procedure TPascalParser.ParseTypeDeclaration(); +var + sname : string; +begin + Tokenizer.CheckToken(toSymbol); + sname := Tokenizer.TokenString; + NextToken(); + CheckCurrentString(GetPascalTokenStr(ptEqual)); + + NextToken(); + if AnsiSameText(Tokenizer.TokenString,GetPascalTokenStr(ptLeftParenthesis)) then + self.ParseEnumType(sname) + else if AnsiSameText(Tokenizer.TokenString,GetPascalTokenStr(ptClass)) then + self.ParseClassType(sname) + else begin + Tokenizer.CheckToken(toSymbol); + if Tokenizer.TokenSymbolIs(GetPascalTokenStr(ptInterface)) then + ParseInterfaceType(sname) + else begin + ReadUntil(GetPascalTokenStr(ptEnd),True); + NextToken();// End + NextToken();// ; + end; + end; +end; + +procedure TPascalParser.ParseInterfaceType(const AName: String); +Var + sbl : TInterfaceDefinition; + + procedure ReadIntfHeader(); + begin + NextToken(); + Repeat + Tokenizer.CheckToken(toSymbol); + NextToken(); + If AnsiSameText(Tokenizer.TokenString,GetPascalTokenStr(ptRigthParenthesis)) Then Begin + NextToken(); + Break; + End; + NextToken(); + CheckCurrentString(GetPascalTokenStr(ptComma)); + + NextToken(); + Until ( Tokenizer.Token = toEOF ) ; + end; + + procedure ReadProcedure(Const AProc : Boolean); + Var + tmpStr,prmName : String; + tmpTkn : TPascalToken; + pr : TMethodDefinition; + prmM : TParameterModifier; + dataTypeSbl : TTypeDefinition; + foundSymbol : TAbstractSymbolDefinition; + begin + NextToken(); + Tokenizer.CheckToken(toSymbol); + tmpStr := Tokenizer.TokenString; + If AProc Then + pr := sbl.AddMethod(tmpStr,mtProcedure) + Else + pr := sbl.AddMethod(tmpStr,mtFunction); + NextToken(); + If AnsiSameText(Tokenizer.TokenString,GetPascalTokenStr(ptLeftParenthesis)) Then Begin + NextToken(); + If AnsiSameText(Tokenizer.TokenString,GetPascalTokenStr(ptRigthParenthesis)) Then + NextToken() + Else Begin + Repeat + Tokenizer.CheckToken(toSymbol); + tmpStr := Tokenizer.TokenString; + tmpTkn := GetPascalTokenFromStr(tmpStr); + prmM := pmNone; + If ( tmpTkn = ptConst ) Then Begin + prmM := pmConst; + End Else If ( tmpTkn = ptVar ) Then Begin + prmM := pmVar; + End Else If ( tmpTkn = ptOut ) Then Begin + prmM := pmOut; + End; + If ( prmM > pmNone ) Then Begin + NextToken(); + tmpStr := Tokenizer.TokenString; + End; + prmName := tmpStr; + NextToken(); + CheckCurrentString(GetPascalTokenStr(ptColon)); + + NextToken(); + Tokenizer.CheckToken(toSymbol); + tmpStr := Tokenizer.TokenString; + foundSymbol := FSymbolTable.Find(tmpStr); + If Assigned(foundSymbol) And ( Not foundSymbol.InheritsFrom(TTypeDefinition) ) Then + Error('Type symbol expected where "%s" was found.',[foundSymbol.Name]); + If Assigned(foundSymbol) Then + dataTypeSbl := foundSymbol As TTypeDefinition + Else Begin + dataTypeSbl := TTypeDefinition.Create(tmpStr); + FSymbolTable.Add(dataTypeSbl); + End; + pr.AddParameter(prmName,prmM,dataTypeSbl); + NextToken(); + tmpStr := Tokenizer.TokenString; + If AnsiSameText(Tokenizer.TokenString,GetPascalTokenStr(ptRigthParenthesis)) Then Begin + NextToken(); + Break; + End; + NextToken(); + Until ( Tokenizer.Token = toEOF ) ; + End; + End; + If Not AProc Then Begin + CheckCurrentString(GetPascalTokenStr(ptColon)); + NextToken(); + Tokenizer.CheckToken(toSymbol); + tmpStr := Tokenizer.TokenString; + dataTypeSbl := FSymbolTable.Find(tmpStr) As TTypeDefinition; + If Not Assigned(dataTypeSbl) Then Begin + dataTypeSbl := TTypeDefinition.Create(tmpStr); + FSymbolTable.Add(dataTypeSbl); + End; + pr.AddParameter('result',pmOut,dataTypeSbl); + NextToken(); + End; + CheckCurrentString(GetPascalTokenStr(ptSemicolon)); + NextToken(); + end; + + procedure ReadFunction(); + begin + ReadProcedure(False); + end; + + procedure ReadGUID(); + begin //['{804A3825-ADA5-4499-87BF-CF5491BFD674}'] + CheckCurrentString(GetPascalTokenStr(ptLeftSquareBracket)); + NextToken(); + FTokenizer.CheckToken(toString); + sbl.InterfaceGUID := FTokenizer.TokenString; + NextToken(); + CheckCurrentString(GetPascalTokenStr(ptRigthSquareBracket)); + NextToken(); + end; + +begin + Tokenizer.CheckTokenSymbol(GetPascalTokenStr(ptInterface)); + sbl := TInterfaceDefinition.Create(AName); + FSymbolTable.Add(sbl); + FCurrentSymbol := sbl; + NextToken(); + if AnsiSameText(Tokenizer.TokenString,GetPascalTokenStr(ptLeftParenthesis)) then + ReadIntfHeader(); + if AnsiSameText(Tokenizer.TokenString,GetPascalTokenStr(ptLeftSquareBracket)) then + ReadGUID(); + repeat + if Tokenizer.TokenSymbolIs(GetPascalTokenStr(ptProcedure)) then + ReadProcedure(True) + else if Tokenizer.TokenSymbolIs(GetPascalTokenStr(ptFunction)) then + ReadFunction() + else if Tokenizer.TokenSymbolIs(GetPascalTokenStr(ptEnd)) then begin + NextToken(); + NextToken(); + Break; + end else begin + Error('"%s", "%s", "%s" expected.',[GetPascalTokenStr(ptProcedure),GetPascalTokenStr(ptFunction),GetPascalTokenStr(ptEnd)]); + end; + until ( Tokenizer.Token = toEOF ) ; +end; + +procedure TPascalParser.ParseEnumType(const AName: String); +Var + sbl : TEnumTypeDefinition; + tmpStr : String; + sblItem : TEnumItemDefinition; + tmpInt : Integer; +begin + sbl := TEnumTypeDefinition.Create(AName); + FSymbolTable.Add(sbl); + FCurrentSymbol := sbl; + CheckCurrentString(GetPascalTokenStr(ptLeftParenthesis)); + NextToken(); + Tokenizer.CheckToken(toSymbol); + tmpInt := 0; + Repeat + tmpStr := Tokenizer.TokenString; + If ( FSymbolTable.IndexOf(tmpStr) > -1 ) Then + Error('Duplicated symbol : "%s"',[tmpStr]); + sblItem := TEnumItemDefinition.Create(tmpStr,sbl,tmpInt); + FSymbolTable.Add(sblItem); + sbl.AddItem(sblItem); + NextToken(); + If AnsiSameText(Tokenizer.TokenString,GetPascalTokenStr(ptRigthParenthesis)) Then + Break; + If AnsiSameText(Tokenizer.TokenString,GetPascalTokenStr(ptComma)) Then + NextToken(); + Tokenizer.CheckToken(toSymbol); + Inc(tmpInt); + Until ( Tokenizer.Token = toEOF ) ; + CheckCurrentString(GetPascalTokenStr(ptRigthParenthesis)); + NextToken(); + CheckCurrentString(GetPascalTokenStr(ptSemicolon)); + NextToken(); +end; + +procedure TPascalParser.ParseClassType(const AName: String); +Var + sbl : TClassTypeDefinition; +begin + sbl := TClassTypeDefinition.Create(AName); + FSymbolTable.Add(sbl); + FCurrentSymbol := sbl; + CheckCurrentString(GetPascalTokenStr(ptClass)); + NextToken(); + ReadUntil(GetPascalTokenStr(ptEnd),True); + CheckCurrentString(GetPascalTokenStr(ptEnd)); + NextToken(); + CheckCurrentString(GetPascalTokenStr(ptSemicolon)); + NextToken(); +end; + +constructor TPascalParser.Create(AStream : TStream; ASymbolTable : TSymbolTable); +begin + Assert(Assigned(AStream)); + Assert(Assigned(ASymbolTable)); + FStream := AStream; + FTokenizer := TParser.Create(FStream); + FSymbolTable := ASymbolTable; + FSymbolTable.Add(CreateWstInterfaceSymbolTable()); + FCurrentSymbol := Nil; +end; + +destructor TPascalParser.Destroy(); +begin + FTokenizer.Free(); + inherited Destroy(); +end; + +function TPascalParser.Parse(): Boolean; +begin + BeginParsing(); + Try + Try + SkipComment(); + ParseHeader(); + ParseInterfaceSection(); + Except + On E : Exception Do Begin + Result := False; + SetErrorMessage(E.Message ); + End; + End; + Finally + EndParsing(); + End; +end; + +end. + diff --git a/wst/tags/0.4/ws_helper/wsdl2pas_imp.pas b/wst/tags/0.4/ws_helper/wsdl2pas_imp.pas new file mode 100644 index 000000000..bde4a58e4 --- /dev/null +++ b/wst/tags/0.4/ws_helper/wsdl2pas_imp.pas @@ -0,0 +1,2307 @@ +unit wsdl2pas_imp; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, DOM, + parserdefs, cursor_intf, rtti_filters; + +type + + EWslParserException = class(Exception) + end; + + TWsdlParser = class; + + TAbstractTypeParserClass = class of TAbstractTypeParser; + { TAbstractTypeParser } + + TAbstractTypeParser = class + private + FOwner : TWsdlParser; + FTypeNode : TDOMNode; + FSymbols : TSymbolTable; + FTypeName : string; + FEmbededDef : Boolean; + public + constructor Create( + AOwner : TWsdlParser; + ATypeNode : TDOMNode; + ASymbols : TSymbolTable; + const ATypeName : string; + const AEmbededDef : Boolean + ); + class function ExtractEmbeddedTypeFromElement( + AOwner : TWsdlParser; + AEltNode : TDOMNode; + ASymbols : TSymbolTable; + const ATypeName : string + ) : TTypeDefinition; + class function GetParserSupportedStyle():string;virtual;abstract; + class procedure RegisterParser(AParserClass : TAbstractTypeParserClass); + class function GetRegisteredParserCount() : Integer; + class function GetRegisteredParser(const AIndex : Integer):TAbstractTypeParserClass; + function Parse():TTypeDefinition;virtual;abstract; + end; + + TDerivationMode = ( dmNone, dmExtension, dmRestriction ); + TSequenceType = ( stElement, stAll ); + + { TComplexTypeParser } + + TComplexTypeParser = class(TAbstractTypeParser) + private + FAttCursor : IObjectCursor; + FChildCursor : IObjectCursor; + FContentNode : TDOMNode; + FContentType : string; + FBaseType : TTypeDefinition; + FDerivationMode : TDerivationMode; + FDerivationNode : TDOMNode; + FSequenceType : TSequenceType; + private + procedure CreateNodeCursors(); + procedure ExtractTypeName(); + procedure ExtractContentType(); + procedure ExtractBaseType(); + function ParseComplexContent(const ATypeName : string):TTypeDefinition; + function ParseSimpleContent(const ATypeName : string):TTypeDefinition; + function ParseEmptyContent(const ATypeName : string):TTypeDefinition; + public + class function GetParserSupportedStyle():string;override; + function Parse():TTypeDefinition;override; + end; + + { TSimpleTypeParser } + + TSimpleTypeParser = class(TAbstractTypeParser) + private + FAttCursor : IObjectCursor; + FChildCursor : IObjectCursor; + FBaseName : string; + FRestrictionNode : TDOMNode; + FIsEnum : Boolean; + private + procedure CreateNodeCursors(); + procedure ExtractTypeName(); + function ExtractContentType() : Boolean; + function ParseEnumContent():TTypeDefinition; + function ParseOtherContent():TTypeDefinition; + public + class function GetParserSupportedStyle():string;override; + function Parse():TTypeDefinition;override; + end; + + TParserMode = ( pmUsedTypes, pmAllTypes ); + + { TWsdlParser } + + TWsdlParser = class + private + FDoc : TXMLDocument; + FSymbols : TSymbolTable; + private + FWsdlShortNames : TStringList; + FSoapShortNames : TStringList; + FXSShortNames : TStringList; + FChildCursor : IObjectCursor; + FServiceCursor : IObjectCursor; + FBindingCursor : IObjectCursor; + FPortTypeCursor : IObjectCursor; + FMessageCursor : IObjectCursor; + FTypesCursor : IObjectCursor; + FSchemaCursor : IObjectCursor; + private + function CreateWsdlNameFilter(const AName : WideString):IObjectFilter; + function FindNamedNode(AList : IObjectCursor; const AName : WideString):TDOMNode; + procedure Prepare(); + procedure ParseService(ANode : TDOMNode); + procedure ParsePort(ANode : TDOMNode); + function ParsePortType( + ANode, ABindingNode : TDOMNode + ) : TInterfaceDefinition; + function ParseOperation( + AOwner : TInterfaceDefinition; + ANode : TDOMNode; + const ASoapBindingStyle : string + ) : TMethodDefinition; + function ParseType(const AName, ATypeOrElement : string) : TTypeDefinition; + procedure ParseTypes(); + public + constructor Create(ADoc : TXMLDocument; ASymbols : TSymbolTable); + destructor Destroy();override; + procedure Parse(const AMode : TParserMode); + property SymbolTable : TSymbolTable read FSymbols; + end; + + +implementation +uses dom_cursors, parserutils, StrUtils, Contnrs; + +const + s_address : WideString = 'address'; + s_all : WideString = 'all'; + //s_any : WideString = 'any'; + s_array : WideString = 'array'; + s_arrayType : WideString = 'arrayType'; + s_attribute : WideString = 'attribute'; + s_base : WideString = 'base'; + s_binding : WideString = 'binding'; + s_body : WideString = 'body'; + s_complexContent : WideString = 'complexContent'; + s_complexType : WideString = 'complexType'; + s_document : WideString = 'document'; + s_element : WideString = 'element'; + s_enumeration : WideString = 'enumeration'; + s_extension : WideString = 'extension'; + s_input : WideString = 'input'; + s_item : WideString = 'item'; + s_location : WideString = 'location'; + s_message : WideString = 'message'; + s_maxOccurs : WideString = 'maxOccurs'; + s_minOccurs : WideString = 'minOccurs'; + s_name : WideString = 'name'; + s_operation : WideString = 'operation'; + s_optional : WideString = 'optional'; + s_output : WideString = 'output'; + s_part : WideString = 'part'; + s_port : WideString = 'port'; + s_portType : WideString = 'portType'; + s_prohibited : WideString = 'prohibited'; + s_ref : WideString = 'ref'; + s_required : WideString = 'required'; + s_restriction : WideString = 'restriction'; + //s_return : WideString = 'return'; + s_rpc : WideString = 'rpc'; + s_schema : WideString = 'schema'; + s_xs : WideString = 'http://www.w3.org/2001/XMLSchema'; + s_sequence : WideString = 'sequence'; + s_service : WideString = 'service'; + s_simpleContent : WideString = 'simpleContent'; + s_simpleType : WideString = 'simpleType'; + s_soap : WideString = 'http://schemas.xmlsoap.org/wsdl/soap/'; + s_soapAction : WideString = 'soapAction'; + s_soapInputEncoding : WideString = 'Input_EncodingStyle'; + s_soapOutputEncoding : WideString = 'OutputEncodingStyle'; + s_soapStyle : WideString = 'style'; + s_style : WideString = 'style'; + s_targetNamespace : WideString = 'targetNamespace'; + s_type : WideString = 'type'; + s_types : WideString = 'types'; + s_unbounded : WideString = 'unbounded'; + s_use : WideString = 'use'; + s_value : WideString = 'value'; + s_wsdl : WideString = 'http://schemas.xmlsoap.org/wsdl/'; + s_xmlns : WideString = 'xmlns'; + + //---------------------------------------------------------- + s_NODE_NAME = 'NodeName'; + s_NODE_VALUE = 'NodeValue'; + s_TRANSPORT = 'TRANSPORT'; + s_FORMAT = 'FORMAT'; + +type TCursorExposedType = ( cetRttiNode, cetDomNode ); +function CreateAttributesCursor(ANode : TDOMNode; const AExposedType : TCursorExposedType):IObjectCursor; +begin + Result := nil; + if ( ANode <> nil ) and ( ANode.Attributes <> nil ) and ( ANode.Attributes.Length > 0 ) then begin + Result := TDOMNamedNodeMapCursor.Create(ANode.Attributes,faNone) ; + if ( AExposedType = cetRttiNode ) then + Result := TDOMNodeRttiExposerCursor.Create(Result); + end; +end; + +function CreateChildrenCursor(ANode : TDOMNode; const AExposedType : TCursorExposedType):IObjectCursor; +begin + Result := nil; + if ( ANode <> nil ) and ANode.HasChildNodes() then begin + Result := TDOMNodeListCursor.Create(ANode.GetChildNodes(),faFreeOnDestroy) ; + if ( AExposedType = cetRttiNode ) then + Result := TDOMNodeRttiExposerCursor.Create(Result); + end; +end; + +function ExtractNameFromQName(const AQName : string):string ; +var + i : Integer; +begin + Result := Trim(AQName); + i := Pos(':',Result); + if ( i > 0 ) then + Result := Copy(Result,( i + 1 ), MaxInt); +end; + +function CreateQualifiedNameFilterStr( + const AName : WideString; + APrefixList : TStrings +) : string; +var + k : Integer; + locStr : string; + locWStr : WideString; +begin + Result := ''; + if ( APrefixList.Count > 0 ) then begin + for k := 0 to Pred(APrefixList.Count) do begin + if IsStrEmpty(APrefixList[k]) then begin + locWStr := '' + end else begin + locWStr := APrefixList[k] + ':'; + end; + locWStr := locWStr + AName; + locStr := s_NODE_NAME; + Result := Result + ' or ' + locStr + ' = ' + QuotedStr(locWStr); + end; + if ( Length(Result) > 0 ) then begin + Delete(Result,1,Length(' or')); + end; + end else begin + Result := Format('%s = %s',[s_NODE_NAME,QuotedStr(AName)]); + end; +end; + +{ TWsdlParser } + +function TWsdlParser.CreateWsdlNameFilter(const AName: WideString): IObjectFilter; +begin + Result := ParseFilter(CreateQualifiedNameFilterStr(AName,FWsdlShortNames),TDOMNodeRttiExposer); +end; + +function TWsdlParser.FindNamedNode( + AList : IObjectCursor; + const AName : WideString +): TDOMNode; +var + attCrs, crs : IObjectCursor; + curObj : TDOMNodeRttiExposer; + fltr : IObjectFilter; +begin + Result := nil; + if Assigned(AList) then begin + fltr := ParseFilter(Format('%s = %s',[s_NODE_NAME,QuotedStr(s_name)]),TDOMNodeRttiExposer); + AList.Reset(); + while AList.MoveNext() do begin + curObj := AList.GetCurrent() as TDOMNodeRttiExposer; + attCrs := CreateAttributesCursor(curObj.InnerObject,cetRttiNode); + if Assigned(attCrs) then begin + crs := CreateCursorOn(attCrs,fltr); + crs.Reset(); + if crs.MoveNext() and AnsiSameText(AName,TDOMNodeRttiExposer(crs.GetCurrent()).NodeValue) then begin + Result := curObj.InnerObject; + exit; + end; + end; + end; + end; +end; + +type + TNotFoundAction = ( nfaNone, nfaRaiseException ); +procedure ExtractNameSpaceShortNames( + AAttribCursor : IObjectCursor; + AResList : TStrings; + const ANameSpace : WideString; + const ANotFoundAction : TNotFoundAction; + const AClearBefore : Boolean +); +var + crs : IObjectCursor; + locObj : TDOMNodeRttiExposer; + wStr : WideString; + i : Integer; +begin + if AClearBefore then begin + AResList.Clear(); + end; + AAttribCursor.Reset(); + crs := CreateCursorOn(AAttribCursor,ParseFilter(Format('%s=%s',[s_NODE_VALUE,QuotedStr(ANameSpace)]),TDOMNodeRttiExposer)); + crs.Reset(); + if crs.MoveNext() then begin + repeat + locObj := crs.GetCurrent() as TDOMNodeRttiExposer; + wStr := Trim(locObj.NodeName); + i := AnsiPos(s_xmlns + ':',wStr); + if ( i > 0 ) then begin + i := AnsiPos(':',wStr); + AResList.Add(Copy(wStr,( i + 1 ), MaxInt)); + end else begin + if ( AResList.IndexOf('') = -1 ) then + AResList.Add(''); + end; + until not crs.MoveNext(); + end else begin + if ( ANotFoundAction = nfaRaiseException ) then begin + raise EWslParserException.CreateFmt('Namespace not found : "%s"',[ANameSpace]); + end; + end; +end; + +procedure ExtractNameSpaceShortNamesNested( + ANode : TDOMNode; + AResList : TStrings; + const ANameSpace : WideString +); +var + nd : TDOMNode; +begin + AResList.Clear(); + nd := ANode; + while Assigned(nd) do begin + if Assigned(nd.Attributes) and ( nd.Attributes.Length > 0 ) then begin + ExtractNameSpaceShortNames(CreateAttributesCursor(nd,cetRttiNode),AResList,ANameSpace,nfaNone,False); + end; + nd := nd.ParentNode; + end; +end; + +procedure TWsdlParser.Prepare(); +var + locAttCursor : IObjectCursor; + locObj : TDOMNodeRttiExposer; +begin + FPortTypeCursor := nil; + FWsdlShortNames.Clear(); + locAttCursor := CreateAttributesCursor(FDoc.DocumentElement,cetRttiNode); + + FChildCursor := TDOMNodeListCursor.Create(FDoc.DocumentElement.GetChildNodes,faFreeOnDestroy) ; + FChildCursor := TDOMNodeRttiExposerCursor.Create(FChildCursor); + + ExtractNameSpaceShortNames(locAttCursor,FWsdlShortNames,s_wsdl,nfaRaiseException,True); + ExtractNameSpaceShortNames(locAttCursor,FSoapShortNames,s_soap,nfaRaiseException,False); + ExtractNameSpaceShortNames(locAttCursor,FXSShortNames,s_xs,nfaNone,True); + + FServiceCursor := CreateCursorOn( + FChildCursor.Clone() as IObjectCursor, + ParseFilter(CreateQualifiedNameFilterStr(s_service,FWsdlShortNames),TDOMNodeRttiExposer) + ); + FServiceCursor.Reset(); + + FBindingCursor := CreateCursorOn( + FChildCursor.Clone() as IObjectCursor, + ParseFilter(CreateQualifiedNameFilterStr(s_binding,FWsdlShortNames),TDOMNodeRttiExposer) + ); + FBindingCursor.Reset(); + + FPortTypeCursor := CreateCursorOn( + FChildCursor.Clone() as IObjectCursor, + ParseFilter(CreateQualifiedNameFilterStr(s_portType,FWsdlShortNames),TDOMNodeRttiExposer) + ); + FPortTypeCursor.Reset(); + + FSchemaCursor := nil; + FTypesCursor := CreateCursorOn( + FChildCursor.Clone() as IObjectCursor, + ParseFilter(CreateQualifiedNameFilterStr(s_types,FWsdlShortNames),TDOMNodeRttiExposer) + ); + FTypesCursor.Reset(); + if FTypesCursor.MoveNext() then begin + locObj := FTypesCursor.GetCurrent() as TDOMNodeRttiExposer; + if locObj.InnerObject.HasChildNodes() then begin + FSchemaCursor := CreateChildrenCursor(locObj.InnerObject,cetRttiNode); + FSchemaCursor.Reset(); + FSchemaCursor := CreateCursorOn( + FSchemaCursor,//.Clone() as IObjectCursor, + ParseFilter(CreateQualifiedNameFilterStr(s_schema,FXSShortNames),TDOMNodeRttiExposer) + ); + FSchemaCursor.Reset(); + end; + end; + + FMessageCursor := CreateCursorOn( + FChildCursor.Clone() as IObjectCursor, + ParseFilter(CreateQualifiedNameFilterStr(s_message,FWsdlShortNames),TDOMNodeRttiExposer) + ); + FMessageCursor.Reset(); +end; + +procedure TWsdlParser.ParseService(ANode: TDOMNode); +var + locCursor, locPortCursor : IObjectCursor; + locObj : TDOMNodeRttiExposer; +begin + locCursor := CreateChildrenCursor(ANode,cetRttiNode); + if Assigned(locCursor) then begin + locPortCursor := CreateCursorOn( + locCursor, + ParseFilter(CreateQualifiedNameFilterStr(s_port,FWsdlShortNames),TDOMNodeRttiExposer) + ); + locPortCursor.Reset(); + while locPortCursor.MoveNext() do begin + locObj := locPortCursor.GetCurrent() as TDOMNodeRttiExposer; + ParsePort(locObj.InnerObject); + end; + end; +end; + +procedure TWsdlParser.ParsePort(ANode: TDOMNode); + + function FindBindingNode(const AName : WideString):TDOMNode; + var + crs : IObjectCursor; + begin + Result := FindNamedNode(FBindingCursor,AName); + if Assigned(Result) then begin + crs := CreateChildrenCursor(Result,cetRttiNode); + if Assigned(crs) then begin + crs := CreateCursorOn(crs,ParseFilter(CreateQualifiedNameFilterStr(s_binding,FSoapShortNames),TDOMNodeRttiExposer)); + crs.Reset(); + if not crs.MoveNext() then begin + Result := nil; + end; + end else begin + Result := nil; + end; + end; + end; + + function ExtractBindingQName(out AName : WideString):Boolean ; + var + attCrs, crs : IObjectCursor; + begin + Result := False; + attCrs := CreateAttributesCursor(ANode,cetRttiNode); + if Assigned(attCrs) then begin + crs := CreateCursorOn(attCrs,ParseFilter(Format('%s = %s',[s_NODE_NAME,QuotedStr(s_binding)]),TDOMNodeRttiExposer)); + crs.Reset(); + if crs.MoveNext() then begin + AName := TDOMNodeRttiExposer(crs.GetCurrent()).NodeValue; + Result := True; + exit; + end; + end; + end; + + function ExtractTypeQName(ABndgNode : TDOMNode; out AName : WideString):Boolean ; + var + attCrs, crs : IObjectCursor; + begin + Result := False; + attCrs := CreateAttributesCursor(ABndgNode,cetRttiNode); + if Assigned(attCrs) then begin + crs := CreateCursorOn(attCrs,ParseFilter(Format('%s = %s',[s_NODE_NAME,QuotedStr(s_type)]),TDOMNodeRttiExposer)); + crs.Reset(); + if crs.MoveNext() then begin + AName := TDOMNodeRttiExposer(crs.GetCurrent()).NodeValue; + Result := True; + exit; + end; + end; + end; + + function FindTypeNode(const AName : WideString):TDOMNode; + begin + Result := FindNamedNode(FPortTypeCursor,AName); + end; + + function ExtractAddress() : string; + var + tmpCrs : IObjectCursor; + nd : TDOMNode; + begin + Result := ''; + if ANode.HasChildNodes() then begin + tmpCrs := CreateCursorOn( + CreateChildrenCursor(ANode,cetRttiNode), + ParseFilter(CreateQualifiedNameFilterStr(s_address,FSoapShortNames),TDOMNodeRttiExposer) + ); + tmpCrs.Reset(); + if tmpCrs.MoveNext() then begin + nd := (tmpCrs.GetCurrent() as TDOMNodeRttiExposer).InnerObject; + tmpCrs := CreateCursorOn( + CreateAttributesCursor(nd,cetRttiNode), + ParseFilter(Format('%s = %s',[s_NODE_NAME,QuotedStr(s_location)]),TDOMNodeRttiExposer) + ); + if Assigned(tmpCrs) and tmpCrs.MoveNext() then begin + Result := (tmpCrs.GetCurrent() as TDOMNodeRttiExposer).NodeValue; + end; + end; + end; + end; + +var + bindingName, typeName : WideString; + i : Integer; + bindingNode, typeNode : TDOMNode; + intfDef : TInterfaceDefinition; +begin + if ExtractBindingQName(bindingName) then begin + i := Pos(':',bindingName); + bindingName := Copy(bindingName,( i + 1 ), MaxInt); + bindingNode := FindBindingNode(bindingName); + if Assigned(bindingNode) then begin + if ExtractTypeQName(bindingNode,typeName) then begin + i := Pos(':',typeName); + typeName := Copy(typeName,( i + 1 ), MaxInt); + typeNode := FindTypeNode(typeName); + if Assigned(typeNode) then begin + intfDef := ParsePortType(typeNode,bindingNode); + intfDef.Address := ExtractAddress(); + end; + end; + end; + end; +end; + +function StrToBindingStyle(const AStr : string):TBindingStyle; +begin + if IsStrEmpty(AStr) then begin + Result := bsDocument; + end else if AnsiSameText(AStr,s_document) then begin + Result := bsDocument; + end else if AnsiSameText(AStr,s_rpc) then begin + Result := bsRPC; + end else begin + Result := bsUnknown; + end; +end; + +function TWsdlParser.ParsePortType(ANode, ABindingNode : TDOMNode) : TInterfaceDefinition; + + function ExtractSoapBindingStyle(out AName : WideString):Boolean ; + var + childrenCrs, crs, attCrs : IObjectCursor; + s : string; + begin + AName := ''; + Result := False; + childrenCrs := CreateChildrenCursor(ABindingNode,cetRttiNode); + if Assigned(childrenCrs) then begin + s := CreateQualifiedNameFilterStr(s_binding,FSoapShortNames); + crs := CreateCursorOn(childrenCrs,ParseFilter(s,TDOMNodeRttiExposer)); + crs.Reset(); + if crs.MoveNext() then begin + attCrs := CreateAttributesCursor(TDOMNodeRttiExposer(crs.GetCurrent()).InnerObject,cetRttiNode); + if Assigned(attCrs) then begin + s := s_NODE_NAME + ' = ' + QuotedStr(s_style); + crs := CreateCursorOn(attCrs,ParseFilter(s,TDOMNodeRttiExposer)); + crs.Reset(); + if crs.MoveNext() then begin + AName := TDOMNodeRttiExposer(crs.GetCurrent()).NodeValue; + Result := True; + exit; + end; + end; + end; + end; + end; + + function ExtractBindingOperationCursor() : IObjectCursor ; + begin + Result := nil; + if ABindingNode.HasChildNodes() then begin + Result := CreateCursorOn( + CreateChildrenCursor(ABindingNode,cetRttiNode), + ParseFilter(CreateQualifiedNameFilterStr(s_operation,FWsdlShortNames),TDOMNodeRttiExposer) + ); + end; + end; + + procedure ParseOperation_EncodingStyle(ABndngOpCurs : IObjectCursor; AOp : TMethodDefinition); + var + nd, ndSoap : TDOMNode; + tmpCrs, tmpSoapCrs, tmpXcrs : IObjectCursor; + in_out_count : Integer; + strBuffer : string; + begin + nd := FindNamedNode(ABndngOpCurs,AOp.ExternalName); + if Assigned(nd) and nd.HasChildNodes() then begin + tmpCrs := CreateCursorOn( + CreateChildrenCursor(nd,cetRttiNode), + ParseFilter( + CreateQualifiedNameFilterStr(s_input,FWsdlShortNames) + ' or ' + + CreateQualifiedNameFilterStr(s_output,FWsdlShortNames) + , + TDOMNodeRttiExposer + ) + ); + tmpCrs.Reset(); + in_out_count := 0; + while tmpCrs.MoveNext() and ( in_out_count < 2 ) do begin + Inc(in_out_count); + nd := (tmpCrs.GetCurrent() as TDOMNodeRttiExposer).InnerObject; + if nd.HasChildNodes() then begin + tmpSoapCrs := CreateCursorOn( + CreateChildrenCursor(nd,cetRttiNode), + ParseFilter(CreateQualifiedNameFilterStr(s_body,FSoapShortNames),TDOMNodeRttiExposer) + ); + tmpSoapCrs.Reset(); + if tmpSoapCrs.MoveNext() then begin + ndSoap := (tmpSoapCrs.GetCurrent() as TDOMNodeRttiExposer).InnerObject; + if Assigned(ndSoap.Attributes) and ( ndSoap.Attributes.Length > 0 ) then begin + tmpXcrs := CreateCursorOn( + CreateAttributesCursor(ndSoap,cetRttiNode), + ParseFilter( + Format('%s = %s',[s_NODE_NAME,QuotedStr(s_use)]), + TDOMNodeRttiExposer + ) + ); + tmpXcrs.Reset(); + if tmpXcrs.MoveNext() then begin + if AnsiSameText(s_input,ExtractNameFromQName(nd.NodeName)) then begin + strBuffer := s_soapInputEncoding; + end else begin + strBuffer := s_soapOutputEncoding; + end; + AOp.Properties.Values[s_FORMAT + '_' + strBuffer] := (tmpXcrs.GetCurrent() as TDOMNodeRttiExposer).InnerObject.NodeValue; + end; + end; + end; + end; + end; + end; + end; + + procedure ParseOperationAttributes(ABndngOpCurs : IObjectCursor; AOp : TMethodDefinition); + var + nd : TDOMNode; + tmpCrs : IObjectCursor; + begin + nd := FindNamedNode(ABndngOpCurs,AOp.ExternalName); + if Assigned(nd) and nd.HasChildNodes() then begin + tmpCrs := CreateCursorOn( + CreateChildrenCursor(nd,cetRttiNode), + ParseFilter(CreateQualifiedNameFilterStr(s_operation,FSoapShortNames),TDOMNodeRttiExposer) + ); + tmpCrs.Reset(); + if tmpCrs.MoveNext() then begin + nd := (tmpCrs.GetCurrent() as TDOMNodeRttiExposer).InnerObject; + if Assigned(nd.Attributes) and ( nd.Attributes.Length > 0 ) then begin + tmpCrs := CreateCursorOn( + CreateAttributesCursor(nd,cetRttiNode), + ParseFilter( + Format( '%s = %s or %s = %s', + [ s_NODE_NAME,QuotedStr(s_soapAction), + s_NODE_NAME,QuotedStr(s_style) + ] + ), + TDOMNodeRttiExposer + ) + ); + tmpCrs.Reset(); + if tmpCrs.MoveNext() then begin + nd := (tmpCrs.GetCurrent() as TDOMNodeRttiExposer).InnerObject; + if AnsiSameText(nd.NodeName,s_style) then begin + AOp.Properties.Values[s_soapStyle] := nd.NodeValue; + end else if AnsiSameText(nd.NodeName,s_soapAction) then begin + AOp.Properties.Values[s_TRANSPORT + '_' + s_soapAction] := nd.NodeValue; + end; + end; + end; + end; + ParseOperation_EncodingStyle(ABndngOpCurs,AOp); + end; + end; + +var + locIntf : TInterfaceDefinition; + locAttCursor : IObjectCursor; + locCursor, locOpCursor, locBindingOperationCursor : IObjectCursor; + locObj : TDOMNodeRttiExposer; + locSoapBindingStyle : string; + locWStrBuffer : WideString; + locMthd : TMethodDefinition; + inft_guid : TGuid; +begin + locAttCursor := CreateAttributesCursor(ANode,cetRttiNode); + locCursor := CreateCursorOn(locAttCursor,ParseFilter(Format('%s = %s',[s_NODE_NAME,QuotedStr(s_name)]),TDOMNodeRttiExposer)); + locCursor.Reset(); + if not locCursor.MoveNext() then + raise EWslParserException.CreateFmt('PortType Attribute not found : "%s"',[s_name]); + locObj := locCursor.GetCurrent() as TDOMNodeRttiExposer; + locIntf := TInterfaceDefinition.Create(locObj.NodeValue); + try + FSymbols.Add(locIntf); + except + FreeAndNil(locIntf); + raise; + end; + Result := locIntf; + if ( CreateGUID(inft_guid) = 0 ) then + locIntf.InterfaceGUID := GUIDToString(inft_guid); + locCursor := CreateChildrenCursor(ANode,cetRttiNode); + if Assigned(locCursor) then begin + locOpCursor := CreateCursorOn(locCursor,ParseFilter(CreateQualifiedNameFilterStr(s_operation,FWsdlShortNames),TDOMNodeRttiExposer)); + locOpCursor.Reset(); + ExtractSoapBindingStyle(locWStrBuffer); + locSoapBindingStyle := locWStrBuffer; + locIntf.BindingStyle := StrToBindingStyle(locSoapBindingStyle); + locBindingOperationCursor := ExtractBindingOperationCursor(); + while locOpCursor.MoveNext() do begin + locObj := locOpCursor.GetCurrent() as TDOMNodeRttiExposer; + locMthd := ParseOperation(locIntf,locObj.InnerObject,locSoapBindingStyle); + if Assigned(locMthd) then begin + ParseOperationAttributes(locBindingOperationCursor,locMthd); + end; + end; + end; +end; + +type + + TParamDefCrack = class(TParameterDefinition); + + TMethodDefinitionCrack = class(TMethodDefinition); + + TTypeDefinitionCrack = class(TTypeDefinition); + +function TWsdlParser.ParseOperation( + AOwner : TInterfaceDefinition; + ANode : TDOMNode; + const ASoapBindingStyle : string +) : TMethodDefinition; + + function ExtractOperationName(out AName : string):Boolean; + var + attCrs, crs : IObjectCursor; + begin + Result := False; + attCrs := CreateAttributesCursor(ANode,cetRttiNode); + if Assigned(attCrs) then begin + crs := CreateCursorOn(attCrs,ParseFilter(s_NODE_NAME + '=' + QuotedStr(s_name) ,TDOMNodeRttiExposer)); + crs.Reset(); + if crs.MoveNext() then begin + AName := TDOMNodeRttiExposer(crs.GetCurrent()).NodeValue; + Result := True; + exit; + end; + end; + end; + + function ExtractMsgName(const AMsgType : string; out AName : string) : Boolean; + var + chldCrs, crs : IObjectCursor; + begin + chldCrs := CreateChildrenCursor(ANode,cetRttiNode); + if ( chldCrs <> nil ) then begin + //crs := CreateCursorOn(chldCrs,ParseFilter(s_NODE_NAME + '=' + QuotedStr(AMsgType) ,TDOMNodeRttiExposer)); + crs := CreateCursorOn(chldCrs,CreateWsdlNameFilter(AMsgType)); + crs.Reset(); + if crs.MoveNext() then begin + chldCrs := CreateAttributesCursor(TDOMNodeRttiExposer(crs.GetCurrent()).InnerObject,cetRttiNode); + if ( chldCrs <> nil ) then begin + crs := CreateCursorOn(chldCrs,ParseFilter(s_NODE_NAME + '=' + QuotedStr(s_message) ,TDOMNodeRttiExposer)); + crs.Reset(); + if crs.MoveNext() then begin + AName := TDOMNodeRttiExposer(crs.GetCurrent()).NodeValue; + Result := True; + exit; + end; + end; + end; + end; + Result := False; + end; + + function FindMessageNode(const AName : string) : TDOMNode; + begin + Result := FindNamedNode(FMessageCursor.Clone() as IObjectCursor,ExtractNameFromQName(AName)); + end; + + function CreatePartCursor(AMsgNode : TDOMNode):IObjectCursor ; + begin + Result := CreateChildrenCursor(AMsgNode,cetRttiNode); + if Assigned(Result) then + Result := CreateCursorOn(Result,CreateWsdlNameFilter(s_part)); + end; + + function GetDataType(const AName, ATypeOrElement : string):TTypeDefinition; + begin + try + Result := ParseType(AName,ATypeOrElement); + except + on e : Exception do begin + WriteLn(e.Message + ' ' + AName + ' ' + ATypeOrElement); + end; + end; + end; + + procedure ExtractMethod( + const AMthdName : string; + out AMthd : TMethodDefinition + ); + var + tmpMthd : TMethodDefinition; + + procedure ParseInputMessage(); + var + inMsg, strBuffer : string; + inMsgNode, tmpNode : TDOMNode; + crs, tmpCrs : IObjectCursor; + prmName, prmTypeName, prmTypeType, prmTypeInternalName : string; + prmInternameName : string; + prmHasInternameName : Boolean; + prmDef : TParameterDefinition; + prmTypeDef : TTypeDefinition; + begin + if ExtractMsgName(s_input,inMsg) then begin + inMsgNode := FindMessageNode(inMsg); + if ( inMsgNode <> nil ) then begin + crs := CreatePartCursor(inMsgNode); + if ( crs <> nil ) then begin + crs.Reset(); + while crs.MoveNext() do begin + tmpNode := (crs.GetCurrent() as TDOMNodeRttiExposer).InnerObject; + if ( tmpNode.Attributes = nil ) or ( tmpNode.Attributes.Length < 1 ) then begin + raise EWslParserException.CreateFmt('Invalid message part : "%s"',[tmpNode.NodeName]); + end; + strBuffer := s_NODE_NAME + '=' + QuotedStr(s_name); + tmpCrs := CreateCursorOn( + CreateAttributesCursor(tmpNode,cetRttiNode), + ParseFilter(strBuffer,TDOMNodeRttiExposer) + ); + tmpCrs.Reset(); + if not tmpCrs.MoveNext() then begin + raise EWslParserException.CreateFmt('Invalid message part : "%s"',[tmpNode.NodeName]); + end; + prmName := (tmpCrs.GetCurrent() as TDOMNodeRttiExposer).NodeValue; + strBuffer := s_NODE_NAME + '=' + QuotedStr(s_element) + ' or ' + s_NODE_NAME + ' = ' + QuotedStr(s_type); + tmpCrs := CreateCursorOn( + CreateAttributesCursor(tmpNode,cetRttiNode), + ParseFilter(strBuffer,TDOMNodeRttiExposer) + ); + tmpCrs.Reset(); + if not tmpCrs.MoveNext() then begin + raise EWslParserException.CreateFmt('Invalid message part : "%s"',[tmpNode.NodeName]); + end; + prmTypeName := (tmpCrs.GetCurrent() as TDOMNodeRttiExposer).NodeValue; + prmTypeType := (tmpCrs.GetCurrent() as TDOMNodeRttiExposer).NodeName; + if IsStrEmpty(prmName) or IsStrEmpty(prmTypeName) or IsStrEmpty(prmTypeType) then begin + raise EWslParserException.CreateFmt('Invalid message part : "%s"',[tmpNode.NodeName]); + end; + if SameText(s_document,ASoapBindingStyle) and + AnsiSameText(prmTypeType,s_element) + then begin + prmName := ExtractNameFromQName(prmTypeName); + end; + prmInternameName := Trim(prmName); + if AnsiSameText(prmInternameName,tmpMthd.Name) then begin + prmInternameName := prmInternameName + 'Param'; + end; + prmHasInternameName := IsReservedKeyWord(prmInternameName) or + ( not IsValidIdent(prmInternameName) ) or + ( tmpMthd.GetParameterIndex(prmInternameName) >= 0 ); + if prmHasInternameName then begin + prmInternameName := '_' + prmInternameName; + end; + prmHasInternameName := not AnsiSameText(prmInternameName,prmName); + prmTypeDef := GetDataType(prmTypeName,prmTypeType); + prmDef := tmpMthd.AddParameter(prmInternameName,pmConst,prmTypeDef); + if prmHasInternameName then begin + prmDef.RegisterExternalAlias(prmName); + end; + if AnsiSameText(tmpMthd.Name,prmTypeDef.Name) then begin + prmTypeInternalName := prmTypeDef.Name + 'Type'; + while ( FSymbols.IndexOf(prmTypeInternalName) >= 0 ) do begin + prmTypeInternalName := '_' + prmTypeInternalName; + end; + TTypeDefinitionCrack(prmTypeDef).SetName(prmTypeInternalName); + end; + end; + end; + end; + end; + end; + + procedure ParseOutputMessage(); + var + outMsg, strBuffer : string; + outMsgNode, tmpNode : TDOMNode; + crs, tmpCrs : IObjectCursor; + prmName, prmTypeName, prmTypeType : string; + prmDef : TParameterDefinition; + prmInternameName : string; + prmHasInternameName : Boolean; + begin + if ExtractMsgName(s_output,outMsg) then begin + outMsgNode := FindMessageNode(outMsg); + if ( outMsgNode <> nil ) then begin + crs := CreatePartCursor(outMsgNode); + if ( crs <> nil ) then begin + prmDef := nil; + crs.Reset(); + While crs.MoveNext() do begin + tmpNode := (crs.GetCurrent() as TDOMNodeRttiExposer).InnerObject; + if ( tmpNode.Attributes = nil ) or ( tmpNode.Attributes.Length < 1 ) then + raise EWslParserException.CreateFmt('Invalid message part : "%s"',[tmpNode.NodeName]); + strBuffer := s_NODE_NAME + '=' + QuotedStr(s_name); + tmpCrs := CreateCursorOn(CreateAttributesCursor(tmpNode,cetRttiNode),ParseFilter(strBuffer,TDOMNodeRttiExposer)); + tmpCrs.Reset(); + if not tmpCrs.MoveNext() then + raise EWslParserException.CreateFmt('Invalid message part : "%s"',[tmpNode.NodeName]); + prmName := (tmpCrs.GetCurrent() as TDOMNodeRttiExposer).NodeValue; + strBuffer := s_NODE_NAME + '=' + QuotedStr(s_element) + ' or ' + s_NODE_NAME + ' = ' + QuotedStr(s_type); + tmpCrs := CreateCursorOn( + CreateAttributesCursor(tmpNode,cetRttiNode), + ParseFilter(strBuffer,TDOMNodeRttiExposer) + ); + tmpCrs.Reset(); + if not tmpCrs.MoveNext() then + raise EWslParserException.CreateFmt('Invalid message part : "%s"',[tmpNode.NodeName]); + prmTypeName := (tmpCrs.GetCurrent() as TDOMNodeRttiExposer).NodeValue; + prmTypeType := (tmpCrs.GetCurrent() as TDOMNodeRttiExposer).NodeName; + if IsStrEmpty(prmName) or IsStrEmpty(prmTypeName) or IsStrEmpty(prmTypeType) then + raise EWslParserException.CreateFmt('Invalid message part : "%s"',[tmpNode.NodeName]); + if SameText(s_document,ASoapBindingStyle) and + AnsiSameText(prmTypeType,s_element) + then begin + prmName := ExtractNameFromQName(prmTypeName); + end; + prmInternameName := Trim(prmName); + if AnsiSameText(prmInternameName,tmpMthd.Name) then begin + prmInternameName := prmInternameName + 'Param'; + end; + //prmHasInternameName := IsReservedKeyWord(prmInternameName) or ( not IsValidIdent(prmInternameName) ); + prmHasInternameName := IsReservedKeyWord(prmInternameName) or + ( not IsValidIdent(prmInternameName) ) or + ( tmpMthd.GetParameterIndex(prmInternameName) >= 0 ); + if prmHasInternameName then + prmInternameName := '_' + prmInternameName; + prmHasInternameName := not AnsiSameText(prmInternameName,prmName); + prmDef := tmpMthd.FindParameter(prmInternameName);//(prmName); + if ( prmDef = nil ) then begin + prmDef := tmpMthd.AddParameter(prmInternameName,pmOut,GetDataType(prmTypeName,prmTypeType)); + prmDef.RegisterExternalAlias(prmName); + end else begin + if prmDef.DataType.SameName(prmTypeName) then begin + TParamDefCrack(prmDef).SetModifier(pmVar); + end else begin + prmInternameName := '_' + prmInternameName; + prmDef := tmpMthd.AddParameter(prmInternameName,pmOut,GetDataType(prmTypeName,prmTypeType)); + prmDef.RegisterExternalAlias(prmName); + end; + end; + end; + if ( SameText(ASoapBindingStyle,s_rpc) and + ( prmDef <> nil ) and ( prmDef.Modifier = pmOut ) and//and SameText(prmDef.Name,s_return) and + ( prmDef = tmpMthd.Parameter[Pred(tmpMthd.ParameterCount)] ) + ) or + ( SameText(ASoapBindingStyle,s_document) and + ( prmDef <> nil ) and + ( prmDef.Modifier = pmOut ) and + ( prmDef = tmpMthd.Parameter[Pred(tmpMthd.ParameterCount)] ) + ) + then begin + TMethodDefinitionCrack(tmpMthd).SetMethodType(mtFunction); + end; + end; + end; + end; + end; + + begin + AMthd := nil; + tmpMthd := TMethodDefinition.Create(AMthdName,mtProcedure); + try + ParseInputMessage(); + ParseOutputMessage(); + except + FreeAndNil(tmpMthd); + AMthd := nil; + raise; + end; + AMthd := tmpMthd; + end; + +var + locMthd : TMethodDefinition; + mthdName : string; +begin + Result := nil; + locMthd := nil; + if not ExtractOperationName(mthdName) then + raise EWslParserException.CreateFmt('Operation Attribute not found : "%s"',[s_name]); + if SameText(s_document,ASoapBindingStyle) then begin + ExtractMethod(mthdName,locMthd); + if ( locMthd <> nil ) then + AOwner.AddMethod(locMthd); + end else if SameText(s_rpc,ASoapBindingStyle) then begin + ExtractMethod(mthdName,locMthd); + if ( locMthd <> nil ) then + AOwner.AddMethod(locMthd); + end; + Result := locMthd; +end; + +function TWsdlParser.ParseType(const AName, ATypeOrElement: string): TTypeDefinition; +var + crsSchemaChild : IObjectCursor; + typNd : TDOMNode; + typName : string; + embededType : Boolean; + + procedure Init(); + var + nd : TDOMNodeRttiExposer; + schmCrsr : IObjectCursor; + begin + if not Assigned(FSchemaCursor) then + raise EWslParserException.Create('Schema cursor not assigned.'); + schmCrsr := FSchemaCursor.Clone() as IObjectCursor; + FSchemaCursor.Reset(); + if not FSchemaCursor.MoveNext() then + raise EWslParserException.Create('Schema cursor is empty.'); + nd := FSchemaCursor.GetCurrent() as TDOMNodeRttiExposer; + crsSchemaChild := CreateChildrenCursor(nd.InnerObject,cetRttiNode); + end; + + procedure FindTypeNode(); + var + nd : TDOMNode; + crs : IObjectCursor; + locStrFilter : string; + begin + typNd := FindNamedNode(crsSchemaChild,ExtractNameFromQName(AName)); + if not Assigned(typNd) then + raise EWslParserException.CreateFmt('Type definition not found 1 : "%s"',[AName]); + if AnsiSameText(ExtractNameFromQName(typNd.NodeName),s_element) then begin + crs := CreateCursorOn(CreateAttributesCursor(typNd,cetRttiNode),ParseFilter(Format('%s = %s',[s_NODE_NAME,QuotedStr(s_type)]),TDOMNodeRttiExposer)); + crs.Reset(); + if crs.MoveNext() then begin + nd := (crs.GetCurrent() as TDOMNodeRttiExposer).InnerObject; + typNd := FindNamedNode(crsSchemaChild,ExtractNameFromQName(nd.NodeValue)); + if not Assigned(typNd) then + raise EWslParserException.CreateFmt('Type definition not found 2 : "%s"',[AName]); + embededType := False; + end else begin + //locStrFilter := Format('%s = %s or %s = %s ',[s_NODE_NAME,QuotedStr(s_complexType),s_NODE_NAME,QuotedStr(s_simpleType)]); + locStrFilter := CreateQualifiedNameFilterStr(s_complexType,FXSShortNames) + ' or ' + + CreateQualifiedNameFilterStr(s_simpleType,FXSShortNames); + crs := CreateCursorOn(CreateChildrenCursor(typNd,cetRttiNode),ParseFilter(locStrFilter,TDOMNodeRttiExposer)); + crs.Reset(); + if not crs.MoveNext() then begin + raise EWslParserException.CreateFmt('Type definition not found 3 : "%s"',[AName]); + end; + typNd := (crs.GetCurrent() as TDOMNodeRttiExposer).InnerObject; + typName := ExtractNameFromQName(AName); + embededType := True; + end; + end; + end; + + function ParseComplexType():TTypeDefinition; + var + locParser : TComplexTypeParser; + begin + locParser := TComplexTypeParser.Create(Self,typNd,FSymbols,typName,embededType); + try + Result := locParser.Parse(); + finally + FreeAndNil(locParser); + end; + end; + + function ParseSimpleType():TTypeDefinition; + var + locParser : TSimpleTypeParser; + begin + locParser := TSimpleTypeParser.Create(Self,typNd,FSymbols,typName,embededType); + try + Result := locParser.Parse(); + finally + FreeAndNil(locParser); + end; + end; + +var + frwType : TTypeDefinition; +begin + embededType := False; + Result := nil; + Result := FSymbols.Find(ExtractNameFromQName(AName),TTypeDefinition) as TTypeDefinition; + if ( not Assigned(Result) ) or ( Result is TForwardTypeDefinition ) then begin + frwType := Result; + Result := nil; + Init(); + FindTypeNode(); + if AnsiSameText(ExtractNameFromQName(typNd.NodeName),s_complexType) then begin + Result := ParseComplexType(); + end else if AnsiSameText(ExtractNameFromQName(typNd.NodeName),s_simpleType) then begin + Result := ParseSimpleType(); + end; + if Assigned(Result) then begin + if Assigned(frwType) and AnsiSameText(Result.ExternalName,frwType.ExternalName) then begin + TTypeDefinitionCrack(Result).SetName(frwType.Name); + end; + FSymbols.Add(Result); + end; + end; +end; + +procedure TWsdlParser.ParseTypes(); +var + nd : TDOMNodeRttiExposer; + schmCrsr, crsSchemaChild, typTmpCrs : IObjectCursor; + typFilterStr : string; + typNode : TDOMNode; +begin + if Assigned(FSchemaCursor) then begin + schmCrsr := FSchemaCursor.Clone() as IObjectCursor; + schmCrsr.Reset(); + while schmCrsr.MoveNext() do begin + nd := schmCrsr.GetCurrent() as TDOMNodeRttiExposer; + crsSchemaChild := CreateChildrenCursor(nd.InnerObject,cetRttiNode); + if Assigned(crsSchemaChild) then begin + typFilterStr := Format( + '%s or %s or %s', + [ CreateQualifiedNameFilterStr(s_complexType,FXSShortNames), + CreateQualifiedNameFilterStr(s_simpleType,FXSShortNames), + CreateQualifiedNameFilterStr(s_element,FXSShortNames) + ] + ); + crsSchemaChild := CreateCursorOn(crsSchemaChild,ParseFilter(typFilterStr,TDOMNodeRttiExposer)); + crsSchemaChild.Reset(); + while crsSchemaChild.MoveNext() do begin + typNode := (crsSchemaChild.GetCurrent() as TDOMNodeRttiExposer).InnerObject; + typTmpCrs := CreateAttributesCursor(typNode,cetRttiNode); + if Assigned(typTmpCrs) then begin + typTmpCrs.Reset(); + typTmpCrs := CreateCursorOn(typTmpCrs,ParseFilter(Format('%s=%s',[s_NODE_NAME,QuotedStr(s_name)]),TDOMNodeRttiExposer)); + typTmpCrs.Reset(); + if typTmpCrs.MoveNext() then begin + ParseType( + (typTmpCrs.GetCurrent() as TDOMNodeRttiExposer).NodeValue, + ExtractNameFromQName(typNode.NodeName) + ); + end; + end; + end; + end; + end; + end; +end; + +constructor TWsdlParser.Create(ADoc: TXMLDocument; ASymbols : TSymbolTable); +begin + Assert(Assigned(ADoc)); + Assert(Assigned(ASymbols)); + FDoc := ADoc; + FWsdlShortNames := TStringList.Create(); + FSoapShortNames := TStringList.Create(); + FXSShortNames := TStringList.Create(); + FSymbols := ASymbols; + FSymbols.Add(CreateWstInterfaceSymbolTable()); +end; + +destructor TWsdlParser.Destroy(); +begin + FreeAndNil(FXSShortNames); + FreeAndNil(FSoapShortNames); + FreeAndNil(FWsdlShortNames); + inherited Destroy(); +end; + +procedure TWsdlParser.Parse(const AMode : TParserMode); + + procedure ParseForwardDeclarations(); + var + i, c : Integer; + sym : TAbstractSymbolDefinition; + typeCursor : IObjectCursor; + tmpNode : TDOMNode; + s : string; + begin + if Assigned(FSchemaCursor) then begin + FSchemaCursor.Reset(); + if FSchemaCursor.MoveNext() then begin + tmpNode := (FSchemaCursor.GetCurrent() as TDOMNodeRttiExposer).InnerObject; + if tmpNode.HasChildNodes() then begin + typeCursor := CreateChildrenCursor(tmpNode,cetRttiNode); + s := CreateQualifiedNameFilterStr(s_complexType,FXSShortNames) + ' or ' + + CreateQualifiedNameFilterStr(s_simpleType,FXSShortNames) + ' or ' + + CreateQualifiedNameFilterStr(s_element,FXSShortNames); + typeCursor := CreateCursorOn(typeCursor,ParseFilter(s,TDOMNodeRttiExposer)); + typeCursor.Reset(); + if typeCursor.MoveNext() then begin + c := FSymbols.Count; + i := 0; + while ( i < c ) do begin + sym := FSymbols[i]; + if ( sym is TForwardTypeDefinition ) then begin + typeCursor.Reset(); + tmpNode := FindNamedNode(typeCursor,sym.ExternalName); + if Assigned(tmpNode) then begin + ParseType(sym.ExternalName,ExtractNameFromQName(tmpNode.NodeName)); + Dec(i); + c := FSymbols.Count; + end else begin + WriteLn('XXXXXXXXXXXXXX = ',sym.Name); + end; + end; + Inc(i); + end; + end; + end; + end; + end; + end; + + procedure ExtractNameSpace(); + var + tmpCrs : IObjectCursor; + nd : TDOMNode; + s : string; + begin + nd := FDoc.DocumentElement; + if Assigned(nd.Attributes) and ( nd.Attributes.Length > 0 ) then begin + tmpCrs := CreateCursorOn( + CreateAttributesCursor(nd,cetRttiNode), + ParseFilter(Format('%s = %s',[s_NODE_NAME,QuotedStr(s_targetNamespace)]),TDOMNodeRttiExposer) + ); + tmpCrs.Reset(); + if tmpCrs.MoveNext() then begin + s := (tmpCrs.GetCurrent() as TDOMNodeRttiExposer).NodeValue; + if not IsStrEmpty(s) then begin + FSymbols.RegisterExternalAlias(s); + end; + end; + end; + end; + +var + locSrvcCrs : IObjectCursor; + locObj : TDOMNodeRttiExposer; +begin + Prepare(); + + locSrvcCrs := FServiceCursor.Clone() as IObjectCursor; + locSrvcCrs.Reset(); + while locSrvcCrs.MoveNext() do begin + locObj := locSrvcCrs.GetCurrent() as TDOMNodeRttiExposer; + ParseService(locObj.InnerObject); + end; + + if ( AMode = pmAllTypes ) then begin + ParseTypes(); + end; + ParseForwardDeclarations(); + ExtractNameSpace(); +end; + +{ TAbstractTypeParser } + +constructor TAbstractTypeParser.Create( + AOwner : TWsdlParser; + ATypeNode : TDOMNode; + ASymbols : TSymbolTable; + const ATypeName : string; + const AEmbededDef : Boolean +); +begin + Assert(Assigned(AOwner)); + Assert(Assigned(ATypeNode)); + Assert(Assigned(ASymbols)); + FOwner := AOwner; + FTypeNode := ATypeNode; + FSymbols := ASymbols; + FTypeName := ATypeName; + FEmbededDef := AEmbededDef; +end; + +class function TAbstractTypeParser.ExtractEmbeddedTypeFromElement( + AOwner : TWsdlParser; + AEltNode : TDOMNode; + ASymbols : TSymbolTable; + const ATypeName : string +): TTypeDefinition; + + function ExtractTypeName() : string; + var + locCrs : IObjectCursor; + begin + locCrs := CreateCursorOn( + CreateAttributesCursor(AEltNode,cetRttiNode), + ParseFilter(Format('%s = %s',[s_NODE_NAME,QuotedStr(s_name)]),TDOMNodeRttiExposer) + ); + locCrs.Reset(); + if not locCrs.MoveNext() then + raise EWslParserException.Create('Unable to find the tag in the type/element node attributes.'); + Result := (locCrs.GetCurrent() as TDOMNodeRttiExposer).NodeValue; + if IsStrEmpty(Result) then begin + raise EWslParserException.Create('Invalid type/element name( the name is empty ).'); + end; + end; + + function FindParser(out AFoundTypeNode : TDOMNode):TAbstractTypeParserClass; + var + k : Integer; + locPrsClss : TAbstractTypeParserClass; + locFilter : string; + locCrs : IObjectCursor; + begin + Result := nil; + AFoundTypeNode := nil; + for k := 0 to Pred(GetRegisteredParserCount()) do begin + locPrsClss := GetRegisteredParser(k); + locFilter := locPrsClss.GetParserSupportedStyle(); + if not IsStrEmpty(locFilter) then begin + locFilter := CreateQualifiedNameFilterStr(locFilter,AOwner.FXSShortNames); + locCrs := CreateCursorOn(CreateChildrenCursor(AEltNode,cetRttiNode),ParseFilter(locFilter,TDOMNodeRttiExposer)); + locCrs.Reset(); + if locCrs.MoveNext() then begin + AFoundTypeNode := (locCrs.GetCurrent() as TDOMNodeRttiExposer).InnerObject; + Result := locPrsClss; + Break; + end; + end; + end; + end; + +var + typName : string; + prsClss : TAbstractTypeParserClass; + prs : TAbstractTypeParser; + typNode : TDOMNode; +begin + if not AEltNode.HasChildNodes() then begin; + raise EWslParserException.Create('Invalid type definition, this element must have children.'); + end; + Result := nil; + typName := ATypeName; + if IsStrEmpty(typName) then begin + typName := ExtractTypeName(); + end; + prsClss := FindParser(typNode); + if ( prsClss = nil ) then begin; + raise EWslParserException.CreateFmt('This type style is not supported : "%s".',[typName]); + end; + prs := prsClss.Create(AOwner,typNode,ASymbols,typName,True); + try + Result := prs.Parse(); + finally + FreeAndNil(prs); + end; +end; + +var + FTypeParserList : TClassList = nil; +class procedure TAbstractTypeParser.RegisterParser(AParserClass: TAbstractTypeParserClass); +begin + if ( FTypeParserList = nil ) then begin + FTypeParserList := TClassList.Create(); + end; + if ( FTypeParserList.IndexOf(AParserClass) < 0 ) then begin + FTypeParserList.Add(AParserClass); + end; +end; + +class function TAbstractTypeParser.GetRegisteredParserCount(): Integer; +begin + if Assigned(FTypeParserList) then begin + Result := FTypeParserList.Count; + end else begin + Result := 0; + end; +end; + +class function TAbstractTypeParser.GetRegisteredParser(const AIndex: Integer): TAbstractTypeParserClass; +begin + Result := TAbstractTypeParserClass(FTypeParserList[AIndex]); +end; + + +{ TComplexTypeParser } + +procedure TComplexTypeParser.CreateNodeCursors(); +begin + FAttCursor := CreateAttributesCursor(FTypeNode,cetRttiNode); + FChildCursor := CreateChildrenCursor(FTypeNode,cetRttiNode); +end; + +procedure TComplexTypeParser.ExtractTypeName(); +var + locCrs : IObjectCursor; +begin + if not FEmbededDef then begin + locCrs := CreateCursorOn( + FAttCursor.Clone() as IObjectCursor, + ParseFilter(Format('%s = %s',[s_NODE_NAME,QuotedStr(s_name)]),TDOMNodeRttiExposer) + ); + locCrs.Reset(); + if not locCrs.MoveNext() then + raise EWslParserException.Create('Unable to find the tag in the type node attributes.'); + FTypeName := (locCrs.GetCurrent() as TDOMNodeRttiExposer).NodeValue; + end; + if IsStrEmpty(FTypeName) then + raise EWslParserException.Create('Invalid type name( the name is empty ).'); +end; + +procedure TComplexTypeParser.ExtractContentType(); +var + locCrs : IObjectCursor; +begin + FContentType := ''; + if Assigned(FChildCursor) then begin + locCrs := CreateCursorOn( + FChildCursor.Clone() as IObjectCursor, + ParseFilter(CreateQualifiedNameFilterStr(s_complexContent,FOwner.FXSShortNames),TDOMNodeRttiExposer) + ); + if Assigned(locCrs) then begin + locCrs.Reset(); + if locCrs.MoveNext() then begin + FContentNode := (locCrs.GetCurrent() as TDOMNodeRttiExposer).InnerObject; + FContentType := FContentNode.NodeName; + end else begin + locCrs := CreateCursorOn( + FChildCursor.Clone() as IObjectCursor, + ParseFilter(CreateQualifiedNameFilterStr(s_simpleContent,FOwner.FXSShortNames),TDOMNodeRttiExposer) + ); + locCrs.Reset(); + if locCrs.MoveNext() then begin + FContentNode := (locCrs.GetCurrent() as TDOMNodeRttiExposer).InnerObject; + FContentType := FContentNode.NodeName; + end else begin + FContentNode := FTypeNode; + FContentType := s_complexContent; + end; + end; + FContentType := ExtractNameFromQName(FContentType); + end; + end; +end; + +procedure TComplexTypeParser.ExtractBaseType(); +var + locContentChildCrs, locCrs : IObjectCursor; + locSymbol : TAbstractSymbolDefinition; + locBaseTypeName, locBaseTypeInternalName, locFilterStr : string; +begin + locFilterStr := CreateQualifiedNameFilterStr(s_extension,FOwner.FXSShortNames); + locContentChildCrs := CreateChildrenCursor(FContentNode,cetRttiNode); + locCrs := CreateCursorOn( + locContentChildCrs.Clone() as IObjectCursor, + ParseFilter(locFilterStr,TDOMNodeRttiExposer) + ); + locCrs.Reset(); + if locCrs.MoveNext() then begin + FDerivationMode := dmExtension; + FDerivationNode := (locCrs.GetCurrent() as TDOMNodeRttiExposer).InnerObject; + end else begin + locFilterStr := CreateQualifiedNameFilterStr(s_restriction,FOwner.FXSShortNames); + locCrs := CreateCursorOn( + locContentChildCrs.Clone() as IObjectCursor, + ParseFilter(locFilterStr,TDOMNodeRttiExposer) + ); + locCrs.Reset(); + if locCrs.MoveNext() then begin + FDerivationMode := dmRestriction; + FDerivationNode := (locCrs.GetCurrent() as TDOMNodeRttiExposer).InnerObject; + end else begin + FDerivationMode := dmNone; + FDerivationNode := nil; + end; + end; + if ( FDerivationMode > dmNone ) then begin + locCrs := CreateCursorOn( + CreateAttributesCursor(FDerivationNode,cetRttiNode), + ParseFilter(Format('%s = %s',[s_NODE_NAME,QuotedStr(s_base)]),TDOMNodeRttiExposer) + ); + locCrs.Reset(); + if not locCrs.MoveNext() then + raise EWslParserException.CreateFmt('Invalid extention/restriction of type "%s" : "base" attribute not found.',[FTypeName]); + locBaseTypeName := ExtractNameFromQName((locCrs.GetCurrent() as TDOMNodeRttiExposer).NodeValue); + locSymbol := FSymbols.Find(locBaseTypeName); + if Assigned(locSymbol) then begin + if locSymbol.InheritsFrom(TTypeDefinition) then begin + FBaseType := locSymbol as TTypeDefinition; + while Assigned(FBaseType) and FBaseType.InheritsFrom(TTypeAliasDefinition) do begin + FBaseType := (FBaseType as TTypeAliasDefinition).BaseType; + end; + if FBaseType.InheritsFrom(TNativeSimpleTypeDefinition) then begin + Assert(Assigned(TNativeSimpleTypeDefinition(FBaseType).BoxedType)); + FBaseType := TNativeSimpleTypeDefinition(FBaseType).BoxedType; + end; + end else begin + raise EWslParserException.CreateFmt('"%s" was expected to be a type definition.',[locSymbol.Name]); + end; + end else begin + locBaseTypeInternalName := ExtractIdentifier(locBaseTypeName); + if IsReservedKeyWord(locBaseTypeInternalName) then + locBaseTypeInternalName := '_' + locBaseTypeInternalName ; + FBaseType := TForwardTypeDefinition.Create(locBaseTypeInternalName); + if not AnsiSameText(locBaseTypeInternalName,locBaseTypeName) then + FBaseType.RegisterExternalAlias(locBaseTypeName); + FSymbols.Add(FBaseType); + end; + end; +end; + +function TComplexTypeParser.ParseComplexContent(const ATypeName : string) : TTypeDefinition; + + function ExtractElementCursor(out AAttCursor : IObjectCursor):IObjectCursor; + var + frstCrsr, tmpCursor : IObjectCursor; + parentNode, tmpNode : TDOMNode; + begin + Result := nil; + AAttCursor := nil; + case FDerivationMode of + dmNone : parentNode := FContentNode; + dmRestriction, + dmExtension : parentNode := FDerivationNode; + end; + if parentNode.HasChildNodes() then begin; + AAttCursor := CreateCursorOn( + CreateChildrenCursor(parentNode,cetRttiNode), + ParseFilter(CreateQualifiedNameFilterStr(s_attribute,FOwner.FXSShortNames),TDOMNodeRttiExposer) + ); + frstCrsr := CreateChildrenCursor(parentNode,cetRttiNode); + tmpCursor := CreateCursorOn( + frstCrsr.Clone() as IObjectCursor, + ParseFilter(CreateQualifiedNameFilterStr(s_sequence,FOwner.FXSShortNames),TDOMNodeRttiExposer) + ); + tmpCursor.Reset(); + if tmpCursor.MoveNext() then begin + FSequenceType := stElement; + tmpNode := (tmpCursor.GetCurrent() as TDOMNodeRttiExposer).InnerObject; + if tmpNode.HasChildNodes() then begin + tmpCursor := CreateCursorOn( + CreateChildrenCursor(tmpNode,cetRttiNode), + ParseFilter(CreateQualifiedNameFilterStr(s_element,FOwner.FXSShortNames),TDOMNodeRttiExposer) + ); + Result := tmpCursor; + end; + end else begin + tmpCursor := CreateCursorOn( + frstCrsr.Clone() as IObjectCursor, + ParseFilter(CreateQualifiedNameFilterStr(s_all,FOwner.FXSShortNames),TDOMNodeRttiExposer) + ); + tmpCursor.Reset(); + if tmpCursor.MoveNext() then begin + FSequenceType := stElement; + tmpNode := (tmpCursor.GetCurrent() as TDOMNodeRttiExposer).InnerObject; + if tmpNode.HasChildNodes() then begin + tmpCursor := CreateCursorOn( + CreateChildrenCursor(tmpNode,cetRttiNode), + ParseFilter(CreateQualifiedNameFilterStr(s_element,FOwner.FXSShortNames),TDOMNodeRttiExposer) + ); + Result := tmpCursor; + end; + end; + end + end else begin + Result := nil; + end; + end; + +var + classDef : TClassTypeDefinition; + isArrayDef : Boolean; + arrayItems : TObjectList; + + procedure ParseElement(AElement : TDOMNode); + var + locAttCursor, locPartCursor : IObjectCursor; + locName, locTypeName, locTypeInternalName : string; + locType : TAbstractSymbolDefinition; + locInternalEltName : string; + locProp : TPropertyDefinition; + locHasInternalName : Boolean; + locMinOccur, locMaxOccur : Integer; + locMaxOccurUnbounded : Boolean; + locStrBuffer : string; + locIsRefElement : Boolean; + begin + locType := nil; + locTypeName := ''; + locAttCursor := CreateAttributesCursor(AElement,cetRttiNode); + locPartCursor := CreateCursorOn(locAttCursor.Clone() as IObjectCursor,ParseFilter(Format('%s = %s',[s_NODE_NAME,QuotedStr(s_name)]),TDOMNodeRttiExposer)); + locPartCursor.Reset(); + locIsRefElement := False; + if not locPartCursor.MoveNext() then begin + locPartCursor := CreateCursorOn(locAttCursor.Clone() as IObjectCursor,ParseFilter(Format('%s = %s',[s_NODE_NAME,QuotedStr(s_ref)]),TDOMNodeRttiExposer)); + locPartCursor.Reset(); + if not locPartCursor.MoveNext() then begin + raise EWslParserException.Create('Invalid definition : missing "name" or "ref" attribute.'); + end; + locIsRefElement := True; + end; + locName := (locPartCursor.GetCurrent() as TDOMNodeRttiExposer).NodeValue; + if locIsRefElement then begin + locName := ExtractNameFromQName(locName); + end; + if IsStrEmpty(locName) then + raise EWslParserException.Create('Invalid definition : empty "name".'); + if locIsRefElement then begin + locTypeName := locName; + end else begin + locPartCursor := CreateCursorOn(locAttCursor.Clone() as IObjectCursor,ParseFilter(Format('%s = %s',[s_NODE_NAME,QuotedStr(s_type)]),TDOMNodeRttiExposer)); + locPartCursor.Reset(); + if locPartCursor.MoveNext() then begin + locTypeName := ExtractNameFromQName((locPartCursor.GetCurrent() as TDOMNodeRttiExposer).NodeValue); + end else begin + locTypeName := Format('%s_%s_Type',[FTypeName,locName]); + locType := TAbstractTypeParser.ExtractEmbeddedTypeFromElement(FOwner,AElement,FSymbols,locTypeName); + if ( locType = nil ) then begin + raise EWslParserException.CreateFmt('Invalid definition : unable to determine the type.'#13'Type name : "%s"; Element name :"%s".',[FTypeName,locName]); + end; + FSymbols.Add(locType); + end; + end; + if IsStrEmpty(locTypeName) then + raise EWslParserException.Create('Invalid definition : empty "type".'); + locType := FSymbols.Find(locTypeName); + if Assigned(locType) then begin + if locIsRefElement then begin + locTypeInternalName := locTypeName; + locTypeInternalName := locTypeInternalName + '_Type'; + TTypeDefinitionCrack(locType).SetName(locTypeInternalName); + end; + end else begin + locTypeInternalName := locTypeName; + if locIsRefElement then begin + locTypeInternalName := locTypeInternalName + '_Type'; + end; + if IsReservedKeyWord(locTypeInternalName) then begin + locTypeInternalName := '_' + locTypeInternalName; + end; + locType := TForwardTypeDefinition.Create(locTypeInternalName); + if not AnsiSameText(locTypeInternalName,locTypeName) then + locType.RegisterExternalAlias(locTypeName); + FSymbols.Add(locType); + end; + + locInternalEltName := locName; + locHasInternalName := IsReservedKeyWord(locInternalEltName); + if locHasInternalName then + locInternalEltName := Format('_%s',[locInternalEltName]); + + locProp := classDef.AddProperty(locInternalEltName,locType as TTypeDefinition); + if locHasInternalName then + locProp.RegisterExternalAlias(locName); + + locMinOccur := 1; + locPartCursor := CreateCursorOn(locAttCursor.Clone() as IObjectCursor,ParseFilter(Format('%s = %s',[s_NODE_NAME,QuotedStr(s_minOccurs)]),TDOMNodeRttiExposer)); + locPartCursor.Reset(); + if locPartCursor.MoveNext() then begin + if not TryStrToInt((locPartCursor.GetCurrent() as TDOMNodeRttiExposer).NodeValue,locMinOccur) then + raise EWslParserException.CreateFmt('Invalid "minOccurs" value : "%s.%s".',[FTypeName,locName]); + if ( locMinOccur < 0 ) then + raise EWslParserException.CreateFmt('Invalid "minOccurs" value : "%s.%s".',[FTypeName,locName]); + end; + if ( locMinOccur = 0 ) then + locProp.StorageOption := soOptional; + + locMaxOccur := 1; + locMaxOccurUnbounded := False; + locPartCursor := CreateCursorOn(locAttCursor.Clone() as IObjectCursor,ParseFilter(Format('%s = %s',[s_NODE_NAME,QuotedStr(s_maxOccurs)]),TDOMNodeRttiExposer)); + locPartCursor.Reset(); + if locPartCursor.MoveNext() then begin + locStrBuffer := (locPartCursor.GetCurrent() as TDOMNodeRttiExposer).NodeValue; + if AnsiSameText(locStrBuffer,s_unbounded) then begin + locMaxOccurUnbounded := True; + end else begin + if not TryStrToInt(locStrBuffer,locMaxOccur) then + raise EWslParserException.CreateFmt('Invalid "maxOccurs" value : "%s.%s".',[FTypeName,locName]); + if ( locMinOccur < 0 ) then + raise EWslParserException.CreateFmt('Invalid "maxOccurs" value : "%s.%s".',[FTypeName,locName]); + end; + end; + isArrayDef := locMaxOccurUnbounded or ( locMaxOccur > 1 ); + if isArrayDef then begin + arrayItems.Add(locProp); + end; + if AnsiSameText(s_attribute,ExtractNameFromQName(AElement.NodeName)) then begin + locProp.IsAttribute := True; + end; + end; + + procedure GenerateArrayTypes( + const AClassName : string; + AArrayPropList : TObjectList + ); + var + locPropTyp : TPropertyDefinition; + k : Integer; + locString : string; + locSym : TAbstractSymbolDefinition; + begin + for k := 0 to Pred(AArrayPropList.Count) do begin + locPropTyp := AArrayPropList[k] as TPropertyDefinition; + locString := Format('%s_%sArray',[AClassName,locPropTyp.Name]); + locSym := FSymbols.Find(locString); + if ( locSym = nil ) then begin + FSymbols.Add( + TArrayDefinition.Create( + locString, + locPropTyp.DataType, + locPropTyp.Name, + locPropTyp.ExternalName, + asEmbeded + ) + ); + end; + end; + end; + + function ExtractSoapArray(const AInternalName : string; const AHasInternalName : Boolean) : TArrayDefinition; + var + ls : TStringList; + crs, locCrs : IObjectCursor; + s : string; + i : Integer; + locSym : TAbstractSymbolDefinition; + ok : Boolean; + nd : TDOMNode; + begin + if not FDerivationNode.HasChildNodes then begin + raise EWslParserException.CreateFmt('Invalid type definition, attributes not found : "%s".',[FTypeName]); + end; + crs := CreateCursorOn( + CreateChildrenCursor(FDerivationNode,cetRttiNode), + ParseFilter(CreateQualifiedNameFilterStr(s_attribute,FOwner.FXSShortNames),TDOMNodeRttiExposer) + ); + ls := TStringList.Create(); + try + ok := False; + crs.Reset(); + while crs.MoveNext() do begin + nd := (crs.GetCurrent() as TDOMNodeRttiExposer).InnerObject; + if Assigned(nd.Attributes) and ( nd.Attributes.Length > 0 ) then begin + ls.Clear(); + ExtractNameSpaceShortNamesNested(nd,ls,s_wsdl); + locCrs := CreateAttributesCursor(nd,cetRttiNode); + locCrs := CreateCursorOn( + locCrs, + ParseFilter(CreateQualifiedNameFilterStr(s_arrayType,ls),TDOMNodeRttiExposer) + ); + if Assigned(locCrs) then begin + locCrs.Reset(); + if locCrs.MoveNext() then begin + ok := True; + Break; + end; + end; + end; + end; + finally + FreeAndNil(ls); + end; + if not ok then begin + raise EWslParserException.CreateFmt('Invalid type definition, unable to find the "%s" attribute : "%s".',[s_arrayType,FTypeName]); + end; + s := ExtractNameFromQName((locCrs.GetCurrent() as TDOMNodeRttiExposer).InnerObject.NodeValue); + i := Pos('[',s); + if ( i < 1 ) then begin + i := MaxInt; + end; + s := Copy(s,1,Pred(i)); + locSym := FSymbols.Find(s); + if not Assigned(locSym) then begin + locSym := TForwardTypeDefinition.Create(s); + FSymbols.Add(locSym); + end; + if not locSym.InheritsFrom(TTypeDefinition) then + raise EWslParserException.CreateFmt('Invalid array type definition, invalid item type definition : "%s".',[FTypeName]); + Result := TArrayDefinition.Create(AInternalName,locSym as TTypeDefinition,s_item,s_item,asScoped); + if AHasInternalName then + Result.RegisterExternalAlias(ATypeName); + end; + +var + eltCrs, eltAttCrs : IObjectCursor; + internalName : string; + hasInternalName : Boolean; + arrayDef : TArrayDefinition; + propTyp, tmpPropTyp : TPropertyDefinition; + tmpClassDef : TClassTypeDefinition; + i : Integer; +begin + ExtractBaseType(); + eltCrs := ExtractElementCursor(eltAttCrs); + + internalName := ExtractIdentifier(ATypeName); + hasInternalName := IsReservedKeyWord(internalName) or + ( not IsValidIdent(internalName) ) or + //( FSymbols.IndexOf(internalName) <> -1 ) or + ( not AnsiSameText(internalName,ATypeName) ); + if hasInternalName then begin + internalName := Format('_%s',[internalName]); + end; + + if ( FDerivationMode = dmRestriction ) and FBaseType.SameName(s_array) then begin + Result := ExtractSoapArray(internalName,hasInternalName); + end else begin + arrayItems := TObjectList.Create(False); + try + classDef := TClassTypeDefinition.Create(internalName); + try + Result := classDef; + if hasInternalName then + classDef.RegisterExternalAlias(ATypeName); + if ( FDerivationMode in [dmExtension, dmRestriction] ) then begin + classDef.SetParent(FBaseType); + end; + if ( classDef.Parent = nil ) then + classDef.SetParent( + (FSymbols.ByName('base_service_intf') as TSymbolTable) + .ByName('TBaseComplexRemotable') as TClassTypeDefinition + ); + if Assigned(eltCrs) or Assigned(eltAttCrs) then begin + isArrayDef := False; + if Assigned(eltCrs) then begin + eltCrs.Reset(); + while eltCrs.MoveNext() do begin + ParseElement((eltCrs.GetCurrent() as TDOMNodeRttiExposer).InnerObject); + end; + end; + if Assigned(eltAttCrs) then begin + eltAttCrs.Reset(); + while eltAttCrs.MoveNext() do begin + ParseElement((eltAttCrs.GetCurrent() as TDOMNodeRttiExposer).InnerObject); + end; + end; + if ( arrayItems.Count > 0 ) then begin + if ( arrayItems.Count = 1 ) and ( classDef.PropertyCount = 1 ) then begin + Result := nil; + propTyp := arrayItems[0] as TPropertyDefinition; + arrayDef := TArrayDefinition.Create(internalName,propTyp.DataType,propTyp.Name,propTyp.ExternalName,asScoped); + FreeAndNil(classDef); + Result := arrayDef; + if hasInternalName then + arrayDef.RegisterExternalAlias(ATypeName); + end else begin + GenerateArrayTypes(internalName,arrayItems); + tmpClassDef := classDef; + classDef := TClassTypeDefinition.Create(tmpClassDef.Name); + Result := classDef; + classDef.SetParent(tmpClassDef.Parent); + if hasInternalName then + classDef.RegisterExternalAlias(ATypeName); + for i := 0 to Pred(tmpClassDef.PropertyCount) do begin + propTyp := tmpClassDef.Properties[i]; + if ( arrayItems.IndexOf(propTyp) = -1 ) then begin + tmpPropTyp := classDef.AddProperty(propTyp.Name,propTyp.DataType); + tmpPropTyp.IsAttribute := propTyp.IsAttribute; + tmpPropTyp.StorageOption := propTyp.StorageOption; + tmpPropTyp.RegisterExternalAlias(propTyp.ExternalName); + end else begin + classDef.AddProperty( + propTyp.Name, + FSymbols.ByName(Format('%s_%sArray',[internalName,propTyp.Name])) as TTypeDefinition + ).RegisterExternalAlias(propTyp.ExternalName); + end; + end; + FreeAndNil(tmpClassDef); + end; + end; + end; + except + FreeAndNil(Result); + raise; + end; + finally + FreeAndNil(arrayItems); + end; + end; +end; + +function TComplexTypeParser.ParseSimpleContent(const ATypeName : string) : TTypeDefinition; + + function ExtractAttributeCursor():IObjectCursor; + var + frstCrsr, tmpCursor : IObjectCursor; + parentNode, tmpNode : TDOMNode; + locFilterStr : string; + begin + Result := nil; + parentNode := FContentNode; + if parentNode.HasChildNodes() then begin; + frstCrsr := CreateChildrenCursor(parentNode,cetRttiNode); + locFilterStr := CreateQualifiedNameFilterStr(s_extension,FOwner.FXSShortNames) + ' or ' + + CreateQualifiedNameFilterStr(s_restriction,FOwner.FXSShortNames) ; + tmpCursor := CreateCursorOn(frstCrsr.Clone() as IObjectCursor,ParseFilter(locFilterStr,TDOMNodeRttiExposer)); + if Assigned(tmpCursor) then begin + tmpCursor.Reset(); + if tmpCursor.MoveNext() then begin + tmpNode := (tmpCursor.GetCurrent() as TDOMNodeRttiExposer).InnerObject; + if tmpNode.HasChildNodes() then begin + locFilterStr := CreateQualifiedNameFilterStr(s_attribute,FOwner.FXSShortNames); + tmpCursor := CreateCursorOn(CreateChildrenCursor(tmpNode,cetRttiNode),ParseFilter(locFilterStr,TDOMNodeRttiExposer)); + if Assigned(tmpCursor) then begin + Result := tmpCursor; + Result.Reset(); + end; + end; + end; + end; + end else begin + Result := nil; + end; + end; + +var + locClassDef : TClassTypeDefinition; + + procedure ParseAttribute(AElement : TDOMNode); + var + locAttCursor, locPartCursor : IObjectCursor; + locName, locTypeName, locStoreOpt : string; + locType : TAbstractSymbolDefinition; + locStoreOptIdx : Integer; + locAttObj : TPropertyDefinition; + locInternalEltName : string; + locHasInternalName : boolean; + begin + locAttCursor := CreateAttributesCursor(AElement,cetRttiNode); + locPartCursor := CreateCursorOn(locAttCursor.Clone() as IObjectCursor,ParseFilter(Format('%s = %s',[s_NODE_NAME,QuotedStr(s_name)]),TDOMNodeRttiExposer)); + locPartCursor.Reset(); + if not locPartCursor.MoveNext() then + raise EWslParserException.CreateFmt('Invalid <%s> definition : missing "name" attribute.',[s_attribute]); + locName := (locPartCursor.GetCurrent() as TDOMNodeRttiExposer).NodeValue; + if IsStrEmpty(locName) then + raise EWslParserException.CreateFmt('Invalid <%s> definition : empty "name".',[s_attribute]); + + locPartCursor := CreateCursorOn(locAttCursor.Clone() as IObjectCursor,ParseFilter(Format('%s = %s',[s_NODE_NAME,QuotedStr(s_type)]),TDOMNodeRttiExposer)); + locPartCursor.Reset(); + if not locPartCursor.MoveNext() then + raise EWslParserException.CreateFmt('Invalid <%s> definition : missing "type" attribute.',[s_attribute]); + locTypeName := ExtractNameFromQName((locPartCursor.GetCurrent() as TDOMNodeRttiExposer).NodeValue); + if IsStrEmpty(locTypeName) then + raise EWslParserException.CreateFmt('Invalid <%s> definition : empty "type".',[s_attribute]); + locType := FSymbols.Find(locTypeName); + if not Assigned(locType) then begin + locType := TForwardTypeDefinition.Create(locTypeName); + FSymbols.Add(locType); + end; + + locPartCursor := CreateCursorOn(locAttCursor.Clone() as IObjectCursor,ParseFilter(Format('%s = %s',[s_NODE_NAME,QuotedStr(s_use)]),TDOMNodeRttiExposer)); + locPartCursor.Reset(); + if locPartCursor.MoveNext() then begin + locStoreOpt := ExtractNameFromQName((locPartCursor.GetCurrent() as TDOMNodeRttiExposer).NodeValue); + if IsStrEmpty(locStoreOpt) then + raise EWslParserException.CreateFmt('Invalid <%s> definition : empty "use".',[s_attribute]); + locStoreOptIdx := AnsiIndexText(locStoreOpt,[s_required,s_optional,s_prohibited]); + if ( locStoreOptIdx < Ord(Low(TStorageOption)) ) or ( locStoreOptIdx > Ord(High(TStorageOption)) ) then + raise EWslParserException.CreateFmt('Invalid <%s> definition : invalid "use" value "%s".',[s_attribute,locStoreOpt]); + end else begin + locStoreOptIdx := 0; + end; + + locInternalEltName := locName; + locHasInternalName := IsReservedKeyWord(locInternalEltName); + if locHasInternalName then + locInternalEltName := Format('_%s',[locInternalEltName]); + + locAttObj := locClassDef.AddProperty(locInternalEltName,locType as TTypeDefinition); + if locHasInternalName then + locAttObj.RegisterExternalAlias(locName); + locAttObj.IsAttribute := True; + locAttObj.StorageOption := TStorageOption(locStoreOptIdx); + end; + +var + locAttCrs : IObjectCursor; + internalName : string; + hasInternalName : Boolean; +begin + ExtractBaseType(); + if not ( FDerivationMode in [dmExtension, dmRestriction] ) then + raise EWslParserException.Create('Invalid "complexeType.simpleType" definition : restriction/extension not found.'); + + internalName := ATypeName; + hasInternalName := IsReservedKeyWord(internalName) or + ( not IsValidIdent(internalName) );{ or + ( FSymbols.IndexOf(internalName) <> -1 );} + if hasInternalName then + internalName := Format('_%s',[internalName]); + + locAttCrs := ExtractAttributeCursor(); + locClassDef := TClassTypeDefinition.Create(Trim(internalName)); + try + Result := locClassDef; + if hasInternalName then + locClassDef.RegisterExternalAlias(ATypeName); + if ( FDerivationMode in [dmExtension, dmRestriction] ) then begin + locClassDef.SetParent(FBaseType); + end; + if ( locClassDef.Parent = nil ) then begin + locClassDef.SetParent( + (FSymbols.ByName('base_service_intf') as TSymbolTable) + .ByName('TBaseComplexRemotable') as TClassTypeDefinition + ); + end; + if ( locAttCrs <> nil ) then begin + locAttCrs.Reset(); + while locAttCrs.MoveNext() do begin + ParseAttribute((locAttCrs.GetCurrent() as TDOMNodeRttiExposer).InnerObject); + end; + end; + except + FreeAndNil(Result); + raise; + end; +end; + +function TComplexTypeParser.ParseEmptyContent(const ATypeName: string): TTypeDefinition; +var + internalName : string; + hasInternalName : Boolean; +begin + internalName := ATypeName; + hasInternalName := IsReservedKeyWord(internalName) or + ( not IsValidIdent(internalName) );{ or + ( FSymbols.IndexOf(internalName) <> -1 );} + if hasInternalName then + internalName := Format('_%s',[internalName]); + Result := TClassTypeDefinition.Create(internalName); + if hasInternalName then + Result.RegisterExternalAlias(ATypeName); + TClassTypeDefinition(Result).SetParent( + (FSymbols.ByName('base_service_intf') as TSymbolTable) + .ByName('TBaseComplexRemotable') as TClassTypeDefinition + ); +end; + +class function TComplexTypeParser.GetParserSupportedStyle(): string; +begin + Result := s_complexType; +end; + +function TComplexTypeParser.Parse() : TTypeDefinition; +var + locSym : TAbstractSymbolDefinition; + locContinue : Boolean; +begin + if not AnsiSameText(ExtractNameFromQName(FTypeNode.NodeName),s_complexType) then + raise EWslParserException.CreateFmt('%s expected but %s found.',[s_complexType,ExtractNameFromQName(FTypeNode.NodeName)]); + CreateNodeCursors(); + ExtractTypeName(); + locContinue := True; + locSym := FSymbols.Find(FTypeName); + if Assigned(locSym) then begin + if not locSym.InheritsFrom(TTypeDefinition) then + raise EWslParserException.CreateFmt('Symbol found in the symbol table but is not a type definition : %s.',[FTypeName]); + locContinue := locSym.InheritsFrom(TForwardTypeDefinition); + if not locContinue then; + Result := locSym as TTypeDefinition; + end; + if locContinue then begin + ExtractContentType(); + if IsStrEmpty(FContentType) then begin + Result := ParseEmptyContent(FTypeName); + end else begin + if AnsiSameText(FContentType,s_complexContent) then + Result := ParseComplexContent(FTypeName) + else + Result := ParseSimpleContent(FTypeName); + end; + end; +end; + +{ TSimpleTypeParser } + +procedure TSimpleTypeParser.CreateNodeCursors(); +begin + FAttCursor := CreateAttributesCursor(FTypeNode,cetRttiNode); + FChildCursor := CreateChildrenCursor(FTypeNode,cetRttiNode); +end; + +procedure TSimpleTypeParser.ExtractTypeName(); +var + locCrs : IObjectCursor; +begin + if not FEmbededDef then begin + locCrs := CreateCursorOn( + FAttCursor.Clone() as IObjectCursor, + ParseFilter(Format('%s = %s',[s_NODE_NAME,QuotedStr(s_name)]),TDOMNodeRttiExposer) + ); + locCrs.Reset(); + if not locCrs.MoveNext() then + raise EWslParserException.Create('Unable to find the tag in the type node attributes.'); + FTypeName := (locCrs.GetCurrent() as TDOMNodeRttiExposer).NodeValue; + end; + if IsStrEmpty(FTypeName) then + raise EWslParserException.Create('Invalid type name( the name is empty ).'); +end; + +function TSimpleTypeParser.ExtractContentType() : Boolean; +var + locCrs, locAttCrs : IObjectCursor; + tmpNode : TDOMNode; +begin + locCrs := CreateCursorOn( + FChildCursor.Clone() as IObjectCursor, + ParseFilter(CreateQualifiedNameFilterStr(s_restriction,FOwner.FXSShortNames),TDOMNodeRttiExposer) + ); + locCrs.Reset(); + if locCrs.MoveNext() then begin + FRestrictionNode := (locCrs.GetCurrent() as TDOMNodeRttiExposer).InnerObject; + tmpNode := nil; + locAttCrs := CreateAttributesCursor(FRestrictionNode,cetRttiNode); + if Assigned(locAttCrs) then begin + locAttCrs := CreateCursorOn(locAttCrs,ParseFilter(Format('%s=%s',[s_NODE_NAME,QuotedStr(s_base)]),TDOMNodeRttiExposer)); + locAttCrs.Reset(); + if locAttCrs.MoveNext() then begin + tmpNode := (locAttCrs.GetCurrent() as TDOMNodeRttiExposer).InnerObject; + end; + end; + FBaseName := ''; + if Assigned(tmpNode) then begin + FBaseName := ExtractNameFromQName(tmpNode.NodeValue); + end; + locCrs := CreateChildrenCursor(FRestrictionNode,cetRttiNode) as IObjectCursor; + if Assigned(locCrs) then begin + locCrs := CreateCursorOn( + locCrs, + ParseFilter(CreateQualifiedNameFilterStr(s_enumeration,FOwner.FXSShortNames),TDOMNodeRttiExposer) + ); + locCrs.Reset(); + if locCrs.MoveNext() then begin + FIsEnum := True; + end else begin + if IsStrEmpty(FBaseName) then + raise EWslParserException.CreateFmt('Base type is not specified for the simple type, parsing : "%s".',[FTypeName]); + FIsEnum := False + end; + end else begin + if IsStrEmpty(FBaseName) then + raise EWslParserException.CreateFmt('Base type is not specified for the simple type, parsing : "%s".',[FTypeName]); + FIsEnum := False + end; + Result := True; + end else begin + //raise EWslParserException.CreateFmt('The parser only support "Restriction" mode simple type derivation, parsing : "%s".',[FTypeName]); + Result := False; + end; +end; + +function TSimpleTypeParser.ParseEnumContent(): TTypeDefinition; + + function ExtractEnumCursor():IObjectCursor ; + begin + Result := CreateCursorOn( + CreateChildrenCursor(FRestrictionNode,cetRttiNode), + ParseFilter(CreateQualifiedNameFilterStr(s_enumeration,FOwner.FXSShortNames),TDOMNodeRttiExposer) + ); + end; + +var + locRes : TEnumTypeDefinition; + locOrder : Integer; + + procedure ParseEnumItem(AItemNode : TDOMNode); + var + tmpNode : TDOMNode; + locItemName, locInternalItemName : string; + locCrs : IObjectCursor; + locItem : TEnumItemDefinition; + locHasInternalName : Boolean; + locBuffer : string; + begin + locCrs := CreateCursorOn(CreateAttributesCursor(AItemNode,cetRttiNode),ParseFilter(Format('%s=%s',[s_NODE_NAME,QuotedStr(s_value)]),TDOMNodeRttiExposer)) as IObjectCursor; + if not Assigned(locCrs) then + raise EWslParserException.CreateFmt('Invalid "enum" item node : no value attribute, type = "%s".',[FTypeName]); + locCrs.Reset(); + if not locCrs.MoveNext() then + raise EWslParserException.CreateFmt('Invalid "enum" item node : no value attribute, type = "%s".',[FTypeName]); + tmpNode := (locCrs.GetCurrent() as TDOMNodeRttiExposer).InnerObject; + locItemName := tmpNode.NodeValue; + if IsStrEmpty(locItemName) then + raise EWslParserException.CreateFmt('Invalid "enum" item node : the value attribute is empty, type = "%s".',[FTypeName]); + + locInternalItemName := ExtractIdentifier(locItemName); + locHasInternalName := IsReservedKeyWord(locInternalItemName) or + ( not IsValidIdent(locInternalItemName) ) or + ( FSymbols.IndexOf(locInternalItemName) <> -1 ) or + ( not AnsiSameText(locInternalItemName,locItemName) ); + if locHasInternalName then begin + locBuffer := ExtractIdentifier(locRes.ExternalName); + if IsStrEmpty(locBuffer) and ( locBuffer[Length(locBuffer)] <> '_' ) then begin + locInternalItemName := Format('%s_%s',[locBuffer,locInternalItemName]); + end else begin + locInternalItemName := Format('%s%s',[locBuffer,locInternalItemName]); + end; + end; + locItem := TEnumItemDefinition.Create(locInternalItemName,locRes,locOrder); + if locHasInternalName then + locItem.RegisterExternalAlias(locItemName); + FSymbols.Add(locItem); + locRes.AddItem(locItem); + Inc(locOrder); + end; + +var + locEnumCrs : IObjectCursor; + intrName : string; + hasIntrnName : Boolean; +begin + locEnumCrs := ExtractEnumCursor(); + + intrName := FTypeName; + hasIntrnName := IsReservedKeyWord(FTypeName) or + ( ( FSymbols.IndexOf(intrName) >= 0 ) and ( not FSymbols.ByName(intrName).InheritsFrom(TForwardTypeDefinition) ) ); + if hasIntrnName then + intrName := '_' + intrName; + + locRes := TEnumTypeDefinition.Create(Trim(intrName)); + try + Result := locRes; + if hasIntrnName then + locRes.RegisterExternalAlias(FTypeName); + locEnumCrs.Reset(); + locOrder := 0; + while locEnumCrs.MoveNext() do begin + ParseEnumItem((locEnumCrs.GetCurrent() as TDOMNodeRttiExposer).InnerObject); + end; + except + FreeAndNil(Result); + raise; + end; +end; + +function TSimpleTypeParser.ParseOtherContent(): TTypeDefinition; +begin // todo : implement TSimpleTypeParser.ParseOtherContent + if IsStrEmpty(FBaseName) then + raise EWslParserException.CreateFmt('Invalid simple type definition : base type not provided, "%s".',[FTypeName]); + Result := TTypeAliasDefinition.Create(FTypeName,FSymbols.ByName(FBaseName) as TTypeDefinition); +end; + +class function TSimpleTypeParser.GetParserSupportedStyle(): string; +begin + Result := s_simpleType; +end; + +function TSimpleTypeParser.Parse(): TTypeDefinition; +var + locSym : TAbstractSymbolDefinition; + locContinue : Boolean; +begin + if not AnsiSameText(ExtractNameFromQName(FTypeNode.NodeName),s_simpleType) then + raise EWslParserException.CreateFmt('%s expected but %s found.',[s_simpleType,ExtractNameFromQName(FTypeNode.NodeName)]); + CreateNodeCursors(); + ExtractTypeName(); + locContinue := True; + locSym := FSymbols.Find(FTypeName); + if Assigned(locSym) then begin + if not locSym.InheritsFrom(TTypeDefinition) then + raise EWslParserException.CreateFmt('Symbol found in the symbol table but is not a type definition : %s.',[FTypeName]); + locContinue := locSym.InheritsFrom(TForwardTypeDefinition); + if not locContinue then begin + Result := locSym as TTypeDefinition; + end; + end; + if locContinue then begin + if ExtractContentType() then begin + if FIsEnum then begin + Result := ParseEnumContent() + end else begin + Result := ParseOtherContent(); + end; + end else begin + FBaseName := 'string'; + Result := ParseOtherContent(); + end; + end; +end; + + +initialization + TAbstractTypeParser.RegisterParser(TSimpleTypeParser); + TAbstractTypeParser.RegisterParser(TComplexTypeParser); + +finalization + FreeAndNil(FTypeParserList); + +end. diff --git a/wst/tags/0.4/ws_helper/wst_resources_utils.pas b/wst/tags/0.4/ws_helper/wst_resources_utils.pas new file mode 100644 index 000000000..f429336ca --- /dev/null +++ b/wst/tags/0.4/ws_helper/wst_resources_utils.pas @@ -0,0 +1,127 @@ +unit wst_resources_utils; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils; + + procedure BinToWstRessource( + const AResourceName : string; + ABinStream, + AWstRstream : TStream + ); + +implementation + +procedure BinToWstRessource( + const AResourceName : string; + ABinStream, + AWstRstream : TStream +); +const MAX_LINE_LEN = 80; READ_LEN = 1024; WRITE_LEN = 1024; +type TWritingState = ( wsBegin, wsInString, wsOutString); +var + locInBuffer, locOutBuffer : string; + locInBufferLen, locOutBufferLen, locLineLen, locInIdx : Integer; + locChar : Char; + locState : TWritingState; + locTotalRead : Integer; + + procedure FillInBuffer(); + begin + locInIdx := 1; + SetLength(locInBuffer,READ_LEN); + locInBufferLen := ABinStream.Read(Pointer(locInBuffer)^,READ_LEN); + SetLength(locInBuffer,locInBufferLen); + Inc(locTotalRead,locInBufferLen); + end; + + procedure FlushBuffer(); + begin + locOutBufferLen := Length(locOutBuffer); + if ( locOutBufferLen > 0 ) then begin + AWstRstream.Write(Pointer(locOutBuffer)^,locOutBufferLen); + locOutBuffer := ''; + locOutBufferLen := 0; + end; + end; + + function ReadChar():Boolean; + begin + if ( locInBufferLen = 0 ) or ( locInIdx > locInBufferLen ) then + FillInBuffer(); + Result := ( locInBufferLen > 0 ) and ( locInIdx <= locInBufferLen ); + if Result then begin + locChar := locInBuffer[locInIdx]; + Inc(locInIdx); + end; + end; + + procedure WriteChar(const AChar : Char); + begin + locOutBuffer := locOutBuffer + AChar; + Inc(locLineLen); + end; + +var + s : string; +begin + locTotalRead := 0; + locLineLen := 0; + locInBufferLen := 0; + locOutBufferLen := 0; + locInIdx := 0; + locState := wsBegin; + locInBuffer := ''; + locOutBuffer := Format(' GetWSTResourceManager().AddResource(''%s'','+sLineBreak + ' ',[AResourceName]); + while ReadChar() do begin + if ( Ord(locChar) in [32..127] ) then begin + case locState of + wsBegin : WriteChar(''''); + wsInString : ; + wsOutString : WriteChar(''''); + end; + WriteChar(locChar); + if ( locChar = '''' ) then + WriteChar(locChar); + locState := wsInString; + end else begin + case locState of + wsBegin : ; + wsInString : WriteChar(''''); + wsOutString : ; + end; + WriteChar('#'); + s := IntToStr(Ord(locChar)); + locOutBuffer := locOutBuffer + s; + Inc(locLineLen,Length(s)); + locState := wsOutString; + end; + if ( ( locLineLen + 4 ) >= MAX_LINE_LEN ) then begin + if ( locState = wsInString ) then + WriteChar(''''); + locOutBuffer := locOutBuffer + sLineBreak + ' +'; + locLineLen := 0; + locState := wsBegin; + end; + locOutBufferLen := Length(locOutBuffer); + if ( locOutBufferLen >= WRITE_LEN ) then begin + FlushBuffer(); + end; + end; + if ( locInBufferLen = 0 ) then begin + locState := wsInString; + WriteChar(''''); + end; + if ( locState = wsInString ) then + WriteChar(''''); + if ( locLineLen > 0 ) then + locOutBuffer := locOutBuffer + sLineBreak; + locOutBuffer := locOutBuffer + ' );'; + FlushBuffer(); +end; + +end. + diff --git a/wst/tags/0.4/wst.inc b/wst/tags/0.4/wst.inc new file mode 100644 index 000000000..e64a5e251 --- /dev/null +++ b/wst/tags/0.4/wst.inc @@ -0,0 +1,15 @@ +{$IFNDEF FPC} + const FPC_RELEASE = 0; + const FPC_VERSION = 0; +{$ENDIF} +{$IFDEF FPC} + {$mode objfpc}{$H+} + {$DEFINE HAS_QWORD} + {$DEFINE USE_INLINE} + {$IF( (FPC_VERSION = 2) and (FPC_RELEASE > 0) ) } + {$define FPC_211} + {$IFEND} +{$ELSE} + {$UNDEF HAS_QWORD} + {$UNDEF USE_INLINE} +{$ENDIF} diff --git a/wst/tags/0.4/wst_delphi.inc b/wst/tags/0.4/wst_delphi.inc new file mode 100644 index 000000000..f900a551b --- /dev/null +++ b/wst/tags/0.4/wst_delphi.inc @@ -0,0 +1,8 @@ +{$IFNDEF HAS_QWORD} + type + QWord = type Int64; + DWORD = LongWord; + PtrInt = Cardinal; + PByteArray = ^ByteArray; + ByteArray = array[0..$effffff] of Byte; +{$ENDIF} \ No newline at end of file diff --git a/wst/tags/0.4/wst_resources_imp.pas b/wst/tags/0.4/wst_resources_imp.pas new file mode 100644 index 000000000..b8dfa9d57 --- /dev/null +++ b/wst/tags/0.4/wst_resources_imp.pas @@ -0,0 +1,236 @@ +unit wst_resources_imp; + +interface + +uses + Classes, SysUtils; + +{$INCLUDE wst.inc} + +type + + EWSTResourceException = class(Exception) + end; + + TWSTResourceManager = Class(TPersistent) + Public + Procedure Assign(Source : TPersistent); override; + Function HasResource(Const AName : String) : Boolean; virtual; abstract; + Function ResourceAsString(Const AName : String) : String; virtual; abstract; + Procedure AddResource(Const AName,AValue : String); overload;virtual; Abstract; + Procedure AddResource(const Name: AnsiString; Values: array of string);overload; + Procedure GetResourceList(List : TStrings); virtual; abstract; + end; + + Function GetWSTResourceManager(Force : Boolean = True) : TWSTResourceManager; + Function SetWSTResourceManager(AValue : TWSTResourceManager) : TWSTResourceManager; + +implementation + +ResourceString + SErrNoSuchResource = 'No such resource in resource list: "%s"'; + +Type + { Default implementation of resource manager } + + TWSTResourceItem = Class(TCollectionItem) + Private + FName : String; + FValue : String; + Public + Property Name : String Read FName Write FName; + Property Value : String Read FValue Write FValue; + end; + + TWSTResourceItems = Class(TCollection) + Private + Function GetResource(AIndex : Integer) : TWSTResourceItem; + Procedure SetResource(AIndex : Integer; AValue : TWSTResourceItem); + Public + Function IndexOfResource(AName : String) : Integer; + Function FindResource(AName : String) : TWSTResourceItem; + Function ResourceByName(AName : String) : TWSTResourceItem; + Property Resources[Index : Integer] : TWSTResourceItem Read GetResource Write SetResource; default; + end; + + TCollectionResourceManager = Class(TWSTResourceManager) + FResources : TWSTResourceItems; + Public + Constructor Create; + Destructor Destroy; override; + Function HasResource(Const AName : String) : Boolean; override; + Function ResourceAsString(Const AName : String) : String; override; + Procedure AddResource(Const AName,AValue : String); override; + Procedure GetResourceList(List : TStrings); override; + end; + + +Function TWSTResourceItems.GetResource(AIndex : Integer) : TWSTResourceItem; + +begin + Result:=TWSTResourceItem(Items[AIndex]); +end; + +Procedure TWSTResourceItems.SetResource(AIndex : Integer; AValue : TWSTResourceItem); + +begin + Items[AIndex]:=AValue; +end; + +Function TWSTResourceItems.IndexOfResource(AName : String) : Integer; + +begin + Result:=Count-1; + While (Result>=0) and (CompareText(GetResource(Result).Name,AName)<>0) do + Dec(Result); +end; + +Function TWSTResourceItems.FindResource(AName : String) : TWSTResourceItem; + +Var + I : Integer; + +begin + I:=IndexOfResource(AName); + If (I=-1) then + Result:=Nil + else + Result:=GetResource(I); +end; + +Function TWSTResourceItems.ResourceByName(AName : String) : TWSTResourceItem; + +begin + Result:=FindResource(AName); + If (Result=Nil) then + Raise EWSTResourceException.CreateFmt(SErrNoSuchResource,[ANAme]); +end; + +Procedure TWSTResourceManager.Assign(Source : TPersistent); + +Var + I : integer; + L : TStringList; + S : String; + R : TWSTResourceManager; + +begin + If Source is TWSTResourceManager then + begin + L:=TStringList.Create; + try + R:=TWSTResourceManager(Source); + R.GetResourceList(L); + For I:=0 to L.Count-1 do + begin + S:=R.ResourceAsString(L[i]); + Self.AddResource(L[i],S); + end; + finally + L.free; + end; + end; +end; + +procedure TWSTResourceManager.AddResource(const Name: AnsiString; Values: array of string); + +var + i,L,TLen, p: integer; + S : String; + +begin + L:=High(Values)-Low(Values)+1; + If (L=1) then + S:=Values[0] + else if (L>1) then + begin + TLen:=0; + for I:=Low(Values) to High(Values) do + TLen:=TLen+Length(Values[i]); + SetLength(S,TLen); + p:=1; + for i:=Low(Values) to High(Values) do + begin + L:=length(Values[i]); + if (L>0) then + begin + Move(Values[i][1],S[p],l); + inc(p,l); + end; + end; + end; + If (S<>'') then + AddResource(Name,S); +end; + + +Function TCollectionResourceManager.HasResource(Const AName : String) : Boolean; + +begin + Result:=FResources.IndexOfResource(AName)<>-1; +end; + +Function TCollectionResourceManager.ResourceAsString(Const AName : String) : String; + +begin + Result:=FResources.ResourceByName(AName).Value; +end; + +Procedure TCollectionResourceManager.AddResource(Const AName,AValue : String); + +Var + R : TWSTResourceItem; + +begin + R:=FResources.Add as TWSTResourceItem; + R.Name:=AName; + R.Value:=AValue; +end; + +Procedure TCollectionResourceManager.GetResourceList(List : TStrings); + +Var + I : Integer; + +begin + For I:=0 to FResources.Count-1 do + List.Add(FResources[i].Name); +end; + +Constructor TCollectionResourceManager.Create; + +begin + FResources:=TWSTResourceItems.Create(TWSTResourceItem); +end; + +Destructor TCollectionResourceManager.Destroy; + +begin + FResources.Free; + Inherited; +end; + +Var + ResMGR : TWSTResourceManager; + +Function GetWSTResourceManager(Force : Boolean = True) : TWSTResourceManager; + +begin + Result:=ResMGR; + If (ResMgr=Nil) and Force then + ResMGr:=TCollectionResourceManager.Create; + Result:=ResMGR; +end; + +Function SetWSTResourceManager(AValue : TWSTResourceManager) : TWSTResourceManager; + +begin + // Copy resources if needed. + If Assigned(ResMGR) and Assigned(AValue) then + AValue.Assign(ResMGR); + FreeAndNil(ResMGR); + ResMGR:=AValue; +end; + +end. + diff --git a/wst/tags/0.4/wst_rtl_imp.inc b/wst/tags/0.4/wst_rtl_imp.inc new file mode 100644 index 000000000..616d40e73 --- /dev/null +++ b/wst/tags/0.4/wst_rtl_imp.inc @@ -0,0 +1,8 @@ +function wst_GetMem(Size : PtrInt) : Pointer;{$IFDEF USE_INLINE}inline;{$ENDIF} +begin + {$IFDEF FPC} + Result := GetMem(Size); + {$ELSE} + GetMem(Result,Size); + {$ENDIF} +end; \ No newline at end of file diff --git a/wst/tags/0.4/wst_rtti_filter/cursor_intf.pas b/wst/tags/0.4/wst_rtti_filter/cursor_intf.pas new file mode 100644 index 000000000..51e9240d7 --- /dev/null +++ b/wst/tags/0.4/wst_rtti_filter/cursor_intf.pas @@ -0,0 +1,153 @@ +unit cursor_intf; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils; + +type + + ECursorException = class(Exception) + end; + + ICursor = interface + ['{2B7756B1-E239-4B6F-A7A3-4B57B98FAD4F}'] + procedure Reset(); + function MoveNext() : Boolean; + function Clone():ICursor; + end; + + IObjectFilter = interface + ['{3DFB1A26-ED2D-428A-9F62-2091A076D97B}'] + function Evaluate(const AObject : TObject) : Boolean; + end; + + IObjectCursor = interface(ICursor) + ['{13E9C22D-0508-4D7A-A969-96E2291B4FE8}'] + function GetCurrent() : TObject; + end; + + IFilterableObjectCursor = interface(IObjectCursor) + ['{F11B588A-E8CF-45D3-98D2-B49755FFC22D}'] + function GetFilter() : IObjectFilter; + function SetFilter(const AFilter : IObjectFilter) : IObjectFilter; + end; + + function CreateCursorOn( + AInputCursor : IObjectCursor; + AFilter : IObjectFilter + ) : IFilterableObjectCursor ; + + + (* + ['{4E3C49EE-5EA6-47CD-8862-3AA4F96BD86E}'] + ['{65D250B6-90AC-40DC-A6EE-4750188D1D94}'] + ['{8B4AE228-C231-45E5-B8A4-2864481B9263}'] + ['{658709D2-2D25-44DB-83CF-DC430D55A21F}'] + ['{B2CFB744-43CF-4787-8256-A0F34E26A729}'] + ['{D3A4A37A-B63A-42AD-8E44-4AD4C28E3C34}'] + ['{DB7A8303-0621-41A0-A948-A7BD71CA99F8}'] + ['{3BB114EB-73CF-4555-ABC7-ABA4A643DBDA}'] + ['{C64B6235-54BE-4DA9-A5E8-D67B579FA14F}'] + + *) + +implementation + +type + + { TSimpleObjectFilterableCursor } + + TSimpleObjectFilterableCursor = class( + TInterfacedObject, + ICursor,IObjectCursor,IFilterableObjectCursor + ) + private + FBaseCursor : IObjectCursor; + FFilter : IObjectFilter; + protected + procedure Reset(); + function MoveNext() : Boolean; + function Clone():ICursor; + function GetCurrent() : TObject; + function GetFilter() : IObjectFilter; + function SetFilter(const AFilter : IObjectFilter) : IObjectFilter; + public + constructor Create( + AInputCursor : IObjectCursor; + AFilter : IObjectFilter + ); + end; + +function CreateCursorOn( + AInputCursor : IObjectCursor; + AFilter : IObjectFilter +) : IFilterableObjectCursor ; +begin + Result := TSimpleObjectFilterableCursor.Create(AInputCursor,AFilter); +end; + + +{ TSimpleObjectFilterableCursor } + +procedure TSimpleObjectFilterableCursor.Reset(); +begin + FBaseCursor.Reset(); +end; + +function TSimpleObjectFilterableCursor.MoveNext(): Boolean; +begin + if ( FFilter = nil ) then begin + Result := FBaseCursor.MoveNext(); + end else begin + while FBaseCursor.MoveNext() do begin + if FFilter.Evaluate(FBaseCursor.GetCurrent()) then begin + Result := True; + exit; + end; + end; + Result := False; + end; +end; + +function TSimpleObjectFilterableCursor.Clone(): ICursor; +var + baseClone : ICursor; +begin + Result := nil; + baseClone := FBaseCursor.Clone(); + if ( baseClone <> nil ) then + Result := TSimpleObjectFilterableCursor.Create(baseClone as IObjectCursor,FFilter); +end; + +function TSimpleObjectFilterableCursor.GetCurrent(): TObject; +begin + Result := FBaseCursor.GetCurrent(); +end; + +function TSimpleObjectFilterableCursor.GetFilter(): IObjectFilter; +begin + Result := FFilter; +end; + +function TSimpleObjectFilterableCursor.SetFilter(const AFilter: IObjectFilter): IObjectFilter; +begin + FFilter := AFilter; + Result := FFilter; +end; + +constructor TSimpleObjectFilterableCursor.Create( + AInputCursor : IObjectCursor; + AFilter : IObjectFilter +); +begin + Assert(Assigned(AInputCursor)); + inherited Create(); + FBaseCursor := AInputCursor; + FFilter := AFilter; +end; + + +end. diff --git a/wst/tags/0.4/wst_rtti_filter/dom_cursors.pas b/wst/tags/0.4/wst_rtti_filter/dom_cursors.pas new file mode 100644 index 000000000..bc2fda250 --- /dev/null +++ b/wst/tags/0.4/wst_rtti_filter/dom_cursors.pas @@ -0,0 +1,259 @@ +unit dom_cursors; + +{$mode objfpc}{$H+} +{$IF (FPC_VERSION = 2) and (FPC_RELEASE > 0)} + {$define FPC_211} +{$ENDIF} +interface + +uses + Classes, SysUtils, + cursor_intf, DOM; + +type + + TFreeAction = ( faNone, faFreeOnDestroy ); + + { TDOMNodeListCursor } + + TDOMNodeListCursor = class(TInterfacedObject,ICursor,IObjectCursor) + private + FList : TDOMNodeList; + FCurrent : TDOMNode; + FFreeListOnDestroy : TFreeAction; + FHasItem : Boolean; + protected + procedure Reset(); + function MoveNext() : Boolean; + function Clone():ICursor; + function GetCurrent() : TObject;virtual; + public + constructor Create( + ADataList : TDOMNodeList; + const AFreeListOnDestroy : TFreeAction + ); + destructor Destroy();override; + end; + + { TDOMNamedNodeMapCursor } + + TDOMNamedNodeMapCursor = class(TInterfacedObject,ICursor,IObjectCursor) + private + FList : TDOMNamedNodeMap; + FCurrent : Integer; + FFreeListOnDestroy : TFreeAction; + protected + procedure Reset(); + function MoveNext() : Boolean; + function Clone():ICursor; + function GetCurrent() : TObject; + public + constructor Create( + ADataList : TDOMNamedNodeMap; + const AFreeListOnDestroy : TFreeAction + ); + destructor Destroy();override; + end; + + { TDOMNodeRttiExposer } + + TDOMNodeRttiExposer = class(TPersistent) + private + FInnerObject: TDOMNode; + function GetNodeName: DOMString; + function GetNodeValue: DOMString; + procedure SetInnerObject(const AValue: TDOMNode); + public + constructor Create(AInnerObject : TDOMNode); + property InnerObject : TDOMNode read FInnerObject write SetInnerObject; + published + property NodeName: DOMString read GetNodeName; + property NodeValue: DOMString read GetNodeValue; + end; + + { TDOMNodeRttiExposerCursor } + + TDOMNodeRttiExposerCursor = class(TInterfacedObject,ICursor,IObjectCursor) + private + FCurrentExposer : TDOMNodeRttiExposer; + FBaseCursor : IObjectCursor; + protected + procedure Reset(); + function MoveNext() : Boolean; + function Clone():ICursor; + function GetCurrent() : TObject;virtual; + public + constructor Create(ADataList : IObjectCursor); + destructor Destroy();override; + end; + +implementation + +{ TDOMNodeListCursor } + +procedure TDOMNodeListCursor.Reset(); +begin + FCurrent := nil; +end; + +function TDOMNodeListCursor.MoveNext(): Boolean; +begin + if ( FCurrent = nil ) then begin + if FHasItem then + FCurrent := FList.Item[0]; + end else begin + FCurrent := FCurrent.NextSibling; + end; + Result := ( FCurrent <> nil ) ; +end; + +function TDOMNodeListCursor.Clone(): ICursor; +begin + Result := TDOMNodeListCursor.Create(FList,faNone); +end; + +function TDOMNodeListCursor.GetCurrent(): TObject; +begin + Result := FCurrent; +end; + +constructor TDOMNodeListCursor.Create( + ADataList : TDOMNodeList; + const AFreeListOnDestroy : TFreeAction +); +begin + Assert(Assigned(ADataList)); + FFreeListOnDestroy := AFreeListOnDestroy; + FList := ADataList; + FHasItem := ( FList.Count > 0 ); + Reset(); +end; + +destructor TDOMNodeListCursor.Destroy(); +begin + FCurrent := nil; + if ( FFreeListOnDestroy = faFreeOnDestroy ) then + FreeAndNil(FList) + else + FList := nil; + inherited Destroy(); +end; + +{ TDOMNodeRttiExposer } + +function TDOMNodeRttiExposer.GetNodeName: DOMString; +begin + Result := InnerObject.NodeName; +end; + +function TDOMNodeRttiExposer.GetNodeValue: DOMString; +begin + Result := InnerObject.NodeValue; +end; + +procedure TDOMNodeRttiExposer.SetInnerObject(const AValue: TDOMNode); +begin + if ( FInnerObject = AValue ) then + exit; + FInnerObject := AValue; +end; + +constructor TDOMNodeRttiExposer.Create(AInnerObject: TDOMNode); +begin + Inherited Create(); + SetInnerObject(AInnerObject); +end; + +{ TDOMNodeRttiExposerCursor } + +procedure TDOMNodeRttiExposerCursor.Reset(); +begin + FBaseCursor.Reset(); +end; + +function TDOMNodeRttiExposerCursor.MoveNext(): Boolean; +begin + Result := FBaseCursor.MoveNext(); +end; + +function TDOMNodeRttiExposerCursor.Clone(): ICursor; +var + baseClone : ICursor; +begin + Result := nil; + baseClone := FBaseCursor.Clone(); + if ( baseClone <> nil ) then + Result := TDOMNodeRttiExposerCursor.Create(baseClone as IObjectCursor) ; +end; + +function TDOMNodeRttiExposerCursor.GetCurrent(): TObject; +begin + FCurrentExposer.InnerObject := FBaseCursor.GetCurrent() as TDOMNode; + if ( FCurrentExposer.InnerObject = nil ) then + Result := nil + else + Result := FCurrentExposer; +end; + +constructor TDOMNodeRttiExposerCursor.Create(ADataList : IObjectCursor); +begin + Assert(Assigned(ADataList)); + inherited Create(); + FBaseCursor := ADataList; + FCurrentExposer := TDOMNodeRttiExposer.Create(nil); +end; + +destructor TDOMNodeRttiExposerCursor.Destroy(); +begin + FreeAndNil(FCurrentExposer);; + inherited Destroy(); +end; + +{ TDOMNamedNodeMapCursor } + +procedure TDOMNamedNodeMapCursor.Reset(); +begin + FCurrent := -1; +end; + +function TDOMNamedNodeMapCursor.MoveNext(): Boolean; +begin + Inc(FCurrent); + Result := ( FCurrent < FList.{$IFNDEF FPC_211}Count{$ELSE}Length{$ENDIF} ); +end; + +function TDOMNamedNodeMapCursor.Clone(): ICursor; +begin + Result := TDOMNamedNodeMapCursor.Create(FList,faNone); +end; + +function TDOMNamedNodeMapCursor.GetCurrent(): TObject; +begin + if ( FCurrent > -1 ) and ( FCurrent < FList.{$IFNDEF FPC_211}Count{$ELSE}Length{$ENDIF} ) then + Result := FList.Item[FCurrent] + else + Result := nil; +end; + +constructor TDOMNamedNodeMapCursor.Create( + ADataList : TDOMNamedNodeMap; + const AFreeListOnDestroy : TFreeAction +); +begin + Assert(Assigned(ADataList)); + FFreeListOnDestroy := AFreeListOnDestroy; + FList := ADataList; + Reset(); +end; + +destructor TDOMNamedNodeMapCursor.Destroy(); +begin + if ( FFreeListOnDestroy = faFreeOnDestroy ) then + FreeAndNil(FList) + else + FList := nil; + inherited Destroy(); +end; + +end. + diff --git a/wst/tags/0.4/wst_rtti_filter/rtti_filters.pas b/wst/tags/0.4/wst_rtti_filter/rtti_filters.pas new file mode 100644 index 000000000..fd7166ede --- /dev/null +++ b/wst/tags/0.4/wst_rtti_filter/rtti_filters.pas @@ -0,0 +1,655 @@ +unit rtti_filters; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, Contnrs, TypInfo, + cursor_intf; + +type + + ERttiFilterException = class(Exception) + end; + + TFilterConnector = ( fcNone, fcAnd, fcOr ); + + TNumericFilterOperator = ( nfoEqual, nfoGreater, nfoLesser, nfoNotEqual ); + TStringFilterOperator = ( sfoEqualCaseSensitive, sfoEqualCaseInsensitive, sfoNotEqual ); + + TRttiFilterCreatorTarget = TPersistent; + TRttiFilterCreatorTargetClass = class of TRttiFilterCreatorTarget; + + TRttiExpNodeItem = class; + TRttiExpNode = class; + + TClearAction = ( clrNone, clrFreeObjects ); + + { TRttiFilterCreator } + TRttiFilterCreator = class + private + FRoot : TRttiExpNode; + FCurrent : TRttiExpNode; + FTargetClass: TRttiFilterCreatorTargetClass; + FCurrentStack : TObjectStack; + private + procedure AddNode( + const ANode : TRttiExpNodeItem; + const AConnector : TFilterConnector + ); + procedure PushCurrent(ACurrent : TRttiExpNode); + function PopCurrent() : TRttiExpNode; + public + constructor Create(const ATargetClass : TRttiFilterCreatorTargetClass); + destructor Destroy();override; + procedure Clear(const AFreeObjects : TClearAction); + function AddCondition( + const APropertyName : string; + const AOperator : TNumericFilterOperator; + const AValue : Integer; + const AConnector : TFilterConnector + ) : TRttiFilterCreator;overload; + function AddCondition( + const APropertyName : string; + const AOperator : TStringFilterOperator; + const AValue : AnsiString; + const AConnector : TFilterConnector + ) : TRttiFilterCreator;overload; + function AddCondition( + const APropertyName : string; + const AOperator : TStringFilterOperator; + const AValue : WideString; + const AConnector : TFilterConnector + ) : TRttiFilterCreator;overload; + + function BeginGroup(const AConnector : TFilterConnector):TRttiFilterCreator; + function EndGroup():TRttiFilterCreator; + property TargetClass : TRttiFilterCreatorTargetClass read FTargetClass; + property Root : TRttiExpNode read FRoot; + end; + + + TRttiExpNodeItem = class + public + function Evaluate(AInstance : TRttiFilterCreatorTarget):Boolean;virtual;abstract; + end; + + { TRttiObjectFilter } + + TRttiObjectFilter = class(TInterfacedObject,IObjectFilter) + private + FFilterRoot : TRttiExpNodeItem; + FOnDestroyFilterAction : TClearAction; + protected + function Evaluate(const AObject : TObject) : Boolean; + public + constructor Create( + AFilterRoot : TRttiExpNodeItem; + const AOnDestroyFilterAction : TClearAction + ); + destructor Destroy();override; + end; + + { TRttiExpNode } + + TRttiExpNode = class(TRttiExpNodeItem) + private + FConnector: TFilterConnector; + FLeft: TRttiExpNodeItem; + FRight: TRttiExpNodeItem; + private + procedure SetConnector(const AValue: TFilterConnector); + procedure SetLeft(const AValue: TRttiExpNodeItem); + procedure SetRight(const AValue: TRttiExpNodeItem); + public + destructor Destroy();override; + function Evaluate(AInstance : TRttiFilterCreatorTarget):Boolean;override; + property Connector : TFilterConnector read FConnector write SetConnector; + property Left : TRttiExpNodeItem read FLeft write SetLeft; + property Right : TRttiExpNodeItem read FRight write SetRight; + end; + + { TRttiExpConcreteNodeItem } + + TRttiExpConcreteNodeItem = class(TRttiExpNodeItem) + private + FPropInfo: PPropInfo; + public + constructor Create(const APropInfo : PPropInfo); + property PropInfo : PPropInfo read FPropInfo; + end; + + { TRttiExpNumericNodeItem } + + TRttiExpNumericNodeItem = class(TRttiExpConcreteNodeItem) + private + FOperation: TNumericFilterOperator; + public + constructor Create( + const APropInfo : PPropInfo; + const AOperation : TNumericFilterOperator + ); + property Operation : TNumericFilterOperator read FOperation; + end; + + { TRttiExpIntegerNodeItem } + + TRttiExpIntegerNodeItem = class(TRttiExpNumericNodeItem) + private + FComparedValue: Integer; + public + constructor Create( + const APropInfo : PPropInfo; + const AOperation : TNumericFilterOperator; + const AComparedValue : Integer + ); + function Evaluate(AInstance : TRttiFilterCreatorTarget):Boolean;override; + property ComparedValue : Integer read FComparedValue; + end; + + { TRttiExpStringNodeItem } + + TRttiExpStringNodeItem = class(TRttiExpConcreteNodeItem) + private + FOperation: TStringFilterOperator; + public + constructor Create( + const APropInfo : PPropInfo; + const AOperation : TStringFilterOperator + ); + property Operation : TStringFilterOperator read FOperation; + end; + + { TRttiExpAnsiStringNodeItem } + + TRttiExpAnsiStringNodeItem = class(TRttiExpStringNodeItem) + private + FComparedValue: AnsiString; + public + constructor Create( + const APropInfo : PPropInfo; + const AOperation : TStringFilterOperator; + const AComparedValue : AnsiString + ); + function Evaluate(AInstance : TRttiFilterCreatorTarget):Boolean;override; + property ComparedValue : AnsiString read FComparedValue; + end; + + { TRttiExpWideStringNodeItem } + + TRttiExpWideStringNodeItem = class(TRttiExpStringNodeItem) + private + FComparedValue: WideString; + public + constructor Create( + const APropInfo : PPropInfo; + const AOperation : TStringFilterOperator; + const AComparedValue : WideString + ); + function Evaluate(AInstance : TRttiFilterCreatorTarget):Boolean;override; + property ComparedValue : WideString read FComparedValue; + end; + + procedure ParseFilter(const AFilterText: string; AFltrCrtr : TRttiFilterCreator);overload; + function ParseFilter( + const AFilterText : string; + ATargetClass : TRttiFilterCreatorTargetClass + ) : IObjectFilter;overload; + +implementation + +function ParseFilter( + const AFilterText : string; + ATargetClass : TRttiFilterCreatorTargetClass +) : IObjectFilter; +var + fltr : TRttiFilterCreator; +begin + Result := nil; + fltr := TRttiFilterCreator.Create(ATargetClass); + try + try + ParseFilter(AFilterText,fltr); + Result := TRttiObjectFilter.Create(fltr.Root,clrFreeObjects); + fltr.Clear(clrNone); + except + fltr.Clear(clrFreeObjects); + end; + finally + FreeAndNil(fltr); + end; +end; + +procedure ParseFilter(const AFilterText: string; AFltrCrtr : TRttiFilterCreator); +const + tkn_LeftParenthesis = '('; tkn_RigthParenthesis = ')'; + tkn_Equal = '='; tkn_NotEqual = '<>'; + tkn_Sup = '>'; tkn_Inf = '<'; + tkn_And = 'and'; tkn_Or = 'or'; +var + strm : TStringStream; + prsr : TParser; + + procedure MoveNext(); + begin + prsr.NextToken(); + if ( prsr.Token = toEOF ) then + raise ERttiFilterException.Create('Unexpected end of filter.'); + end; + +var + propName : string; + propInfo : PPropInfo; + lastCntr : TFilterConnector; + + procedure Handle_String(); + var + s : string; + ws : WideString; + fltrOp : TStringFilterOperator; + begin + MoveNext(); + s := prsr.TokenString(); + if ( s = tkn_Equal ) then + fltrOp := sfoEqualCaseInsensitive + else if ( s = tkn_NotEqual ) then + fltrOp := sfoNotEqual + else + raise ERttiFilterException.CreateFmt('Unexpected symbol : "%s".',[s]); + MoveNext(); + prsr.CheckToken(toString); + if ( propInfo^.PropType^.Kind = tkWString ) then begin + ws := prsr.TokenString(); + AFltrCrtr.AddCondition(propName,fltrOp,ws,lastCntr); + end else begin + s := prsr.TokenString(); + AFltrCrtr.AddCondition(propName,fltrOp,s,lastCntr); + end; + end; + + procedure Handle_Integer(); + var + s : string; + fltrOp : TNumericFilterOperator; + begin + MoveNext(); + s := prsr.TokenString(); + if ( s = tkn_Equal ) then + fltrOp := nfoEqual + else if ( s = tkn_NotEqual ) then + fltrOp := nfoNotEqual + else if ( s = tkn_Inf ) then + fltrOp := nfoLesser + else if ( s = tkn_Sup ) then + fltrOp := nfoGreater + else + raise ERttiFilterException.CreateFmt('Unexpected symbol : "%s".',[s]); + MoveNext(); + prsr.CheckToken(toInteger); + AFltrCrtr.AddCondition(propName,fltrOp,prsr.TokenInt(),lastCntr); + end; + +var + s : string; +begin + lastCntr := fcAnd; + AFltrCrtr.Clear(clrFreeObjects); + strm := TStringStream.Create(Trim(AFilterText)); + try + prsr := TParser.Create(strm); + while ( prsr.Token <> toEOF ) do begin + s := prsr.TokenString(); + if SameText(s,tkn_LeftParenthesis) then + AFltrCrtr.BeginGroup(lastCntr) + else if SameText(s,tkn_RigthParenthesis) then + AFltrCrtr.EndGroup() + else if SameText(s,tkn_And) then + lastCntr := fcAnd + else if SameText(s,tkn_Or) then + lastCntr := fcOr + else begin + prsr.CheckToken(toSymbol); + propName := prsr.TokenString(); + propInfo := GetPropInfo(AFltrCrtr.TargetClass,propName); + if ( propInfo = nil ) then + raise ERttiFilterException.CreateFmt('Invalid property : "%s"',[propName]); + if ( propInfo^.PropType^.Kind in [tkSString,tkLString,tkAString,tkWString] ) then + Handle_String() + else if ( propInfo^.PropType^.Kind in [tkInteger,tkInt64,tkQWord] ) then + Handle_Integer() + else + raise ERttiFilterException.CreateFmt('Type not handled : "%s"',[GetEnumName(TypeInfo(TTypeKind),Ord(propInfo^.PropType^.Kind))]); + end; + prsr.NextToken(); + end; + finally + FreeAndNil(strm); + end; +end; + +procedure ClearObject(ARoot : TRttiExpNodeItem); +begin + if Assigned(ARoot) then begin + if ARoot.InheritsFrom(TRttiExpNode) then begin + with TRttiExpNode(ARoot) do begin + ClearObject(Right); + Right := nil; + ClearObject(Left); + Left := nil; + end; + end; + ARoot.Free(); + end; +end; + +{ TRttiExpNode } + +procedure TRttiExpNode.SetRight(const AValue: TRttiExpNodeItem); +begin + if ( Connector = fcNone ) and ( AValue <> nil ) then + raise ERttiFilterException.Create('"Connector" must be set before "Right".'); + //FreeAndNil(FRight); + FRight := AValue; +end; + +procedure TRttiExpNode.SetConnector(const AValue: TFilterConnector); +begin + if ( AValue = fcNone ) and ( FRight <> nil ) then + raise ERttiFilterException.Create('"Right" must be set to "nil" before "Connector" can be set to "none".'); + FConnector := AValue; +end; + +procedure TRttiExpNode.SetLeft(const AValue: TRttiExpNodeItem); +begin + if ( FRight <> nil ) and ( AValue = nil ) then + raise ERttiFilterException.Create('"Right" must be set to "nil" before "Left" can be set to "none".'); + //FreeAndNil(FLeft); + FLeft := AValue; +end; + +destructor TRttiExpNode.Destroy(); +begin + FreeAndNil(FLeft); + FreeAndNil(FRight); + inherited Destroy(); +end; + +function TRttiExpNode.Evaluate(AInstance: TRttiFilterCreatorTarget): Boolean; +begin + if Assigned(Left) then begin + Result := Left.Evaluate(AInstance); + if not Assigned(Right) then + Exit; + if Result and ( Connector = fcOr ) then + Exit; + if ( not Result ) and ( Connector = fcAnd ) then + Exit; + Result := Right.Evaluate(AInstance); + end else begin + Result := False; + end; +end; + +{ TRttiExpConcreteNodeItem } + +constructor TRttiExpConcreteNodeItem.Create(const APropInfo : PPropInfo); +begin + Assert(Assigned(APropInfo)); + FPropInfo := APropInfo; +end; + +{ TRttiExpIntegerNodeItem } + +constructor TRttiExpIntegerNodeItem.Create( + const APropInfo : PPropInfo; + const AOperation : TNumericFilterOperator; + const AComparedValue : Integer +); +begin + Assert(Assigned(APropInfo)); + if not ( APropInfo^.PropType^.Kind in [tkInteger,tkInt64,tkQWord] ) then + raise ERttiFilterException.CreateFmt('Invalid property data type. "%s" excpeted.',['Integer']); + inherited Create(APropInfo,AOperation); + FComparedValue := AComparedValue; +end; + +function TRttiExpIntegerNodeItem.Evaluate(AInstance: TRttiFilterCreatorTarget): Boolean; +begin + case Operation of + nfoEqual : Result := ( GetOrdProp(AInstance,PropInfo) = ComparedValue ); + nfoGreater : Result := ( GetOrdProp(AInstance,PropInfo) > ComparedValue ); + nfoLesser : Result := ( GetOrdProp(AInstance,PropInfo) < ComparedValue ); + nfoNotEqual : Result := ( GetOrdProp(AInstance,PropInfo) <> ComparedValue ); + end; +end; + +{ TRttiFilterCreator } + +procedure TRttiFilterCreator.AddNode( + const ANode : TRttiExpNodeItem; + const AConnector : TFilterConnector +); +var + tmpNode : TRttiExpNode; +begin + Assert(Assigned(ANode)); + if not Assigned(FRoot) then begin + FRoot := TRttiExpNode.Create(); + FCurrent := FRoot; + end; + if not Assigned(FCurrent.Left) then begin + FCurrent.Left := ANode; + FCurrent.Connector := AConnector; + Exit; + end; + if ( AConnector <= fcNone ) then + raise ERttiFilterException.Create('Invalid connector value.'); + if not Assigned(FCurrent.Right) then begin + FCurrent.Right := ANode; + FCurrent.Connector := AConnector; + Exit; + end; + tmpNode := TRttiExpNode.Create(); + tmpNode.Left := FCurrent.Right; + FCurrent.Right := tmpNode; + FCurrent := tmpNode; + FCurrent.Connector := AConnector; + FCurrent.Right := ANode; +end; + +procedure TRttiFilterCreator.PushCurrent(ACurrent: TRttiExpNode); +begin + FCurrentStack.Push(FCurrent); + FCurrent := ACurrent; +end; + +function TRttiFilterCreator.PopCurrent(): TRttiExpNode; +begin + if not FCurrentStack.AtLeast(1) then + raise ERttiFilterException.Create('"BeginGroup" must be called before "EndGroup".'); + Result := FCurrentStack.Pop() as TRttiExpNode; + FCurrent := Result; +end; + +constructor TRttiFilterCreator.Create(const ATargetClass: TRttiFilterCreatorTargetClass); +begin + Assert(Assigned(ATargetClass)); + FTargetClass := ATargetClass; + FCurrentStack := TObjectStack.Create(); +end; + +destructor TRttiFilterCreator.Destroy(); +begin + FreeAndNil(FCurrentStack); + inherited Destroy(); +end; + +procedure TRttiFilterCreator.Clear(const AFreeObjects: TClearAction); +var + i : Integer; +begin + if ( AFreeObjects = clrFreeObjects ) then + ClearObject(FRoot); + for i := 0 to Pred(FCurrentStack.Count) do + FCurrentStack.Pop(); + FRoot := nil; +end; + +function TRttiFilterCreator.AddCondition( + const APropertyName : string; + const AOperator : TNumericFilterOperator; + const AValue : Integer; + const AConnector : TFilterConnector +) : TRttiFilterCreator; +begin + AddNode( + TRttiExpIntegerNodeItem.Create(GetPropInfo(TargetClass,APropertyName),AOperator,AValue), + AConnector + ); + Result := Self; +end; + +function TRttiFilterCreator.AddCondition( + const APropertyName : string; + const AOperator : TStringFilterOperator; + const AValue : AnsiString; + const AConnector : TFilterConnector +): TRttiFilterCreator; +begin + AddNode( + TRttiExpAnsiStringNodeItem.Create(GetPropInfo(TargetClass,APropertyName),AOperator,AValue), + AConnector + ); + Result := Self; +end; + +function TRttiFilterCreator.AddCondition( + const APropertyName : string; + const AOperator : TStringFilterOperator; + const AValue : WideString; + const AConnector : TFilterConnector +): TRttiFilterCreator; +begin + AddNode( + TRttiExpWideStringNodeItem.Create(GetPropInfo(TargetClass,APropertyName),AOperator,AValue), + AConnector + ); + Result := Self; +end; + +function TRttiFilterCreator.BeginGroup(const AConnector: TFilterConnector):TRttiFilterCreator; +var + gn : TRttiExpNode; +begin + if not Assigned(FCurrent) then + AddNode(TRttiExpNode.Create(),fcNone); + gn := TRttiExpNode.Create(); + AddNode(gn,AConnector); + PushCurrent(gn); + Result := Self; +end; + +function TRttiFilterCreator.EndGroup(): TRttiFilterCreator; +begin + PopCurrent(); + Result := Self; +end; + +{ TRttiObjectFilter } + +function TRttiObjectFilter.Evaluate(const AObject: TObject): Boolean; +begin + Result := FFilterRoot.Evaluate(TRttiFilterCreatorTarget(AObject)); +end; + +constructor TRttiObjectFilter.Create( + AFilterRoot : TRttiExpNodeItem; + const AOnDestroyFilterAction : TClearAction +); +begin + Assert(Assigned(AFilterRoot)); + FFilterRoot := AFilterRoot; + FOnDestroyFilterAction := AOnDestroyFilterAction; +end; + +destructor TRttiObjectFilter.Destroy(); +begin + if ( FOnDestroyFilterAction = clrFreeObjects ) then + ClearObject(FFilterRoot); + inherited Destroy(); +end; + +{ TRttiExpNumericNodeItem } + +constructor TRttiExpNumericNodeItem.Create( + const APropInfo: PPropInfo; + const AOperation: TNumericFilterOperator +); +begin + Assert(Assigned(APropInfo)); + inherited Create(APropInfo); + FOperation := AOperation; +end; + +{ TRttiExpStringNodeItem } + +constructor TRttiExpStringNodeItem.Create( + const APropInfo: PPropInfo; + const AOperation: TStringFilterOperator +); +begin + Assert(Assigned(APropInfo)); + inherited Create(APropInfo); + FOperation := AOperation; +end; + +{ TRttiExpAnsiStringNodeItem } + +constructor TRttiExpAnsiStringNodeItem.Create( + const APropInfo: PPropInfo; + const AOperation: TStringFilterOperator; + const AComparedValue: AnsiString +); +begin + Assert(Assigned(APropInfo)); + if not ( APropInfo^.PropType^.Kind in [tkSString,tkLString,tkAString] ) then + raise ERttiFilterException.CreateFmt('Invalid property data type. "%s" excpeted.',['AnsiString']); + inherited Create(APropInfo,AOperation); + FComparedValue := AComparedValue; +end; + +function TRttiExpAnsiStringNodeItem.Evaluate(AInstance: TRttiFilterCreatorTarget): Boolean; +begin + case Operation of + sfoEqualCaseSensitive : Result := ( GetStrProp(AInstance,PropInfo) = ComparedValue ); + sfoEqualCaseInsensitive : Result := AnsiSameText(GetStrProp(AInstance,PropInfo),ComparedValue); + sfoNotEqual : Result := ( GetStrProp(AInstance,PropInfo) <> ComparedValue); + end; +end; + +{ TRttiExpWideStringNodeItem } + +constructor TRttiExpWideStringNodeItem.Create( + const APropInfo: PPropInfo; + const AOperation: TStringFilterOperator; + const AComparedValue: WideString +); +begin + Assert(Assigned(APropInfo)); + if not ( APropInfo^.PropType^.Kind in [tkWString] ) then + raise ERttiFilterException.CreateFmt('Invalid property data type. "%s" excpeted.',['WideString']); + inherited Create(APropInfo,AOperation); + FComparedValue := AComparedValue; +end; + +function TRttiExpWideStringNodeItem.Evaluate(AInstance: TRttiFilterCreatorTarget): Boolean; +begin + case Operation of + sfoEqualCaseSensitive : Result := AnsiSameStr(GetStrProp(AInstance,PropInfo),ComparedValue); + sfoEqualCaseInsensitive : Result := AnsiSameText(GetStrProp(AInstance,PropInfo),ComparedValue); + sfoNotEqual : Result := not AnsiSameText(GetStrProp(AInstance,PropInfo),ComparedValue); + end; +end; + +end. diff --git a/wst/tags/0.4/wst_rtti_filter/rtti_filters_tests.lpi b/wst/tags/0.4/wst_rtti_filter/rtti_filters_tests.lpi new file mode 100644 index 000000000..ba1852574 --- /dev/null +++ b/wst/tags/0.4/wst_rtti_filter/rtti_filters_tests.lpi @@ -0,0 +1,266 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wst/tags/0.4/wst_rtti_filter/rtti_filters_tests.lpr b/wst/tags/0.4/wst_rtti_filter/rtti_filters_tests.lpr new file mode 100644 index 000000000..35822b094 --- /dev/null +++ b/wst/tags/0.4/wst_rtti_filter/rtti_filters_tests.lpr @@ -0,0 +1,159 @@ +program rtti_filters_tests; + +{$mode objfpc}{$H+} +//{$DEFINE VER2_0} +uses + custapp, Classes, SysUtils, fpcunit, testreport, testregistry, tests, + cursor_intf, rtti_filters, std_cursors, test_std_cursors, dom_cursors; + +const + ShortOpts = 'alh'; + Longopts: array[1..5] of string = ('all', 'list', 'format:', 'suite:', 'help'); + Version = 'Version 0.1'; + +type + TFormat = (fPlain, fLatex, fXML); + + TTestRunner = class(TCustomApplication) + private + protected + procedure DoRun; override; + procedure doTestRun(aTest: TTest); virtual; + public + end; + +var + FormatParam: TFormat; + + procedure TTestRunner.doTestRun(aTest: TTest); + var + testResult: TTestResult; + + procedure doXMLTestRun(aText: TTest); + var + XMLResultsWriter: TXMLResultsWriter; + begin + try + XMLResultsWriter := TXMLResultsWriter.Create; + testResult.AddListener(XMLResultsWriter); + XMLResultsWriter.WriteHeader; + aTest.Run(testResult); + XMLResultsWriter.WriteResult(testResult); + finally + XMLResultsWriter.Free; + testResult.Free; + end; + end; + + {$IFNDEF VER2_0} + procedure doPlainTestRun(aText: TTest); + var + PlainResultsWriter: TPlainResultsWriter; + begin + try + PlainResultsWriter := TPlainResultsWriter.Create; + testResult.AddListener(PlainResultsWriter); + PlainResultsWriter.WriteHeader; + aTest.Run(testResult); + PlainResultsWriter.WriteResult(testResult); + finally + PlainResultsWriter.Free; + testResult.Free; + end; + end; + {$ENDIF} + + begin + testResult := TTestResult.Create; + + case FormatParam of + fLatex: doXMLTestRun(aTest); //no latex implemented yet + {$IFNDEF VER2_0} + fPlain: doPlainTestRun(aTest); + {$ENDIF} + else + doXMLTestRun(aTest); + end; + end; + + procedure TTestRunner.DoRun; + var + I: integer; + S: string; + begin + S := CheckOptions(ShortOpts, LongOpts); + if (S <> '') then + Writeln(S); + + if HasOption('h', 'help') or (ParamCount = 0) then + begin + writeln(Title); + writeln(Version); + writeln; + writeln('Usage: '); + writeln(' --format=latex output as latex source (only list implemented)'); + {$IFNDEF VER2_0} + writeln(' --format=plain output as plain ASCII source'); + {$ENDIF} + writeln(' --format=xml output as XML source (default)'); + writeln; + writeln(' -l or --list show a list of registered tests'); + writeln(' -a or --all run all tests'); + writeln(' --suite=MyTestSuiteName run single test suite class'); + writeln; + writeln('The results can be redirected to an xml file,'); + writeln('for example: ./testrunner --all > results.xml'); + end; + + //get the format parameter + FormatParam := fXML; + if HasOption('format') then + begin + if GetOptionValue('format') = 'latex' then + FormatParam := fLatex; + {$IFNDEF VER2_0} + if GetOptionValue('format') = 'plain' then + FormatParam := fPlain; + {$ENDIF} + end; + + //get a list of all registed tests + if HasOption('l', 'list') then + case FormatParam of + fLatex: Write(GetSuiteAsLatex(GetTestRegistry)); + {$IFNDEF VER2_0} + fPlain: Write(GetSuiteAsPlain(GetTestRegistry)); + {$ENDIF} + else + Write(GetSuiteAsXML(GetTestRegistry)); + end; + + //run the tests + if HasOption('a', 'all') then + doTestRun(GetTestRegistry) + else + if HasOption('suite') then + begin + S := ''; + S := GetOptionValue('suite'); + if S = '' then + for I := 0 to GetTestRegistry.Tests.Count - 1 do + writeln(GetTestRegistry[i].TestName) + else + for I := 0 to GetTestRegistry.Tests.Count - 1 do + if GetTestRegistry[i].TestName = S then + doTestRun(GetTestRegistry[i]); + end; + Terminate; + end; + +var + App: TTestRunner; + +begin + App := TTestRunner.Create(nil); + App.Initialize; + App.Title := 'FPCUnit Console Test Case runner.'; + App.Run; + App.Free; +end. diff --git a/wst/tags/0.4/wst_rtti_filter/rtti_filters_tests.pas b/wst/tags/0.4/wst_rtti_filter/rtti_filters_tests.pas new file mode 100644 index 000000000..d0a08e5a8 --- /dev/null +++ b/wst/tags/0.4/wst_rtti_filter/rtti_filters_tests.pas @@ -0,0 +1,11 @@ +program rtti_filters_tests; + +{$mode objfpc}{$H+} + +uses + Classes, SysUtils, + cursor_intf, rtti_filters; + +begin +end. + diff --git a/wst/tags/0.4/wst_rtti_filter/std_cursors.pas b/wst/tags/0.4/wst_rtti_filter/std_cursors.pas new file mode 100644 index 000000000..05d3e94e2 --- /dev/null +++ b/wst/tags/0.4/wst_rtti_filter/std_cursors.pas @@ -0,0 +1,112 @@ +unit std_cursors; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, Contnrs, + cursor_intf; + +type + + { TObjectListCursor } + + TObjectListCursor = class(TInterfacedObject,ICursor,IObjectCursor) + private + FList : TObjectList; + FCurrentIndex : Integer; + protected + procedure Reset(); + function MoveNext() : Boolean;virtual; + function Clone():ICursor; + function GetCurrent() : TObject; + public + constructor Create(ADataList : TObjectList); + end; + + { TObjectListFilterableCursor } + + TObjectListFilterableCursor = class(TObjectListCursor,IFilterableObjectCursor) + private + FFilter : IObjectFilter; + protected + function MoveNext() : Boolean;override; + function GetFilter() : IObjectFilter; + function SetFilter(const AFilter : IObjectFilter) : IObjectFilter; + public + destructor Destroy();override; + end; + +implementation + +{ TObjectListCursor } + +procedure TObjectListCursor.Reset(); +begin + FCurrentIndex := -1; +end; + +function TObjectListCursor.MoveNext(): Boolean; +begin + Inc(FCurrentIndex); + Result := ( FCurrentIndex < FList.Count ); +end; + +function TObjectListCursor.Clone(): ICursor; +begin + Result := TObjectListCursor.Create(FList); +end; + +function TObjectListCursor.GetCurrent(): TObject; +begin + if ( FCurrentIndex < 0 ) or ( FCurrentIndex >= FList.Count ) then + raise ECursorException.Create('Invalid cursor state.'); + Result := FList[FCurrentIndex]; +end; + +constructor TObjectListCursor.Create(ADataList: TObjectList); +begin + Assert(Assigned(ADataList)); + FList := ADataList; + Reset(); +end; + +{ TObjectListFilterableCursor } + +function TObjectListFilterableCursor.MoveNext(): Boolean; +begin + if ( FFilter = nil ) then begin + Result := inherited MoveNext(); + end else begin + while ( inherited MoveNext() ) do begin + if FFilter.Evaluate(GetCurrent()) then begin + Result := True; + Exit; + end; + end; + Result := False; + end; +end; + +function TObjectListFilterableCursor.GetFilter(): IObjectFilter; +begin + Result := FFilter; +end; + +function TObjectListFilterableCursor.SetFilter( + const AFilter: IObjectFilter +): IObjectFilter; +begin + FFilter := AFilter; + Result := FFilter; +end; + +destructor TObjectListFilterableCursor.Destroy(); +begin + FFilter := nil; + inherited Destroy(); +end; + +end. + diff --git a/wst/tags/0.4/wst_rtti_filter/test_std_cursors.pas b/wst/tags/0.4/wst_rtti_filter/test_std_cursors.pas new file mode 100644 index 000000000..8b186a6ea --- /dev/null +++ b/wst/tags/0.4/wst_rtti_filter/test_std_cursors.pas @@ -0,0 +1,232 @@ +unit test_std_cursors; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, Contnrs, + fpcunit, testutils, testregistry, + cursor_intf, std_cursors, rtti_filters; + +type + + { TClass_A } + + TClass_A = class(TPersistent) + private + FIntProp: Integer; + public + constructor Create(AIntProp : Integer); + published + property IntProp : Integer read FIntProp; + end; + + { TClass_B } + + TClass_B = class(TClass_A) + private + FIntProp_A: Integer; + FIntProp_B: Integer; + public + constructor Create(AIntProp,AIntProp_A,AIntProp_B : Integer); + published + property IntProp_A : Integer read FIntProp_A; + property IntProp_B : Integer read FIntProp_B; + end; + + { TObjectListCursor_Test } + + TObjectListCursor_Test = class(TTestCase) + published + procedure All(); + end; + + { TObjectListFilterableCursor_Test } + + TObjectListFilterableCursor_Test = class(TTestCase) + published + procedure All(); + end; + +implementation + +{ TClass_A } + +constructor TClass_A.Create(AIntProp: Integer); +begin + FIntProp := AIntProp; +end; + +{ TObjectListCursor_Test } + +procedure TObjectListCursor_Test.All(); +const O_COUNT = 100; +var + x : IObjectCursor; + ls : TObjectList; + c, i : Integer; +begin + ls := TObjectList.Create(True); + try + x := TObjectListCursor.Create(ls); + x.Reset(); + CheckEquals(False,x.MoveNext()); + x.Reset(); + CheckEquals(False,x.MoveNext()); + CheckEquals(False,x.MoveNext()); + try + x.GetCurrent(); + Check(False); + except + on e : ECursorException do begin + // GOOD + end; + end; + + ls.Add(TClass_A.Create(0)); + x.Reset(); + CheckEquals(True,x.MoveNext()); + CheckSame(ls[0],x.GetCurrent()); + CheckEquals(False,x.MoveNext()); + try + x.GetCurrent(); + Check(False); + except + on e : ECursorException do begin + // GOOD + end; + end; + x.Reset(); + CheckEquals(True,x.MoveNext()); + CheckSame(ls[0],x.GetCurrent()); + CheckEquals(False,x.MoveNext()); + + ls.Clear(); + for i := 0 to Pred(O_COUNT) do + ls.Add(TClass_A.Create(i)); + x.Reset(); + for i := 0 to Pred(O_COUNT) do begin + CheckEquals(True,x.MoveNext()); + CheckSame(ls[i],x.GetCurrent()); + end; + CheckEquals(False,x.MoveNext()); + x.Reset(); + for i := 0 to Pred(O_COUNT) do begin + CheckEquals(True,x.MoveNext()); + CheckSame(ls[i],x.GetCurrent()); + end; + finally + ls.Free(); + end; +end; + + +{ TClass_B } + +constructor TClass_B.Create(AIntProp, AIntProp_A, AIntProp_B: Integer); +begin + inherited Create(AIntProp); + FIntProp_A := AIntProp_A; + FIntProp_B := AIntProp_B; +end; + +{ TObjectListFilterableCursor_Test } + +procedure TObjectListFilterableCursor_Test.All(); +const O_COUNT = 100; +var + x : IFilterableObjectCursor; + ls : TObjectList; + c, i : Integer; + f : IObjectFilter; + fcr : TRttiFilterCreator; +begin + fcr := nil; + ls := TObjectList.Create(True); + try + x := TObjectListFilterableCursor.Create(ls); + CheckNull(x.GetFilter()); + x.Reset(); + CheckEquals(False,x.MoveNext()); + x.Reset(); + CheckEquals(False,x.MoveNext()); + CheckEquals(False,x.MoveNext()); + try + x.GetCurrent(); + Check(False); + except + on e : ECursorException do begin + // GOOD + end; + end; + + ls.Add(TClass_A.Create(0)); + x.Reset(); + CheckEquals(True,x.MoveNext()); + CheckSame(ls[0],x.GetCurrent()); + CheckEquals(False,x.MoveNext()); + try + x.GetCurrent(); + Check(False); + except + on e : ECursorException do begin + // GOOD + end; + end; + x.Reset(); + CheckEquals(True,x.MoveNext()); + CheckSame(ls[0],x.GetCurrent()); + CheckEquals(False,x.MoveNext()); + + ls.Clear(); + for i := 0 to Pred(O_COUNT) do + ls.Add(TClass_A.Create(i)); + x.Reset(); + for i := 0 to Pred(O_COUNT) do begin + CheckEquals(True,x.MoveNext()); + CheckSame(ls[i],x.GetCurrent()); + end; + CheckEquals(False,x.MoveNext()); + x.Reset(); + for i := 0 to Pred(O_COUNT) do begin + CheckEquals(True,x.MoveNext()); + CheckSame(ls[i],x.GetCurrent()); + end; + + ls.Clear(); + for i := 0 to Pred(O_COUNT) do + ls.Add(TClass_B.Create(i,( i mod 10 ), ( i mod ( ( i + 1 ) * 2 ) ) )); + + fcr := TRttiFilterCreator.Create(TClass_B); + fcr.AddCondition('IntProp',nfoEqual,-1,fcOr);// + f := TRttiObjectFilter.Create(fcr.Root,clrFreeObjects) as IObjectFilter; + x.SetFilter(f); + Check(x.GetFilter()=f); + x.SetFilter(nil); + CheckNull(x.GetFilter()); + x.SetFilter(f); + Check(x.GetFilter()=f); + x.Reset(); + CheckEquals(False,x.MoveNext()); + + fcr.AddCondition('IntProp',nfoGreater,-1,fcOr); + x.Reset(); + CheckEquals(True,x.MoveNext()); + + x.Reset(); + for i := 0 to Pred(O_COUNT) do begin + CheckEquals(True,x.MoveNext()); + CheckSame(ls[i],x.GetCurrent()); + end; + + finally + ls.Free(); + fcr.Free(); + end; +end; + +Initialization + RegisterTests([TObjectListCursor_Test,TObjectListFilterableCursor_Test]); + +end. diff --git a/wst/tags/0.4/wst_rtti_filter/tests.pas b/wst/tags/0.4/wst_rtti_filter/tests.pas new file mode 100644 index 000000000..9f2572390 --- /dev/null +++ b/wst/tags/0.4/wst_rtti_filter/tests.pas @@ -0,0 +1,900 @@ +unit tests; + +{$mode objfpc}{$H+} +//{$DEFINE DBG_DISPLAY} + +interface + +uses + Classes, SysUtils, fpcunit, testutils, testregistry, TypInfo, + + rtti_filters; + +type + + { TClass_A } + + TClass_A = class(TPersistent) + private + FIntProp: Integer; + FStrProp: string; + FWideStrProp: widestring; + published + property IntProp : Integer read FIntProp write FIntProp; + property StrProp : string read FStrProp write FStrProp; + property WideStrProp : widestring read FWideStrProp write FWideStrProp; + end; + TClass_AClass = class of TClass_A; + + { TRttiExpIntegerNodeItem_Test } + + TRttiExpIntegerNodeItem_Test = class(TTestCase) + published + procedure Create_Test(); + procedure Evaluate_Equal(); + procedure Evaluate_Lesser(); + procedure Evaluate_Greater(); + end; + + { TRttiExpAnsiStringNodeItem_Test } + + TRttiExpAnsiStringNodeItem_Test = class(TTestCase) + published + procedure Create_Test(); + procedure Evaluate_EqualCaseSensitive(); + procedure Evaluate_EqualCaseInsensitive(); + end; + + { TRttiExpwWideStringNodeItem_Test } + + TRttiExpwWideStringNodeItem_Test = class(TTestCase) + published + procedure Create_Test(); + procedure Evaluate_EqualCaseSensitive(); + procedure Evaluate_EqualCaseInsensitive(); + end; + + { TRttiExpNode_Test } + + TRttiExpNode_Test = class(TTestCase) + published + procedure Left_True(); + procedure LeftTrue_Or_RightFalse(); + procedure LeftTrue_Or_RightTrue(); + procedure LeftTrue_And_RightFalse(); + procedure LeftTrue_And_RightTrue(); + + procedure Left_False(); + procedure LeftFalse_Or_RightFalse(); + procedure LeftFalse_Or_RightTrue(); + procedure LeftFalse_And_RightFalse(); + end; + + { TRttiFilterCreator_Test } + + TRttiFilterCreator_Test = class(TTestCase) + published + procedure Creation(); + procedure AddContion(); + procedure BeginEnd_Group(); + end; + + { TRttiParser_Test } + + TRttiParser_Test = class(TTestCase) + published + procedure SimpleOperators(); + procedure BeginEnd_Group(); + end; + +implementation + +procedure TRttiExpIntegerNodeItem_Test.Create_Test(); +var + x : TRttiExpIntegerNodeItem; +begin + x := nil; + try + try + x := TRttiExpIntegerNodeItem.Create(GetPropInfo(TClass_A,'StrProp'),nfoEqual,10); + Check(False); + except + on e : EAssertionFailedError do + raise; + on e : ERttiFilterException do begin + // nothing! + end; + end; + finally + x.Free(); + end; +end; + +procedure TRttiExpIntegerNodeItem_Test.Evaluate_Equal(); +const VAL_1 : Integer = 1210; +var + x : TRttiExpIntegerNodeItem; + t : TClass_A; +begin + x := nil; + t := TClass_A.Create(); + try + x := TRttiExpIntegerNodeItem.Create(GetPropInfo(t,'IntProp'),nfoEqual,VAL_1); + + t.IntProp := 0; + Check( x.Evaluate(t) = False ,'False'); + + t.IntProp := VAL_1; + Check( x.Evaluate(t) = True, 'True' ); + finally + x.Free(); + t.Free(); + end; +end; + +procedure TRttiExpIntegerNodeItem_Test.Evaluate_Lesser(); +const VAL_1 : Integer = 1210; +var + x : TRttiExpIntegerNodeItem; + t : TClass_A; +begin + x := nil; + t := TClass_A.Create(); + try + x := TRttiExpIntegerNodeItem.Create(GetPropInfo(t,'IntProp'),nfoLesser,VAL_1); + + t.IntProp := 0; + Check( x.Evaluate(t) = True ,'True'); + + t.IntProp := VAL_1 + 1; + Check( x.Evaluate(t) = False, 'False' ); + finally + x.Free(); + t.Free(); + end; +end; + +procedure TRttiExpIntegerNodeItem_Test.Evaluate_Greater(); +const VAL_1 : Integer = 1210; +var + x : TRttiExpIntegerNodeItem; + t : TClass_A; +begin + x := nil; + t := TClass_A.Create(); + try + x := TRttiExpIntegerNodeItem.Create(GetPropInfo(t,'IntProp'),nfoGreater,VAL_1); + + t.IntProp := 0; + Check( x.Evaluate(t) = False, 'False' ); + + t.IntProp := VAL_1 + 1; + Check( x.Evaluate(t) = True ,'True'); + finally + x.Free(); + t.Free(); + end; +end; + + +{ TRttiExpNode_Test } + +procedure TRttiExpNode_Test.Left_True(); +const VAL_1 : Integer = 1210; +var + x : TRttiExpNode; + t : TClass_A; +begin + x := nil; + t := TClass_A.Create(); + try + x := TRttiExpNode.Create(); + CheckNull(x.Left); + CheckNull(x.Right); + Check(x.Connector = fcNone); + + x.Left := TRttiExpIntegerNodeItem.Create(GetPropInfo(t,'IntProp'),nfoEqual,VAL_1); + + t.IntProp := 0; + Check( x.Evaluate(t) = False, 'False' ); + + t.IntProp := VAL_1; + Check( x.Evaluate(t) = True ,'True'); + finally + x.Free(); + t.Free(); + end; +end; + +procedure TRttiExpNode_Test.LeftTrue_Or_RightFalse(); +const VAL_1 : Integer = 1210; +var + x : TRttiExpNode; + t : TClass_A; +begin + x := nil; + t := TClass_A.Create(); + try + x := TRttiExpNode.Create(); + CheckNull(x.Left); + CheckNull(x.Right); + Check(x.Connector = fcNone); + + x.Left := TRttiExpIntegerNodeItem.Create(GetPropInfo(t,'IntProp'),nfoLesser,VAL_1); + x.Connector := fcOr; + x.Right := TRttiExpIntegerNodeItem.Create(GetPropInfo(t,'IntProp'),nfoGreater,VAL_1); + + t.IntProp := 0; + Check( x.Evaluate(t) = True ,'True'); + finally + x.Free(); + t.Free(); + end; +end; + +procedure TRttiExpNode_Test.LeftTrue_Or_RightTrue(); +const VAL_1 : Integer = 1210; +var + x : TRttiExpNode; + t : TClass_A; +begin + x := nil; + t := TClass_A.Create(); + try + x := TRttiExpNode.Create(); + CheckNull(x.Left); + CheckNull(x.Right); + Check(x.Connector = fcNone); + + x.Left := TRttiExpIntegerNodeItem.Create(GetPropInfo(t,'IntProp'),nfoLesser,VAL_1); + x.Connector := fcOr; + x.Right := TRttiExpIntegerNodeItem.Create(GetPropInfo(t,'IntProp'),nfoLesser,VAL_1); + + t.IntProp := 0; + Check( x.Evaluate(t) = True ,'True'); + finally + x.Free(); + t.Free(); + end; +end; + +procedure TRttiExpNode_Test.LeftTrue_And_RightFalse(); +const VAL_1 : Integer = 1210; +var + x : TRttiExpNode; + t : TClass_A; +begin + x := nil; + t := TClass_A.Create(); + try + x := TRttiExpNode.Create(); + CheckNull(x.Left); + CheckNull(x.Right); + Check(x.Connector = fcNone); + + x.Left := TRttiExpIntegerNodeItem.Create(GetPropInfo(t,'IntProp'),nfoLesser,VAL_1); + x.Connector := fcAnd; + x.Right := TRttiExpIntegerNodeItem.Create(GetPropInfo(t,'IntProp'),nfoGreater,VAL_1); + + t.IntProp := 0; + Check( x.Evaluate(t) = False ,'False'); + finally + x.Free(); + t.Free(); + end; +end; + +procedure TRttiExpNode_Test.LeftTrue_And_RightTrue(); +const VAL_1 : Integer = 1210; +var + x : TRttiExpNode; + t : TClass_A; +begin + x := nil; + t := TClass_A.Create(); + try + x := TRttiExpNode.Create(); + CheckNull(x.Left); + CheckNull(x.Right); + Check(x.Connector = fcNone); + + x.Left := TRttiExpIntegerNodeItem.Create(GetPropInfo(t,'IntProp'),nfoLesser,VAL_1); + x.Connector := fcAnd; + x.Right := TRttiExpIntegerNodeItem.Create(GetPropInfo(t,'IntProp'),nfoLesser,VAL_1); + + t.IntProp := 0; + Check( x.Evaluate(t) = True ,'True'); + finally + x.Free(); + t.Free(); + end; +end; + +procedure TRttiExpNode_Test.Left_False(); +const VAL_1 : Integer = 1210; +var + x : TRttiExpNode; + t : TClass_A; +begin + x := nil; + t := TClass_A.Create(); + try + x := TRttiExpNode.Create(); + CheckNull(x.Left); + CheckNull(x.Right); + Check(x.Connector = fcNone); + + x.Left := TRttiExpIntegerNodeItem.Create(GetPropInfo(t,'IntProp'),nfoGreater,VAL_1); + + t.IntProp := 0; + Check( x.Evaluate(t) = False, 'False' ); + finally + x.Free(); + t.Free(); + end; +end; + +procedure TRttiExpNode_Test.LeftFalse_Or_RightFalse(); +const VAL_1 : Integer = 1210; +var + x : TRttiExpNode; + t : TClass_A; +begin + x := nil; + t := TClass_A.Create(); + try + x := TRttiExpNode.Create(); + CheckNull(x.Left); + CheckNull(x.Right); + Check(x.Connector = fcNone); + + x.Left := TRttiExpIntegerNodeItem.Create(GetPropInfo(t,'IntProp'),nfoEqual,VAL_1); + x.Connector := fcOr; + x.Right := TRttiExpIntegerNodeItem.Create(GetPropInfo(t,'IntProp'),nfoGreater,VAL_1); + + t.IntProp := 0; + Check( x.Evaluate(t) = False ,'False'); + finally + x.Free(); + t.Free(); + end; +end; + +procedure TRttiExpNode_Test.LeftFalse_Or_RightTrue(); +const VAL_1 : Integer = 1210; +var + x : TRttiExpNode; + t : TClass_A; +begin + x := nil; + t := TClass_A.Create(); + try + x := TRttiExpNode.Create(); + CheckNull(x.Left); + CheckNull(x.Right); + Check(x.Connector = fcNone); + + x.Left := TRttiExpIntegerNodeItem.Create(GetPropInfo(t,'IntProp'),nfoEqual,VAL_1); + x.Connector := fcOr; + x.Right := TRttiExpIntegerNodeItem.Create(GetPropInfo(t,'IntProp'),nfoEqual,0); + + t.IntProp := 0; + Check( x.Evaluate(t) = True ,'True'); + finally + x.Free(); + t.Free(); + end; +end; + +procedure TRttiExpNode_Test.LeftFalse_And_RightFalse(); +const VAL_1 : Integer = 1210; +var + x : TRttiExpNode; + t : TClass_A; +begin + x := nil; + t := TClass_A.Create(); + try + x := TRttiExpNode.Create(); + CheckNull(x.Left); + CheckNull(x.Right); + Check(x.Connector = fcNone); + + x.Left := TRttiExpIntegerNodeItem.Create(GetPropInfo(t,'IntProp'),nfoLesser,-VAL_1); + x.Connector := fcAnd; + x.Right := TRttiExpIntegerNodeItem.Create(GetPropInfo(t,'IntProp'),nfoGreater,VAL_1); + + t.IntProp := 0; + Check( x.Evaluate(t) = False ,'False'); + finally + x.Free(); + t.Free(); + end; +end; + +{ TRttiFilterCreator_Test } + +procedure TRttiFilterCreator_Test.Creation(); +var + x : TRttiFilterCreator; +begin + x := TRttiFilterCreator.Create(TClass_A); + try + CheckNull(x.Root,'Root <> nil'); + Check(( x.TargetClass = TClass_A ), 'TargetClass'); + finally + x.Free(); + end; +end; + +procedure Display(const AMsg : string); +begin + {$IFDEF DBG_DISPLAY} + Write(AMsg); + {$ENDIF} +end; + +type TPrintProc = procedure(const AMsg : string); +procedure PrintTree( + ATree : TRttiExpNodeItem; + APrintProc : TPrintProc; + const AIndent : Integer +); +begin + if Assigned(ATree) then begin + if ATree.InheritsFrom(TRttiExpNode) then begin + APrintProc(StringOfChar('-',AIndent)); + APrintProc(GetEnumName(TypeInfo(TFilterConnector),Ord(TRttiExpNode(ATree).Connector)) + #10#13); + PrintTree(TRttiExpNode(ATree).Left,APrintProc,AIndent+2); + PrintTree(TRttiExpNode(ATree).Right,APrintProc,AIndent+2); + end else if ATree.InheritsFrom(TRttiExpConcreteNodeItem) then begin + APrintProc(StringOfChar('-',AIndent)); + if ATree.InheritsFrom(TRttiExpNumericNodeItem) then begin + APrintProc(TRttiExpConcreteNodeItem(ATree).PropInfo^.Name + ' ' + GetEnumName(TypeInfo(TNumericFilterOperator),Ord(TRttiExpNumericNodeItem(ATree).Operation)) ); + end else if ATree.InheritsFrom(TRttiExpStringNodeItem) then begin + APrintProc(TRttiExpConcreteNodeItem(ATree).PropInfo^.Name + ' ' + GetEnumName(TypeInfo(TStringFilterOperator),Ord(TRttiExpStringNodeItem(ATree).Operation)) ) + end; + if ATree.InheritsFrom(TRttiExpIntegerNodeItem) then + APrintProc(' ' + IntToStr(TRttiExpIntegerNodeItem(ATree).ComparedValue)) + else if ATree.InheritsFrom(TRttiExpAnsiStringNodeItem) then + APrintProc(' ' + QuotedStr(TRttiExpAnsiStringNodeItem(ATree).ComparedValue)); + APrintProc(#10#13); + end; + end; +end; + +procedure CompareTree(ATreeA,ATreeB : TRttiExpNodeItem); +begin + if ( ( ATreeA = nil ) and ( ATreeB <> nil ) ) or + ( ( ATreeB = nil ) and ( ATreeA <> nil ) ) + then begin + raise Exception.Create('not equal'); + end; + if ( ATreeA <> nil ) then begin + if ATreeA.ClassType <> ATreeB.ClassType then + raise Exception.Create('Class not equal'); + if ATreeA.InheritsFrom(TRttiExpNode) then begin + if TRttiExpNode(ATreeA).Connector <> + TRttiExpNode(ATreeB).Connector + then + raise Exception.Create('TRttiExpNode not equal'); + CompareTree(TRttiExpNode(ATreeA).Left,TRttiExpNode(ATreeB).Left); + CompareTree(TRttiExpNode(ATreeA).Right,TRttiExpNode(ATreeB).Right); + end else if ATreeA.InheritsFrom(TRttiExpConcreteNodeItem) then begin + if ATreeA.InheritsFrom(TRttiExpIntegerNodeItem) then begin + if TRttiExpIntegerNodeItem(ATreeA).Operation <> + TRttiExpIntegerNodeItem(ATreeB).Operation + then + raise Exception.Create('Operation not equal'); + + if TRttiExpIntegerNodeItem(ATreeA).ComparedValue <> + TRttiExpIntegerNodeItem(ATreeB).ComparedValue + then + raise Exception.Create('Value not equal'); + end else if ATreeA.InheritsFrom(TRttiExpStringNodeItem) then begin + if TRttiExpStringNodeItem(ATreeA).Operation <> + TRttiExpStringNodeItem(ATreeB).Operation + then + raise Exception.Create('Operation not equal'); + + if ATreeA.InheritsFrom(TRttiExpAnsiStringNodeItem) then begin + if TRttiExpAnsiStringNodeItem(ATreeA).ComparedValue <> + TRttiExpAnsiStringNodeItem(ATreeB).ComparedValue + then + raise Exception.Create('Value not equal'); + end else if ATreeA.InheritsFrom(TRttiExpWideStringNodeItem) then begin + if TRttiExpWideStringNodeItem(ATreeA).ComparedValue <> + TRttiExpWideStringNodeItem(ATreeB).ComparedValue + then + raise Exception.Create('Value not equal'); + end + end; + + end; + end; +end; + +procedure TRttiFilterCreator_Test.AddContion(); +const VAL_1 : Integer = 1210; VAL_2 : Integer = 1076; VAL_3 : Integer = 176; + VAL_4 : Integer = -176; +var + x : TRttiFilterCreator; + xin : TRttiExpIntegerNodeItem; + xn : TRttiExpNode; +begin + x := TRttiFilterCreator.Create(TClass_A); + try + x.AddCondition('IntProp',nfoGreater,VAL_1,fcOr); + CheckNotNull(x.Root,'Root'); + CheckNotNull(x.Root.Left,'Root.Left'); + CheckIs(x.Root.Left,TRttiExpIntegerNodeItem,'Root.Left'); + xin := x.Root.Left as TRttiExpIntegerNodeItem; + CheckEquals(VAL_1,xin.ComparedValue); + Check( ( xin.Operation = nfoGreater ), 'Operation'); + CheckNull(x.Root.Right,'Root.Right'); + Check( ( x.Root.Connector = fcOr ), 'Root.Connector'); + + x.AddCondition('IntProp',nfoLesser,VAL_2,fcAnd); + CheckNotNull(x.Root.Left,'Root.Left'); + CheckIs(x.Root.Left,TRttiExpIntegerNodeItem,'Root.Left'); + xin := x.Root.Left as TRttiExpIntegerNodeItem; + CheckEquals(VAL_1,xin.ComparedValue); + Check( ( xin.Operation = nfoGreater ), 'Operation'); + CheckNotNull(x.Root.Right,'Root.Right'); + Check( ( x.Root.Connector = fcAnd ), 'Root.Connector'); + CheckIs(x.Root.Right,TRttiExpIntegerNodeItem,'Root.Right'); + xin := x.Root.Right as TRttiExpIntegerNodeItem; + CheckEquals(VAL_2,xin.ComparedValue); + Check( ( xin.Operation = nfoLesser ), 'Operation'); + + x.AddCondition('IntProp',nfoEqual,VAL_3,fcOr); + CheckNotNull(x.Root.Left,'Root.Left'); + CheckIs(x.Root.Left,TRttiExpIntegerNodeItem,'Root.Left'); + xin := x.Root.Left as TRttiExpIntegerNodeItem; + CheckEquals(VAL_1,xin.ComparedValue); + Check( ( xin.Operation = nfoGreater ), 'Operation'); + CheckNotNull(x.Root.Right,'Root.Right'); + Check( ( x.Root.Connector = fcAnd ), 'Root.Connector'); + CheckIs(x.Root.Right,TRttiExpNode,'Root.Right'); + xn := x.Root.Right as TRttiExpNode; + CheckNotNull(xn.Left,'Root.Right.Left'); + CheckIs(xn.Left,TRttiExpIntegerNodeItem); + xin := xn.Left as TRttiExpIntegerNodeItem; + CheckEquals(VAL_2,xin.ComparedValue); + Check( ( xin.Operation = nfoLesser ), 'Operation'); + + CheckIs(xn.Right,TRttiExpIntegerNodeItem,'xn.Right'); + xin := xn.Right as TRttiExpIntegerNodeItem; + CheckEquals(VAL_3,xin.ComparedValue); + Check( ( xin.Operation = nfoEqual ), 'Operation'); + + x.AddCondition('IntProp',nfoEqual,VAL_4,fcAnd); + PrintTree(x.Root,@Display,2); + finally + x.Free(); + end; +end; + +procedure TRttiFilterCreator_Test.BeginEnd_Group(); +const VAL_1 : Integer = 1210; VAL_2 : Integer = 1076; VAL_3 : Integer = 176; + VAL_4 : Integer = -176; +var + x : TRttiFilterCreator; + xin : TRttiExpIntegerNodeItem; + xn : TRttiExpNode; +begin + x := TRttiFilterCreator.Create(TClass_A); + try + x.AddCondition('IntProp',nfoGreater,VAL_1,fcOr); + CheckNotNull(x.Root,'Root'); + CheckNotNull(x.Root.Left,'Root.Left'); + CheckIs(x.Root.Left,TRttiExpIntegerNodeItem,'Root.Left'); + xin := x.Root.Left as TRttiExpIntegerNodeItem; + CheckEquals(VAL_1,xin.ComparedValue); + Check( ( xin.Operation = nfoGreater ), 'Operation'); + CheckNull(x.Root.Right,'Root.Right'); + Check( ( x.Root.Connector = fcOr ), 'Root.Connector'); + + x.BeginGroup(fcOr); + CheckNotNull(x.Root.Left,'Root.Left'); + CheckIs(x.Root.Left,TRttiExpIntegerNodeItem,'Root.Left'); + xin := x.Root.Left as TRttiExpIntegerNodeItem; + CheckEquals(VAL_1,xin.ComparedValue); + Check( ( xin.Operation = nfoGreater ), 'Operation'); + + CheckNotNull(x.Root.Right,'Root.Right'); + Check( ( x.Root.Connector = fcOr ), 'Root.Connector'); + CheckIs(x.Root.Right,TRttiExpNode,'Root.Right'); + xn := x.Root.Right as TRttiExpNode; + CheckNull(xn.Left); + CheckNull(xn.Right); + + x.AddCondition('IntProp',nfoLesser,VAL_2,fcAnd); + CheckNotNull(x.Root.Left,'Root.Left'); + CheckIs(x.Root.Left,TRttiExpIntegerNodeItem,'Root.Left'); + xin := x.Root.Left as TRttiExpIntegerNodeItem; + CheckEquals(VAL_1,xin.ComparedValue); + Check( ( xin.Operation = nfoGreater ), 'Operation'); + + CheckNotNull(x.Root.Right,'Root.Right'); + Check( ( x.Root.Connector = fcOr ), 'Root.Connector'); + CheckIs(x.Root.Right,TRttiExpNode,'Root.Right'); + xn := x.Root.Right as TRttiExpNode; + CheckNotNull(xn.Left,'xn.Left'); + CheckNull(xn.Right,'xn.Right'); + Check( ( xn.Connector = fcAnd ), 'xn.Connector'); + CheckIs(xn.Left,TRttiExpIntegerNodeItem,'xn.Left'); + xin := xn.Left as TRttiExpIntegerNodeItem; + CheckEquals(VAL_2,xin.ComparedValue); + Check( ( xin.Operation = nfoLesser ), 'Operation'); + + x.AddCondition('IntProp',nfoEqual,VAL_3,fcAnd); + CheckNotNull(x.Root.Left,'Root.Left'); + CheckIs(x.Root.Left,TRttiExpIntegerNodeItem,'Root.Left'); + xin := x.Root.Left as TRttiExpIntegerNodeItem; + CheckEquals(VAL_1,xin.ComparedValue); + Check( ( xin.Operation = nfoGreater ), 'Operation'); + + CheckNotNull(x.Root.Right,'Root.Right'); + Check( ( x.Root.Connector = fcOr ), 'Root.Connector'); + CheckIs(x.Root.Right,TRttiExpNode,'Root.Right'); + xn := x.Root.Right as TRttiExpNode; + CheckNotNull(xn.Left,'xn.Left'); + CheckNotNull(xn.Right,'xn.Right'); + Check( ( xn.Connector = fcAnd ), 'xn.Connector'); + CheckIs(xn.Left,TRttiExpIntegerNodeItem,'xn.Left'); + xin := xn.Left as TRttiExpIntegerNodeItem; + CheckEquals(VAL_2,xin.ComparedValue); + Check( ( xin.Operation = nfoLesser ), 'Operation'); + + CheckIs(xn.Right,TRttiExpIntegerNodeItem,'xn.Right'); + xin := xn.Right as TRttiExpIntegerNodeItem; + CheckEquals(VAL_3,xin.ComparedValue); + Check( ( xin.Operation = nfoEqual ), 'Operation'); + + x.EndGroup(); + x.AddCondition('IntProp',nfoEqual,VAL_4,fcOr); + PrintTree(x.Root,@Display,2); + + Display(#10#13); + Display(#10#13); + x.Clear(clrFreeObjects); + x.BeginGroup(fcAnd); + x.AddCondition('IntProp',nfoLesser,VAL_1,fcAnd); + x.BeginGroup(fcOr); + x.AddCondition('IntProp',nfoEqual,VAL_2,fcAnd); + x.AddCondition('IntProp',nfoEqual,VAL_3,fcAnd); + x.EndGroup(); + x.AddCondition('IntProp',nfoEqual,VAL_2,fcOr); + x.EndGroup(); + x.AddCondition('IntProp',nfoGreater,VAL_4,fcAnd); + PrintTree(x.Root,@Display,2); + finally + x.Free(); + end; +end; + + +{ TRttiExpAnsiStringNodeItem_Test } + +procedure TRttiExpAnsiStringNodeItem_Test.Create_Test(); +var + x : TRttiExpAnsiStringNodeItem; +begin + x := nil; + try + try + x := TRttiExpAnsiStringNodeItem.Create(GetPropInfo(TClass_A,'IntProp'),sfoEqualCaseInsensitive,'Azerty'); + Check(False); + except + on e : EAssertionFailedError do + raise; + on e : ERttiFilterException do begin + // nothing! + end; + end; + finally + x.Free(); + end; +end; + +procedure TRttiExpAnsiStringNodeItem_Test.Evaluate_EqualCaseSensitive(); +const VAL_1 = 'AzertY'; +var + x : TRttiExpAnsiStringNodeItem; + t : TClass_A; +begin + x := nil; + t := TClass_A.Create(); + try + x := TRttiExpAnsiStringNodeItem.Create(GetPropInfo(t,'StrProp'),sfoEqualCaseSensitive,VAL_1); + + t.StrProp := 'aaadddd'; + Check( x.Evaluate(t) = False ,'False'); + + t.StrProp := UpperCase(VAL_1); + Check( x.Evaluate(t) = False ,'False'); + + t.StrProp := LowerCase(VAL_1); + Check( x.Evaluate(t) = False ,'False'); + + t.StrProp := VAL_1; + Check( x.Evaluate(t) = True, 'True' ); + finally + x.Free(); + t.Free(); + end; +end; + +procedure TRttiExpAnsiStringNodeItem_Test.Evaluate_EqualCaseInsensitive(); +const VAL_1 = 'AzertY'; +var + x : TRttiExpAnsiStringNodeItem; + t : TClass_A; +begin + x := nil; + t := TClass_A.Create(); + try + x := TRttiExpAnsiStringNodeItem.Create(GetPropInfo(t,'StrProp'),sfoEqualCaseInsensitive,VAL_1); + + t.StrProp := 'aaadddd'; + Check( x.Evaluate(t) = False ,'False'); + + t.StrProp := UpperCase(VAL_1); + Check( x.Evaluate(t) = True ,'True'); + + t.StrProp := LowerCase(VAL_1); + Check( x.Evaluate(t) = True ,'True'); + + t.StrProp := VAL_1; + Check( x.Evaluate(t) = True, 'True' ); + finally + x.Free(); + t.Free(); + end; +end; + +{ TRttiExpwWideStringNodeItem_Test } + +procedure TRttiExpwWideStringNodeItem_Test.Create_Test(); +var + x : TRttiExpWideStringNodeItem; +begin + x := nil; + try + try + x := TRttiExpWideStringNodeItem.Create(GetPropInfo(TClass_A,'IntProp'),sfoEqualCaseInsensitive,'Azerty'); + Check(False); + except + on e : EAssertionFailedError do + raise; + on e : ERttiFilterException do begin + // nothing! + end; + end; + finally + x.Free(); + end; +end; + +procedure TRttiExpwWideStringNodeItem_Test.Evaluate_EqualCaseSensitive(); +const VAL_1 = 'AzertY'; +var + x : TRttiExpWideStringNodeItem; + t : TClass_A; +begin + x := nil; + t := TClass_A.Create(); + try + x := TRttiExpWideStringNodeItem.Create(GetPropInfo(t,'WideStrProp'),sfoEqualCaseSensitive,VAL_1); + + t.WideStrProp := 'aaadddd'; + Check( x.Evaluate(t) = False ,'False'); + + t.WideStrProp := UpperCase(VAL_1); + Check( x.Evaluate(t) = False ,'False'); + + t.WideStrProp := LowerCase(VAL_1); + Check( x.Evaluate(t) = False ,'False'); + + t.WideStrProp := VAL_1; + Check( x.Evaluate(t) = True, 'True' ); + finally + x.Free(); + t.Free(); + end; +end; + +procedure TRttiExpwWideStringNodeItem_Test.Evaluate_EqualCaseInsensitive(); +const VAL_1 = 'AzertY'; +var + x : TRttiExpWideStringNodeItem; + t : TClass_A; +begin + x := nil; + t := TClass_A.Create(); + try + x := TRttiExpWideStringNodeItem.Create(GetPropInfo(t,'WideStrProp'),sfoEqualCaseInsensitive,VAL_1); + + t.WideStrProp := 'aaadddd'; + Check( x.Evaluate(t) = False ,'False'); + + t.WideStrProp := UpperCase(VAL_1); + Check( x.Evaluate(t) = True ,'True'); + + t.WideStrProp := LowerCase(VAL_1); + Check( x.Evaluate(t) = True ,'True'); + + t.WideStrProp := VAL_1; + Check( x.Evaluate(t) = True, 'True' ); + finally + x.Free(); + t.Free(); + end; +end; + + +{ TRttiParser_Test } + +procedure TRttiParser_Test.SimpleOperators(); +const VAL_1 = 'inoussa'; +var + x : TRttiFilterCreator; + sN : TRttiExpAnsiStringNodeItem; +begin + x := TRttiFilterCreator.Create(TClass_A); + try + ParseFilter(Format('StrProp = %s',[QuotedStr(VAL_1)]),x); + CheckNotNull(x.Root,'Root <> nil'); + CheckIs(x.Root.Left,TRttiExpAnsiStringNodeItem); + sN := x.Root.Left as TRttiExpAnsiStringNodeItem; + CheckEquals('StrProp',sN.PropInfo^.Name); + CheckEquals(VAL_1,sN.ComparedValue); + finally + x.Free(); + end; +end; + +procedure TRttiParser_Test.BeginEnd_Group(); +const VAL_1 : Integer = 1210; VAL_2 : Integer = 1076; VAL_3 : Integer = 176; + VAL_4 : Integer = -176; + VAL_S = 'inoussa'; +var + x, y : TRttiFilterCreator; + xin : TRttiExpIntegerNodeItem; + xn : TRttiExpNode; + sfltr : string; +begin + y := nil; + x := TRttiFilterCreator.Create(TClass_A); + try + sfltr := Format('IntProp > %d or ( IntProp < %d and StrProp = %s ) or IntProp = %d',[VAL_1,VAL_2,QuotedStr(VAL_S),VAL_4]); + ParseFilter(sfltr,x); + PrintTree(x.Root,@Display,2); + y := TRttiFilterCreator.Create(TClass_A); + y.AddCondition('IntProp',nfoGreater,VAL_1,fcOr); + y.BeginGroup(fcOr); + y.AddCondition('IntProp',nfoLesser,VAL_2,fcAnd); + y.AddCondition('StrProp',sfoEqualCaseInsensitive,VAL_S,fcAnd); + y.EndGroup(); + y.AddCondition('IntProp',nfoEqual,VAL_4,fcOr); + + CompareTree(x.Root,y.Root); + finally + x.Free(); + end; +end; + + +Initialization + RegisterTests( + [ TRttiExpIntegerNodeItem_Test, + TRttiExpAnsiStringNodeItem_Test, + TRttiExpwWideStringNodeItem_Test, + TRttiExpNode_Test,TRttiFilterCreator_Test, + + TRttiParser_Test + ] + ); + +end.