??xml version="1.0" encoding="utf-8" standalone="yes"?>禁断一区二区三区在线,久久久久一区二区,欧美一区日韩一区http://www.aygfsteel.com/askcuix/category/32346.htmlKeep Walking......zh-cnThu, 22 Oct 2009 18:04:12 GMTThu, 22 Oct 2009 18:04:12 GMT60CXF客户端请求超时设|?/title><link>http://www.aygfsteel.com/askcuix/archive/2009/10/22/299433.html</link><dc:creator>Chris.Cui</dc:creator><author>Chris.Cui</author><pubDate>Thu, 22 Oct 2009 14:41:00 GMT</pubDate><guid>http://www.aygfsteel.com/askcuix/archive/2009/10/22/299433.html</guid><wfw:comment>http://www.aygfsteel.com/askcuix/comments/299433.html</wfw:comment><comments>http://www.aygfsteel.com/askcuix/archive/2009/10/22/299433.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/askcuix/comments/commentRss/299433.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/askcuix/services/trackbacks/299433.html</trackback:ping><description><![CDATA[     摘要: 在用WebServiceӞ我们通常都会在客L中设|请求超时的限制Q以避免长时间的去连接不可用的服务器。在CXF的环境中Q提供了两个属性对客户端的时限制q行配置?nbsp; <a href='http://www.aygfsteel.com/askcuix/archive/2009/10/22/299433.html'>阅读全文</a><img src ="http://www.aygfsteel.com/askcuix/aggbug/299433.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/askcuix/" target="_blank">Chris.Cui</a> 2009-10-22 22:41 <a href="http://www.aygfsteel.com/askcuix/archive/2009/10/22/299433.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>数据l定之JAXBhttp://www.aygfsteel.com/askcuix/archive/2009/02/17/255195.htmlChris.CuiChris.CuiTue, 17 Feb 2009 14:22:00 GMThttp://www.aygfsteel.com/askcuix/archive/2009/02/17/255195.htmlhttp://www.aygfsteel.com/askcuix/comments/255195.htmlhttp://www.aygfsteel.com/askcuix/archive/2009/02/17/255195.html#Feedback0http://www.aygfsteel.com/askcuix/comments/commentRss/255195.htmlhttp://www.aygfsteel.com/askcuix/services/trackbacks/255195.html阅读全文

Chris.Cui 2009-02-17 22:22 发表评论
]]>
理解SAXhttp://www.aygfsteel.com/askcuix/archive/2009/02/06/253608.htmlChris.CuiChris.CuiFri, 06 Feb 2009 09:19:00 GMThttp://www.aygfsteel.com/askcuix/archive/2009/02/06/253608.htmlhttp://www.aygfsteel.com/askcuix/comments/253608.htmlhttp://www.aygfsteel.com/askcuix/archive/2009/02/06/253608.html#Feedback0http://www.aygfsteel.com/askcuix/comments/commentRss/253608.htmlhttp://www.aygfsteel.com/askcuix/services/trackbacks/253608.html阅读全文

Chris.Cui 2009-02-06 17:19 发表评论
]]>
WebService之WSDLhttp://www.aygfsteel.com/askcuix/archive/2008/07/04/212597.htmlChris.CuiChris.CuiFri, 04 Jul 2008 07:02:00 GMThttp://www.aygfsteel.com/askcuix/archive/2008/07/04/212597.htmlhttp://www.aygfsteel.com/askcuix/comments/212597.htmlhttp://www.aygfsteel.com/askcuix/archive/2008/07/04/212597.html#Feedback0http://www.aygfsteel.com/askcuix/comments/commentRss/212597.htmlhttp://www.aygfsteel.com/askcuix/services/trackbacks/212597.html阅读全文

Chris.Cui 2008-07-04 15:02 发表评论
]]>
WebService之SOAPhttp://www.aygfsteel.com/askcuix/archive/2008/07/03/212298.htmlChris.CuiChris.CuiThu, 03 Jul 2008 04:47:00 GMThttp://www.aygfsteel.com/askcuix/archive/2008/07/03/212298.htmlhttp://www.aygfsteel.com/askcuix/comments/212298.htmlhttp://www.aygfsteel.com/askcuix/archive/2008/07/03/212298.html#Feedback0http://www.aygfsteel.com/askcuix/comments/commentRss/212298.htmlhttp://www.aygfsteel.com/askcuix/services/trackbacks/212298.html

      SOAPQSimple Object Access ProtocolQ,它是一U标准消息传递协议,通常是Web Service的事实标准。SOAP是以XML为基QSOAP消息格式是由XML Schema模式定义Q通过XML命名I间使SOAPh很强的扩展性?br />       SOAP messageQSOAP XML文实例Q通常通过其他某些|络协议的有效蝲h携带SOAP消息Q例如:HTTP, SMTP, TCP/IP{?br />       WebService可以使用两种消息传递方式:One-Way messagingQ单向消息传递)或者Request/Response messagingQ请?响应消息传递)

 二、SOAP的基本结?br />        SOAP中根元素是Envelope元素。Envelope元素中可以包含多个可选的Header元素Q必d时包含一个Body元素。Header元素必须是Envelope元素的直接子元素Qƈ且要位于Body元素之前?br />
三、SOAP的命名空?br />       SOAP消息可以在Header元素和Body元素中包含若q不同的XML元素Q用唯一的命名空间来标识它们?br />       xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/命名I间定义了标准SOAP元素Q例如:Envelope, Header和Body{)。Header元素的每个头文g都有自己的命名空间?br />
四?SOAP?br />       SOAP header在Web Service中的应用来多Q例如安全性、事务以及其他各U服务方面的大量“标准”文g头。SOAP文g头是扩展SOAP协议的一个功能非常强大的措施QSOAP文g头的扩展性是SOAP得以行q且获得其他协议没有取得成功的另一个原因?br />      
    4.1 actor属?next、ultimate receiver)
          Actor是由SOAP注释定义的,在SOAP 1.2中,actor属性已l被更名为role。Actor属性和XML命名I间l合在一起用,以确定要用哪个代码模块处理具体的Header?br />           Next角色表示消息路径中的下一个节点必d理文件头?br />           Ultimate receiver角色表示只有消息的最l接收方才能处理指定的Header?br />
    4.2 mustUnderstand属?br />           表示处理是否为强制性处理,如果一个节点不能识别某一个强制性HeaderQ那么必定会产生SOAP错误?br />           如果MustUnderstand属性的值是0Q如果应用程序没有能够识别该文g_那么必须删除此文件头?br />
五、SOAP?br />        Body元素要包含应用程序专有的数据或者错误消息。应用程序的专有数据可以是Q意XML数据或者是提供l过E调用的L参数。只有SOAP消息最后的接收方应该处理SOAP Body?br />
六、SOAP消息传递模?br />        SOAP支持四种消息传递模式(RPC/Literal, Document/ Literal, RPC/Encoded, and Document/EncodedQ,但是WS-I Basic Profile只允许RPC/Literal和Document/ LiteralQ不支持SOAP encodingQ因为它会引起严重的互操作性。Literal表示可以ҎXML模式验证XML文档的有效性?br />
       6.1 Document/ Literal消息传递模?br />              Document/ Literal消息传递模式中QSOAP的Body元素包含一个XML格式良好的文段Q?br />
       6.2 RPC/Literal消息传递模?br />              RPC/Literal消息传递模式将Body元素格式化成struct。PRCh消息包含调用的方法名UC输入参数。RPC响应消息则包含返回值和各种输出参数Q或者错误)Q?/p>

SOAPh消息Q?br />
<?xml version="1.0" encoding="UTF-8"?>

<soap:Envelope

 
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"

 xmlns:mh
="http://www.Monson-Haefel.com/jwsbook/BookQuote">

   
<soap:Body>

      
<mh:getBookPrice>

          
<isbn>0321146182</isbn>

      
</mh:getBookPrice>

   
</soap:Body>

</soap:Envelope>

SOAPq回消息

<?xml version="1.0" encoding="UTF-8"?>

<soap:Envelope

 
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"

 xmlns:mh
="http://www.Monson-Haefel.com/jwsbook/BookQuote" >

   
<soap:Body>

      
<mh:getBookPriceResponse>

          
<result>24.99</result>

      
</mh:getBookPriceResponse>

   
</soap:Body>

</soap:Envelope>


        6.3 消息传递模式和消息交换模式
            Messaging ModesQ(RPC/Literal, Document/ Literal, RPC/Encoded, and Document/EncodedQ。消息传递模式通常描述的是SOAP消息的有效负载:即XML文档D|者是q程q程调用对应的参数和q回值的XML表示?br />             Messaging Exchange Patterns (MEPs)QOne-Way and Request/Response MEPs。消息交换模式表C的是消息的向Q而不是消息的内容

七、SOAP错误
       SOAP错误是由消息接收方(消息的中介体或者最l接收方Q生的。只有用的h/响应消息传递模式的时候,才要L收方SOAP错误传递给发送方?br />
       7.1 faultcode元素
            faultcode表示错误错误代码Q包括Client、Server、VersionMismatch和MustUnderstand不同cd?br />             Client表示传递SOAP消息的节点出C错误Q发送错误)Q例如:消息不是一个良好的格式Q或者包含无效数据、缺所期望的信息,接收节点׃产生一个Client错误?br />             Server表示接收到SOAP消息的节点发生故障或者不能处理SOAP消息Q中介体或者最l接收方引v的错误)。例如:当接收节点处理SOAP消息不能q接到数据库{资源,׃产生一个Server错误?br />             VersionMismatch表示接收节点不能识别SOAP消息的Envelope元素的命名空_例如QSOAP 1.1的节Ҏ收到SOAP1.2消息?br />             MustUnderstand表示节点不能识别“MustUnderstand=1”指定的headerQ就会生这个类型的fault?br />             q有一些非标准的错误信息例如:

          <soap:Body>
              
<soap:Fault>
                          <faultcode>wsse:InvalidSecurityToken</faultcode>
                     
<faultstring>An invalid security token was provided</faultstring>
                     
<detail/>
                
</soap:Fault>
          
</soap:Body>


        7.2 faultstring元素
              faultstring表示错误的描qͼ是强制性元素,可以使用Ҏ属性xml:lang表示文本消息使用的语a?br />
        7.3 faultactor元素
              faultactor表示遇到错误q且产生错误的节点,如果错误节点是一个中介节点,那么需要用faultactor元素Q但是如果错误节Ҏ最l接收方Q则该元素可选?br />  
        7.4 detail元素

       如果Body元素的内容生错误,必须包含错误消息的detail元素Q但是如果文件头发生错误Q则不能包含该元?br />
八、SOAP和HTTP
        目前最常用SOAP的传输体是HTTP。大多数HTTP的传输由HTTP GETh和HTTP应答l成的,HTTP GETh指定了请求的面Q可以包含一些参敎ͼHTTP response作ؓ有效负蝲q回到到h斏V另外,HTTP POSTh有效负蝲Q所以适合携带SOAP消息?br />
        8.1 HTTP POST消息传输的SOAP
              HTTP POST消息必须包含SOAPAction文g字头QSOAP1.2?“application/soap+xml”) MIMEcd替换SOAPAction文g头?br />               Content-Type是text/xmlQ表C有效负载是一个XML文。带附g的SOAP会指定mulitpart/relatedQ但是不推荐q样做?br />
        8.2 HTTP响应代码
              200-level的HTTP成功代码包括Q?br />                      200 OK表示消息没有错误Q包含一个正常的SOAP响应消息?br />                      200 AcceptedQ表C成功处理了hQ但是没有SOAP响应数据Q类gvoidq回cd?br />               400-level错误
                     400 Bad RequestQ表CSOAP消息中的HTTPh或者XML格式不正?br />                      405 Method Not AllowedQ如果不是通过HTTP POST方式传递的SOAP消息Q返回此错误?br />                      415 Unsupported Media TypeQtext/xml值包含一个Content-Type文g_否则返回此错误?br />               500 Internal Server ErrorQ当h/响应MEP中的响应消息是SOAP错误Ӟ必须使用此代码?/p>

Chris.Cui 2008-07-03 12:47 发表评论
]]>
WebService复习http://www.aygfsteel.com/askcuix/archive/2008/06/19/209161.htmlChris.CuiChris.CuiThu, 19 Jun 2008 07:03:00 GMThttp://www.aygfsteel.com/askcuix/archive/2008/06/19/209161.htmlhttp://www.aygfsteel.com/askcuix/comments/209161.htmlhttp://www.aygfsteel.com/askcuix/archive/2008/06/19/209161.html#Feedback0http://www.aygfsteel.com/askcuix/comments/commentRss/209161.htmlhttp://www.aygfsteel.com/askcuix/services/trackbacks/209161.html
  • WebService使用开攄协议q行通讯Q?
  • WebService是自描述和自包含的;
  • XML是WebService的基Q?
    WebService是基于XML+HTTP来实现的QHTTP协议是常用的Internet协议QXML语言的独立性ؓ不同q_和不同编E语a之间的数据交换提供了便利QWebService包含了三个重要的元素QSOAP、UDDI、WSDL?br />
  • SOAPQSimple Object Access protocolQ?br /> SOAP表示单对象访问协议,是一U通过Internetq行通讯的协议,SOAP消息是一UXML文Q有其自qXML Schema、命名空间和处理规则?
  • WSDLQWeb Service Description LanguageQ?br /> WSDL表示webservice描述语言Q是一个用于描qWeb服务的文档格式,用来指定客户与具体的web服务通讯时必M用的切的消息格式、Internet协议以及地址?
  • UDDIQUniversal Description, Discovery, and IntegrationQ?br /> UDDI定义了一套标准的Web服务操作ҎQ用于存储、查找有兛_它Web服务应用E序斚w的消息?




Chris.Cui 2008-06-19 15:03 发表评论
]]>
Hessian实例http://www.aygfsteel.com/askcuix/archive/2008/04/24/208293.htmlChris.CuiChris.CuiThu, 24 Apr 2008 05:37:00 GMThttp://www.aygfsteel.com/askcuix/archive/2008/04/24/208293.htmlhttp://www.aygfsteel.com/askcuix/comments/208293.htmlhttp://www.aygfsteel.com/askcuix/archive/2008/04/24/208293.html#Feedback0http://www.aygfsteel.com/askcuix/comments/commentRss/208293.htmlhttp://www.aygfsteel.com/askcuix/services/trackbacks/208293.html        试着写了一个Hessian的例子,是参考caucho官网上的一个exampleQ很单,也没什么实际的意义Q但以领会Hessian的用法?/p>

1、徏立一个Remote Interface

package com.hessian.test;

public interface MathService {
 
    
public int add(int a, int b);

}


   2、Service Implementation
    

package com.hessian.test;

import com.caucho.hessian.server.HessianServlet;

public class HessianMathService extends HessianServlet implements MathService {

   
public int add(int a, int b){
      
return a + b;
   }


}


     官网上的例子是没有实现MathService接口的,而且也能q行成功Q但我觉得有点不合逻辑Q不应该该实现cM为MathService接口暴露lclient端?/p>

3、web.xml
    

<servlet>
   
<servlet-name>math</servlet-name>
   
<servlet-class>
      com.hessian.test.HessianMathService
   
</servlet-class>
</servlet>
<servlet-mapping>
   
<servlet-name>math</servlet-name>
   
<url-pattern>/hessian/math</url-pattern>
</servlet-mapping>


4、Java client
     

public class HessianClientTest {
   
public static void main(String[] args){
       String url 
= "http://localhost:8080/hessiantest/hessian/math";
       HessianProxyFactory factory 
= new HessianProxyFactory();
       MathService math 
= null;
       
try {
           math 
= (MathService)factory.create(MathService.class, url);
       }
 catch (MalformedURLException e) {
           System.out.println(
"occur exception: " + e);
       }

       System.out.println(
"3 + 2 = " + math.add(32));
   }

}


   使用java实现的clientQ通过HessianProxyFactory的create卛_获取到服务接口?/p>

5、python client

from hessianlib import Hessian

url 
= "http://localhost:8080/hessiantest/hessian/math"
proxy 
= Hessian(url)
print "2 + 3 =", proxy.add(23)


   使用python实现的clientQ需加入hessianlib.py?/p>

   以上是一个完整的Hessian实现?/p>

   Spring也提供了对Hessian的集成,若用springQserver端的service实现cd不需实现HessianServletQ用Spring的DispatcherServlet来配|一个Servlet暴露你的服务?br />    web.xml
    

<servlet>
   
<servlet-name>remote</servlet-name>
   
<servlet-class>        
org.springframework.web.servlet.DispatcherServlet
   
</servlet-class>
   
<load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
   
<servlet-name>remote</servlet-name>
   
<url-pattern>/remote/*</url-pattern>
</servlet-mapping>


   q需要在 WEB-INF 目录里创Z个名?remote-servlet.xmlQremoteZ配置的servlet名)的应用上下文?br />    remote-servlet.xml

<bean id="mathService" class=" com.hessian.test.HessianMathService">
</bean>

<bean name="/math"         class="org.springframework.remoting.caucho.HessianServiceExporter">
   
<property name="service" ref=" mathService "/>
   
<property name="serviceInterface" value=" com.hessian.test.MathService "/>
</bean>


server端做以上操作卛_?/p>

client端可以g用之前的操作Q若使用spring则可通过 HessianProxyFactoryBean在客Lq接服务Q在spring的配|中加入Q?/p>

<bean class="com.hessian.test.HessianClientTest">
     
<property name="mathService" ref="mathService"/>
</bean>

<bean id=" mathService "         class="org.springframework.remoting.caucho.HessianProxyFactoryBean">
   
<property name="serviceUrl"             value="http://remotehost:8080/hessiantest/remote/math"/>
   
<property name="serviceInterface" value="com.hessian.test.MathService"/>
</bean>


加入以上的配|后Q就可像使用其他的bean一样去操作了。原来实C个webservice是可以这么简单的?/p>

 



Chris.Cui 2008-04-24 13:37 发表评论
]]>
对于Hessian的一Ҏ?/title><link>http://www.aygfsteel.com/askcuix/archive/2008/04/22/208290.html</link><dc:creator>Chris.Cui</dc:creator><author>Chris.Cui</author><pubDate>Tue, 22 Apr 2008 09:23:00 GMT</pubDate><guid>http://www.aygfsteel.com/askcuix/archive/2008/04/22/208290.html</guid><wfw:comment>http://www.aygfsteel.com/askcuix/comments/208290.html</wfw:comment><comments>http://www.aygfsteel.com/askcuix/archive/2008/04/22/208290.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/askcuix/comments/commentRss/208290.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/askcuix/services/trackbacks/208290.html</trackback:ping><description><![CDATA[        一直都没有Z在项目中ȝ正的体会webserviceQ之前有个项目需提供单webservice的接口,是通过spring对JAX-RPC的实现去暴露服务Q然后用eclipse自动生成WSDL文g以及部vQ就此了事,也没有去q。最q项目不太忙了,想了解一下webserviceQ看看其中的I竟?br />        前几天看了下AXISQ发现这个基于SOAP协议的webservice实现实在是不让hU道。我按照User Guide把example试验了一下,也自己写了个单的例子跑了一下,都成功了Q但让我感觉q样一个webservice太麻烦了Q繁琐的部vQ服务端与客L耗时的解析操作,一U极其笨重的感觉Q据说XFire的实现相对简单,但还没来得及看,改天比较一下?br />        一同事极其推崇HessianQ今天简单看了下Q这是一个基于binary的实玎ͼ看了一个例子,极其的简单,没有了繁琐的部vQ简单的服务调用Q只看了java的,q不清楚用其他的语言如何实现客户端,看了一对于各Uwebservice实现的性能比较Qhessianq远领先于其他的实现QAXIS貌似性能最差。在如此的性能差距下,q有那么多的应用采用AXIS实现Qؓ何?<br />        我认为hessian更适合作ؓ一个独立的异构pȝ的实玎ͼ比如我们公司的品基本是前台采用JAVAQ后台采用C++Q在q种情况下,前后C间如何通讯应该是可以由我们军_的,多半都不会受到客L牵制Q在q种情况下,hessian明显优于AXIS。但是对于部分品需要对其他开发商提供接口Q我觉得hessian׃适用了,不同开发商之间更需要WSDLq种服务描述文gd实现q行规定Q不知道hessian有没有这U服务描q的东西Q暂时还没看刎ͼ服务端的代码通常是不会提供给其它开发商的,q种时候如何去做实现呢Q如果说是通过开发文进行告知,我觉得是不够合理的,q不是一U标准,每个人的表达方式及理解都有差异,隑օ会有错误发生?br />        单看了下hessianQ有q么一Ҏ法,ȝ来说Qhessian的实现更Ҏ让javaE序员去理解Q没有太多的学习成本QAXISq对复杂了点,打算l箋深入的学习一下hessian? <img src ="http://www.aygfsteel.com/askcuix/aggbug/208290.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/askcuix/" target="_blank">Chris.Cui</a> 2008-04-22 17:23 <a href="http://www.aygfsteel.com/askcuix/archive/2008/04/22/208290.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <a href="http://www.aygfsteel.com/" title="狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频">狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频</a> </div> </footer> վ֩ģ壺 <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ɽ</a>| <a href="http://" target="_blank">ɽ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">üɽ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Դ</a>| <a href="http://" target="_blank">̶</a>| <a href="http://" target="_blank">Ƹ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">̶</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">պ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ˮ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ǭ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Զ</a>| <a href="http://" target="_blank">Ͷ</a>| <a href="http://" target="_blank">˱</a>| <a href="http://" target="_blank">Ͷ</a>| <a href="http://" target="_blank">Т</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">֣</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Ͻ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Ƿ</a>| <a href="http://" target="_blank">ǿ</a>| <a href="http://" target="_blank">躣</a>| <a href="http://" target="_blank">Ϫ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ר</a>| <a href="http://" target="_blank"></a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>