当前位置: 首页 > news >正文

网站模板下载html免费ftp服务器申请网站

网站模板下载html,免费ftp服务器申请网站,周口在线网站建设,锦州哪家做网站介绍 在Spring Integration的支持下#xff0c;您的应用程序可以使用出站Web服务网关来调用Web服务。 调用由该网关处理#xff0c;因此您只需要担心构建请求消息和处理响应。 但是#xff0c;使用这种方法并不明显#xff0c;如何配置其他选项#xff0c;例如设置超时或操… 介绍 在Spring Integration的支持下您的应用程序可以使用出站Web服务网关来调用Web服务。 调用由该网关处理因此您只需要担心构建请求消息和处理响应。 但是使用这种方法并不明显如何配置其他选项例如设置超时或操作缓存。 本文将展示如何设置客户端超时并将其与网关集成。 本文分为以下几节 介绍。 Web服务调用概述。 配置消息发件人。 示例应用程序。 结论。 源代码可以在github上找到。 Web服务调用概述 Web服务出站网关将Web服务调用委托给Spring Web Services WebServiceTemplate 。 当消息到达出站网关时此模板使用消息发件人以创建新连接。 下图显示了该流程的概述 默认情况下Web服务模板将HttpUrlConnectionMessageSender设置为其消息发送者这是不支持配置选项的基本实现。 但是可以通过设置具有设置读取和连接超时能力的更高级的消息发送者来覆盖此行为。 我们将在下一部分中配置消息发送者。 配置消息发件人 我们将配置消息发件人到出站网关。 这样网关将使用提供的模板设置模板的消息发送者。 我们在示例中提供的实现是HttpComponentsMessageSender类该类也来自Spring Web Services项目。 该消息发件人允许我们定义以下超时 connectionTimeout 设置建立连接之前的超时。 readTimeout 设置基础HttpClient的套接字超时。 这是服务回复所需的时间。 组态 bean idmessageSender classorg.springframework.ws.transport.http.HttpComponentsMessageSenderproperty nameconnectionTimeout value${timeout.connection}/property namereadTimeout value${timeout.read}/ /bean 属性文件包含两个值它们都设置为两秒钟 timeout.connection 2000 timeout.read 2000 配置完成后我们将其添加到Web服务出站网关配置中 int-ws:outbound-gateway urihttp://localhost:8080/spring-ws-courses/courses marshallermarshaller unmarshallermarshaller request-channelrequestChannel message-sendermessageSender/ 要使用此消息发件人您将需要添加以下依赖项 dependencygroupIdorg.apache.httpcomponents/groupIdartifactIdhttpclient/artifactIdversion4.3.3/version /dependency 就是这样 下一部分将显示示例应用程序以查看其工作方式。 样例应用 流程很简单 它包含一个向Web服务发送请求并接收响应的应用程序。 Web服务源代码可以在github上找到。 beans xmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexmlns:contexthttp://www.springframework.org/schema/contextxmlns:inthttp://www.springframework.org/schema/integrationxmlns:int-wshttp://www.springframework.org/schema/integration/wsxmlns:oxmhttp://www.springframework.org/schema/oxmxsi:schemaLocationhttp://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsdhttp://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsdhttp://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsdhttp://www.springframework.org/schema/integration/ws http://www.springframework.org/schema/integration/ws/spring-integration-ws.xsdhttp://www.springframework.org/schema/oxm http://www.springframework.org/schema/oxm/spring-oxm-3.0.xsdcontext:component-scan base-packagexpadro.spring.integration.ws/context:property-placeholder locationclasspath:props/service.properties/!-- System entry --int:gateway idsystemEntry default-request-channelrequestChannel service-interfacexpadro.spring.integration.ws.gateway.CourseService/!-- Web service invocation --int-ws:outbound-gateway urihttp://localhost:8080/spring-ws-courses/courses marshallermarshaller unmarshallermarshaller request-channelrequestChannel message-sendermessageSender/oxm:jaxb2-marshaller idmarshaller contextPathxpadro.spring.integration.ws.types /bean idmessageSender classorg.springframework.ws.transport.http.HttpComponentsMessageSenderproperty nameconnectionTimeout value${timeout.connection}/property namereadTimeout value${timeout.read}//bean/beans 网关包含我们将进入消息传递系统的方法 public interface CourseService {GatewayGetCourseResponse getCourse(GetCourseRequest request); } 最后测试 ContextConfiguration(locations {/xpadro/spring/integration/ws/config/int-course-config.xml}) RunWith(SpringJUnit4ClassRunner.class) public class TestIntegrationApp {Autowiredprivate CourseService service;Testpublic void invokeNormalOperation() {GetCourseRequest request new GetCourseRequest();request.setCourseId(BC-45);GetCourseResponse response service.getCourse(request);assertNotNull(response);assertEquals(Introduction to Java, response.getName());}Testpublic void invokeTimeoutOperation() {try {GetCourseRequest request new GetCourseRequest();request.setCourseId(DF-21);GetCourseResponse response service.getCourse(request);assertNull(response);} catch (WebServiceIOException e) {assertTrue(e.getCause() instanceof SocketTimeoutException);}} }结论 我们已经学习了如何为Web服务出站网关设置其他选项以建立超时。 在下一篇文章中我将解释如何缓存此调用。 翻译自: https://www.javacodegeeks.com/2014/05/spring-integration-configure-web-service-client-timeout.html
http://www.sadfv.cn/news/269128/

相关文章:

  • 网站设计展示建湖哪家专业做网站
  • 北京做网站建设公司哪家好中国诚乡建设部网站
  • 建设集团网站方案设计vk汉化网站谁做的
  • c 网站建设教程视频教程域名注册局官网
  • windows搭建php网站张家港注册公司流程和费用
  • WordPress建站收费seo百度推广
  • 怎么把网站提交设计网站建设常州
  • 在线图片编辑网站源码网站建设中所涉及的所有链接建设
  • 网站条形码如何做北京网站建设推荐q479185700上快
  • 内网做网站泰安关键词优化
  • 农机公司网站建设旅游网站域名应该如何设计
  • 东莞做网站推广软件工程哪个学校最好
  • php网站开发技术要点北京发布重磅消息
  • 三门峡市住房建设局网站给几个网址谢谢
  • 商贸城网站建设方案网站开发的投标案例
  • 睢县做网站网站建设实训分析总结
  • 冯耀宗seo视频教程网站优化的核心不包括
  • h5 和手机网站上海什么做网站的公司比较好
  • 玉树市wap网站建设公司汽车手机网站制作
  • wordpress 大网站wordpress可以商用吗
  • 怎么用域名建网站深圳网站建设外包公司哪家好
  • 红花岗区建设局网站建设银行成都市第九支行 网站
  • 怎么做网站注册推广网站的页面大小
  • 关键词搜索引擎工具怎么样优化关键词排名
  • 个人网站源码php太原新媒体运营公司
  • wordpress邀请码注册江苏seo团队
  • 网站制作流程论文wordpress搬家文章
  • 广东建设部网站海南省住建设厅网站报监
  • 网站投放广告怎么做用discuz做门户网站
  • 一个ip可以做几个网站互联网公司市值