Overview

Digipolitan class generator can easily create required files to deploy quickly a project on iOS or Android. It deals with webservices interfacing by auto-generating the setup and executing scripts using the framework and allows developers to focus on technical and functional aspects of the application. The class generator needs a XML file using a specific syntax exposed during this tutorial with a concrete example.


Context


To illustrate usable XML tags, we take as example the building of a RPG game called "Heroes" to create an interface between webservices and mobile apps.


Example


Download the XML example file


Tool


Open the service class generator


Documentation




Tag <project>


                    
<?xml version="1.0" encoding="UTF-8" ?>
<project name="SampleHeroes" package="com.digipolitan.sample.heroes" prefix="HR" version="1.0" author="Toto" copyright="Toto Corp." lang="fr">
   <description>…</description>
   <classes …>…</classes>
   <enums …>…</enums>
   <webservices …>…</webservices>
</project>

                    
                

Description : Root tag which describes project's global data.


Attributes
Name Type Multiplicity Description
name String 1
  • Project's name
package String 1
  • Project's global package
  • Will be used by its children while generating
  • Used for file tree generation (folders)
prefix String 0..1
  • Prefix to apply to each file generated (ex : HRCharacterWebservice.java)
version Float 1
  • Project's version
  • Will be written on header's comments of each file generated
author String 0..1
  • Project's author
  • Will be written on header's comments of each file generated
copyright String 0..1
  • Project's copyright
  • Will be written on header's comments of each file generated
lang String 0..1
  • Project's language
  • Mainly used for documentation generation
  • Availables : fr, en


Child nodes
Tag Multiplicity Description
<description> 0..1
  • A little word to describe the project
<classes> 1
  • Global tag which contains classes to generate
<enum> 0..1
  • Global tag which contains enums to generate
<webservices> 0..1
  • Global tag which contains webservices to generate



Tag <classes>


                    
<?xml version="1.0" encoding="UTF-8" ?>
<project name="SampleHeroes" package="com.digipolitan.sample.heroes" prefix="HR" version="1.0" author="Toto" copyright="Toto Corp." lang="fr">
   <classes subpackage="domains.classes">
      …
   </classes>
</project>
                    
                

Description : Tag containing all classes and models to generate and used on webservices and apps.


Attributes
Name Type Multiplicity Description
subpackage String 1
  • Define classes global package
  • Used for file tree generation (folders)
  • Appended to project's global package (com.digipolitan.sample.heroes.domains.classes)


Child nodes
Tag Multiplicity Description
<class> 1..*
  • Tag containing class data



Tag <class>


                    
<?xml version="1.0" encoding="UTF-8" ?>
<project name="SampleHeroes" package="com.digipolitan.sample.heroes" prefix="HR" version="1.0" author="Toto" copyright="Toto Corp." lang="fr">
   <classes subpackage="domains.classes">
      <class name="Identifiable" subpackage="common">
         <properties>…</properties>
      </class>
      <class name="Character" subpackage="characters" extends="Identifiable">
         <description>…</description>
         <properties>…</properties>
      </class>
   </classes>
</project>
                    
                

Description : Tag describing a class which contains all usable data by webservices and apps.


Attributes
Name Type Multiplicity Description
name String 1
  • Class name (Object syntax)
  • Gathers many data types which naming aren't the same (optional but recommended) :
    • Models (standard naming [ex : Character])
    • Container classes which contains webservice's input parameters, global case (suffix Data to append [ex : CharacterData])
    • Container classes which contains webservice's input parameters, filter case (suffix Criteria to append [ex : CharacterCriteria])
    • Container classes which contains webservice's output parameters (suffix Result to append [ex : CharacterResult])
subpackage String 0..1
  • Defines class global package
  • Used for file tree generation (folders)
  • Appended to project and classes global package (com.digipolitan.sample.heroes.domains.classes.common)
extends String 0..1
  • Inheritance of current class to another
  • Just class name if it exists on XML file
  • Absolute package class path if external class


Child nodes
Tag Multiplicity Description
<description> 0..1
  • A little word about the class, will be written on header comments of the generated file
<properties> 1
  • Tag containing all properties, attributes of the class



Tag <properties>


                    
<?xml version="1.0" encoding="UTF-8" ?>
<project name="SampleHeroes" package="com.digipolitan.sample.heroes" prefix="HR" version="1.0" author="Toto" copyright="Toto Corp." lang="fr">
   <classes subpackage="domains.classes">
      <class name="Identifiable" subpackage="common">
         <properties>
            …
         </properties>
      </class>
      <class name="Character" subpackage="characters" extends="Identifiable">
         <properties>
            …
         </properties>
      </class>
   </classes>
</project>
                    
                

Description : Tag containing all properties, attributes of the current class.


Attributes
Name Type Multiplicity Description
None


Child nodes
Tag Multiplicity Description
<property> 1..*
  • Tag containing the property, attribute data



Tag <property>


                    
<?xml version="1.0" encoding="UTF-8" ?>
<project name="SampleHeroes" package="com.digipolitan.sample.heroes" prefix="HR" version="1.0" author="Toto" copyright="Toto Corp." lang="fr">
   <classes subpackage="domains.classes">
      <class name="Identifiable" subpackage="common">
         <properties>
            <property name="id" type="int" primary="true" />
         </properties>
      </class>
      <class name="Character" subpackage="characters" extends="Identifiable">
         <properties>
            <property name="login" type="string" />
            <property name="password" type="string" />
            <property name="created_on" type="date" />
            <property name="name" type="string" />
            <property name="gender" type="Gender" />
            <property name="picture" type="URL" />
            <property name="attributes" type="map" parameterType="string;double" />
            <property name="stuffs" type="list" parameterType="Stuff" />
         </properties>
      </class>
   </classes>
</project>
                    
                

Description : Tag describing a class property.


Attributes
Name Type Multiplicity Description
name String 1
  • Property's name. It's highly recommended to use a non-object syntax. Par example, it's better to write created_on than createdOn
type String 1
  • Property's type. Many cases :
    • It's a primitive or a classic complex : lowercase only (ex : double,int, string, date, url)
    • Existing class or enum into XML file (ex : Gender)
    • List or map property : keyword « map » and « list », parameterType attribute becomes required
parameterType String 0..1
  • Property's type. Many cases :
    • It's a primitive or a classic complex : lowercase only (ex : double,int, string, date, url)
    • Existing class or enum into XML file (ex : Gender)
  • Definition of keys/values types of a map :
    • Separator « ; »
    • Syntax « [keyType] ;[valueType] » (ex : string;double)
primary Boolean 0..1
  • Used for comparing objects on this property only.
  • Otherwise, the function equals will be executed on all class properties.


Child nodes
Tag Multiplicity Description
<description> 0..1
  • A little word about the property, will be written close to the property into the generated class



Tag <enums>


                    
<?xml version="1.0" encoding="UTF-8" ?>
<project name="SampleHeroes" package="com.digipolitan.sample.heroes" prefix="HR" version="1.0" author="Toto" copyright="Toto Corp." lang="fr">
   <enums subpackage="domains.classes">
      …
   </enums>
</project>
                    
                

Description : Tag containing all enums to generate and used on webservices and apps.


Attributes
Name Type Multiplicity Description
subpackage String 1
  • Defines enum's global package
  • Used for file tree generation (folders)
  • Appended to project's global package (com.digipolitan.sample.heroes.domains.classes)


Child nodes
Tag Multiplicity Description
<enum> 1..*
  • Tag containing enum data



Tag <enum>


                    
<?xml version="1.0" encoding="UTF-8" ?>
<project name="SampleHeroes" package="com.digipolitan.sample.heroes" prefix="HR" version="1.0" author="Toto" copyright="Toto Corp." lang="fr">
   <enums subpackage="domains.classes">
      <enum name="ResultCode" subpackage="common">
         <description>Server's result code</description>
         <values>...</values>
      </enum>
   </enums>
</project>

                    
                

Description : Tag describing an enum


Attributes
Name Type Multiplicity Description
name String 1
  • Enum's name (Object syntax)
subpackage String 0..1
  • Defines enum's package
  • Used for file tree generation (folders)
  • Appended to project and enums global package (com.digipolitan.sample.heroes.domains.classes.common)


Child nodes
Tag Multiplicity Description
<description> 0..1
  • A little word about the enum, will be written on header comments of the generated file
<values> 1
  • Enum values



Tag <values>


                    
<?xml version="1.0" encoding="UTF-8" ?>
<project name="SampleHeroes" package="com.digipolitan.sample.heroes" prefix="HR" version="1.0" author="Toto" copyright="Toto Corp." lang="fr">
   <enums subpackage="domains.classes">
      <enum name="ResultCode" subpackage="common">
         <description>Server's result code</description>
         <values default="OK">
           <value .../>
           <value .../>
         </values>
      </enum>
   </enums>
</project>

                    
                

Description : Tag describing a set of enum values


Attributes
Name Type Multiplicity Description
default String 0..1
  • An enum default value, selected into value available


Child nodes
Tag Multiplicity Description
<value> 1..*
  • An enum value



Tag <value>


                    
<?xml version="1.0" encoding="UTF-8" ?>
<project name="SampleHeroes" package="com.digipolitan.sample.heroes" prefix="HR" version="1.0" author="Toto" copyright="Toto Corp." lang="fr">
   <enums subpackage="domains.classes">
      <enum name="ResultCode" subpackage="common">
         <description>Server's result code</description>
         <values default="OK">
           <value name="OK">
             <description>
               It's alright !
             </description>
           </value>
           <value name="FAILED" value="9">
             <description>
               Houston, we have a problem !
             </description>
           </value>
         </values>
      </enum>
   </enums>
</project>

                    
                

Description : Tag describing an enum value


Attributes
Name Type Multiplicity Description
name String 1
  • Enum's key
value Integer 0..1
  • By default, enum values iterator start from 0 and increment by 1.
  • You can force an enum value to have a defined index by set this attribute.
  • The enum values iterator will be moved on this value for next enum values defined.


Child nodes
Tag Multiplicity Description
<description> 0..1
  • A little word about the enum value, will be written on header this value on the generated file



Tag <webservices>


                    
<?xml version="1.0" encoding="UTF-8" ?>
<project name="SampleHeroes" package="com.digipolitan.sample.heroes" prefix="HR" version="1.0" author="Toto" copyright="Toto Corp." lang="fr">
   <webservices interfaceSubpackage="domains.interfaces" implementationSubpackage="platforms.webservices" mockSubpackage="platforms.mocks">
      <webservice …>…</webservice>
      <proxies …>…</proxies>
      <reverseProxies …>…</reverseProxies>
   </webservices>
</project>
                    
                

Description : Tag containing all webservices to generate and its proxies and reverse proxies.


Attributes
Name Type Multiplicity Description
interfaceSubpackage String 1
  • Defines webservice interfaces package
  • Used for file tree generation (folders)
  • Appended to project's global package (com.digipolitan.sample.heroes.domains.interfaces)
implementationSubpackage String 1
  • Defines webservice implementations package
  • Used for file tree generation (folders)
  • Appended to project's global package (com.digipolitan.sample.heroes.platforms.webservices)
mockSubpackage String 1
  • Defines webservice mocks package
  • Used for file tree generation (folders)
  • Appended to project's global package (com.digipolitan.sample.heroes.platforms.mocks)


Child nodes
Tag Multiplicity Description
<webservice> 1..*
  • Tag describing webservice data
<proxies> 0..1
  • Tag containing all proxies
<reverseProxies> 0..1
  • Tag containing all reverse proxies



Tag <webservice>


            
<?xml version="1.0" encoding="UTF-8" ?>
<project name="SampleHeroes" package="com.digipolitan.sample.heroes" prefix="HR" version="1.0" author="Toto" copyright="Toto Corp." lang="fr">
   <webservices interfaceSubpackage="domains.interfaces" implementationSubpackage="platforms.webservices" mockSubpackage="platforms.mocks">
      <webservice name="Character" interfaceSubpackage="characters" implementationSubpackage="classes.characters" mockSubpackage="classes.characters" base="HHttpWebService">
         …
      </webservice>
   </webservices>
</project>
            
          

Description : Tag containing webservice data and methods callable.


Attributes
Name Type Multiplicity Description
name String 1
  • Webservice's name (Object syntax)
interfaceSubpackage String 1
  • Defines webservice interface package
  • Used for file tree generation (folders)
  • Appended to project and webservices global package (com.digipolitan.sample.heroes.domains.interfaces.characters)
implementationSubpackage String 1
  • Defines webservice implementation package
  • Used for file tree generation (folders)
  • Appended to project and webservices global package (com.digipolitan.sample.heroes.platforms.webservices.classes.characters)
mockSubpackage String 1
  • Defines webservice mock package
  • Used for file tree generation (folders)
  • Appended to project and webservices global package (com.digipolitan.sample.heroes.platforms.mocks.classes.characters)
base String 0..1
  • Inheritance of webservice implementation


Child nodes
Tag Multiplicity Description
<description> 0..1
  • A little word about the webservice, will be written on header comments of generated file
<method> 1..*
  • Tag describing webservice's method parameters



Tag <method>


            
<?xml version="1.0" encoding="UTF-8" ?>
<project name="SampleHeroes" package="com.digipolitan.sample.heroes" prefix="HR" version="1.0" author="Toto" copyright="Toto Corp." lang="fr">
   <webservices interfaceSubpackage="domains.interfaces" implementationSubpackage="platforms.webservices" mockSubpackage="platforms.mocks">
      <webservice name="Character" interfaceSubpackage="characters" implementationSubpackage="classes.characters" mockSubpackage="classes.characters" base="HHttpWebService">
         <method name="create" timeout="30" type="post">
            …
         </method>
      </webservice>
   </webservices>
</project>
            
          

Description : Tag containing all data about the callable webservice's method.


Attributes
Name Type Multiplicity Description
name String 1
  • Webservice's method name
timeout int 0..1
  • By default, 8 seconds
type String 1
  • HTTP protocol used
  • Values available : (lowercase)
    • get
    • post
    • post-json : Body request is on JSON


Child nodes
Tag Multiplicity Description
<description> 0..1
  • A little word about webservice's method, will be written on method's header comments
<cache> 0..1
  • Webservice method cache info
<urls> 1
  • Webservice method URLs
<input> 0..1
  • Tag describing webservice's method input parameters
<output> 0..1
  • Tag describing webservice's method output parameters



Tag <cache>


            
<?xml version="1.0" encoding="UTF-8" ?>
<project name="SampleHeroes" package="com.digipolitan.sample.heroes" prefix="HR" version="1.0" author="Toto" copyright="Toto Corp." lang="fr">
   <webservices interfaceSubpackage="domains.interfaces" implementationSubpackage="platforms.webservices" mockSubpackage="platforms.mocks">
      <webservice name="Character" interfaceSubpackage="characters" implementationSubpackage="classes.characters" mockSubpackage="classes.characters" base="HHttpWebService">
         <method name="create" timeout="30" type="post">
            <cache type="light" mode="always" duration="1" unit="day" secure="false" />
         </method>
      </webservice>
   </webservices>
</project>
            
          

Description : Tag containing all data about the webservice's method cache info.


Attributes
Name Type Multiplicity Description
type String 0..1
  • Webservice's method cache info type
  • Values available : (lowercase)
    • light
    • heavy
mode String 0..1
  • Webservice's method cache info mode
  • Values available : (lowercase)
    • always
    • no_connection
duration int 1
  • Duration to retain data retrieved on cache
unit String 1
  • Duration's unit
  • Values available : (lowercase)
    • second
    • minute
    • hour
    • day
    • week
secure Boolean 0..1
  • Webservice's method cache info secure mode


Child nodes
Tag Multiplicity Description
None



Tag <urls>


                    
<?xml version="1.0" encoding="UTF-8" ?>
<project name="SampleHeroes" package="com.digipolitan.sample.heroes" prefix="HR" version="1.0" author="Toto" copyright="Toto Corp." lang="fr">
   <webservices interfaceSubpackage="domains.interfaces" implementationSubpackage="platforms.webservices" mockSubpackage="platforms.mocks">
      <webservice name="Character" interfaceSubpackage="characters" implementationSubpackage="classes.characters" mockSubpackage="classes.characters" base="HHttpWebService">
         <method name="create" timeout="30" type="post">
            <urls>
              ...
            </urls>
         </method>
      </webservice>
   </webservices>
</project>
                    
                

Description : Tag containing all data about the webservice's method urls.


Attributes
Name Type Multiplicity Description
None


Child nodes
Tag Multiplicity Description
<url> 1..3
  • Tag containing a URL webservice method



Tag <url>


                    
<?xml version="1.0" encoding="UTF-8" ?>
<project name="SampleHeroes" package="com.digipolitan.sample.heroes" prefix="HR" version="1.0" author="Toto" copyright="Toto Corp." lang="fr">
   <webservices interfaceSubpackage="domains.interfaces" implementationSubpackage="platforms.webservices" mockSubpackage="platforms.mocks">
      <webservice name="Character" interfaceSubpackage="characters" implementationSubpackage="classes.characters" mockSubpackage="classes.characters" base="HHttpWebService">
         <method name="create" timeout="30" type="post">
            <urls>
              <url type="prod">http://digipolitan.com/sample/heroes/api/v1/character/create</url>
              <url type="test">http://dev.digipolitan.com/sample/heroes/api/v1/character/create</url>
              <url type="debug">http://debug.digipolitan.com/sample/heroes/api/v1/character/create</url>
            </urls>
         </method>
      </webservice>
   </webservices>
</project>
                    
                

Description : Tag containing all data about a webservice's method url.


Attributes
Name Type Multiplicity Description
type String 1
  • Webservice's method URL environment
  • Values available : (lowercase)
    • prod : must be defined
    • test : optional
    • debug : optional


Child nodes
Tag Multiplicity Description
None



Tag <input>


            
<?xml version="1.0" encoding="UTF-8" ?>
<project name="SampleHeroes" package="com.digipolitan.sample.heroes" prefix="HR" version="1.0" author="Toto" copyright="Toto Corp." lang="fr">
   <webservices interfaceSubpackage="domains.interfaces" implementationSubpackage="platforms.webservices" mockSubpackage="platforms.mocks">
      <webservice name="Character" interfaceSubpackage="characters" implementationSubpackage="classes.characters" mockSubpackage="classes.characters" base="HHttpWebService">
         <method name="create" timeout="30" type="post">
            <input type="CharacterCreateData" reverseProxy="CharacterReverseProxy">
              <description>A description</description>
              <annotations>
                ...
              </annotations>
            </input>
         </method>
      </webservice>
   </webservices>
</project>
            
          

Description : Tag containing all input parameters of a callable webservice's method.


Attributes
Name Type Multiplicity Description
type String 1
  • Container class name containing all input parameters (classes into tag <classes> with suffix Data or Criteria)
reverseProxy String 0..1
  • ReverseProxy associated to above class described
  • A reverse proxy must be defined if data to send contains types :
    • date
    • url
    • blob
    • Key mapping
    • Class or enum defined into XML file


Child nodes
Tag Multiplicity Description
<description> 0..1
  • A little word about webservice's method input parameters
<annotations> 0..1
  • Webservice method input annotations (used on document generator)



Tag <output>


            
<?xml version="1.0" encoding="UTF-8" ?>
<project name="SampleHeroes" package="com.digipolitan.sample.heroes" prefix="HR" version="1.0" author="Toto" copyright="Toto Corp." lang="fr">
   <webservices interfaceSubpackage="domains.interfaces" implementationSubpackage="platforms.webservices" mockSubpackage="platforms.mocks">
      <webservice name="Character" interfaceSubpackage="characters" implementationSubpackage="classes.characters" mockSubpackage="classes.characters" base="HHttpWebService">
         <method name="create" timeout="30" type="post">
            <output format="json" type="CharacterResult" proxy="CharacterResultProxy">
              <description>A description</description>
              <annotations>
                ...
              </annotations>
            </output>
         </method>
      </webservice>
   </webservices>
</project>
            
          

Description : Tag containing all webservice's method output parameters.


Attributes
Name Type Multiplicity Description
type String 1
  • Container class name which contains output parameters (described into tag <classes> with suffix Result)
proxy String 0..1
  • Proxy associated to above class
  • Proxy must be defined if received data contains data types :
    • date
    • url
    • blob
    • Key mapping
    • Class or enum defined into XML file
format String 0..1
  • Output parameters format
  • Values available :
    • json
    • xml


Child nodes
Tag Multiplicity Description
<description> 0..1
  • A little word about webservice's method output parameters
<annotations> 0..1
  • Webservice method output annotations (used on document generator)



Tag <annotations>


            
<?xml version="1.0" encoding="UTF-8" ?>
<project name="SampleHeroes" package="com.digipolitan.sample.heroes" prefix="HR" version="1.0" author="Toto" copyright="Toto Corp." lang="fr">
   <webservices interfaceSubpackage="domains.interfaces" implementationSubpackage="platforms.webservices" mockSubpackage="platforms.mocks">
      <webservice name="Character" interfaceSubpackage="characters" implementationSubpackage="classes.characters" mockSubpackage="classes.characters" base="HHttpWebService">
         <method name="create" timeout="30" type="post">
            <input type="CharacterCreateData" reverseProxy="CharacterReverseProxy">
              <description>A description</description>
              <annotations>
                <keys>
                  ...
                </keys>
              </annotations>
            </input>
         </method>
      </webservice>
   </webservices>
</project>
            
          
            
<?xml version="1.0" encoding="UTF-8" ?>
<project name="SampleHeroes" package="com.digipolitan.sample.heroes" prefix="HR" version="1.0" author="Toto" copyright="Toto Corp." lang="fr">
   <webservices interfaceSubpackage="domains.interfaces" implementationSubpackage="platforms.webservices" mockSubpackage="platforms.mocks">
      <webservice name="Character" interfaceSubpackage="characters" implementationSubpackage="classes.characters" mockSubpackage="classes.characters" base="HHttpWebService">
         <method name="create" timeout="30" type="post">
            <output format="json" type="CharacterResult" proxy="CharacterResultProxy">
              <description>A description</description>
              <annotations>
                <keys>
                  ...
                </keys>
              </annotations>
            </output>
         </method>
      </webservice>
   </webservices>
</project>
            
          

Description : Tag containing webservice input/output method annotations.


Attributes
Name Type Multiplicity Description
None


Child nodes
Tag Multiplicity Description
<keys> 0..1
  • Webservice method input/output annotation keys (used on document generator)



Tag <keys>


            
<?xml version="1.0" encoding="UTF-8" ?>
<project name="SampleHeroes" package="com.digipolitan.sample.heroes" prefix="HR" version="1.0" author="Toto" copyright="Toto Corp." lang="fr">
   <webservices interfaceSubpackage="domains.interfaces" implementationSubpackage="platforms.webservices" mockSubpackage="platforms.mocks">
      <webservice name="Character" interfaceSubpackage="characters" implementationSubpackage="classes.characters" mockSubpackage="classes.characters" base="HHttpWebService">
         <method name="create" timeout="30" type="post">
            <input type="CharacterCreateData" reverseProxy="CharacterReverseProxy">
              <description>A description</description>
              <annotations>
                <keys>
                  <key .../>
                  <key .../>
                  <key .../>
                </keys>
              </annotations>
            </input>
         </method>
      </webservice>
   </webservices>
</project>
            
          
            
<?xml version="1.0" encoding="UTF-8" ?>
<project name="SampleHeroes" package="com.digipolitan.sample.heroes" prefix="HR" version="1.0" author="Toto" copyright="Toto Corp." lang="fr">
   <webservices interfaceSubpackage="domains.interfaces" implementationSubpackage="platforms.webservices" mockSubpackage="platforms.mocks">
      <webservice name="Character" interfaceSubpackage="characters" implementationSubpackage="classes.characters" mockSubpackage="classes.characters" base="HHttpWebService">
         <method name="create" timeout="30" type="post">
            <output format="json" type="CharacterResult" proxy="CharacterResultProxy">
              <description>A description</description>
              <annotations>
                <keys>
                  <key .../>
                </keys>
              </annotations>
            </output>
         </method>
      </webservice>
   </webservices>
</project>
            
          

Description : Tag containing webservice input/output method annotation keys.
Used on document generator, its list by default all the properties/attributes of the input/output expected (based on I/O type or proxy/reverse proxy).
By explicitly write a property/attribute of expected I/O into this tag, you define :

  • - For input, you can set if the property/attribute is required or not (required by default). Just by defining it, it set it to false.
  • - For output, you can set if the property/attribute is on webservice response or not. Just by defining it, it set it to not present.


Attributes
Name Type Multiplicity Description
None


Child nodes
Tag Multiplicity Description
<key> 1..*
  • Webservice I/O method annotation key



Tag <key>


            
<?xml version="1.0" encoding="UTF-8" ?>
<project name="SampleHeroes" package="com.digipolitan.sample.heroes" prefix="HR" version="1.0" author="Toto" copyright="Toto Corp." lang="fr">
   <webservices interfaceSubpackage="domains.interfaces" implementationSubpackage="platforms.webservices" mockSubpackage="platforms.mocks">
      <webservice name="Character" interfaceSubpackage="characters" implementationSubpackage="classes.characters" mockSubpackage="classes.characters" base="HHttpWebService">
         <method name="create" timeout="30" type="post">
            <input type="CharacterCreateData" reverseProxy="CharacterReverseProxy">
              <description>A description</description>
              <annotations>
                <keys>
                  <key name="created_on" />					// created_on isn't required
                  <key name="password" required="false" />	// password isn't required
                </keys>
              </annotations>
            </input>
         </method>
      </webservice>
   </webservices>
</project>
            
          
            
<?xml version="1.0" encoding="UTF-8" ?>
<project name="SampleHeroes" package="com.digipolitan.sample.heroes" prefix="HR" version="1.0" author="Toto" copyright="Toto Corp." lang="fr">
   <webservices interfaceSubpackage="domains.interfaces" implementationSubpackage="platforms.webservices" mockSubpackage="platforms.mocks">
      <webservice name="Character" interfaceSubpackage="characters" implementationSubpackage="classes.characters" mockSubpackage="classes.characters" base="HHttpWebService">
         <method name="create" timeout="30" type="post">
            <output format="json" type="CharacterResult" proxy="CharacterResultProxy">
              <description>A description</description>
              <annotations>
                <keys>
                  <key name="created_on" />					// created_on will be ignored
                  <key name="stuffs">
                    <keys>
                       <key name="material" /> 				// stuffs.material will be ignored
                    </keys>
                  </key>
                </keys>
              </annotations>
            </output>
         </method>
      </webservice>
   </webservices>
</project>
            
          

Description : Tag containing webservice input/output method annotation key.
Used on document generator, its list by default all the properties/attributes of the input/output expected (based on I/O type or proxy/reverse proxy).
By explicitly write a property/attribute of expected I/O into this tag, you define :

  • - For input, you can set if the property/attribute is required or not (required by default). Just by defining it, it set it to false.
    Child tag <keys> is not used for input.
  • - For output, you can set if the property/attribute is on webservice response or not. Just by defining it, it set it to not present. If output data has depth values, you can represent it with <keys> child tag.


Attributes
Name Type Multiplicity Description
name String 1
  • Parameter name/key on input/output data sent/received
required Boolean 0..1
  • Set parameter name/key as required or not


Child nodes
Tag Multiplicity Description
<keys> 0..1
  • Used for output, can define data structure if it has depth



Tag <proxies>


            
<?xml version="1.0" encoding="UTF-8" ?>
<project name="SampleHeroes" package="com.digipolitan.sample.heroes" prefix="HR" version="1.0" author="Toto" copyright="Toto Corp." lang="fr">
   <webservices interfaceSubpackage="domains.interfaces" implementationSubpackage="platforms.webservices" mockSubpackage="platforms.mocks">
      <proxies subpackage="classes.proxies">
         …
      </proxies>
   </webservices>
</project>
            
          

Description : Tag containing all proxies used by webservices.


Attributes
Name Type Multiplicity Description
subpackage String 1
  • Defines proxies global package
  • Used for file tree generation (folders)
  • Appended to project's global package (com.digipolitan.sample.heroes.platforms.webservices.classes.proxies)


Child nodes
Tag Multiplicity Description
<proxy> 1..*
  • Tag describing a proxy



Tag <proxy>


            
<?xml version="1.0" encoding="UTF-8" ?>
<project name="SampleHeroes" package="com.digipolitan.sample.heroes" prefix="HR" version="1.0" author="Toto" copyright="Toto Corp." lang="fr">
   <webservices interfaceSubpackage="domains.interfaces" implementationSubpackage="platforms.webservices" mockSubpackage="platforms.mocks">
      <proxies subpackage="classes.proxies">
         <proxy name="CommonResultProxy" model="CommonResult" subpackage="common">
            <description>…</description>
            <transformers>
               …
            </transformers>
         </proxy>
         <proxy name="CharacterResultProxy" model="CharacterResult" subpackage="characters" extends="CommonResultProxy">
            <setters>
               …
            </setters>
            <ignoreKeys …/>
         </proxy>      
      </proxies>
   </webservices>
</project>
            
          

Description : Tag describing proxy data, used for handling request's output parameters.


Attributes
Name Type Multiplicity Description
name String 1
  • Proxy's name (Object syntax, suffix Proxy recommended)
model String 0..1
  • Handling model class
subpackage String 0..1
  • Defines proxy's package
  • Used for file tree generation (folders)
  • Appended to project and proxies global package (com.digipolitan.sample.heroes.platforms.webservices.classes.proxies.characters)
extends String 0..1
  • Inheritance of the proxy to another
  • Just proxy name


Child nodes
Tag Multiplicity Description
<description> 0..1
  • A little word about the proxy, will be written on header comments of the generated file
<transformers> 0..1
  • Tag containing all transformers
  • Used when the model contains :
    • date
    • url
    • enum
    • ciphering variable (e.g. passwords)
  •  
  • Can also handle sub proxies
  • Used when the model contains :
    • Class from the XML file
  •  
  • Can also handle sub conditional proxies
  • Used when the model contains :
    • For a given class from the XML file, which proxy can handle input depending on conditions
<setters> 0..1
  • Tag containing all setters
  • Used when an output parameter needs to be handled by a specific setter
<ignoreKeys> 0..1
  • Tag containing all keys to ingore



Tag <setters>


            
<?xml version="1.0" encoding="UTF-8" ?>
<project name="SampleHeroes" package="com.digipolitan.sample.heroes" prefix="HR" version="1.0" author="Toto" copyright="Toto Corp." lang="fr">
   <webservices interfaceSubpackage="domains.interfaces" implementationSubpackage="platforms.webservices" mockSubpackage="platforms.mocks">
      <proxies subpackage="classes.proxies">
         <proxy name="CharacterResultProxy" model="CharacterResult" subpackage="characters" extends="CommonResultProxy">
            <setters>
               …
            </setters>
         </proxy>
      </proxies>
   </webservices>
</project>
            
          

Description : Tag containing all setters used by the proxy.


Attributes
Name Type Multiplicity Description
None


Child nodes
Tag Multiplicity Description
<setter> 1..*
  • Tag describing a setter



Tag <setter>


            
<?xml version="1.0" encoding="UTF-8" ?>
<project name="SampleHeroes" package="com.digipolitan.sample.heroes" prefix="HR" version="1.0" author="Toto" copyright="Toto Corp." lang="fr">
   <webservices interfaceSubpackage="domains.interfaces" implementationSubpackage="platforms.webservices" mockSubpackage="platforms.mocks">
      <proxies subpackage="classes.proxies">
         <proxy name="CharacterResultProxy" model="CharacterResult" subpackage="characters" extends="CommonResultProxy">
            <setters>
               <setter key="result" target="setCharacter" />
            </setters>
         </proxy>
      </proxies>
   </webservices>
</project>
            
          

Description : Tag which assigns a setter to a specific output parameter.


Attributes
Name Type Multiplicity Description
key String 1
  • Output key parameter to handle
target String 1
  • The setter handler


Child nodes
Tag Multiplicity Description
<description> 0..1
  • A little word about the setter



Tag <ignoreKeys>


            
<?xml version="1.0" encoding="UTF-8" ?>
<project name="SampleHeroes" package="com.digipolitan.sample.heroes" prefix="HR" version="1.0" author="Toto" copyright="Toto Corp." lang="fr">
   <webservices interfaceSubpackage="domains.interfaces" implementationSubpackage="platforms.webservices" mockSubpackage="platforms.mocks">
      <proxies subpackage="classes.proxies">
         <proxy name="CharacterResultProxy" model="CharacterResult" subpackage="characters" extends="CommonResultProxy">
            <ignoreKeys values="useless_data;not_used_data" />
         </proxy>
      </proxies>
   </webservices>
</project>
            
          

Description : Tag which ignores a list of request's output parameters.


Attributes
Name Type Multiplicity Description
values String 1
  • List of request's output parameters
  • Separator « ; »


Child nodes
Tag Multiplicity Description
<description> 0..1
  • A little word about ignored keys



Tag <reverseProxies>


            
<?xml version="1.0" encoding="UTF-8" ?>
<project name="SampleHeroes" package="com.digipolitan.sample.heroes" prefix="HR" version="1.0" author="Toto" copyright="Toto Corp." lang="fr">
   <webservices interfaceSubpackage="domains.interfaces" implementationSubpackage="platforms.webservices" mockSubpackage="platforms.mocks">
      <reverseProxies subpackage="classes.reverseproxies">
         …
      </reverseProxies>
   </webservices>
</project>
            
          

Description : Tag containing all reverse proxies used by webservice's methods.


Attributes
Name Type Multiplicity Description
subpackage String 1
  • Defines reverse proxies global package
  • Used for file tree generation (folders)
  • Appended to project's global package (com.digipolitan.sample.heroes.platforms.webservices.classes.reverseproxies)


Child nodes
Tag Multiplicity Description
<reverseProxy> 1..*
  • Tag describing a reverse proxy



Tag <reverseProxy>


            
<?xml version="1.0" encoding="UTF-8" ?>
<project name="SampleHeroes" package="com.digipolitan.sample.heroes" prefix="HR" version="1.0" author="Toto" copyright="Toto Corp." lang="fr">
   <webservices interfaceSubpackage="domains.interfaces" implementationSubpackage="platforms.webservices" mockSubpackage="platforms.mocks">
      <reverseProxies subpackage="classes.reverseproxies">
         <reverseProxy name="CharacterReverseProxy" subpackage="characters"> 
            <description>…</description>
            <transformers>
               …
            </transformers>
            <keys>
               …
            </keys>
         </reverseProxy>
         <reverseProxy name="CharacterEditReverseProxy" subpackage="characters" extends="CharacterReverseProxy">
            <ignoreFields …/>
         </reverseProxy>
      </reverseProxies>
   </webservices>
</project>
            
          

Description : Tag describing proxy data, used to handle request's input parameters.


Attributes
Name Type Multiplicity Description
name String 1
  • Reverse proxy name (object syntax, suffix ReverseProxy recommended)
subpackage String 0..1
  • Defines reverse proxy package
  • Used for file tree generation (folders)
  • Appended to project and reverse proxies's global package (com.digipolitan.sample.heroes.platforms.webservices.classes.reverseproxies.characters)
extends String 0..1
  • Inheritance of the reverse proxy to another
  • Just reverse proxy name


Child nodes
Tag Multiplicity Description
<description> 0..1
  • A little word about the reverse proxy, will be written on header comments of generated file
<transformers> 0..1
  • Tag containing all transformers
  • Used when the model contains :
    • date
    • url
    • enum

  • Can also handle sub reverse proxies
  • Used when the model contains :
    • Class from the XML file
<keys> 0..1
  • Tag containing all setters
  • Used when an input parameter needs to be mapped with a specific object's property
<ignoreFields> 0..1
  • Tag containing all input parameters to ignore



Tag <keys>


            
<?xml version="1.0" encoding="UTF-8" ?>
<project name="SampleHeroes" package="com.digipolitan.sample.heroes" prefix="HR" version="1.0" author="Toto" copyright="Toto Corp." lang="fr">
   <webservices interfaceSubpackage="domains.interfaces" implementationSubpackage="platforms.webservices" mockSubpackage="platforms.mocks">
      <reverseProxies subpackage="classes.reverseproxies">
         <reverseProxy name="CharacterReverseProxy" subpackage="characters"> 
            <keys>
               …
            </keys>
         </reverseProxy>
      </reverseProxies> 
   </webservices>
</project>
            
          

Description : Tag containing all keys used by the reverse proxy. Used when an object's property needs to be mapped with a request input parameter.


Attributes
Name Type Multiplicity Description
None


Child nodes
Tag Multiplicity Description
<key> 1..*
  • Tag describing a key



Tag <key>


            
<?xml version="1.0" encoding="UTF-8" ?>
<project name="SampleHeroes" package="com.digipolitan.sample.heroes" prefix="HR" version="1.0" author="Toto" copyright="Toto Corp." lang="fr">
   <webservices interfaceSubpackage="domains.interfaces" implementationSubpackage="platforms.webservices" mockSubpackage="platforms.mocks">
      <reverseProxies subpackage="classes.reverseproxies">
         <reverseProxy name="CharacterReverseProxy" subpackage="characters"> 
            <keys>
               <key name="login" target="nickname">
                  <description>Here we map the property 'login' from Character model with the parameter 'nickname' from the request</description>
               </key>
            </keys>
         </reverseProxy>
      </reverseProxies> 
   </webservices>
</project>
            
          

Description : Tag describing a mapping between an object's property and a request's input parameter.


Attributes
Name Type Multiplicity Description
name String 1 Object's property name
target String 1 Request's input parameter name


Child nodes
Tag Multiplicity Description
<description> 0..1
  • A little word about the key



Tag <ignoreFields>


            
<?xml version="1.0" encoding="UTF-8" ?>
<project name="SampleHeroes" package="com.digipolitan.sample.heroes" prefix="HR" version="1.0" author="Toto" copyright="Toto Corp." lang="fr">
   <webservices interfaceSubpackage="domains.interfaces" implementationSubpackage="platforms.webservices" mockSubpackage="platforms.mocks">
      <reverseProxies subpackage="classes.reverseproxies">
         <reverseProxy name="CharacterEditReverseProxy" subpackage="characters" extends="CharacterReverseProxy">
            <ignoreFields values="login;password;created_on;gender;level;attributes" />
         </reverseProxy>
      </reverseProxies>
   </webservices>
</project>
            
          

Description : Tag containing all request input parameters to ignore.


Attributes
Name Type Multiplicity Description
values String 1
  • Input parameters to ignore list
  • Separator « ; »


Child nodes
Tag Multiplicity Description
<description> 0..1
  • A little word about fields to ignore



Tag <conditionalProxies>


            
<?xml version="1.0" encoding="UTF-8" ?>
<project name="SampleHeroes" package="com.digipolitan.sample.heroes" prefix="HR" version="1.0" author="Toto" copyright="Toto Corp." lang="fr">
   <webservices interfaceSubpackage="domains.interfaces" implementationSubpackage="platforms.webservices" mockSubpackage="platforms.mocks">
      <conditionalProxies subpackage="classes.conditionalproxies">
         …
      </conditionalProxies>
   </webservices>
</project>
            
          

Description : Tag containing all conditional proxies used by webservice's methods.

A conditional proxy defines which proxy handle output data sent depending on output parameters.
e.g. : If a output parameter named 'type' = 1, ProxyA handle this. If 'type' = 2, ProxyB handle this.


Attributes
Name Type Multiplicity Description
subpackage String 1
  • Defines conditional proxies global package
  • Used for file tree generation (folders)
  • Appended to project's global package (com.digipolitan.sample.heroes.platforms.webservices.classes.conditionalproxies)


Child nodes
Tag Multiplicity Description
<conditionalProxy> 1..*
  • Tag describing a conditional proxy



Tag <conditionalProxy>


            
<?xml version="1.0" encoding="UTF-8" ?>
<project name="SampleHeroes" package="com.digipolitan.sample.heroes" prefix="HR" version="1.0" author="Toto" copyright="Toto Corp." lang="fr">
   <webservices interfaceSubpackage="domains.interfaces" implementationSubpackage="platforms.webservices" mockSubpackage="platforms.mocks">
      <conditionalProxies subpackage="classes.conditionalproxies">
      		<conditionalProxy name="StuffConditionalProxy" subpackage="stuffs" defaultProxy="StuffProxy">
	                <conditions>
	                    ...
	                </conditions>
            </conditionalProxy>
      </conditionalProxies>
   </webservices>
</project>
            
          

Description : Tag containing conditional proxy data, used to decide which proxy handle output parameters depending on conditions.

e.g. : If a output parameter named 'type' = 1, ProxyA handle this. If 'type' = 2, ProxyB handle this.


Attributes
Name Type Multiplicity Description
name String 1 Conditional proxy name (object syntax, suffix ConditionalProxy recommended)
subpackage String 0..1
  • Defines conditional proxy package
  • Used for file tree generation (folders)
  • Appended to project and conditional proxies's global package (com.digipolitan.sample.heroes.platforms.webservices.classes.conditionalproxies.stuffs)
extends String 0..1
  • Inheritance of the conditional proxy to another
  • Just conditional proxy name
defaultProxy String 0..1 Default proxy which handle data


Child nodes
Tag Multiplicity Description
<description> 0..1
  • A little word about the conditional proxy
  • e.g. : To describe conditions
<conditions> 0..1 List of conditions to describe proxy routing



Tag <conditions>


            
<?xml version="1.0" encoding="UTF-8" ?>
<project name="SampleHeroes" package="com.digipolitan.sample.heroes" prefix="HR" version="1.0" author="Toto" copyright="Toto Corp." lang="fr">
   <webservices interfaceSubpackage="domains.interfaces" implementationSubpackage="platforms.webservices" mockSubpackage="platforms.mocks">
      <conditionalProxies subpackage="classes.conditionalproxies">
      		<conditionalProxy name="StuffConditionalProxy" subpackage="stuffs" defaultProxy="StuffProxy">
	                <conditions>
	                    ...
	                </conditions>
            </conditionalProxy>
      </conditionalProxies>
   </webservices>
</project>
            
          

Description : Tag containing all conditions of a conditional proxy used by webservice's methods.


Attributes
Name Type Multiplicity Description
None


Child nodes
Tag Multiplicity Description
<condition> 1..*
  • Tag describing a condition



Tag <condition>


            
<?xml version="1.0" encoding="UTF-8" ?>
<project name="SampleHeroes" package="com.digipolitan.sample.heroes" prefix="HR" version="1.0" author="Toto" copyright="Toto Corp." lang="fr">
   <webservices interfaceSubpackage="domains.interfaces" implementationSubpackage="platforms.webservices" mockSubpackage="platforms.mocks">
      <conditionalProxies subpackage="classes.conditionalproxies">
      		<conditionalProxy name="StuffConditionalProxy" subpackage="stuffs" defaultProxy="StuffProxy">
	                <conditions>
	                    <condition key="description" proxy="SpecialStuffProxy" />
	                </conditions>
            </conditionalProxy>
      </conditionalProxies>
   </webservices>
</project>
            
          

Description : Tag containing a condition from a conditional proxy to describe which proxy to choose depending conditions.

For example above, conditional proxy described will use SpecialStuffProxy if a output parameter named 'description' is present. Else it will use the default proxy StuffProxy.


Attributes
Name Type Multiplicity Description
key String 1 Output key name to trigger this condition
value String 0..1 To describe multiple conditions on the same key.
e.g. : If a output parameter named 'type' has many values.
proxy String 1 Proxy attached to current condition.


Child nodes
Tag Multiplicity Description
<description> 0..1
  • A little word about the condition



Tag <transformers>


            
<?xml version="1.0" encoding="UTF-8" ?>
<project name="SampleHeroes" package="com.digipolitan.sample.heroes" prefix="HR" version="1.0" author="Toto" copyright="Toto Corp." lang="fr">
   <webservices interfaceSubpackage="domains.interfaces" implementationSubpackage="platforms.webservices" mockSubpackage="platforms.mocks">
      <proxies subpackage="classes.proxies">
         <proxy name="CommonResultProxy" model="CommonResult" subpackage="common">
            <transformers>
               …
            </transformers>
         </proxy>
      </proxies>
   </webservices>
</project>
            
          

            
<?xml version="1.0" encoding="UTF-8" ?>
<project name="SampleHeroes" package="com.digipolitan.sample.heroes" prefix="HR" version="1.0" author="Toto" copyright="Toto Corp." lang="fr">
   <webservices interfaceSubpackage="domains.interfaces" implementationSubpackage="platforms.webservices" mockSubpackage="platforms.mocks">
      <reverseProxies subpackage="classes.reverseproxies">
         <reverseProxy name="CharacterReverseProxy" subpackage="characters"> 
            <transformers>
               …
            </transformers>
         </reverseProxy>
      </reverseProxies>
   </webservices>
</project>
            
          

Description : Tag containing all transformers used by the proxy / reverse proxy.


Attributes
Name Type Multiplicity Description
None


Child nodes
Tag Multiplicity Description
<transformer> 1..*
  • Tag describing a transformer



Tag <transformer>


            
<?xml version="1.0" encoding="UTF-8" ?>
<project name="SampleHeroes" package="com.digipolitan.sample.heroes" prefix="HR" version="1.0" author="Toto" copyright="Toto Corp." lang="fr">
   <webservices interfaceSubpackage="domains.interfaces" implementationSubpackage="platforms.webservices" mockSubpackage="platforms.mocks">
      <proxies subpackage="classes.proxies">
         <proxy name="CommonResultProxy" model="CommonResult" subpackage="common">
            <transformers>
               <transformer key="code" type="ResultCode" format="ordinal">
                  <description>Response code's transformer</description>
               </transformer>
            </transformers>
         </proxy>
         <proxy name="CharacterProxy" model="Character" subpackage="characters">
            <transformers>
               <transformer key="created_on" type="Date" format="yyyy-MM-dd" />
               <transformer key="gender" type="Gender" format="ordinal" />
               <transformer key="picture" type="URL" />
            </transformers>
         </proxy>
      </proxies>
   </webservices>
</project>
            
          

            
<?xml version="1.0" encoding="UTF-8" ?>
<project name="SampleHeroes" package="com.digipolitan.sample.heroes" prefix="HR" version="1.0" author="Toto" copyright="Toto Corp." lang="fr">
   <webservices interfaceSubpackage="domains.interfaces" implementationSubpackage="platforms.webservices" mockSubpackage="platforms.mocks">
      <reverseProxies subpackage="classes.reverseproxies">
         <reverseProxy name="CharacterReverseProxy" subpackage="characters"> 
            <transformers>
               <transformer key="password" type="Encrypt" format="AES_128" environmentKey="crypt_key_ws_h">
                  <description>Password's transformer using the environment variable crypt_key_ws_h</description>
               </transformer>
               <transformer key="created_on" type="Date" format="yyyy-MM-dd" />
               <transformer key="gender" type="Gender" format="ordinal" />
               <transformer key="picture" type="Encode" format="Base64" />
            </transformers>
         </reverseProxy>
      </reverseProxies>
   </webservices>
</project>
            
          

Description : Tag describing a transformer and can manipulate request parameter.


Attributes
Name Type Multiplicity Description
key String 1 I/O key parameter to transform
type String 1
  • Property's type
  • Various cases :
    • date
    • url
    • enums
    • ciphering variables, many modes available : 'Encrypt', 'Decrypt', 'Encode', 'Decode', 'Hashage'
    • proxy : Used when output data sent needs itself a proxy
    • conditional proxy : Used when output data sent needs itself a conditional proxy
    • reverse proxy : Used when input data expected needs itself a reverse proxy
    • map
format String 1
  • Additional data about typing
  • If :
    • date : format wanted (ISO)
    • enums, 2 formats available : ordinal or text
    • ciphering variables, many algorithms available depending on mode chosen above :
      • Encrypt : 'AES_128'
      • Decrypt : 'AES_128'
      • Encode : 'Base64'
      • Decode : 'Base64'
      • Hashage : 'Md5', 'Sha1', 'Sha256', 'Sha512'
environmentKey String 0..1
  • Additional data for Encrypt, Decrypt cipher functions by providing environment key
locale String 0..1
  • ...


Child nodes
Tag Multiplicity Description
<description> 0..1
  • A little word about the transformer
<transformers> 0..1
  • For map transformer only, it contains strictly 2 subtransformers with keys 'key' and 'value' to assign transformers on map attributes