我在使用 NetBeans 7.2 为 NetSuite 生成代理类时遇到问题。
WSDL 的位置是https://webservices.netsuite.com/wsdl/v2012_2_0/netsuite.wsdl
添加引用该 WSDL 的新 Web 服务客户端时,我得到以下输出:
ant -f "\\\\network.local\\usersfolders\\roberth\\My Documents\\NetBeansProjects\\JavaApplication2" wsimport-client-netsuite
init:
wsimport-init:
Created dir: \\network.local\usersfolders\roberth\My Documents\NetBeansProjects\JavaApplication2\build\generated-sources\jax-ws
wsimport-client-netsuite:
Created dir: \\network.local\usersfolders\roberth\My Documents\NetBeansProjects\JavaApplication2\build\generated\jax-wsCache\netsuite
command line: wsimport -d "\\network.local\usersfolders\roberth\My Documents\NetBeansProjects\JavaApplication2\build\generated\jax-wsCache\netsuite" -extension -Xnocompile -Xendorsed -keep -s "\\network.local\usersfolders\roberth\My Documents\NetBeansProjects\JavaApplication2\build\generated\jax-wsCache\netsuite" -catalog "\\network.local\usersfolders\roberth\My Documents\NetBeansProjects\JavaApplication2" -verbose "\\network.local\usersfolders\roberth\My Documents\NetBeansProjects\JavaApplication2\xml-resources\web-service-references\netsuite\wsdl" -wsdllocation https://webservices.netsuite.com/wsdl/v2012_2_0/netsuite.wsdl
Missing WSDL_URI
Usage: wsimport [options] <WSDL_URI>
where [options] include:
-b <path> specify jaxws/jaxb binding files or additional schemas
(Each <path> must have its own -b)
Examples:
wsimport stock.wsdl -b stock.xml -b stock.xjb
wsimport -d generated http://example.org/stock?wsdl
\\network.local\usersfolders\roberth\My Documents\NetBeansProjects\JavaApplication2\nbproject\jaxws-build.xml:22: wsimport failed
BUILD FAILED (total time: 0 seconds)
我习惯于 C# 和导入服务参考(阅读我对 Java 中的 ANT 和 Web 服务的经验为零),并且不确定如何继续。谁能指出我正确的方向?
- 编辑 -
经过几次尝试,我能够在 Eclipse 中生成代理类,但是我发现有些类没有生成。进一步的研究发现,原因是我需要能够生成未引用的类型。NetSuite 文档说要在 ant 任务中添加以下内容:
或者作为替代添加 -w -a 到以下命令:java –cp <classpath> org.apache.axis.wsdl.WSDL2Java <url>
但是我通过命令尝试了选项 2wsdl2java.bat -ss -sd
-ap -uri https://webservices.netsuite.com/wsdl/v2012_2_0/netsuite.wsdl
并得到:
Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException
: org.apache.axis2.wsdl.codegen.CodeGenerationException: java.lang.RuntimeExcept
ion: Element QName is null for ExceededRequestSizeFault!
at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGener
ationEngine.java:293)
例外仍在继续,如果需要更多详细信息,请告诉我。