2

我正在使用wsimportAnt 任务:

<target name="wsimport">
    <wsimport
        verbose    = "true"
        destdir    ="${javasource-auto-wsimport.dir}"
        package    ="${wsimport-package.name}"
        xnocompile ="true"
        wsdl       ="${wsdl.file}"
    />
</target>

并收到以下警告:

[wsimport] Consider using <depends>/<produces> so that wsimport won't do unnecessary compilation
[wsimport] JAX-WS RI 2.2.8
[wsimport] command line: wsimport -d /playground/jax-ws/client/src-auto-wsimport -Xnocompile -verbose wsdl-auto/MyService.wsdl -p foo.client
[wsimport] parsing WSDL...
[wsimport] 
[wsimport] 
[wsimport] [WARNING] unknown extensibility element or attribute "ns1" (in namespace "http://www.w3.org/2000/xmlns/")
[wsimport]   line 17 of file:/playground/jax-ws/client/wsdl-auto/IHello.wsdl
[wsimport] 
[wsimport] [WARNING] unknown extensibility element or attribute "ns2" (in namespace "http://www.w3.org/2000/xmlns/")
[wsimport]   line 18 of file:/playground/jax-ws/client/wsdl-auto/IHello.wsdl
[wsimport] 

现在,<depends>/<produces>我知道如何处理的东西——这是我担心的两个警告。它抱怨的行(IHello.wsdl 文件的第 17 和 18 行)是:

  <input ns1:Action="http://zar.bar.foo/IHello/sayHelloRequest" message="tns:sayHello" xmlns:ns1="http://www.w3.org/2007/05/addressing/metadata"/>
  <output ns2:Action="http://zar.bar.foo/IHello/sayHelloResponse" message="tns:sayHelloResponse" xmlns:ns2="http://www.w3.org/2007/05/addressing/metadata"/>

似乎该工具无法识别ns1ns2正确声明了命名空间前缀。

当我从命令行调用该wsimport工具时,我没有收到任何警告:

$ /usr/lib/jvm/java-7-oracle/bin/wsimport -version
JAX-WS RI 2.2.4-b01
$/usr/lib/jvm/java-7-oracle/bin/wsimport -d src-auto-wsimport/ -p foo.client  -Xnocompile wsdl-auto/MyService.wsdl
parsing WSDL...



Generating code...

我的问题是:

  1. 为什么会出现差异?
  2. 考虑到差异,我应该使用该工具的命令行版本wsimport还是基于 Ant 任务的工具?
  3. 为什么我会收到这些警告?
4

0 回答 0