Java Blog for Alex Wan

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

          導航

          <2008年9月>
          31123456
          78910111213
          14151617181920
          21222324252627
          2829301234
          567891011

          隨筆分類(148)

          文章分類

          隨筆檔案(104)

          統計

          留言簿(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 閱讀(5654) 評論(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.  回復  更多評論   

          主站蜘蛛池模板: 隆子县| 陇南市| 双桥区| 宁武县| 南安市| 阿拉善右旗| 冷水江市| 双鸭山市| 东平县| 仁布县| 沛县| 仁化县| 南汇区| 新龙县| 武清区| 五大连池市| 布拖县| 汽车| 沧州市| 保靖县| 武陟县| 长岛县| 息烽县| 甘泉县| 金川县| 梓潼县| 奇台县| 武安市| 嘉鱼县| 贵港市| 云梦县| 彭阳县| 宜兰县| 丹寨县| 香河县| 铜鼓县| 高尔夫| 丰都县| 隆化县| 泗阳县| 竹溪县|