1.使用idea自带webservices 工具生成
打开Tools->WebServices->Generate Java Code From Wsdl
其中Web service wsdl url 填写wsdl地址
output path是输出路径
Package prefix 是包路径
Web Service Platform 选择 Glassfish/JAX-WS 2.2RI/Metro 1.X/JWSDP 2.2
2. 使用wsimport命令生成
wsimport -encoding utf-8 -keep -p com.xxx.xxx -d e:\\ http://xxxx?wsdl
3.使用wsdl2java工具生成 (推荐使用)
下载 http://cxf.apache.org/download.html cxf
配置环境变量 CXF_HOME 且将 %CXF_HOME%\bin添加到path中
#-autoNameResolution 解决“具有相同名称 "com.dataservice.roadtopub.OracleConnection" 的类/接口已在使用。请使用类定制设置来解决此冲突。”错误
wsdl2java -encoding utf-8 -p com.xxx.xxx -d e:\\ -autoNameResolution http://xxxx?wsdl