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 05:35:23 GMT
Hi Jean-Yves,

> There is one thing that make me  perplex about simpleType. In your
> sample you have simpleTypes. The actual implementation of simpleType for
> document/literal style is wrong for me (need to be confirmed).
>
> With the current implementation the following schema declaration :
>
> ...
>            <s:element name="aThing" type="s0:aThing" final="restriction"/>
>             <s:simpleType name="aThing">
>                 <s:restriction base="s:string">
>                     <s:maxLength value="255"/>
>                 </s:restriction>
>              </s:simpleType>
> ..
>
> Will produce the SOAP request ;
>
> ...
> 	<value>aThing Test</value>
> ...

Yes this is wrong.

>
> But I think that for simpleType in doc/lit the value tag must be
> omitted. All the simpleTypes should be serialized and deserialazed as
> sort of PCDATA. If true the runtime will need some extra API such as
> GetAsPcData(..) and GetPcDataAsString|Int...(...).

I dont think that we need such API functions. All this has to be handled
by the WSDL2Ws tool.

Consider the following schema section of thing.wsdl

          <s:element name="aThing" type="s0:aThing" final="restriction"/>
          <s:simpleType name="aThing">
              <s:restriction base="s:string">
                  <s:maxLength value="255"/>
              </s:restriction>
          </s:simpleType>
          <s:element name="find_aThing" type="s0:find_aThing"
final="restriction"/>
          <s:complexType name="find_aThing" final="restriction">
              <s:sequence>
                  <s:element ref="s0:aThing" maxOccurs="1"/>
              </s:sequence>
          </s:complexType>

IMO WSDL2Ws tool should treat this in the same way that it will treat
following,

          <s:element name="find_aThing" type="s0:find_aThing"
final="restriction"/>
          <s:complexType name="find_aThing" final="restriction">
              <s:sequence>
                  <s:element name="aThing" type="s:string" maxOccurs="1"/>
              </s:sequence>
          </s:complexType>

The SOAP message in both cases should be,

<ns1:find_aThing xmlns:ns1="urn:Thing">
   <aThing>some text .......</aThing>
</ns1:find_aThing>

Only difference between the 2 sets of generated code is that the former
should have additional code to check whether the length of string (to be
serialized is less than 255).

What do you think ?.

thanks,

Susantha.


Mime
View raw message