org.apache.cxf.binding.soap.SoapFault: SimManagementClient#insert(SimManagementModel) failed and no

最近在写一个调用,对方的接口是webservice接口,我使用的org.apache.cxf.endpoint.Client对象的invoke方法去调用,偶尔出现 org.apache.cxf.binding.soap.SoapFault: SimManagementClient#insert(SimManagementModel) failed and no fallback available. 的错误返回,搜了很多资料没有提到这个错误,自己仔细检查了错误打印 我这里的错误是因为读取超时引起的,因为我并没有在client对象设置超时时间,因此经过重试之后抛出的异常是上面的
解决方法:
	给client对象加上超时设置
在这里插public static Object call(String wsdl,String method,String requestStr){
		JaxWsDynamicClientFactory factory = JaxWsDynamicClientFactory.newInstance();
		// 接口的wsdl地址,加上这个后缀
		Client client = factory.createClient(wsdl);
		HTTPConduit conduit = (HTTPConduit) client.getConduit();
		HTTPClientPolicy policy = new HTTPClientPolicy();
		long timeout = 15000
		policy.setConnectionTimeout(timeout);
		policy.setReceiveTimeout(timeout);
		conduit.setClient(policy);
		//动态invoke方法
		Object[] os =client.invoke(method,requestStr);
		return os[0];
		}

你可能感兴趣的:(org.apache.cxf.binding.soap.SoapFault: SimManagementClient#insert(SimManagementModel) failed and no)