You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by "marcin.kasinski@gmail.com" <ma...@gmail.com> on 2011/05/27 10:39:19 UTC

CXF and xsd restrictions


Hello.

Can you tell me what kind of annotation I can use in my JAVA to generate xsd
restrictions in wsdl ?

I need to generate code bellow.

 <xs:simpleType>
    <xs:restriction base="xs:integer">
      <xs:minInclusive value="0"/>
      <xs:maxInclusive value="120"/>
    </xs:restriction>
  </xs:simpleType>

<xs:simpleType name="carType">
  <xs:restriction base="xs:string">
    <xs:enumeration value="Audi"/>
    <xs:enumeration value="Golf"/>
    <xs:enumeration value="BMW"/>
  </xs:restriction>
</xs:simpleType>


Thanks 
Marcion

--
View this message in context: http://cxf.547215.n5.nabble.com/CXF-and-xsd-restrictions-tp4431241p4431241.html
Sent from the cxf-dev mailing list archive at Nabble.com.

Re: CXF and xsd restrictions

Posted by "marcin.kasinski@gmail.com" <ma...@gmail.com>.
Thank you for reply.

You said there's no way to do it with annotation .

Can I do in different way ?
Can I do with other framework ?

My case is:

Generate java class with methods and set minoccurs, maxoccurs and
restrictions and then generate wsdl and other necessary files from this
bean.

Any idea ?

--
View this message in context: http://cxf.547215.n5.nabble.com/CXF-and-xsd-restrictions-tp4431241p4433246.html
Sent from the cxf-dev mailing list archive at Nabble.com.

Re: CXF and xsd restrictions

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

No, there's no way to do it with annotation in java code, jaxb can't  
support it.

Take a look at related discussions here[1]
[1]http://cxf.547215.n5.nabble.com/JAXB-Any-way-to-incorporate-restrictions-into-annotations-td3405878.html#a3406031

Freeman
On 2011-5-27, at 下午4:39, marcin.kasinski@gmail.com wrote:

>
>
> Hello.
>
> Can you tell me what kind of annotation I can use in my JAVA to  
> generate xsd
> restrictions in wsdl ?
>
> I need to generate code bellow.
>
> <xs:simpleType>
>    <xs:restriction base="xs:integer">
>      <xs:minInclusive value="0"/>
>      <xs:maxInclusive value="120"/>
>    </xs:restriction>
>  </xs:simpleType>
>
> <xs:simpleType name="carType">
>  <xs:restriction base="xs:string">
>    <xs:enumeration value="Audi"/>
>    <xs:enumeration value="Golf"/>
>    <xs:enumeration value="BMW"/>
>  </xs:restriction>
> </xs:simpleType>
>
>
> Thanks
> Marcion
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/CXF-and-xsd-restrictions-tp4431241p4431241.html
> Sent from the cxf-dev mailing list archive at Nabble.com.

---------------------------------------------
Freeman Fang

FuseSource
Email:ffang@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
Connect at CamelOne May 24-26
The Open Source Integration Conference