You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "peter schröder (JIRA)" <ji...@apache.org> on 2010/04/28 16:36:32 UTC

[jira] Created: (CXF-2789) wsdl2java generates bad @XmlSeeAlso annotation

wsdl2java generates bad @XmlSeeAlso annotation
----------------------------------------------

                 Key: CXF-2789
                 URL: https://issues.apache.org/jira/browse/CXF-2789
             Project: CXF
          Issue Type: Bug
          Components: Tooling
    Affects Versions: 2.2.7
            Reporter: peter schröder
            Priority: Minor
         Attachments: service.wsdl

we are trying to generate a client stub from the attlasian crowd service wsdl and having some problems with their (bad) approach on exception handling.

there are several exceptions thrown that are in an inheritance chain with java.rmi.RemoteException and java.lang.Throwable.

we excluded these two from generation with calling wsdl with nexclude:

{noformat}
wsdl2java -autoNameResolution -verbose -client -d src/main/java -nexclude http://rmi.java=java.rmi -nexclude http://lang.java=java.lang -b wsdl/service_bindings.xml wsdl/service.wsdl
{noformat}

this produces a port type like this:

{noformat}
@WebService(targetNamespace = "urn:SecurityServer", name = "SecurityServerPortType")
@XmlSeeAlso({com.atlassian.crowd.integration.authentication.ObjectFactory.class,ObjectFactory.class,com.atlassian.crowd.integration.model.ObjectFactory.class,com.atlassian.crowd.integration.model.user.ObjectFactory.class,com.atlassian.crowd.integration.exception.ObjectFactory.class,java.rmi.ObjectFactory.class,com.atlassian.crowd.integration.soap.ObjectFactory.class,java.lang.ObjectFactory.class})
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
public interface SecurityServerPortType {
{noformat}

where java.rmi.ObjectFactory.class and java.lang.ObjectFactory.class were not generated!

maybe i did it completely wrong...

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


[jira] Commented: (CXF-2789) wsdl2java generates bad @XmlSeeAlso annotation

Posted by "peter schröder (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-2789?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12864412#action_12864412 ] 

peter schröder commented on CXF-2789:
-------------------------------------

the next issue is that generating a Throwable class from a wsdl results in a class that does not have methods like printStackTrace etc...

i don't think that it is a good idea to generate classes from java standard library!

> wsdl2java generates bad @XmlSeeAlso annotation
> ----------------------------------------------
>
>                 Key: CXF-2789
>                 URL: https://issues.apache.org/jira/browse/CXF-2789
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>    Affects Versions: 2.2.7
>            Reporter: peter schröder
>            Priority: Minor
>         Attachments: service.wsdl
>
>
> we are trying to generate a client stub from the attlasian crowd service wsdl and having some problems with their (bad) approach on exception handling.
> there are several exceptions thrown that are in an inheritance chain with java.rmi.RemoteException and java.lang.Throwable.
> we excluded these two from generation with calling wsdl with nexclude:
> {noformat}
> wsdl2java -autoNameResolution -verbose -client -d src/main/java -nexclude http://rmi.java=java.rmi -nexclude http://lang.java=java.lang -b wsdl/service_bindings.xml wsdl/service.wsdl
> {noformat}
> this produces a port type like this:
> {noformat}
> @WebService(targetNamespace = "urn:SecurityServer", name = "SecurityServerPortType")
> @XmlSeeAlso({com.atlassian.crowd.integration.authentication.ObjectFactory.class,ObjectFactory.class,com.atlassian.crowd.integration.model.ObjectFactory.class,com.atlassian.crowd.integration.model.user.ObjectFactory.class,com.atlassian.crowd.integration.exception.ObjectFactory.class,java.rmi.ObjectFactory.class,com.atlassian.crowd.integration.soap.ObjectFactory.class,java.lang.ObjectFactory.class})
> @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
> public interface SecurityServerPortType {
> {noformat}
> where java.rmi.ObjectFactory.class and java.lang.ObjectFactory.class were not generated!
> maybe i did it completely wrong...

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


[jira] Commented: (CXF-2789) wsdl2java generates bad @XmlSeeAlso annotation

Posted by "Fabian Nilius (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-2789?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12862187#action_12862187 ] 

Fabian Nilius commented on CXF-2789:
------------------------------------

In addition, the following lines in the ObjectFactory are also generated even though java.rmi.RemoteException was excluded. 
They lead to annotation errors, and have to be deleted manually.

  /**
     * Create an instance of {@link JAXBElement }{@code <}{@link RemoteException }{@code >}}
     * 
     */
    @XmlElementDecl(namespace = "urn:SecurityServer", name = "RemoteException")
    public JAXBElement<RemoteException> createRemoteException(RemoteException value) {
        return new JAXBElement<RemoteException>(_RemoteException_QNAME, RemoteException.class, null, value);
    }

- Fabian

> wsdl2java generates bad @XmlSeeAlso annotation
> ----------------------------------------------
>
>                 Key: CXF-2789
>                 URL: https://issues.apache.org/jira/browse/CXF-2789
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>    Affects Versions: 2.2.7
>            Reporter: peter schröder
>            Priority: Minor
>         Attachments: service.wsdl
>
>
> we are trying to generate a client stub from the attlasian crowd service wsdl and having some problems with their (bad) approach on exception handling.
> there are several exceptions thrown that are in an inheritance chain with java.rmi.RemoteException and java.lang.Throwable.
> we excluded these two from generation with calling wsdl with nexclude:
> {noformat}
> wsdl2java -autoNameResolution -verbose -client -d src/main/java -nexclude http://rmi.java=java.rmi -nexclude http://lang.java=java.lang -b wsdl/service_bindings.xml wsdl/service.wsdl
> {noformat}
> this produces a port type like this:
> {noformat}
> @WebService(targetNamespace = "urn:SecurityServer", name = "SecurityServerPortType")
> @XmlSeeAlso({com.atlassian.crowd.integration.authentication.ObjectFactory.class,ObjectFactory.class,com.atlassian.crowd.integration.model.ObjectFactory.class,com.atlassian.crowd.integration.model.user.ObjectFactory.class,com.atlassian.crowd.integration.exception.ObjectFactory.class,java.rmi.ObjectFactory.class,com.atlassian.crowd.integration.soap.ObjectFactory.class,java.lang.ObjectFactory.class})
> @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
> public interface SecurityServerPortType {
> {noformat}
> where java.rmi.ObjectFactory.class and java.lang.ObjectFactory.class were not generated!
> maybe i did it completely wrong...

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


[jira] Commented: (CXF-2789) wsdl2java generates bad @XmlSeeAlso annotation

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

Daniel Kulp commented on CXF-2789:
----------------------------------



This is more or less working as designed.   The -nexclude excludes the generation of the code, but it still assumes the classes are available.  The normal use case is that the classes have been generated in a previous module or similar and can be picked up from there.

In your specific case, I would recommend using the -p parameter like "-p http://lang.java=com.mycompany.jlang  -p http://rmi.java=com.mycompany.jrmi" or similar to get the code generated for them, but outside the disallowed packages.   One main reason as well is if those faults appear on the wire, we can at least deserialize them into something that may be useful.

> wsdl2java generates bad @XmlSeeAlso annotation
> ----------------------------------------------
>
>                 Key: CXF-2789
>                 URL: https://issues.apache.org/jira/browse/CXF-2789
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>    Affects Versions: 2.2.7
>            Reporter: peter schröder
>            Priority: Minor
>         Attachments: service.wsdl
>
>
> we are trying to generate a client stub from the attlasian crowd service wsdl and having some problems with their (bad) approach on exception handling.
> there are several exceptions thrown that are in an inheritance chain with java.rmi.RemoteException and java.lang.Throwable.
> we excluded these two from generation with calling wsdl with nexclude:
> {noformat}
> wsdl2java -autoNameResolution -verbose -client -d src/main/java -nexclude http://rmi.java=java.rmi -nexclude http://lang.java=java.lang -b wsdl/service_bindings.xml wsdl/service.wsdl
> {noformat}
> this produces a port type like this:
> {noformat}
> @WebService(targetNamespace = "urn:SecurityServer", name = "SecurityServerPortType")
> @XmlSeeAlso({com.atlassian.crowd.integration.authentication.ObjectFactory.class,ObjectFactory.class,com.atlassian.crowd.integration.model.ObjectFactory.class,com.atlassian.crowd.integration.model.user.ObjectFactory.class,com.atlassian.crowd.integration.exception.ObjectFactory.class,java.rmi.ObjectFactory.class,com.atlassian.crowd.integration.soap.ObjectFactory.class,java.lang.ObjectFactory.class})
> @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
> public interface SecurityServerPortType {
> {noformat}
> where java.rmi.ObjectFactory.class and java.lang.ObjectFactory.class were not generated!
> maybe i did it completely wrong...

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


[jira] Resolved: (CXF-2789) wsdl2java generates bad @XmlSeeAlso annotation

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

Daniel Kulp resolved CXF-2789.
------------------------------

       Resolution: Won't Fix
    Fix Version/s: Invalid



Unfortunately, this is not something we're allowed to fix.   The JAX-WS spec (and JAXB spec) says we're not allowed to do any mapping of these and it's up to the user to provide jaxb customization files to remap the class names and such as required by the user.

> wsdl2java generates bad @XmlSeeAlso annotation
> ----------------------------------------------
>
>                 Key: CXF-2789
>                 URL: https://issues.apache.org/jira/browse/CXF-2789
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>    Affects Versions: 2.2.7
>            Reporter: peter schröder
>            Priority: Minor
>             Fix For: Invalid
>
>         Attachments: service.wsdl
>
>
> we are trying to generate a client stub from the attlasian crowd service wsdl and having some problems with their (bad) approach on exception handling.
> there are several exceptions thrown that are in an inheritance chain with java.rmi.RemoteException and java.lang.Throwable.
> we excluded these two from generation with calling wsdl with nexclude:
> {noformat}
> wsdl2java -autoNameResolution -verbose -client -d src/main/java -nexclude http://rmi.java=java.rmi -nexclude http://lang.java=java.lang -b wsdl/service_bindings.xml wsdl/service.wsdl
> {noformat}
> this produces a port type like this:
> {noformat}
> @WebService(targetNamespace = "urn:SecurityServer", name = "SecurityServerPortType")
> @XmlSeeAlso({com.atlassian.crowd.integration.authentication.ObjectFactory.class,ObjectFactory.class,com.atlassian.crowd.integration.model.ObjectFactory.class,com.atlassian.crowd.integration.model.user.ObjectFactory.class,com.atlassian.crowd.integration.exception.ObjectFactory.class,java.rmi.ObjectFactory.class,com.atlassian.crowd.integration.soap.ObjectFactory.class,java.lang.ObjectFactory.class})
> @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
> public interface SecurityServerPortType {
> {noformat}
> where java.rmi.ObjectFactory.class and java.lang.ObjectFactory.class were not generated!
> maybe i did it completely wrong...

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


[jira] Updated: (CXF-2789) wsdl2java generates bad @XmlSeeAlso annotation

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

peter schröder updated CXF-2789:
--------------------------------

    Attachment: service.wsdl

> wsdl2java generates bad @XmlSeeAlso annotation
> ----------------------------------------------
>
>                 Key: CXF-2789
>                 URL: https://issues.apache.org/jira/browse/CXF-2789
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>    Affects Versions: 2.2.7
>            Reporter: peter schröder
>            Priority: Minor
>         Attachments: service.wsdl
>
>
> we are trying to generate a client stub from the attlasian crowd service wsdl and having some problems with their (bad) approach on exception handling.
> there are several exceptions thrown that are in an inheritance chain with java.rmi.RemoteException and java.lang.Throwable.
> we excluded these two from generation with calling wsdl with nexclude:
> {noformat}
> wsdl2java -autoNameResolution -verbose -client -d src/main/java -nexclude http://rmi.java=java.rmi -nexclude http://lang.java=java.lang -b wsdl/service_bindings.xml wsdl/service.wsdl
> {noformat}
> this produces a port type like this:
> {noformat}
> @WebService(targetNamespace = "urn:SecurityServer", name = "SecurityServerPortType")
> @XmlSeeAlso({com.atlassian.crowd.integration.authentication.ObjectFactory.class,ObjectFactory.class,com.atlassian.crowd.integration.model.ObjectFactory.class,com.atlassian.crowd.integration.model.user.ObjectFactory.class,com.atlassian.crowd.integration.exception.ObjectFactory.class,java.rmi.ObjectFactory.class,com.atlassian.crowd.integration.soap.ObjectFactory.class,java.lang.ObjectFactory.class})
> @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
> public interface SecurityServerPortType {
> {noformat}
> where java.rmi.ObjectFactory.class and java.lang.ObjectFactory.class were not generated!
> maybe i did it completely wrong...

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