wsdl2java icon indicating copy to clipboard operation
wsdl2java copied to clipboard

jaxb-bindings annotations not working

Open kunalkanere16 opened this issue 6 years ago • 5 comments

I have converted a maven project to gradle and using wsdl2java. The plugin works fine with below properties: wsdlsToGenerate = [ ['-p', 'foo.bar', '-autoNameResolution', "$projectDir/src/main/resources/wsdl/My_WSDL.wsdl" ] ]

However the below fails:

['-p', 'foo.bar', '-autoNameResolution', '-b', "$projectDir/src/main/resources/binding.xjb", "$projectDir/src/main/resources/wsdl/My_WSDL.wsdl" ] ]

Error: Unsupported binding namespace "http://annox.dev.java.net". Perhaps you meant "http://java.sun.com/xml/ns/jaxb/xjc"?

Using: cxfVersion = "3.2.4" Gradle: 4.8.1 Java: 1.8

binding_xjb.zip

Any help will be great!!

kunalkanere16 avatar Feb 11 '19 08:02 kunalkanere16

since you are not providing a full working example of how to reproduce this, I will have to start guessing for solutions:

  • did you try adding the "-Xannotate" argument?

nilsmagnus avatar Feb 11 '19 09:02 nilsmagnus

  • did you add your annotation classes to the classpath?

nilsmagnus avatar Feb 11 '19 09:02 nilsmagnus

Hi, Sorry because of compliance, I cannot share source code. -XAnnotate is not supported in list of options for the cfx version I am using. The classes I want to annotate are generated from wsdl in the given package.

kunalkanere16 avatar Feb 11 '19 09:02 kunalkanere16

I have attached the binding.xjb file I am using to annotate the generated java classes.

kunalkanere16 avatar Feb 11 '19 09:02 kunalkanere16

build.gradle snippet:

`wsdl2java { wsdlsToGenerate = [ ['-p', 'foo.bar', '-autoNameResolution','-xjc-Xannotate', '-b',"$projectDir/src/main/resources/binding.xjb", "$projectDir/src/main/resources/wsdl/MY_WSDL.wsdl" ] ] generatedWsdlDir = file("$projectDir/build/generated-sources") wsdlDir = file("$projectDir/src/main/resources/wsdl") }

wsdl2javaExt { cxfVersion = "3.2.4" deleteGeneratedSourcesOnClean = true }`

dependencies: compile 'org.jvnet.jaxb2_commons:jaxb2-basics-annotate:1.1.0' compile 'org.apache.cxf.xjcplugins:cxf-xjc-ts:3.0.5' compile 'xerces:xercesImpl:2.9.1'

-Xannotate errror:

XJC reported 'BadCommandLineException' for -xjc argument:-extension -Xannotate

Available plugin options: -Xinject-code : inject specified Java code fragments into the generated code -Xlocator : enable source location support for generated code -Xsync-methods : generate accessor methods with the 'synchronized' keyword -mark-generated : mark the generated code as @javax.annotation.Generated -episode <FILE> : generate the episode file for separate compilation -Xpropertyaccessors : Use XmlAccessType PROPERTY instead of FIELD for generated classes

kunalkanere16 avatar Feb 12 '19 00:02 kunalkanere16