Author: alessio.soldano(a)jboss.com
Date: 2010-03-16 12:33:53 -0400 (Tue, 16 Mar 2010)
New Revision: 11788
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/tools/WSContractConsumer.java
spi/trunk/src/main/java/org/jboss/wsf/spi/tools/ant/WSConsumeTask.java
spi/trunk/src/main/java/org/jboss/wsf/spi/tools/cmd/WSConsume.java
spi/trunk/src/test/java/org/jboss/test/wsf/spi/tools/CmdConsumeTracker.java
Log:
[JBWS-2793] WSConsume support for implicit header
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/tools/WSContractConsumer.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/tools/WSContractConsumer.java 2010-03-16
12:36:41 UTC (rev 11787)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/tools/WSContractConsumer.java 2010-03-16
16:33:53 UTC (rev 11788)
@@ -165,6 +165,14 @@
public abstract void setAdditionalCompilerClassPath(List<String> classPath);
/**
+ * Enables or disables processing of implicit SOAP headers (i.e. SOAP headers
+ * defined in the wsdl:binding but not wsdl:portType section.) Default is false.
+ *
+ * @param additionalHeaders a boolean enabling processing of implicit SOAP headers
+ */
+ public abstract void setAdditionalHeaders(boolean additionalHeaders);
+
+ /**
* Set the target JAX-WS specification target. Allowed values are 2.0, 2.1 and 2.2
* @param target the JAX-WS specification version.
*/
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/tools/ant/WSConsumeTask.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/tools/ant/WSConsumeTask.java 2010-03-16
12:36:41 UTC (rev 11787)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/tools/ant/WSConsumeTask.java 2010-03-16
16:33:53 UTC (rev 11788)
@@ -92,6 +92,7 @@
private boolean fork;
private boolean debug;
private boolean nocompile;
+ private boolean additionalHeaders;
private String target;
// Not actually used right now
@@ -134,6 +135,11 @@
{
this.extension = extension;
}
+
+ public void setAdditionalHeaders(boolean additionalHeaders)
+ {
+ this.additionalHeaders = additionalHeaders;
+ }
public void setSourcedestdir(File sourcedestdir)
{
@@ -190,6 +196,7 @@
WSContractConsumer consumer = WSContractConsumer.newInstance();
consumer.setGenerateSource(keep);
consumer.setExtension(extension);
+ consumer.setAdditionalHeaders(additionalHeaders);
consumer.setNoCompile(nocompile);
if (destdir != null)
consumer.setOutputDirectory(destdir);
@@ -277,6 +284,9 @@
if (extension)
command.createArgument().setValue("-e");
+
+ if (additionalHeaders)
+ command.createArgument().setValue("-a");
for (File file : bindingFiles)
{
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/tools/cmd/WSConsume.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/tools/cmd/WSConsume.java 2010-03-16 12:36:41
UTC (rev 11787)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/tools/cmd/WSConsume.java 2010-03-16 16:33:53
UTC (rev 11788)
@@ -54,6 +54,7 @@
* <tr><td>-v, --verbose </td><td>Show full
exception stack traces</td></tr>
* <tr><td>-l, --load-consumer </td><td>Load the
consumer and exit (debug utility)</td></tr>
* <tr><td>-e, --extension </td><td>Enable SOAP
1.2 binding extension</td></tr>
+ * <tr><td>-a, --additionalHeaders </td><td>Enable SOAP
1.2 binding extension</td></tr>
* </table>
* </pre>
*
@@ -71,6 +72,7 @@
private boolean verbose;
private boolean loadConsumer;
private boolean extension;
+ private boolean additionalHeaders;
private boolean noCompile;
private File sourceDir;
private String target;
@@ -86,7 +88,7 @@
private URL parseArguments(String[] args)
{
- String shortOpts = "b:c:p:w:o:s:t:khqvlne";
+ String shortOpts = "b:c:p:w:o:s:t:khqvlnea";
LongOpt[] longOpts =
{
new LongOpt("binding", LongOpt.REQUIRED_ARGUMENT, null, 'b'),
@@ -102,6 +104,7 @@
new LongOpt("verbose", LongOpt.NO_ARGUMENT, null, 'v'),
new LongOpt("nocompile", LongOpt.NO_ARGUMENT, null, 'n'),
new LongOpt("extension", LongOpt.NO_ARGUMENT, null, 'e'),
+ new LongOpt("additionalHeaders", LongOpt.NO_ARGUMENT, null,
'a'),
new LongOpt("load-consumer", LongOpt.NO_ARGUMENT, null, 'l'),
};
@@ -147,6 +150,9 @@
case 'e':
extension = true;
break;
+ case 'a':
+ additionalHeaders = true;
+ break;
case 'n':
noCompile = true;
break;
@@ -204,6 +210,7 @@
consumer.setGenerateSource(generateSource);
consumer.setOutputDirectory(outputDir);
consumer.setExtension(extension);
+ consumer.setAdditionalHeaders(additionalHeaders);
if (sourceDir != null)
consumer.setSourceDirectory(sourceDir);
@@ -272,6 +279,7 @@
out.println(" -v, --verbose Show full exception stack
traces");
out.println(" -l, --load-consumer Load the consumer and exit (debug
utility)");
out.println(" -e, --extension Enable SOAP 1.2 binding
extension");
+ out.println(" -a, --additionalHeaders Enable processing of implicit
SOAP headers");
out.println(" -n, --nocompile Do not compile generated
sources");
out.flush();
}
Modified: spi/trunk/src/test/java/org/jboss/test/wsf/spi/tools/CmdConsumeTracker.java
===================================================================
--- spi/trunk/src/test/java/org/jboss/test/wsf/spi/tools/CmdConsumeTracker.java 2010-03-16
12:36:41 UTC (rev 11787)
+++ spi/trunk/src/test/java/org/jboss/test/wsf/spi/tools/CmdConsumeTracker.java 2010-03-16
16:33:53 UTC (rev 11788)
@@ -88,6 +88,12 @@
{
LAST_EVENT += "setAdditionalCompilerClassPath";
}
+
+ @Override
+ public void setAdditionalHeaders(boolean additionalHeaders)
+ {
+ LAST_EVENT += "setAdditionalHeaders";
+ }
@Override
public void setTarget(String target)