From jbossws-commits at lists.jboss.org Fri Sep 14 12:07:10 2012 Content-Type: multipart/mixed; boundary="===============0364293669187845338==" MIME-Version: 1.0 From: jbossws-commits at lists.jboss.org To: jbossws-commits at lists.jboss.org Subject: [jbossws-commits] JBossWS SVN: r16723 - in common-tools/trunk/src: main/java/org/jboss/ws/tools/cmd and 1 other directories. Date: Fri, 14 Sep 2012 12:07:10 -0400 Message-ID: <201209141607.q8EG7Asf031169@svn01.web.mwc.hst.phx2.redhat.com> --===============0364293669187845338== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: alessio.soldano(a)jboss.com Date: 2012-09-14 12:07:09 -0400 (Fri, 14 Sep 2012) New Revision: 16723 Modified: common-tools/trunk/src/main/java/org/jboss/ws/tools/ant/WSProvideTask.ja= va common-tools/trunk/src/main/java/org/jboss/ws/tools/cmd/WSProvide.java common-tools/trunk/src/test/java/org/jboss/test/ws/tools/CmdProvideTrack= er.java Log: [JBWS-3510] Add WSProvide option for specifying soap:address location to us= e in generated wsdl Modified: common-tools/trunk/src/main/java/org/jboss/ws/tools/ant/WSProvide= Task.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- common-tools/trunk/src/main/java/org/jboss/ws/tools/ant/WSProvideTask.j= ava 2012-09-14 16:06:46 UTC (rev 16722) +++ common-tools/trunk/src/main/java/org/jboss/ws/tools/ant/WSProvideTask.j= ava 2012-09-14 16:07:09 UTC (rev 16723) @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2006, Red Hat Middleware LLC, and individual contributors + * Copyright 2012, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * @@ -32,7 +32,6 @@ import org.apache.tools.ant.types.Path; import org.apache.tools.ant.types.Reference; import org.apache.tools.ant.types.CommandlineJava.SysProperties; -import org.apache.tools.ant.types.Environment.Variable; import org.jboss.ws.api.tools.WSContractProvider; = import java.io.File; @@ -55,6 +54,7 @@ * resourcedestdirThe output directory for resource art= ifacts (WSDL/XSD).value of destdir * sourcedestdirThe output directory for Java source.value of destdir * genwsdlWhether or not to generate WSDL.fals= e + * addressThe generated port soap:address in wsdl.= * extensionEnable SOAP 1.2 binding extension.= false * verboseEnables more informational output about cmd p= rogress.false * seiService Endpoint Implementation. @@ -88,6 +88,7 @@ * = * @author Jason T. Greene * @author Richard Opalka + * @author Alessio Soldano<= /a> */ public class WSProvideTask extends Task { @@ -103,6 +104,7 @@ private boolean verbose; private boolean fork; private boolean debug; + private String portSoapAddress; = // Not actually used right now public void setDebug(boolean debug) @@ -183,6 +185,11 @@ this.genwsdl =3D genwsdl; } = + public void setPortSoapAddress(String portSoapAddress) + { + this.portSoapAddress =3D portSoapAddress; + } + = private ClassLoader getClasspathLoader(ClassLoader parent) { AntClassLoader antLoader =3D new AntClassLoader(parent, getProject(), cl= asspath, false); @@ -228,6 +235,7 @@ gen.setGenerateSource(keep); gen.setGenerateWsdl(genwsdl); gen.setExtension(extension); + gen.setPortSoapAddress(portSoapAddress); = if (destdir !=3D null) gen.setOutputDirectory(destdir); @@ -287,6 +295,11 @@ if (genwsdl) command.createArgument().setValue("-w"); = + if (portSoapAddress !=3D null) { + command.createArgument().setValue("-a"); + command.createArgument().setValue(portSoapAddress); + } + = if (extension) command.createArgument().setValue("-e"); = Modified: common-tools/trunk/src/main/java/org/jboss/ws/tools/cmd/WSProvide= .java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- common-tools/trunk/src/main/java/org/jboss/ws/tools/cmd/WSProvide.java = 2012-09-14 16:06:46 UTC (rev 16722) +++ common-tools/trunk/src/main/java/org/jboss/ws/tools/cmd/WSProvide.java = 2012-09-14 16:07:09 UTC (rev 16723) @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2006, Red Hat Middleware LLC, and individual contributors + * Copyright 2012, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * @@ -52,6 +52,7 @@ * -o, --output=3D<directory> The directory to pu= t generated artifacts * -r, --resource=3D<directory>The directory to pu= t resource artifacts * -s, --source=3D<directory> The directory to pu= t Java source + * -a, --address=3D<address> The generated port = soap:address in wsdl * -q, --quiet Be somewhat more quie= t * -t, --show-traces Show full exception s= tack traces * -l, --load-provider Load the provider and= exit (debug utility) @@ -60,6 +61,7 @@ * = * @author Jason T. Greene * @author Richard Opalka + * @author Alessio Soldano<= /a> */ public class WSProvide { @@ -73,6 +75,7 @@ private boolean loadProvider; private File resourceDir; private File sourceDir; + private String portSoapAddress; = public static final String PROGRAM_NAME =3D SecurityActions.getSystemPr= operty("program.name", WSProvide.class.getSimpleName()); = @@ -85,7 +88,7 @@ = private String parseArguments(String[] args) { - String shortOpts =3D "hwko:r:s:c:qtle"; + String shortOpts =3D "hwko:r:s:a:c:qtle"; LongOpt[] longOpts =3D = { new LongOpt("help", LongOpt.NO_ARGUMENT, null, 'h'), @@ -94,6 +97,7 @@ new LongOpt("output", LongOpt.REQUIRED_ARGUMENT, null, 'o'), new LongOpt("resource", LongOpt.REQUIRED_ARGUMENT, null, 'r'), new LongOpt("source", LongOpt.REQUIRED_ARGUMENT, null, 's'), + new LongOpt("address", LongOpt.REQUIRED_ARGUMENT, null, 'a'), new LongOpt("classpath", LongOpt.REQUIRED_ARGUMENT, null, 'c'), new LongOpt("quiet", LongOpt.NO_ARGUMENT, null, 'q'), new LongOpt("show-traces", LongOpt.NO_ARGUMENT, null, 't'), @@ -131,6 +135,9 @@ case 'c': processClassPath(getopt.getOptarg()); break; + case 'a': + portSoapAddress =3D getopt.getOptarg(); + break; case 'l': loadProvider =3D true; break; @@ -182,6 +189,7 @@ gen.setGenerateSource(generateSource); gen.setOutputDirectory(outputDir); gen.setExtension(extension); + gen.setPortSoapAddress(portSoapAddress); if (resourceDir !=3D null) gen.setResourceDirectory(resourceDir); if (sourceDir !=3D null) @@ -254,6 +262,7 @@ out.println(" -h, --help Show this help message"= ); out.println(" -k, --keep Keep/Generate Java sour= ce"); out.println(" -w, --wsdl Enable WSDL file genera= tion"); + out.println(" -a, --address=3D
The generated port so= ap:address in wsdl"); out.println(" -c, --classpath=3D The classpath that co= ntains the endpoint"); out.println(" -o, --output=3D The directory to put = generated artifacts"); out.println(" -r, --resource=3D The directory to put = resource artifacts"); Modified: common-tools/trunk/src/test/java/org/jboss/test/ws/tools/CmdProvi= deTracker.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- common-tools/trunk/src/test/java/org/jboss/test/ws/tools/CmdProvideTrac= ker.java 2012-09-14 16:06:46 UTC (rev 16722) +++ common-tools/trunk/src/test/java/org/jboss/test/ws/tools/CmdProvideTrac= ker.java 2012-09-14 16:07:09 UTC (rev 16723) @@ -83,4 +83,9 @@ { LAST_EVENT +=3D "setMessageStream"; } + + public void setPortSoapAddress(String address) + { + LAST_EVENT +=3D "setPortSoapAddress"; + } } --===============0364293669187845338==--