You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Scott McCoy <ta...@cpan.org> on 2006/03/13 20:44:11 UTC

WSDL2Java and SimpleType doing *strange* things.

When given the declaration...

<complexType name="keyword">
    <simpleContent>
      <extension base="xsd:string">
        <attribute name="advertisementId" type="xsd:int"/>
        <attribute name="autoBid" type="xsd:boolean"/>
        <attribute name="bid" type="xsd:decimal"/>
        <attribute name="matchType" type="impl:match-type"/>
      </extension>
    </simpleContent>
</complexType>

WSDL2Java generates a Bean class that has a get_value (named after the
internal _value a less complex type declaration has?) and set_value method
for accessing the value, but when deployed Axis outputs a wsdl that has an
*attribute* named _value for the keyword complexType.

When given....

<complexType name="keyword">
    <simpleContent/>
    <attribute name="value" type="xsd:string"/>
    <attribute name="advertisementId" type="xsd:int"/>
    <attribute name="autoBid" type="xsd:boolean"/>
    <attribute name="bid" type="xsd:decimal"/>
    <attribute name="match" type="impl:match-type"/>
</complexType>

WSDL2Java generates exactly what I expect, but then when deployed axis
returns a wsdl that contains:

<complexType name="keyword">
    <simpleContent>
      <extension base="xsd:string">
        <attribute name="advertisementId" type="xsd:int"/>
        <attribute name="autoBid" type="xsd:boolean"/>
        <attribute name="bid" type="xsd:decimal"/>
        <attribute name="matchType" type="impl:match-type"/>
      </extension>
    </simpleContent>
</complexType>

How do I get WSDL2Java to do what I want?  Heh.  I'd prefer to my markup to
look like:

<keyword id=".." advertisement-id=".." auto-bid=".." bid=".." match="..">The
Keyword</keyword>

But having an attribute named value containing the keyword is a close runner
up in perferred behaviors.

Thanks,
    Scott S. McCoy

Re: WSDL2Java and SimpleType doing *strange* things.

Posted by Dies Koper <di...@jp.fujitsu.com>.
Hello Scott,

Why not not use the ?wsdl generated wsdl?
(i.e. specify the original one in the WSDD instead)

Regards,
Dies


Scott McCoy wrote:
> When given the declaration...
> 
> <complexType name="keyword">
>     <simpleContent>
>       <extension base="xsd:string">
>         <attribute name="advertisementId" type="xsd:int"/>
>         <attribute name="autoBid" type="xsd:boolean"/>
>         <attribute name="bid" type="xsd:decimal"/>
>         <attribute name="matchType" type="impl:match-type"/>
>       </extension>
>     </simpleContent>
> </complexType>
> 
> WSDL2Java generates a Bean class that has a get_value (named after the
> internal _value a less complex type declaration has?) and set_value method
> for accessing the value, but when deployed Axis outputs a wsdl that has an
> *attribute* named _value for the keyword complexType.
> 
> When given....
> 
> <complexType name="keyword">
>     <simpleContent/>
>     <attribute name="value" type="xsd:string"/>
>     <attribute name="advertisementId" type="xsd:int"/>
>     <attribute name="autoBid" type="xsd:boolean"/>
>     <attribute name="bid" type="xsd:decimal"/>
>     <attribute name="match" type="impl:match-type"/>
> </complexType>
> 
> WSDL2Java generates exactly what I expect, but then when deployed axis
> returns a wsdl that contains:
> 
> <complexType name="keyword">
>     <simpleContent>
>       <extension base="xsd:string">
>         <attribute name="advertisementId" type="xsd:int"/>
>         <attribute name="autoBid" type="xsd:boolean"/>
>         <attribute name="bid" type="xsd:decimal"/>
>         <attribute name="matchType" type="impl:match-type"/>
>       </extension>
>     </simpleContent>
> </complexType>
> 
> How do I get WSDL2Java to do what I want?  Heh.  I'd prefer to my markup to
> look like:
> 
> <keyword id=".." advertisement-id=".." auto-bid=".." bid=".." match="..">The
> Keyword</keyword>
> 
> But having an attribute named value containing the keyword is a close runner
> up in perferred behaviors.
> 
> Thanks,
>     Scott S. McCoy