Java Blog for Alex Wan

          Let life be beautiful like summer flowers and death like autumn leaves.

          統計

          留言簿(10)

          BlogJava

          Blogs

          DIV+CSS

          JQuery相關

          友情鏈接

          常去的地方

          數據供應

          閱讀排行榜

          評論排行榜

          [CXF]Spring下設置CXF的WebService客戶端超時時長

          背景:
          在使用WebService的時候,我們可能需要一個備份的WebService服務器.一旦主服務器down了,我們可以使用備份的服務器.那么這里就需要對客服端連接服務器的時間做一個修改.

          在Spring+CXF的WebService環境下,客戶端有兩個時間屬性是可配置的,分別是ConnectionTimeout和ReceiveTimeout.
          ConnectionTimeout--WebService以TCP連接為基礎,這個屬性可以理解為tcp的握手時的時間設置,超過設置的時間長則認為是連接超時.以毫秒為單位,默認是30000毫秒,即30秒.

          ReceiveTimeout -- 這個屬性是發送WebService的請求后等待響應的時間,超過設置的時長就認為是響應超時.以毫秒為單位,默認是60000毫秒,即60秒.


          設置的例子:

           1<?xml version="1.0" encoding="UTF-8"?>
           2<beans xmlns="http://www.springframework.org/schema/beans"
           3    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           4    xmlns:jee="http://www.springframework.org/schema/jee"
           5    xmlns:jaxws="http://cxf.apache.org/jaxws"
           6    xmlns:http-conf="http://cxf.apache.org/transports/http/configuration" 
           7    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
           8           http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.0.xsd
           9           http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
          10           http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd ">
          11        <http-conf:conduit name="{http://impl.service.product.super.com/}ProjectService.http-conduit"> 
          12        <http-conf:client ConnectionTimeout="10000" ReceiveTimeout="20000"/>
          13    </http-conf:conduit> 
          14</beans>
          15

           

          這里需要注意的有幾個地方:
          1:需要指定http-conf名稱空間 xmlns:http-conf=http://cxf.apache.org/transports/http/configuration
          2:指定模式位置: http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd
          3:http-conf:conduit中的name屬性,指定設置生效的服務,如例子中,只對服務名為{http://impl.service.product.sww.com/}ProjectService的服務生效.
          使用下面的設置則會對所有服務生效

          <http-conf:conduit name="*.http-conduit">
                
          </http-conf:conduit>


          更詳細的配置請參考CXF官方文檔:

          http://cwiki.apache.org/CXF20DOC/client-http-transport-including-ssl-support.html

           



          Let life be beautiful like summer flowers and death like autumn leaves.

          posted on 2008-09-04 16:45 Alexwan 閱讀(5653) 評論(26)  編輯  收藏 所屬分類: J2EE

          評論

          # re: [CXF]Spring下設置CXF的WebService客戶端超時時長 2010-01-05 21:47 Emily32Av

          A kind of good information about this good post. The good accomplished custom written essays and the ability to <a href=" http://www.supremeessays.com">buy essay</a> just about this topic is suggested by paper writing services.   回復  更多評論   

          # re: [CXF]Spring下設置CXF的WebService客戶端超時時長 2010-08-16 23:07 credit loans

          Every one remembers that life seems to be not cheap, however some people need cash for various issues and not every one gets big sums cash. Thus to receive fast home loans or short term loan would be a correct solution.   回復  更多評論   

          # re: [CXF]Spring下設置CXF的WebService客戶端超時時長 2010-08-22 23:55 custom research paper

          Actually, it's not hard to buy essay writing service when you are pressured by time to write custom paper. Hence, that's a common thing to search for custom company.   回復  更多評論   

          # re: [CXF]Spring下設置CXF的WebService客戶端超時時長 2010-12-30 10:32 dress

          I can't believe how much of this I just wasn't aware of. Thank you for bringing moreinformation to this topic for me. I'm truly grateful and really impressed  回復  更多評論   

          # re: [CXF]Spring下設置CXF的WebService客戶端超時時長 2011-01-11 21:30 dissertation

          Very oft to get the dotoral level you should purchase thesis summary about this good post and thesis.   回復  更多評論   

          # re: [CXF]Spring下設置CXF的WebService客戶端超時時長 2011-07-06 17:00 buy an essay

          What are essays writing services? These corporations help university students to cope with papers writing and it ought to be available to buy custom essay papers written by experts.   回復  更多評論   

          # re: [CXF]Spring下設置CXF的WebService客戶端超時時長 2011-07-08 16:52 bookmark service

          A lot of business owners say things like: "Whay should I utilize the automatic social bookmarking service?", or "Which way can it assist me? " The answer is easy! Bookmarking submissions options offered by experts can generate more sales at your internet site.   回復  更多評論   

          # re: [CXF]Spring下設置CXF的WebService客戶端超時時長 2011-07-13 05:04 thesis writing service

          Want to have high academic grades? Therefore, all you have to do is to complete the English thesis of premium quality or purchase thesis analysis at the dissertation writing service.   回復  更多評論   

          # re: [CXF]Spring下設置CXF的WebService客戶端超時時長 2011-07-13 08:39 thesis service

          The thesis ideas creating deal can be fascinating but time consuming. Therefore, when some people want to take a rest and perform their fantastic story referring to this topic, they should to find the professional thesis writing service, which would help people all the time.   回復  更多評論   

          # re: [CXF]Spring下設置CXF的WebService客戶端超時時長 2011-07-15 10:47 research papers online

          Lots of different people in the world are searching for specialized custom writing support. Thence, we can propose to buy college essay and be assured, it's a bright decision.   回復  更多評論   

          # cpanel hosting 2011-12-10 01:59 mivpljaipur@gmail.com

          ,我們可以使用備份的服務器.那么這里就需要對客服端連接服務器的時間做  回復  更多評論   

          # cpanel hosting 2011-12-10 02:00 cpanel hosting

          指定設置生效的服務,如例子中,只對服務  回復  更多評論   

          # Latest news 2011-12-12 16:00 Latest news

          the world are searching for specialized custom writing support.   回復  更多評論   

          # re: [CXF]Spring下設置CXF的WebService客戶端超時時長 2011-12-14 01:46 hostgator coupon

          您出示您的文章,信息和能力,給未知的事實是所有的最令人驚訝的因素,我徹底留下深刻的印象。  回復  更多評論   

          # re: [CXF]Spring下設置CXF的WebService客戶端超時時長 2011-12-15 15:57 claim online

          A lot of business owners say things like:   回復  更多評論   

          # re: [CXF]Spring下設置CXF的WebService客戶端超時時長 2011-12-19 19:06 Free online dating

          The thesis ideas creating deal can be fascinating but time consuming.  回復  更多評論   

          # re: [CXF]Spring下設置CXF的WebService客戶端超時時長 2011-12-31 17:02 Exotic Car Rental Miami

          TCP連接為基礎,這個屬性可以理解為tcp的握手時的時間設置,超過設置的時間長則認為是連接超時.以  回復  更多評論   

          # re: [CXF]Spring下設置CXF的WebService客戶端超時時長 2012-01-06 20:18 Logo design

          Not a big fan of the subject but a good read none the less.
            回復  更多評論   

          # re: [CXF]Spring下設置CXF的WebService客戶端超時時長 2012-02-14 01:20 hostgator promo code

          Web服務是一種可以在許多方面使用的工具集。  回復  更多評論   

          # re: [CXF]Spring下設置CXF的WebService客戶端超時時長 2012-02-14 01:21 bluehost coupon 3.95

          Web服務也可以用來實現一個架構,面向服務架構的概念。  回復  更多評論   

          # re: [CXF]Spring下設置CXF的WebService客戶端超時時長 2012-02-14 01:22 best cpanel hosting

          自動化工具,可以幫助創建一個Web服務。  回復  更多評論   

          # re: [CXF]Spring下設置CXF的WebService客戶端超時時長 2012-05-12 17:57 Seo UK

          性可以理解為tcp的握手時的時間設置,超過設置的時間長則認為是連接超時.以毫秒為單位,默認是3  回復  更多評論   

          # re: [CXF]Spring下設置CXF的WebService客戶端超時時長 2012-05-16 11:27 website design india

          This is such a Great resource that you are providing and you give it away for free. It gives in depth information. Thanks for this valuable information.


            回復  更多評論   

          # re: [CXF]Spring下設置CXF的WebService客戶端超時時長 2012-05-28 17:31 Digital Marketing Agency

          待響應的時間,超過設置的時長就認為是響應超時.以毫秒為單位,默認是60000毫秒,即60秒.  回復  更多評論   

          # re: [CXF]Spring下設置CXF的WebService客戶端超時時長 2012-08-07 19:06 best casino

          這個屬性是發送WebService的請求后等待響應的時間,超過設置的時長就認為是響應超時.以毫秒為單位,默認是60000毫秒,即60秒.  回復  更多評論   

          # re: [CXF]Spring下設置CXF的WebService客戶端超時時長 2014-01-22 13:34 Web Design Bangalore

          Thank you for this great blog! Really enjoying every little bit of it and I have you bookmarked to check out new stuff you post.  回復  更多評論   

          主站蜘蛛池模板: 昌都县| 九江县| 买车| 新宁县| 遂昌县| 湖州市| 延津县| 东安县| 涡阳县| 富锦市| 云和县| 孝义市| 双牌县| 象山县| 西宁市| 虞城县| 承德市| 南阳市| 曲阳县| 新郑市| 报价| 文成县| 洛南县| 汾西县| 始兴县| 昭觉县| 陵水| 太谷县| 大城县| 扶余县| 清新县| 舟曲县| 浪卡子县| 通渭县| 商南县| 江北区| 双峰县| 连城县| 报价| 泸溪县| 孙吴县|