This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Web Services and the fly likes Spring-WS client domain classes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Spring-WS client domain classes" Watch "Spring-WS client domain classes" New topic

Spring-WS client domain classes

Joyce Kind

Joined: Nov 27, 2008
Posts: 8

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:


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

Thanks very much!
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
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!

My free books and tutorials:
Joyce Kind

Joined: Nov 27, 2008
Posts: 8
Thanks, I will try wsimport.

Happy New Year to you!
I agree. Here's the link:
subject: Spring-WS client domain classes
Similar Threads
wsgen does not generate correct schema bindings and wsdl file
Facade design pattern in web services
JAXWS can not add additional classes
Spring-WS Client
javax.xml.bind.annotation.XmlSchemaType missing