根据wsdl调用webservice接口

前端之家收集整理的这篇文章主要介绍了根据wsdl调用webservice接口前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

1、在eclipse中创建一个webservice client

2、测试代码

public static void main(String[] args) {
		SI_YHLC_YHLC1003Proxy oajda = new SI_YHLC_YHLC1003Proxy();
		SI_YHLC_YHLC1003BindingStub oajdaStub = (SI_YHLC_YHLC1003BindingStub) oajda.getSI_YHLC_YHLC1003();
		oajdaStub.setUsername("czx");
		oajdaStub.setPassword("123");
		oajdaStub.setTimeout(300 * 1000);

		try {
			LcSheetInFacade facde = new LcSheetInFacade();
			facde.setFdApplicantJobNum("10005700");
			facde.setFdApplicantPhone("15859445452");
			facde.setFdCostDuringTime("2017-01");
			facde.setFdCostPaymentAmount("5");
			facde.setFdRemarkInfo("ddd");
			GetSheet sheet = new GetSheet();
			sheet.setArg0(facde);
			GetSheetResponse response = oajdaStub.SI_YHLC_YHLC1003(sheet);
			System.out.println(response.get_return().getReturnCode());
		} catch (RemoteException e) {
			e.printStackTrace();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
}

猜你在找的WebService相关文章