当前位置: 首页 > 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.yutouwan.com/news/269128/

相关文章:

  • 建设网站的技术方案八桂云网站建设
  • 图片网站制作网站注册手机号安全吗
  • 做瞹瞹瞹免费网站哪个建设网站好
  • 在excel表里做网站模板室内设计联盟课堂
  • 手机网站设计只找亿企邦动画制作平台
  • 深圳建站公司推荐天津市网站建设
  • 宁夏做网站建设公司常德网站seo
  • 网站端网站开发凡科网微信小程序制作
  • 常州专门做网站的公司有哪些四川seo哪里有
  • seo网站优化推广网站离线浏览器 怎么做
  • 家电网站首页制作网站建设 贴吧
  • 网站域名到期怎么续费个人怎么建立微信公众号
  • 做网站老板嫌弃太丑谁的锅物流网站建设方案
  • 重庆网站建设开发公司大学生网站建设例题答案
  • 建设工程个人信息采集哪个网站用手机做诱导网站
  • 做网站的公司还市场吗公司网站建设知识
  • 慕枫宁波网站建设正规建网站企业
  • 网站域名注册商重庆网站设计制作价格
  • 浙江中钦建设有限公司网站济宁网站建设济宁
  • 营销型网站建设评价个人网站的优点
  • 美容加盟的网站建设濮阳网站注册
  • 天津模板建站定制网站百度网盘app下载安装
  • 网站建设与管理复习知识点搭建门户网站
  • 《网页设计与网站建设》大作业要求家纺 网站模版
  • 网站建设方案书安全性创建自己网站的步骤
  • 大学生兼职网站做ppt网页加速器哪个好
  • 重庆九龙坡区网站建设专业网页制作的帮手
  • 建设银行国际互联网网站笔记本做网站要什么好
  • 学会网站开发有什么好处wordpress域名设置方法
  • 网站排名系统哪个好做平面设计常用的网站