• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to generate JAXB Bindings for the xml element definition which is extending from other xml

 
Ranch Hand
Posts: 558
2
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I have following xsd, from which I'm trying to generate JAXB bindings using maven plugin.



As you see above I have the above schema defined, such thta request type is completely defined in the above schema, but response is referred to a type defined in another schema.

Now, when I ran the JAXB, I see MainRequest.java something like below




but I do not see any response object as below




but instead see below class being generated as expected under shared/simpleInfo


Is there any way, like customizing the binding, so that JAXB generates class what I want, as changing the xsd is out of scope for us. Please advice.

The very reason I'm expecting to see an class MainResponse.java instead of simpleResponseType.java, is during the unmarshalling of the webservice response, we receive and the root element of the response would be <MainResponse> but not <SimpleResponseType>.

Any help here.
 
Kumar Raja
Ranch Hand
Posts: 558
2
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If this question is not posted in the appropriate category, could some one move this to the right group, so that it gets the visibility it needed.
 
Ranch Hand
Posts: 734
7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Before one can jump to any conclusion, I think one has to make sure the schema is properly constructed to define the vocabulary one is intended to define.

As far as I can see, you missed out the targetNamespace and that is critical. I wold say add that attribute and make sure you mean to have MainRequest and MainResponse defined in that namespace or which one in which namespace (the target namespace or the imported namespace).
 
When people don’t understand what you are doing they call you crazy. But this tiny ad just doesn't care:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic