This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 158594 - wrong schemas type in wsdl for overload methods
Summary: wrong schemas type in wsdl for overload methods
Status: RESOLVED WONTFIX
Alias: None
Product: webservices
Classification: Unclassified
Component: JAX-WS (show other bugs)
Version: 6.x
Hardware: PC All
: P3 blocker (vote)
Assignee: Milan Kuchtiak
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-16 04:01 UTC by leichao
Modified: 2016-07-07 09:54 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
3 files in it for java , wsdl, xsd (1.53 KB, text/plain)
2009-02-16 04:05 UTC, leichao
Details

Note You need to log in before you can comment on or make changes to this bug.
Description leichao 2009-02-16 04:01:48 UTC
1. create a web application
2. start from java,  add web service from scratch
3. add overloaded methods in webservice implementation class
4. right click the webservice node and generate wsdl file

The schema defination is wrong.  

However, when deploy the webservice to glassfish v2,  the wsdl retrieved from it is correct.   The webservice
implementation class and the created wsdl/xsd are attached.
Comment 1 leichao 2009-02-16 04:05:03 UTC
Created attachment 77013 [details]
3 files in it for java , wsdl, xsd
Comment 2 Milan Kuchtiak 2009-02-16 13:21:06 UTC
I don't see any problem with that.
The wsdl file has some provisional elements, like <xsd:import schemaLocation.../> or <soap:address location... />
but these values are replaced by the server during deployment.

What specifically is wrong with the schema definition ?
Comment 3 leichao 2009-02-17 05:45:16 UTC
the wsdl file is correct but the schema file is wrong.  In Java file below, the type of parameter of the 2nd 'print' is
int. this info is missing in xsd.  Also when run jdk 6 tool wsgen, the created schema file is correct and it's different
from what netbeans created.

@WebService()
public class NewWebService {
    @WebMethod(operationName = "print")
    @Oneway
    public void print(@WebParam(name = "parameter") String parameter) {
    }

    @WebMethod(operationName = "print_1")
    @Oneway
    @RequestWrapper(className = "test.print_1")
    public void print(@WebParam(name = "parameter") int parameter) {
    }
}
Comment 4 Milan Kuchtiak 2009-02-17 09:21:20 UTC
I see the attached schema file is strange.

However, I cannot reproduce this issue.
I guess, this must be a problem of particular version of JAX-WS (wsgen) used in your project.
Tested with GlassFish V2 (JAX-WS version used here is 2.1.3.1)

I think, this is not a Netbeans bug but JAX-WS problem.
We bundle Netbeans with JAX-WS 2.1.4 version where wsgen works correctly for this example.

In case of Web Application with GlassFish V2 target server, the libraries(jar files) from server are
used(webservices-tools.jar).
In case of Web Application with Tomcat, the JAX-WS library bundled with IDE is used (jaxws-tools.jar)

Please, can you send the version of JAX-WS used in your application ?
Go to :
Project View -> Libraries -> GlassFish V2 -> webservices-tools.jar -> com.sun.tools.ws package -> version.properties
(you can copy the content of version.properties)
Comment 5 leichao 2009-02-18 03:02:28 UTC
the content of version.properties is below,

build-id=hudson-749
                build-version=JAX-WS RI 2.1.3.1-hudson-749-SNAPSHOT
                major-version=2.1.3.1
Comment 6 Milan Kuchtiak 2009-02-18 09:39:46 UTC
The JAX-WS used in GlassFish is fine.

Finally I found the problem.
It's in the version of JAX-WS api used in JDK1.6.
I wasn't able to reproduce since I used jdk1.5.

Nevertheless, I am going to fix this issue by setting java.endorsed.dirs JVM property to wsgen ant task.
This should be generated automatically.

The workaround is this:
- change the "wsgen-NewWebService" target in nbproject/jaxws-build.xml in a following way:

    <target name="wsgen-NewWebService" depends="wsgen-init">
        <wsgen fork="true" sourcedestdir="${build.generated.sources.dir}/jax-ws"
resourcedestdir="${build.generated.sources.dir}/jax-ws/resources/" destdir="${build.generated.sources.dir}/jax-ws"
xendorsed="true" keep="true" genwsdl="true" sei="test.NewWebService">
            <classpath
path="${java.home}/../lib/tools.jar:${build.classes.dir}:${j2ee.platform.wsgen.classpath}:${javac.classpath}"/>
            <jvmarg value="-Djava.endorsded.dirs=${jaxws.endorsed.dir}"/>
        </wsgen>
    </target>

Note: the "fork" attribute must also be added to force wsgen using another JVM than IDE is running on.

Sorry for inconveniency.
Comment 7 Denis Anisimov 2010-10-28 14:04:02 UTC
The bug is still valid and proposed solution doesn't work.
jaxws.endorsed.dir property is not defined.
Comment 8 Sergey Petrov 2013-04-15 14:44:41 UTC
seems valid for 3.1.2.2 and jdk7.
with suggested sample I got 'int' parameter in xsd only after deployment.
also tried workaround above without success.
Comment 9 Martin Balin 2016-07-07 09:54:10 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss