[
https://issues.apache.org/jira/browse/CXF-1620?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12623760#action_12623760
]
Bob Fields commented on CXF-1620:
---------------------------------
Wow that was fast. 5 minutes after verifying the problem you figured it out. I
noticed it wasn't traversing up the attribute when I had to move the jxb
namespace declaration to globalBindings in order for the binding to work
without the class name customization. I verified it works with 2.1.2 after
moving the extensionBindingPrefixes. I'm creating pattern templates for web
service generation from UML models (using AndroMDA), this whole exercise was
very helpful. Yes I did forget that I had removed the jxb bindings from
JXBJavaType.xjb, but the same markup was in the other bindings file, commented
out.
The non-parsing of the space separated bindings files also occurred for me when
running org.apache.cxf.tools.wsdlto.WSDLToJava class from java (debugging in
Eclipse with command line arguments). Did you verify it worked from the ant
script?
Will you add the working binding sample to the samples list and the Adapters
classes to cxf core, or do you need additional code or a patch file? I also
wanted to demonstrate using the xjc argument in CXF - we use lots of Jaxb2
plugins in our regular Jaxb code (in the process of converting 275 schemas from
Jaxb pre-release to Jaxb 2.1 on one project). Also wanted the pom.xml file to
demonstrate wsdl2java with all of the various options.
Part of what threw me for the bindings was that I just recently switched from
2.0 to 2.1 CXF. When trying the working bindings file in 2.0.8 I get:
[java] Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: In
valid content was found starting with element 'xjc:javaType'. One of '{"http://j
ava.sun.com/xml/ns/jaxb":javaType, "http://java.sun.com/xml/ns/jaxb":serializabl
e, "http://java.sun.com/xml/ns/jaxb/xjc":serializable, "http://java.sun.com/xml/
ns/jaxb/xjc":superClass, "http://java.sun.com/xml/ns/jaxb/xjc":superInterface, "
http://java.sun.com/xml/ns/jaxb/xjc":typeSubstitution, "http://java.sun.com/xml/
ns/jaxb/xjc":smartWildcardDefaultBinding, "http://java.sun.com/xml/ns/jaxb/xjc":
simple, "http://java.sun.com/xml/ns/jaxb/xjc":generateElementProperty, "http://j
ava.sun.com/xml/ns/jaxb/xjc":noMarshaller, "http://java.sun.com/xml/ns/jaxb/xjc"
:noUnmarshaller, "http://java.sun.com/xml/ns/jaxb/xjc":noValidator, "http://java
.sun.com/xml/ns/jaxb/xjc":noValidatingUnmarshaller}' is expected.
Thanks for everything. CXF has been a very good product so far, fewer problems
than with a lot of the other tools we use here (we're an IBM Rational /
Websphere shop).
> wsdl2java ignores jaxb2 xjc globalBindings with namespace xjc
> -------------------------------------------------------------
>
> Key: CXF-1620
> URL: https://issues.apache.org/jira/browse/CXF-1620
> Project: CXF
> Issue Type: Bug
> Components: JAXB Databinding
> Affects Versions: 2.0.6
> Environment: CXF 2.0.6. Jaxb 2.0.5
> Reporter: Bob Fields
> Assignee: Daniel Kulp
> Fix For: 2.0.8, 2.1.2
>
> Attachments: wsdl_first_binding_wrapped.zip
>
>
> JAXB databindings work fine as shown in wsdl2java bindings documentation for
> customizing Date mapping. If I add the Jaxb2 specific customizations, they
> are ignored in xjc. Specifically, add jxb:version="2.0"
> jxb:extensionBindingPrefixes="xjc"
> xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" in the jaxws:bindings
> declaration, and use something like <xjc:serializable> <xjc:simple>
> <xjc:javaType adapter=""> in the jxb:globalBindings section. There's no error
> or anything, the xjc bindings are simply ignored.
> One possibly related problem - if cxf-manifest.jar is in my environment
> classpath, Jaxb2 xjc customizations cause the xjc ant task to fail even when
> I set the classpath. I'm generating JAXB classes in a project unrelated to
> CXF using Jaxb 2.0.5 xjc jar. I have to remove the manifest jar from the
> classpath for xjc to work again.
> We specifically need xjc:simple to avoid JAXBElement creations and to add
> @XmlRootElement where it would otherwise not appear. We also want
> xjc:javaType adapter="" because the jxb:javaType print/parse bindings create
> one Adapter class for each binding customization (not for each customization
> type), which can be several hundred in very large webservice projects.
> A related improvement would be to add CXF DataTypeAdapter classes that extend
> javax.xml.bind.annotation.adapters.XmlAdapter<String, Date> with a marshal
> and unmarshal method, which looks like the generated AdapterX classes. I
> would suggest four classes for date, time, dateTime, and integer (replacing
> BigInteger with Integer).
> A sample project showing JAXB customized datatype bindings for wsdl2java
> would be helpful too. If I get some time next week I'll create and submit one
> based on the wsdl2java samples, with a working jxb binding and an xjc binding
> that should work but doesn't. Unless this issue has already been noticed and
> is being worked on (I didn't see anything related in JIRA).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.