You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Bob Fields (JIRA)" <ji...@apache.org> on 2008/06/02 03:47:45 UTC

[jira] Created: (CXF-1620) wsdl2java ignores jaxb2 xjc globalBindings with namespace xjc

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


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.


[jira] Commented: (CXF-1620) wsdl2java ignores jaxb2 xjc globalBindings with namespace xjc

Posted by "John Greeley (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1620?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12622773#action_12622773 ] 

John Greeley commented on CXF-1620:
-----------------------------------

Here's the page describing the Sun vendor customizations to XJC -  https://jaxb.dev.java.net/2.1.7/docs/vendorCustomizations.html

> 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
>
>
> 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.


[jira] Commented: (CXF-1620) wsdl2java ignores jaxb2 xjc globalBindings with namespace xjc

Posted by "John Greeley (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1620?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12622770#action_12622770 ] 

John Greeley commented on CXF-1620:
-----------------------------------

This is not fixed. The XJC external bindings (note that these are non-standard "vendor customizations" implemented in Sun JAXB RI) work fine in the maven2 jaxb plugin and the maven2 jaxws plugin but not in the maven2 cxf codegen plugin. This is really annoying if you depend on these customizations because you have to mess around with the barely-supported Metro related maven plugins for a CXF maven project. 

> 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
>
>
> 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.


[jira] Commented: (CXF-1620) wsdl2java ignores jaxb2 xjc globalBindings with namespace xjc

Posted by "Bob Fields (JIRA)" <ji...@apache.org>.
    [ 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.


[jira] Resolved: (CXF-1620) wsdl2java ignores jaxb2 xjc globalBindings with namespace xjc

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1620?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp resolved CXF-1620.
------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0.8
                   2.1.2
         Assignee: Daniel Kulp


I'm going to resolve this as the bug in the title is now fixed.

We do provide parser things for the various dates/times/etc:

<jxb:globalBindings  xmlns:jxb="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/XMLSchema">
       <jxb:javaType name="java.util.Date" xmlType="xs:dateTime"
                     parseMethod="org.apache.cxf.tools.common.DataTypeAdapter.parseDateTime"
                     printMethod="org.apache.cxf.tools.common.DataTypeAdapter.printDateTime"/>
 </jxb:globalBindings>

If that isn't adequate (I'm not sure on the pros/cons), please log another jira for that.

> 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.1.2, 2.0.8
>
>
> 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.


[jira] Commented: (CXF-1620) wsdl2java ignores jaxb2 xjc globalBindings with namespace xjc

Posted by "Bob Fields (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1620?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12623687#action_12623687 ] 

Bob Fields commented on CXF-1620:
---------------------------------

Verified still not working in CXF 2.1.2. I created a sample based on the samples\wsdl_first_wrapped with customized bindings, adding a DateTypes class. I added Adapter classes for date, time, dateTime for both Date and calendar types, and updated build.xml generate.code task to use the bindings. There are three binding files: 
JXBJavaType.xjb demonstrates jxb:javaType Customization from the jaxws namespace (works but produces the Adapter# classes) using XPATH node; 
XJCJavaType.xjb demonstrates the xjc:javaType Customization from the jxb namespace, which works for global customizations without having to use XPATH (also works for Jaxb XJC directly), but does not allow customization of the class names that you get from the jaxws namespace;
BADJAXWSJavaType.xjb demonstrates the xjc binding customization starting from the jaxws namespace, the same as the JXBJavaType except xjc:javaType is used instead of jxb:javaType.

The sample could eventually be added to the list of samples and the 6 classes which extend XMLAdapter could be added to the CXF code base. I'm sure there are other Adapter classes out there that are needed (I saw CurrencyAdapter in one test sample and MapAdapter in another).

Reading through the docs, it looks like multiple binding files can be passed to wsdl2java -b (separated by a space), that's a potential solution here because of the different namespaces but I was unable to get it to work. The build.xml generate.code task shows a call with the two binding files. wsdl2java attempts to parse the parameters (two files separated by a space) together as a single parameter and throws an IOException File not found.

> 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
>
>
> 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.


[jira] Commented: (CXF-1620) wsdl2java ignores jaxb2 xjc globalBindings with namespace xjc

Posted by "Bob Fields (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1620?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12622672#action_12622672 ] 

Bob Fields commented on CXF-1620:
---------------------------------

Still not fixed. The parseMethod/printMethod attributes work, but the adapter="" annotation does not. Tested with CXF 2.1.1. Strangely enough, I can get it working if I use just the jxb:bindings namespace but not with the jaxws:bindings namespace (which works with the jxb:javaType as long as I select an XPATH node). I'll file another JIRA with some working and non-working examples. The parse/printMethod customization is not adequate.

> 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
>
>
> 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.


[jira] Updated: (CXF-1620) wsdl2java ignores jaxb2 xjc globalBindings with namespace xjc

Posted by "Bob Fields (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1620?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bob Fields updated CXF-1620:
----------------------------

    Attachment: wsdl_first_binding_wrapped.zip

Modified version of wsdl_first_xml_wrapped, showing customized bindings.

> 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.


[jira] Commented: (CXF-1620) wsdl2java ignores jaxb2 xjc globalBindings with namespace xjc

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1620?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12623717#action_12623717 ] 

Daniel Kulp commented on CXF-1620:
----------------------------------



OK.   If you move the jxb:extensionBindingPrefixes="xjc" attribute to the jxb:globalBindings node, it all works fine.   (that's how my test case has it setup which is why I knew my test worked.   It apparently doesn't traverse up the parents to find that attribute.


> 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.


[jira] Commented: (CXF-1620) wsdl2java ignores jaxb2 xjc globalBindings with namespace xjc

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1620?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12623713#action_12623713 ] 

Daniel Kulp commented on CXF-1620:
----------------------------------


OK:

1) JXBJavaType.xjb - doesn't have any jaxb customizations in it.  Just customizations for the SEI name and service name.   Did you send the wrong version? 

2) I can reproduce the BADJAXWSJavaType.xjb thing.   Digging in now.

3) The wsdl2java macro that is setup in common_build.xml only allows a single binding file.   You could modify the macro to allow multiple files:

<macrodef name="wsdl2java">
        <attribute name="srcdestdir" default="${build.src.dir}"/>
        <attribute name="destdir" default="${build.classes.dir}"/>
        <attribute name="file"/>
        <attribute name="servicename.arg" default=""/>
        <attribute name="bindingfile" default=""/>
        <attribute name="bindingfile2" default=""/>
        <attribute name="dir" default="${wsdl.dir}"/>
        <attribute name="package" default="NOT_SPECIFIED"/>
        <attribute name="compile" default="false"/>
        <attribute name="classdir" default=""/>
        <attribute name="gen" default="all"/>
        <attribute name="validate" default="true"/>
        <sequential>
            <mkdir dir="@{destdir}"/>
            <mkdir dir="@{srcdestdir}"/>
            <condition property="package.arg.@{file}" value="-p @{package}">
                <not>
                    <equals arg1="@{package}" arg2="NOT_SPECIFIED"/>
                </not>
            </condition>
            <property name="package.arg.@{file}" value=""/>
            <condition property="binding.arg" value='-b "@{bindingfile}"'>
                <not>
                    <equals arg1="@{bindingfile}" arg2=""/>
                </not>
            </condition>
            <property name="binding.arg" value=""/>
            <condition property="binding.arg2" value='-b "@{bindingfile2}"'>
                <not>
                    <equals arg1="@{bindingfile2}" arg2=""/>
                </not>
            </condition>
            <property name="binding.arg2" value=""/>
            <java failonerror="true" classname="org.apache.cxf.tools.wsdlto.WSDLToJava" fork="yes">
                <classpath>
                    <path refid="cxf.classpath" />
                </classpath>
                <sysproperty key="java.util.logging.config.file" value="${cxf.etc.dir}/logging.properties"/>
                <sysproperty key="exitOnFinish" value="true"/>
                <arg line="@{servicename.arg}"/>
                <arg line="${package.arg.@{file}}"/>
                <arg line="${binding.arg}"/>
                <arg line="${binding.arg2}"/>
                <arg value="-verbose"/>
                <arg value="-d"/>
                <arg value="@{srcdestdir}"/>
                <arg value="-all"/>
                <arg value="-validate"/>
                <arg value="@{dir}/@{file}"/>
            </java>
        </sequential>
    </macrodef>



> 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.


[jira] Commented: (CXF-1620) wsdl2java ignores jaxb2 xjc globalBindings with namespace xjc

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1620?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12622857#action_12622857 ] 

Daniel Kulp commented on CXF-1620:
----------------------------------


This is marked "Fix version: 2.1.2".   Are you using 2.1.2?  Bob specifically mentions 2.1.1 which it would obviously NOT be fixed in.

It DOES work for my simple test case.   Buy your test case could be more complex than mine.   If you could attach a non-working test case, then it might have a chance of getting debugged and fixed.

> 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
>
>
> 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.