You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Michael Klimiuk (JIRA)" <ji...@apache.org> on 2009/09/09 16:18:57 UTC

[jira] Created: (CXF-2429) wsdl2java tool generates client stub which always uses default (JAXB) databinding while another one style is specified in the command line (-db argument)

wsdl2java tool generates client stub which always uses default (JAXB) databinding while another one style is specified in the command line (-db argument)
---------------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: CXF-2429
                 URL: https://issues.apache.org/jira/browse/CXF-2429
             Project: CXF
          Issue Type: Bug
          Components: Tooling
    Affects Versions: 2.2.3, 2.1.6
         Environment: the issue is not environment related
            Reporter: Michael Klimiuk


SCENARIO:

The following ant task is executed to generate client artifacts:

        <java classname="org.apache.cxf.tools.wsdlto.WSDLToJava" fork="true">
            <arg value="-client" />
            <arg value="-db" />
            <arg value="xmlbeans" />
            <arg value="-d" />
            <arg value="${gen.dir}" />
            <arg value="${wsdl.file}" />
            <classpath>
                <path refid="ws.classpath" />
            </classpath>
        </java>


ACTUAL RESULT:

Generated class XXXService.java uses default databinding style (JAXB) for creation of a service client while the XmlBeans style is specified. Furthermore, the databinding style cannot even be changed programmatically using available interfaces.


EXPECTED RESULT:

Generated class XXXService.java must use the specified databinding style for creation of a service client.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-2429) wsdl2java tool generates client stub which always uses default (JAXB) databinding while another one style is specified in the command line (-db argument)

Posted by "Michael Klimiuk (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-2429?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12757180#action_12757180 ] 

Michael Klimiuk commented on CXF-2429:
--------------------------------------

Thanks for the reply, Daniel

My workaround solution is something like your 2nd and 3rd points.

In our case:
- the simple front-end is used;
- XmlBeans databinding is used;
- and WSDL location is not specified, so the service will be "built from the class".

The following patch is applied on generated artifacts:
- the annotations are removed from the generated web service interface (just to disable warnings when using ReflectionServiceFactoryBean);
- the most important change in XXXService class is:

    public MyPortInterface createPort(String address) {
        ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
        factory.setServiceClass(MyPortInterface.class);
        factory.setDataBinding(new XmlBeansDataBinding());
        factory.setBindingId(BINDING_ID);
        factory.setEndpointName(PORT_NAME);
        factory.setServiceName(SERVICE);
        factory.setAddress(address);
        return (MyPortInterface) factory.create();
    }

After that the XXXClass is actually not an extension of javax.xml.ws.Service, because we need only generated SERVICE and PORT_NAME Qname values in the inserted method.

> wsdl2java tool generates client stub which always uses default (JAXB) databinding while another one style is specified in the command line (-db argument)
> ---------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-2429
>                 URL: https://issues.apache.org/jira/browse/CXF-2429
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>    Affects Versions: 2.1.6, 2.2.3
>         Environment: the issue is not environment related
>            Reporter: Michael Klimiuk
>
> SCENARIO:
> The following ant task is executed to generate client artifacts:
>         <java classname="org.apache.cxf.tools.wsdlto.WSDLToJava" fork="true">
>             <arg value="-client" />
>             <arg value="-db" />
>             <arg value="xmlbeans" />
>             <arg value="-d" />
>             <arg value="${gen.dir}" />
>             <arg value="${wsdl.file}" />
>             <classpath>
>                 <path refid="ws.classpath" />
>             </classpath>
>         </java>
> ACTUAL RESULT:
> Generated class XXXService.java uses default databinding style (JAXB) for creation of a service client while the XmlBeans style is specified. Furthermore, the databinding style cannot even be changed programmatically using available interfaces.
> EXPECTED RESULT:
> Generated class XXXService.java must use the specified databinding style for creation of a service client.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (CXF-2429) wsdl2java tool generates client stub which always uses default (JAXB) databinding while another one style is specified in the command line (-db argument)

Posted by "Michael Klimiuk (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-2429?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12757180#action_12757180 ] 

Michael Klimiuk edited comment on CXF-2429 at 10/2/09 1:22 AM:
---------------------------------------------------------------

Thanks for the reply, Daniel

My workaround solution is something like your 2nd and 3rd points.

In our case:
- XmlBeans databinding is used;
- and WSDL location is not specified, so the service will be "built from the class".

The following patch is applied on generated artifacts:
- the most important change in XXXService class is:

    public MyPortInterface createPort(String address) {
        JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
        factory.setServiceClass(MyPortInterface.class);
        factory.setDataBinding(new XmlBeansDataBinding());
        factory.setBindingId(BINDING_ID);
        factory.setEndpointName(PORT_NAME);
        factory.setServiceName(SERVICE);
        factory.setAddress(address);
        return (MyPortInterface) factory.create();
    }

After that the XXXClass is actually not an extension of javax.xml.ws.Service, because we need only generated SERVICE and PORT_NAME Qname values in the inserted method.

      was (Author: mklimiuk):
    Thanks for the reply, Daniel

My workaround solution is something like your 2nd and 3rd points.

In our case:
- the simple front-end is used;
- XmlBeans databinding is used;
- and WSDL location is not specified, so the service will be "built from the class".

The following patch is applied on generated artifacts:
- the annotations are removed from the generated web service interface (just to disable warnings when using ReflectionServiceFactoryBean);
- the most important change in XXXService class is:

    public MyPortInterface createPort(String address) {
        ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
        factory.setServiceClass(MyPortInterface.class);
        factory.setDataBinding(new XmlBeansDataBinding());
        factory.setBindingId(BINDING_ID);
        factory.setEndpointName(PORT_NAME);
        factory.setServiceName(SERVICE);
        factory.setAddress(address);
        return (MyPortInterface) factory.create();
    }

After that the XXXClass is actually not an extension of javax.xml.ws.Service, because we need only generated SERVICE and PORT_NAME Qname values in the inserted method.
  
> wsdl2java tool generates client stub which always uses default (JAXB) databinding while another one style is specified in the command line (-db argument)
> ---------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-2429
>                 URL: https://issues.apache.org/jira/browse/CXF-2429
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>    Affects Versions: 2.1.6, 2.2.3
>         Environment: the issue is not environment related
>            Reporter: Michael Klimiuk
>            Assignee: Daniel Kulp
>             Fix For: 2.2.4
>
>
> SCENARIO:
> The following ant task is executed to generate client artifacts:
>         <java classname="org.apache.cxf.tools.wsdlto.WSDLToJava" fork="true">
>             <arg value="-client" />
>             <arg value="-db" />
>             <arg value="xmlbeans" />
>             <arg value="-d" />
>             <arg value="${gen.dir}" />
>             <arg value="${wsdl.file}" />
>             <classpath>
>                 <path refid="ws.classpath" />
>             </classpath>
>         </java>
> ACTUAL RESULT:
> Generated class XXXService.java uses default databinding style (JAXB) for creation of a service client while the XmlBeans style is specified. Furthermore, the databinding style cannot even be changed programmatically using available interfaces.
> EXPECTED RESULT:
> Generated class XXXService.java must use the specified databinding style for creation of a service client.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-2429) wsdl2java tool generates client stub which always uses default (JAXB) databinding while another one style is specified in the command line (-db argument)

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

Daniel Kulp commented on CXF-2429:
----------------------------------


As a point of note: this is fixed on trunk, but it's not something that can be backported to 2.2/2.1 due to it using new annotation infrastructure available only on trunk.

For 2.1/2.2, it would need to either:

1) Generate a spring config file (cxf.xml) that would configure the databinding for the ports.

2) Not generate the Service.java at all and require you to use the JaxWsServiceFactoryBean API's and such.

3) Embed some other code in the generated Service to set the databinding, but that might have JAX-WS spec compliance issues.   



> wsdl2java tool generates client stub which always uses default (JAXB) databinding while another one style is specified in the command line (-db argument)
> ---------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-2429
>                 URL: https://issues.apache.org/jira/browse/CXF-2429
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>    Affects Versions: 2.1.6, 2.2.3
>         Environment: the issue is not environment related
>            Reporter: Michael Klimiuk
>
> SCENARIO:
> The following ant task is executed to generate client artifacts:
>         <java classname="org.apache.cxf.tools.wsdlto.WSDLToJava" fork="true">
>             <arg value="-client" />
>             <arg value="-db" />
>             <arg value="xmlbeans" />
>             <arg value="-d" />
>             <arg value="${gen.dir}" />
>             <arg value="${wsdl.file}" />
>             <classpath>
>                 <path refid="ws.classpath" />
>             </classpath>
>         </java>
> ACTUAL RESULT:
> Generated class XXXService.java uses default databinding style (JAXB) for creation of a service client while the XmlBeans style is specified. Furthermore, the databinding style cannot even be changed programmatically using available interfaces.
> EXPECTED RESULT:
> Generated class XXXService.java must use the specified databinding style for creation of a service client.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (CXF-2429) wsdl2java tool generates client stub which always uses default (JAXB) databinding while another one style is specified in the command line (-db argument)

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

Daniel Kulp resolved CXF-2429.
------------------------------

       Resolution: Fixed
    Fix Version/s: 2.2.4
         Assignee: Daniel Kulp

Ported the @Databinding annotation to 2.2.4

> wsdl2java tool generates client stub which always uses default (JAXB) databinding while another one style is specified in the command line (-db argument)
> ---------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-2429
>                 URL: https://issues.apache.org/jira/browse/CXF-2429
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>    Affects Versions: 2.1.6, 2.2.3
>         Environment: the issue is not environment related
>            Reporter: Michael Klimiuk
>            Assignee: Daniel Kulp
>             Fix For: 2.2.4
>
>
> SCENARIO:
> The following ant task is executed to generate client artifacts:
>         <java classname="org.apache.cxf.tools.wsdlto.WSDLToJava" fork="true">
>             <arg value="-client" />
>             <arg value="-db" />
>             <arg value="xmlbeans" />
>             <arg value="-d" />
>             <arg value="${gen.dir}" />
>             <arg value="${wsdl.file}" />
>             <classpath>
>                 <path refid="ws.classpath" />
>             </classpath>
>         </java>
> ACTUAL RESULT:
> Generated class XXXService.java uses default databinding style (JAXB) for creation of a service client while the XmlBeans style is specified. Furthermore, the databinding style cannot even be changed programmatically using available interfaces.
> EXPECTED RESULT:
> Generated class XXXService.java must use the specified databinding style for creation of a service client.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.