I'm trying to replicate what this plug-in does in Gradle. If I execute:
./wsdl2java -encoding UTF-8 -d /src/target/generated-sources/cxf -fe jaxws21
-sn UserSoapServicePorts -faultSerialVersionUID 1 -xjc-Xannotate
-p http:... -p urn:... -p urn:... -p urn:... -p urn:h... -p urn:...
-p urn:... -p urn:...
-verbose /src/xmlTemp/user-soap-v1.wsdl
...then I get:
an 22, 2016 3:51:05 PM org.apache.cxf.wsdl11.WSDLServiceBuilder checkForWrapped
INFO: Operation {urn:stuff:wsdl:person:v1}doSomething cannot be unwrapped, input message must reference global element declaration with same localname as operation
As far as I can tell, though the lines are identical. Any ideas what might be wrong?
Use
buildscript {
ext {
xjcVersion= '3.0.5'
jaxbOutputDir = "$buildDir/generated/cxf"
jaxb2BasicsVersion = '0.11.0'
}
}
configurations {
cxf
}
apply plugin: 'java'
apply plugin: 'eclipse'
sourceSets {
main {
java {
srcDirs += "$jaxbOutputDir"
}
}
}
task wsdl2java(type: JavaExec) {
ext {
outputDir = file("$jaxbOutputDir")
}
systemProperties = ['javax.xml.accessExternalSchema': 'file' , 'file.encoding':'UTF8']
outputs.upToDateWhen { false }
outputs.dir outputDir
main = 'org.apache.cxf.tools.wsdlto.WSDLToJava'
classpath = project.configurations.cxf
args '-d', outputDir
args '-fe', 'jaxws21'
args '-client'
args '-verbose'
args '-validate'
args '-mark-generated'
// args '-xjc-X'
args '-xjc-Xfluent-api'
args '-xjc-Xts'
args '-xjc-XhashCode'
args '-xjc-Xequals'
args '-b',"$projectDir/src/main/resources/jaxws-custom-bindings.xjb"
args "$projectDir/src/main/resources/wsdl/myWsdl.wsdl"
doLast {
println "----- cxf jaxb2 files generated -----"
}
}
dependencies {
cxf "org.apache.cxf:cxf-tools-wsdlto-core:$cxfVersion"
cxf "org.apache.cxf:cxf-tools-wsdlto-frontend-jaxws:$cxfVersion"
cxf "org.apache.cxf:cxf-tools-wsdlto-databinding-jaxb:$cxfVersion"
cxf "org.jvnet.jaxb2_commons:jaxb2-fluent-api:3.0"
cxf "org.apache.cxf.xjcplugins:cxf-xjc-ts:$xjcVersion"
cxf "org.jvnet.jaxb2_commons:jaxb2-basics:$jaxb2BasicsVersion"
compile "org.apache.cxf.xjc-utils:cxf-xjc-runtime:$xjcVersion"
compile "org.jvnet.jaxb2_commons:jaxb2-basics-runtime:$jaxb2BasicsVersion"
compile 'commons-lang:commons-lang:2.6'
}
compileJava.dependsOn wsdl2java
have fun.