axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject RE: Generating wrapped doc/lit style code by WSDL2Ws tool
Date Thu, 11 Mar 2004 15:17:03 GMT
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 simpleTypes.
> I think we need this generation to delegate the control to those classes
> 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 only
a function to check the restrictions and we have a typedef.

   <s:simpleType name="aThing">
      <s:restriction base="s:string">
         <s:maxLength value="255"/>

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 think.

> other good reason for this is that a simpleType can be reused (so no
> code duplication).

> Look here as an example of such generation (no control by now) :
> WSDL file is :
> The only problem I have is for arrays. I don't like my implementation so
> your help will be appreciated. See :

I looked all that and I too feel that this should be simpler than this. I
will review and let you know.



View raw message