Comments (4)
Can you please provide a short XML snippet of the WSDL file you are using in your tests? Where exactly does the <xs:appinfo>
element occur in your WSDL file, and where (in which class) would you expect the @AppInfo
annotation to be generated?
Assuming this is the structure of your WSDL file:
<wsdl:definitions ...>
<wsdl:types>
<xs:schema ...>
<xs:complexType name="TestRequest">
<xs:annotation id="id123">
<xs:appinfo source="src 1">appinfo 1</xs:appinfo>
...
</xs:annotation>
...
</xs:complexType>
...
</xs:schema>
</wsdl:types>
...
</wsdl:definitions>
... then the <xs:appinfo>
can occur only within the <xs:schema>
element (e.g., within a <xs:complexType>
element), not outside of it. Maybe this answers your question. Otherwise, please provide a minimal test case. Thanks
from jaxb-facets.
Thank you for reply. I'm using test.wsdl from your project. So it has the snippet you presented. I'm running the following command:
./bin/wsimport.sh -keep -B-jaxb-facets -d ~/temp ~/IdeaProjects/jaxb-facets-master/testutils/src/test/resources/test.wsdl
And I'm expecting that file ~/temp/pellcorp/com/service/personservice/TestRequest.java will have @AppoInfo annotation (just as in the file from your project ~/IdeaProjects/jaxb-facets-master/jaxb-impl/src/test/java/at/ac/tuwien/infosys/jaxb/test/TestRequest.java):
...
@Documentation("doc 3")
@AppInfo(source = "src 1", value = "appinfo 1")
@SuppressWarnings("all")
@Assert(test = "not(bar1) or not(bar2)")
public class TestRequest {
@XmlAttribute
public ChartType type;
...
But instead genereated file (~/temp/pellcorp/com/service/personservice/TestRequest.java) has only @document annotation:
...
@Annotation(documentation = @Documentation("doc 3"))
public class TestRequest {
@XmlElement(required = true)
@Facets(pattern = "[0-9]+", whiteSpace = Facets.WhiteSpace.preserve)
...
from jaxb-facets.
Thanks for reporting. I have pushed a new version 898c4e0 which contains basic support for @AppInfo
in generated Java classes.
When you have an element like this one:
<xs:complexType name="TestRequest">
<xs:annotation>
<xs:appinfo source="src 1"><foo xmlns="myns123">appinfo 1</foo></xs:appinfo>
<xs:documentation source="src 1" xml:lang="en">doc 1</xs:documentation>
</xs:annotation>
...
... then the generated source will look like this:
@Annotation(documentation = @Documentation("doc 1"), appinfo = @AppInfo("<foo xmlns=\"myns123\">appinfo 1</foo>"))
public class TestRequest {
...
However, there are some limitations imposed on us, due to issues in JAXB/XJC:
- The
source
attribute ofappinfo
elements gets parsed but is not preserved. It simply gets lost when transforming XSD -> Java. Root cause is here: http://grepcode.com/file/repo1.maven.org/maven2/com.sun.xml.bind/jaxb-xjc/2.2.5/com/sun/tools/xjc/reader/xmlschema/bindinfo/BindInfo.java?av=f#148 - The content of an
appinfo
element must be an element. I.e., text contents like<appinfo>appinfo 1</appinfo>
don't work, it needs to be wrapped in a root element:<appinfo><foo xmlns="myns123">appinfo 1</foo></appinfo>
. Also note that thefoo
element must be fully qualified, i.e., have a valid namespace declaration.
Version number has not been changed. To use this updated version, please clean your Maven cache in $HOME/.m2/repository
and the updated version will be automatically re-downloaded.
Closing this issue for now. Please feel free to re-open if there are any other issues/questions.
from jaxb-facets.
Thanks a lot!
from jaxb-facets.
Related Issues (20)
- AnnotationLocation missing HOT 2
- compilation fails because of testutils pom HOT 1
- wsimport issue HOT 6
- Adding support for assertions HOT 3
- Support for JavaEE annotations HOT 8
- Using @Documentation annotation at field level causes @XmlSchemaType to be ignored HOT 2
- @Pattern annotation does not work nicely with @XmlID and @XmlIDREF HOT 6
- WARNING: Unable to get @MinOccurs annotation from type com.sun.xml.bind.v2.model.impl.TypeRefImpl@667de82c HOT 1
- Issue with @Facets and @XmlJavaTypeAdapter HOT 2
- mvn clean install with empty repository HOT 3
- Jaxb-Facets @MaxOccurs generated XML Schema validation not working HOT 2
- Which license HOT 4
- Spring boot 1.3.1 + jaxb-facets HOT 2
- Any plans into getting facets into JDK's JAXB? HOT 5
- Preserve annotations during schema creation HOT 3
- Working example with cxf-xjc-plugin
- appear NullPointerException HOT 1
- java.lang.NoClassDefFoundError: com/sun/tools/javac/code/Type$ClassType HOT 3
- Pushing facets support upstream HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jaxb-facets.