Java – wsimport ant task and JDK 6

I am trying to generate a web service proxy class using Jax WS, and use the wsimport ant task, similar to this question, with the following follow-up questions:

As far as I know, the updated version of JDK 1.6 includes Jax WS, and the wsimport ant task is in JDK tools Jar file

Why don't ants find this automatically?

Why doesn't eclipse automatically find this?

I found some references using Jax WS and JDK 6, but these seem to be based on copying a separately downloaded Jax WS library and putting it into the JDK ext folder (I assume it is no longer necessary because it is actually bundled with the JDK now)

What is the correct way to use the wsimport task with JDK version 1.6 that already contains Jax WS?

My build XML:

<?xml version="1.0" encoding="UTF-8"?>
<project name="wsproxy">
    <taskdef name="wsimport" classname="com.sun.tools.ws.ant.WsImport" />
    <target name="wsgentest">
        <wsimport
            wsdl="http://localhost/Service?wsdl"
            destdir="bin-gen"
            sourcedestdir="src-gen"
            keep="true"
            verbose="true"
            package="com.ws">
        </wsimport>
    </target>
</project>

Solution

It turns out that the wsimport class in JDK is not actually an ant task, but an actual wsimport command line tool I also misread the package name: com sun. tools. internal. ws.

The actual ant tasks can be found in WebServices tools. Net in the Metro package here Jar You need to put it in the ant lib directory

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>