WSDL2Java giving unexpected results when generating client Port interface
-------------------------------------------------------------------------

                 Key: CXF-1078
                 URL: https://issues.apache.org/jira/browse/CXF-1078
             Project: CXF
          Issue Type: Bug
          Components: JAXB Databinding
    Affects Versions: 2.0.2
         Environment: Mac OS/X, JDK5.
            Reporter: Jesse McLaughlin


I was previously using WSDL2Java for XFire 1.2.6, and with XFire this example 
works just fine.  When I switched to CXF the results are quite different and 
don't look right...

I have two files in this test, the WSDL and one XSD file.  The XSD contains 
comments indicating where sections can be commented/uncommented in order to 
show how the results vary unexpectedly.

When WSDL2Java is run on the attached WSDL file (passing the -client arg), the 
generated file 'com/test/testservice/TestPort.java' looks like this:

@WebService(targetNamespace = "http://www.test.com/TestService/";, name = 
"TestPort")
public interface TestPort {

    @ResponseWrapper(targetNamespace = "http://www.test.com/test";, className = 
"com.test.test.GetPersonRes", localName = "getPersonResponse")
    @RequestWrapper(targetNamespace = "http://www.test.com/test";, className = 
"com.test.test.GetPersonReq", localName = "getPerson")
    @WebMethod
    public void getPerson();
}

This is wrong since according to the WSDL the getPerson() operation takes a 
parameter and also returns a parameter.

When the XSD is changed to the use the alternative type definitions as 
indicated in the inline comments, the generated file then becomes:

@WebService(targetNamespace = "http://www.test.com/TestService/";, name = 
"TestPort")
public interface TestPort {

    @ResponseWrapper(targetNamespace = "http://www.test.com/test";, className = 
"com.test.test.GetPersonRes", localName = "getPersonResponse")
    @RequestWrapper(targetNamespace = "http://www.test.com/test";, className = 
"com.test.test.GetPersonReq", localName = "getPerson")
    @WebResult(targetNamespace = "", name = "return")
    @WebMethod
    public com.test.test.GetPersonRes.Return getPerson(
        @WebParam(targetNamespace = "", name = "personId")
        java.math.BigInteger personId
    );
}

Which looks much more like what I want (and also what XFire gave).

It seems that changing the parameter definitions to inherit from an abstract 
base type somehow causes this issue.

For reference, here are the jars on my classpath when I run WSDL2Java:

        cxf-2.0.2-incubator.jar
        cxf-manifest-incubator.jar
        jaxb-api-2.0.jar
        jaxb-impl-2.0.5.jar
        jaxb-xjc-2.0.jar
        jaxen-1.1.jar
        jdom-1.0.jar
        neethi-2.0.2.jar
        stax-api-1.0.1.jar
        stax-utils-20060502.jar
        velocity-1.4.jar
        velocity-dep-1.4.jar
        wstx-asl-3.2.1.jar
        xml-resolver-1.2.jar
        XmlSchema-1.2.jar
        jaxws-api-2.0.jar
        wsdl4j-1.6.1.jar
        geronimo-ws-metadata_2.0_spec-1.1.1.jar
        geronimo-activation_1.1_spec-1.0-M1.jar
        geronimo-annotation_1.0_spec-1.1.jar
        commons-logging-1.1.jar
        log4j-1.2.11.jar


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

Reply via email to