Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3315298
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:20:01+00:00 2026-05-17T22:20:01+00:00

I am struggling with a simple JAXB customization issue. I have an schema like

  • 0

I am struggling with a simple JAXB customization issue. I have an schema like this. (its actually a snippet of Bing Maps Web Services schema)

 <xs:complexType name="GeocodeOptions">
  <xs:sequence>
    <xs:element minOccurs="0" name="Count" nillable="true" type="xs:int" />
    <xs:element minOccurs="0" name="Filters" nillable="true" type="ArrayOfFilterBase" />
  </xs:sequence>
</xs:complexType>
<xs:complexType name="ArrayOfFilterBase">
  <xs:sequence>
    <xs:element minOccurs="0" maxOccurs="unbounded" name="FilterBase" nillable="true" type="FilterBase" />
  </xs:sequence>
</xs:complexType>

Now when I generate java classes using wsimport, it creates code structure like:

public class GeocodeOptions implements Serializable {
...
    public ArrayOfFilterBase getFilters() {
    ...
    }

    public void setFilters(ArrayOfFilterBase value) {
    ...
    }
}

public class ArrayOfFilterBase implements Serializable {
...
    public List<FilterBase> getFilterBaseList() {
    ...
    }
}

As you notice ArrayOfFilterBase is a container class which I would like to omit. I would like to have the getFilterBaseList() method directly inside GeocodeOptions class.

Is it possible to do it through JAXB customization? I searched hard for it but could not find a solution.

Thanks for your help.

Regards
Nabeel Mukhtar

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T22:20:02+00:00Added an answer on May 17, 2026 at 10:20 pm

    Yes, you can omit the container using the @XmlElementWrapper annotation. Your code should look something like this:

    public class GeocodeOptions implements Serializable {
           @XmlElementWrapper(name = "...")
           @XmlElement(name = "...")
          public List<FilterBase> getFilterBaseList() {
           ...
          }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This may seem like a very simple question, but I have been struggling with
Just struggling with a simple issue with ASP.NET MVC. I have a list of
Struggling still with this after hours or research.. I have a simple helper class
Have been struggling all day trying to make this simple example work using socket.io.
Been struggling with this simple selector problem a couple of hours now and must
I've been struggling with this simple task for more expirienced people, I'm stuck for
im struggling with syntax here: hopefully this question is v simple, im just miising
I have been struggling to get a simple autocomplete working with my Rails app
Right now I'm struggling to get this simple PHP AJAX request to work. <html>
I have been struggling trying to test a super simple EJB project in netbeans.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.