0

I have the following requirements and thinking about how to best get java objects from a WSDL.

  • XML data comes from a public SOAP Webservice
  • I have to use JAXB
  • I want to automatically unmarshall the retrieved data to Java objects

Ideally I'd like to have java objects using JAXB Annotations. Are there any tools that I could combine to autogenerate these?

membersound
  • 81,582
  • 193
  • 585
  • 1,120

2 Answers2

3

Sure, there are lots of ways to use JAX-WS (which uses JAXB for its XML binding) to generate a web service client.

You can execute it from the command-line: http://www.mkyong.com/webservices/jax-ws/jax-ws-wsimport-tool-example/

As part of your Maven build: https://jax-ws-commons.java.net/jaxws-maven-plugin/

Or from within your Eclipse environment: http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.jst.ws.cxf.doc.user%2Ftasks%2Fcreate_client.html

davidfmatheson
  • 3,539
  • 19
  • 27
1

Yes, there are. With every jdk, there is an executable file called wsimport that does exactly what you want.

Here is an answer i gave to a similar question.

Community
  • 1
  • 1
f1sh
  • 11,489
  • 3
  • 25
  • 51