Results 1 to 3 of 3
  1. #1
    Saumya is offline Member
    Join Date
    Nov 2012
    Posts
    2
    Rep Power
    0

    Default JAXB XmlElement - Problem with Arrayfields

    Hi,

    I have used below getter method level XmlElement annotation for generating xsd from Java class.
    @XmlElement(type=Integer.class, required=true)
    public int [] getTestArrayInt () { .... }

    Generated XML element:
    <xsd:element name="testArrayInt" type="xsd:int"/>

    minOccurs's default value is said to be 1. Hence, it is not being displayed here.
    But maxOccurs="unbounded" which should be listed for Array elements is missing. Soap UI expects maxOccurs="unbounded" to be present for the array elements. As a result, in Soap UI, this element is not being treated as an array.

    When I have removed type=Integer.class from the annotation, I started getting maxOccurs="unbounded" in the XML. But I need this type specially for primitive datatypes. Without type in annotation, minOccurs=1 gets missing for elements which are not required (i.e. required =true is not set).

    Can someone help me in this?

    Thanks in advance,
    Saumya

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default Re: JAXB XmlElement - Problem with Arrayfields

    Moved form a staff-only section.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    Saumya is offline Member
    Join Date
    Nov 2012
    Posts
    2
    Rep Power
    0

    Default Re: JAXB XmlElement - Problem with Arrayfields

    This is an urgent issue. Please suggest.

Similar Threads

  1. jaxb and xml exstenstion
    By Daniela in forum XML
    Replies: 0
    Last Post: 07-28-2011, 06:41 PM
  2. Replies: 1
    Last Post: 02-24-2011, 11:22 AM
  3. Jaxb
    By Paul Richards in forum XML
    Replies: 1
    Last Post: 08-03-2009, 09:56 PM
  4. JAXB Marshalling
    By akbar4ums in forum XML
    Replies: 1
    Last Post: 12-20-2008, 04:39 AM
  5. JAXB Unmarshalling
    By prateek in forum XML
    Replies: 0
    Last Post: 07-10-2008, 06:53 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •