axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From susan...@opensource.lk
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.
Ex1:

   <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;
  return AXIS_RESTRICTION_FAIL;
}

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.
Ex:
AddOutputParam(const AxisChar* pchName, void* pValue, XSDTYPE type)
to
AddOutputParam(const AxisChar* pchName, void* pValue, XSDTYPE type, void*
pRestr_funct)

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) :
>
> 	http://jy.baudy.free.fr/axis/thing/
>
> WSDL file is :
>
> 	http://jy.baudy.free.fr/axis/thing/thing.wsdl
>
>
> The only problem I have is for arrays. I don't like my implementation so
> your help will be appreciated. See :
> 	http://jy.baudy.free.fr/axis/thing/AThingResponse.cpp
>

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

Thanks,

Susantha.

Mime
View raw message