WeBService AXIS2 generates interfaces and interface calls based on wsdl files

1. Download the axis2-1.6.2-bin.zip file and unzip it

2. Configure environment variables D:\Development Documents\axis2-1.6.2\bin

3. Add the wsdl file to be converted to the bin directory

4. Shift + right mouse button to open the command window here

5. Enter the command wsdl2java -uri wsdl file name -p file address in the cmd window. For example: wsdl2java -uri B_FScanDF.wsdl -p com.huaxin.serviceclient.bfscandf

6. Interface call

String xmlIn = createXmlin(params);
		String url = params.getString("url");
		String string;
		try {
			BaseStub stub = new BaseStub(url);
			B_FScanDF b_FScanDF = new B_FScanDF();
			b_FScanDF.setInput(xmlIn);
			MonitorHeaderE monitorHeaderE = new MonitorHeaderE();
			string = stub.b_FScanDF(b_FScanDF, monitorHeaderE).getB_FScanDFResult();
		} catch (Exception e) {
			// e.printStackTrace();
			string = "<query type='error'> <error type='cancel'> <error code='internal-server-error' /> <text> 服务发生错误</text> </error> </query>";
		}
		return string;

 

Guess you like

Origin blog.csdn.net/u010445301/article/details/84768148