--引用参考
【使用Spring ws提供的访问webservice技术】
--Spring的WebServiceTemplate访问WebService的方法及其本质原理
[url]https://blog.csdn.net/kkdelta/article/details/7290769[/url]
--spring WebServiceTemplate 调用 axis1.4 发布的webservice
[url]https://www.cnblogs.com/liu-s/p/5677521.html[/url]
--几种常用的webservice客户端和spring集成的方法
[url]https://blog.csdn.net/qiuhan/article/details/49487009[/url]
其它可参考:
1、用SOAP方式调用webservice
[url]http://jackzlz.iteye.com/blog/1998346[/url]
2、WebService中的WSDL详解
[url]http://blog.csdn.net/wenzhi20102321/article/details/68486526[/url]
【使用Spring ws提供的访问webservice技术】
--Spring的WebServiceTemplate访问WebService的方法及其本质原理
[url]https://blog.csdn.net/kkdelta/article/details/7290769[/url]
--spring WebServiceTemplate 调用 axis1.4 发布的webservice
[url]https://www.cnblogs.com/liu-s/p/5677521.html[/url]
--几种常用的webservice客户端和spring集成的方法
[url]https://blog.csdn.net/qiuhan/article/details/49487009[/url]
/**
* 服务接口地址
*/
@Value("${remote.target.net.gateway.url}")
private String serviceUrl;
@SuppressWarnings("rawtypes")
public IResult demoFun(List<Integer> paramA, BigDecimal paramB) {
try {
//demo示例--ws soap请求
Map<String, Object> map = new HashMap<String, Object>();
map.put("paramA", paramA);
map.put("paramB", paramB.toString());
String json = GsonUtils.toJson(map);
logger.info("打印请求远程主机接口地址-->{},参数-->{}", serviceUrl, json);
RemoteAvailableService service = new RemoteAvailableService(new URL(serviceUrl));
RemoteAvailableServiceSoap soap = service.getRemoteAvailableServiceSoap();
RequestResult result = soap.doTargetFun(json);
logger.info("打印请求远程主机接口-->{},返回数据-->{}", "doTargetFun", GsonUtils.toJson(result));
if (result.getResult() == null) {
return DefaultResult.fail("******");
}
//com.alibaba.fastjson
List<Map<String, Object>> list = JSONObject.parseObject(result.getResult().toString(),new TypeReference<List<Map<String, Object>>>(){});
return DefaultResult.success(list);
} catch (Exception e) {
logger.error("******发生错误", e);
return DefaultResult.fail("******");
}
}
其它可参考:
1、用SOAP方式调用webservice
[url]http://jackzlz.iteye.com/blog/1998346[/url]
2、WebService中的WSDL详解
[url]http://blog.csdn.net/wenzhi20102321/article/details/68486526[/url]
版权声明:本文为big1989wmf原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。