我想从以下WSDL生成一些java代码:http://www.ebi.ac.uk/Tools/services/soap/emboss_needle?wsdlwsimport:当XSD嵌入到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.