Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Spring-WS client domain classes

 
Joyce Kind
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

This is my first time to try spring-ws client.

After reading documentation and some examples online, I found I need to generate JAXB domain classes from XML schema first, so I can use JAXB objectFacotry to create request domain object and ask Spring framework to send over my request to a Web Services. But I only have one WSDL file from the Web Service and there is no seperate XSD file. I saw the XML schema actually is written inside the WSDL file as below:

<wsdl:type>
<xs:schema>...</xs:schema>
<xs:schema>...</xs:schema>
<xs:schema>...</xs:schema>
<xs:schema>...</xs:schema>
</wsdl:type>

For this built-in XSD, how do I generate JAXB domain classes?

Thanks very much!
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
You have two choices, as far as I know:
1. Use wsimport to process the WSDL and generate all artifacts. Then discard the web service client stub classes and keep the JAXB classes.
2. Extract the XML type definitions and generate the JAXB classes with the JAXB schema compilation tool xjc.
Best wishes!
 
Joyce Kind
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, I will try wsimport.

Happy New Year to you!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic