• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Kumar Raja
Ranch Hand
Posts: 547
2
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • 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: 547
2
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • 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.
 
g tsuji
Ranch Hand
Posts: 667
3
  • Mark post as helpful
  • send pies
  • 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).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic