1.下载axis2,并安装,具体安装方法自行百度;
2.dos环境进入bin文件夹
wsdl2java -uri https://XXXXX.com.cn/xyt/services/AppInfoPushService?wsdl -p com.client -s -o stubwsdl2java -uri https://XX.com.cn/xyt/services/AppInfoPushService?wsdl -p axis2.service.server -o stub
输入命令即可在bin路径下生成有代码
3.使用方法
public static String excute(String requestXml) { String responseXml = ""; try { WebRequestServiceServiceStub stub = new WebRequestServiceServiceStub(); Options options = stub._getServiceClient().getOptions(); //等待接收数据的时间也是 默认60s 修改为90s options.setTimeOutInMilliSeconds(60000*3); stub._getServiceClient().setOptions(options); DoRequestService doRequestService = new DoRequestService(); org.apache.axis2.databinding.types.soapencoding.String xmlinput = new org.apache.axis2.databinding.types.soapencoding.String(); xmlinput.setString(requestXml); doRequestService.setXmlInput(xmlinput); DoRequestServiceResponse doRequestServiceResponse = stub.doRequestService(doRequestService); org.apache.axis2.databinding.types.soapencoding.String result = doRequestServiceResponse.getDoRequestServiceReturn(); responseXml = result.toString(); stub._getServiceClient().cleanup(); } catch (Exception e) { logger.error("调用XXX出错", e); } return responseXml; }