Liberty: The web services commands

Liberty provides several command utilities to work with Java Architecture for XML Binding (JAXB) and Java API for XML Web Services (JAX-WS) applications.


schemagen command for JAXB applications

Generate a schema file from Java classes using the schemagen schema generator tool to create the XML schema. After we have created a mapping between XML schema and Java classes, XML instance documents can be converted to and from Java objects using the JAXB binding runtime API. The resulting Java classes contain all the necessary information that the JAXB run time requires to parse the XML for marshaling and unmarshaling. We can use the JAXB classes within JAX-WS applications or the JAXB classes in your non-JAX-WS Java applications for processing XML data.

See schemagen command for JAXB applications.


xjc command for JAXB applications

We can generate fully annotated Java classes from an XML schema file using the xjc command-line tool provided by the JAXB schema compiler. Use the xjc schema compiler tool to start with an XML schema definition (XSD) to create a set of JavaBeans that map to the elements and types defined in the XSD schema. After we have created a mapping between XML schema and Java classes, we can convert XML instance documents to and from Java objects using the JAXB binding runtime API. The resulting annotated Java classes contains all the necessary information that the JAXB runtime requires to parse the XML for marshaling and unmarshaling. We can use the resulting JAXB classes within JAX-WS applications or the resulting JAXB classes in your non-JAX-WS Java applications to process XML data.

See xjc command for JAXB applications.


wsgen command for JAX-WS applications

The wsgen command-line tool generates the necessary artifacts required by JAX-WS applications when we start with Java code for Web Services programming. When we start with a service endpoint implementation, use the wsgen tool to generate the required JAX-WS artifacts.

See wsgen command for JAX-WS applications.


wsimport command for JAX-WS applications

The wsimport command-line tool processes an existing Web Services Description Language (WSDL) file and generates the required artifacts for developing JAX-WS web service applications. When we start with an existing WSDL file, use the wsimport command-line tool to generate the required JAX-WS artifacts. Attention: To change the package name of the generated classes, include -p <Expected_Java_Package_Name> in the wsimport command line. After that, do not change Java package name manually.

See wsimport command for JAX-WS applications.