axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Yves Baudy <>
Subject Simple Types integration for DOC/LIT in C/C++ Stack
Date Thu, 11 Mar 2004 22:04:30 GMT

For my own opinion I think that we should involve more persons in this 
discussion. Simple types are very frequently used in a simple way. But 
they also can be more complex. Here an example :

     <element name="size" type="tns:simpleSize" />
     <simpleType name="simpleSize">
           <restriction base="integer" />
           <restriction base="boolean" />
           <restriction base=string" />

Where the XML can be :

   <size xsi:type='xsd:string'>1</size>

For this kind of declaration a class should be generated. This is 
probably why most of the stubs generation tooling produce classes for 

But your approach is also very useful for restriction on simpleTypes. 
The customer interface is very simple (only primitiv type méanipulation) 
and the generation process will be more simple to maintain.


 >Hi Jean-Yves
 >> Hi Susantha,
 >> With your approach if we don't add any API to the runtime we need to
 >> consider the generation or not of classes/structures for the 
 >> I think we need this generation to delegate the control to those 
 >> rather than to the generated classes of the "caller" complexType. An
 >I agree. But I searched in all the wsdls I have for simpleType
 >declarations and I found that simpleType is used to basically have
 >restriction on it like enumerations, maxLength, minLength. These
 >restrictions are some checks to be done just before
 >serialization/deserialization. Please correct me if I am wrong.
 >So what I suggest is not to create a type for a simpleType but create 
 >a function to check the restrictions and we have a typedef.
 >   <s:simpleType name="aThing">
 >      <s:restriction base="s:string">
 >         <s:maxLength value="255"/>
 >     </s:restriction>
 >   </s:simpleType>
 >we create
 >typedef xsd_string aThing; //this is optional
 >int Check_Restrictions_aThing(aThing* var)
 >  if (strlen(var)<255) return AXIS_RESTRICTION_OK;
 >Then the "caller" complex type will call Check_Restrictions_xxx >function
 >on each of its simpleType varibles to verify. Probably we have to >change
 >the API functions to add this function pointer passing capability.
 >AddOutputParam(const AxisChar* pchName, void* pValue, XSDTYPE type)
 >AddOutputParam(const AxisChar* pchName, void* pValue, XSDTYPE type, >void*
 >But I am still thinking a lot about this design. Let me know what you 
 >> other good reason for this is that a simpleType can be reused (so no
 >> code duplication).

View raw message