1.通过MessageSender客户化http连接参数

  AbstractHttpWebServiceMessageSender有若干实现子类:

  - CommonsHttpMessageSender(deprecated)

  - HttpComponentsMessageSender

  - HttpUrlConnectionMessageSender

2.CommonsHttpMessageSender

2.1 CommonsHttpMessageSender 需要依赖于Apache httpclient包

<dependency>
  <groupId>commons-httpclient</groupId>
  <artifactId>commons-httpclient</artifactId>
  <version>{version}</version>
</dependency>

2.2 示例源于spring integration sample master

<chain input-channel="fahrenheitChannel" output-channel="celsiusChannel">
  <ws:header-enricher>
    <ws:soap-action value="http://www.w3schools.com/webservices/CelsiusToFahrenheit" />
  </ws:header-enricher>
  <ws:outbound-gateway uri="http://www.w3schools.com/webservices/tempconvert.asmx" message-sender="httpSender"/>
</chain>

<beans:bean id="httpSender" class="org.springframework.ws.transport.http.CommonsHttpMessageSender">
  <beans:constructor-arg name="httpClient">
    <beans:bean class="org.apache.commons.httpclient.HttpClient">
      <beans:property name="httpConnectionManager" ref="httpConnectionManager" />
    </beans:bean>
  </beans:constructor-arg>
</beans:bean>

<beans:bean id="httpConnectionManager" class="org.apache.commons.httpclient.MultiThreadedHttpConnectionManager">
  <beans:property name="params">
    <beans:bean class="org.apache.commons.httpclient.params.HttpConnectionManagerParams">
      <beans:property name="soTimeout" value="5000" />
      <!-- <beans:property name="maxTotalConnections" value="100" />
         <beans:property name="defaultMaxConnectionsPerHost" value="100" /> -->
    </beans:bean>
  </beans:property>
</beans:bean>

3. HttpComponentsMessageSender

3.1 HttpComponentsMessageSender 需要依赖于Apache http components包

<dependency>
  <groupId>org.apache.httpcomponents</groupId>
  <artifactId>httpclient</artifactId>
  <version>4.3.3</version>
</dependency>

3.2 配置相对容易

<ws:outbound-gateway uri="http://www.w3schools.com/webservices/tempconvert.asmx" message-sender="httpComponentsSender" />

<beans:bean id="httpComponentsSender" class="org.springframework.ws.transport.http.HttpComponentsMessageSender">
  <beans:property name="connectionTimeout" value="12" />
  <beans:property name="readTimeout" value="12" />
</beans:bean>

That's it!

Spring Integration - WS Outbound Gateway的更多相关文章

  1. [转] Spring Integration 系统集成

    [From] http://blog.csdn.net/w_x_z_/article/details/53316618 pring Ingegration 提供了基于Spring的EIP(Enterp ...

  2. Spring Integration - 自动轮询发送手机短信

    Spring Integration 配置 <?xml version="1.0" encoding="UTF-8"?> <beans xml ...

  3. spring Integration服务总线

    最新项目中使用数据交换平台,主要通过交换平台抓取HIS数据库医生医嘱检查检验等数据以及FTP上的txt文件,html等病程文件,生成XML文件,之后通过业务系统按业务规则对数据进行处理,再将其存入数据 ...

  4. Spring Integration实现分布式锁

    学习本篇之前,可以先看下文章 什么是分布式锁,了解下基本概念. 之前都是手写一个分布式锁,其实Spring早就提供了分布式锁的实现.早期,分布式锁的相关代码存在于Spring Cloud的子项目Spr ...

  5. Spring Integration概述

    1.   Spring Integration概述 1.1     背景 Spring框架的一个重要主题是控制反转.从广义上来说,Spring处理其上下文中管理的组件的职责.只要组件减轻了职责,它们同 ...

  6. ref:Spring Integration Zip 不安全解压(CVE-2018-1261)漏洞分析

    ref:https://mp.weixin.qq.com/s/SJPXdZWNKypvWmL-roIE0Q 0x00 漏洞概览 漏洞名称:Spring Integration Zip不安全解压 漏洞编 ...

  7. 0.9.0.RELEASE版本的spring cloud alibaba sentinel+gateway网关实例

    sentinel除了让服务提供方.消费方用之外,网关也能用它来限流.我们基于上次整的网关(参见0.9.0.RELEASE版本的spring cloud alibaba nacos+gateway网关实 ...

  8. Spring Cloud 系列之 Gateway 服务网关(二)

    本篇文章为系列文章,未读第一集的同学请猛戳这里:Spring Cloud 系列之 Gateway 服务网关(一) 本篇文章讲解 Gateway 网关的多种路由规则.动态路由规则(配合服务发现的路由规则 ...

  9. Spring Cloud 系列之 Gateway 服务网关(三)

    本篇文章为系列文章,未读第一集的同学请猛戳这里: Spring Cloud 系列之 Gateway 服务网关(一) Spring Cloud 系列之 Gateway 服务网关(二) 本篇文章讲解 Ga ...

随机推荐

  1. 阿里云ECS服务器部署HADOOP集群(一):Hadoop完全分布式集群环境搭建

    准备: 两台配置CentOS 7.3的阿里云ECS服务器: hadoop-2.7.3.tar.gz安装包: jdk-8u77-linux-x64.tar.gz安装包: hostname及IP的配置: ...

  2. linux命令--文件目录操作命令

    一.命令的基本格式 1.命令提示符 [root@love2 ~]# []:这是提示符的分隔符号,没有特殊含义. root:显示的是当前的登录用户. @:分隔符号,没有特殊含义.love2:当前系统的主 ...

  3. LinearLayout适配不同机型技巧

    <View android:layout_width="match_parent" android:layout_height="0dp" android ...

  4. JAVA网络通信底层调用LINUX探究

    前言:该博客花了我一个下午得心血,全部手打,路过给个赞,拒绝抄袭!!!!!!!!!!!!!!!!!!!!!!!!! 简单的SOCKET通信程序 先从一段简单的JAVA程序性开始写起,这里我们才用半双工 ...

  5. 图解 Spring:HTTP 请求的处理流程与机制【4】

    4. HTTP 请求在 Spring 框架中的处理流程 在穿越了 Web 容器和 Web 应用之后,HTTP 请求将被投送到 Spring 框架,我们继续剖析后续流程.Web 应用与 Spring M ...

  6. es3设置属性不能修改

    /*es3*/ { var Person =function () { var data ={ name:'zs', sex:'男', age:18 } this.get=function (key) ...

  7. vue 做一个简单的TodoList

    目录结构 index.html <!DOCTYPE html> <html> <head> <meta charset="utf-8"&g ...

  8. selenium常用命令之页面元素定位

    WebDriver driver= new ChromeDriver();   <input type="text" id="phone" name=&q ...

  9. vi指令详解

    ★ vi的模式(命令模式.插入模式.ex模式) 1)命令模式: 在我们刚刚通过vi新建或打开一个已经存在的文件时,首先默认被读取的模式就是“命令模式”,命令模式的特征就是,在编辑器窗口左下角的位置上没 ...

  10. vscode + platformIO开发stm32f4

    我的电脑环境 win10 vscode 1.36.1 vscode安装插件 安装完这个插件后会提示你安装 platformIOCore,按照提示安装即可.安装过程可能比较缓慢, 可能需要翻墙. 新建项 ...