我是CXF的全新,我试图从WSDL创建一个客户端.过去我已经使用了Metro和Axis.我下载了apache-cxf-2.3.3并使用wsdl2
java来生成客户端存根.我使用Maven并将其设置为我的pom:
2.3.3
org.apache.cxf
cxf-rt-frontend-jaxws
${cxf.version}
org.apache.cxf
cxf-rt-transports-http
${cxf.version}
org.apache.cxf
cxf-rt-ws-security
${cxf.version}
true
org.apache.maven.plugins
maven-compiler-plugin
1.5
1.5
true
true
当我构建项目时,我会收到以下错误:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project client-cxf: Compilation failure: Compilation failure:
[ERROR] \Devel\Projects\Client-CXF\src\main\java\my\webservice\ServiceRuntimeException.java:[38,149] cannot find symbol
[ERROR] symbol : method required()
和
[ERROR] \Devel\Projects\Client-CXF\src\main\java\my\snmpv2\MyService.java:[76,8] cannot find symbol
[ERROR] symbol : constructor Service(java.net.URL,javax.xml.namespace.QName,javax.xml.ws.WebServiceFeature[])
[ERROR] location: class javax.xml.ws.Service
似乎这些问题与生成的代码使用Java 6功能(XmlElementRef的“require”元素,Service的新构造函数)相关,但CXF Maven依赖关系适用于Java 5.
有没有办法指定生成的代码应该符合Java 5?