我正在尝试从以下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 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。