org.apache.ws.java2wsdl.Java2WSDL Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of axis2-java2wsdl Show documentation
Show all versions of axis2-java2wsdl Show documentation
To generate WSDL file for a given Java class
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.ws.java2wsdl;
import java.util.Map;
import org.apache.axis2.description.java2wsdl.Java2WSDLConstants;
import org.apache.axis2.util.CommandLineOptionConstants;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.ws.java2wsdl.jaxws.JAXWS2WSDLCodegenEngine;
import org.apache.ws.java2wsdl.utils.Java2WSDLCommandLineOption;
import org.apache.ws.java2wsdl.utils.Java2WSDLCommandLineOptionParser;
import org.apache.ws.java2wsdl.utils.Java2WSDLOptionsValidator;
public class Java2WSDL {
private static Log log = LogFactory.getLog(Java2WSDL.class);
public static void main(String[] args) throws Exception {
Java2WSDLCommandLineOptionParser commandLineOptionParser = new Java2WSDLCommandLineOptionParser(
args);
if (isJwsOptionEnabled(commandLineOptionParser)){
JAXWS2WSDLCodegenEngine engine = new JAXWS2WSDLCodegenEngine(commandLineOptionParser.getAllOptions(), args);
engine.generate();
return;
}
// validate the arguments
validateCommandLineOptions(commandLineOptionParser);
Java2WSDLCodegenEngine engine = new Java2WSDLCodegenEngine(commandLineOptionParser.getAllOptions());
engine.generate();
log.info("WSDL created at "+ engine.getOutputFile());
}
public static void printUsage() {
System.out.println("Usage: java2wsdl [options] -cn ");
System.out.println("\nwhere [options] include:");
System.out.println(" -o