Friday, 19 October 2012

How to convert WSDL to Java using JBoss WS Consume tool

It is simple

Go to Following Path in command prompt:
jboss-6.0.0.Final\bin

Run the following Batch file
wsconsume -k E:\Configuration\WebServiceSchema\wsdl\Service.wsdl

Following will be shown on screen
Could not find log4j.xml configuration, logging to console.
log4j:WARN No appenders could be found for logger (org.apache.cxf.common.logging.LogUtils).
log4j:WARN Please initialize the log4j system properly.
Loading FrontEnd jaxws ...
Loading DataBinding jaxb ...
wsdl2java -compile -exsh false -d E:\jboss-6.0.0.Final\bin\output -verbose -classdir E:\jboss-6.0.0.Final\bin\output -allowElementReferences
 file:/E:\Configuration\WebServiceSchema\wsdl\Service.wsdl wsdl2java - Apache CXF 2.3.1

Output will be there in following folder
jboss-6.0.0.Final\bin\output\

WSConsume is a command line tool

  -h, --help                  Show this help message
  -b, --binding=<file>        One or more JAX-WS or JAXB binding files
  -k, --keep                  Keep/Generate Java source
  -c  --catalog=<file>        Oasis XML Catalog file for entity resolution
  -p  --package=<name>        The target package for generated source
  -w  --wsdlLocation=<loc>    Value to use for @WebServiceClient.wsdlLocation
  -o, --output=<directory>    The directory to put generated artifacts
  -s, --source=<directory>    The directory to put Java source
  -t, --target=<2.1|2.2>      The JAX-WS specification target
  -q, --quiet                 Be somewhat more quiet
  -v, --verbose               Show full exception stack traces
  -l, --load-consumer         Load the consumer and exit (debug utility)
  -e, --extension             Enable SOAP 1.2 binding extension
  -a, --additionalHeaders     Enables processing of implicit SOAP headers
  -n, --nocompile             Do not compile generated sources

No comments:

Post a Comment