【发布时间】:2011-12-02 20:59:58
【问题描述】:
我正在尝试从以下 WSDL 生成一些 java 代码:http://www.ebi.ac.uk/Tools/services/soap/emboss_needle?wsdl
$ wsimport -keep "http://www.ebi.ac.uk/Tools/services/soap/emboss_needle?wsdl"
但是它会生成一些JAXBElement<String> 而不是String。所以我尝试使用这里描述的 xjb 绑定:Get rid of JAXBElement in classes generated by wsimport called from ant
<jxb:bindings xmlns:jxb="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="2.0">
<jxb:bindings>
<jxb:globalbindings generateelementproperty="false">
<jxb:javatype name="java.lang.String" xmltype="xs:string"/>
</jxb:globalbindings>
</jxb:bindings>
</jxb:bindings>
但是 wsimport 引发了异常:
$ wsimport -keep -b binding.xjb "http://www.ebi.ac.uk/Tools/services/soap/emboss_needle?wsdl"
[ERROR] The "jxb:globalbindings" customization is not associated with any schema element.
line 6 of file:/home/lindenb/tmp/WS/biostar14996.xjb
XSD 模式嵌入在 WSDL 文档中。我应该为 jxb:schemaLocation 提供什么 URI?我该如何解决这个问题?
谢谢,
P.
【问题讨论】: