我在这里找到了解决方案,如果有人在将来需要它:
1.将此插件添加到pom.xml
org.apache.cxf
cxf-codegen-plugin
${cxf.version}
generate-sources
generate-sources
${basedir}/src/main/java
${basedir}/src/main/resources
*Service.wsdl
${basedir}/src/main/resources/your_wsdl.wsdl
-client
-impl
-server
-verbose
-validate
${basedir}/src/main/resources/binding.xml
wsdl2java
2.编写自定义绑定(binding.xml)
xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
node="wsdl:definitions/wsdl:types/xs:schema[@targetNamespace='http://wsdl/SendService.wsdl']">
xmlns:xs="http://www.w3.org/2001/XMLSchema">
运行’mvn生成源’