靈魂-放水

          為學(xué)日益,為道日損。

          BlogJava 首頁(yè) 新隨筆 聯(lián)系 聚合 管理
            296 Posts :: 10 Stories :: 274 Comments :: 0 Trackbacks
               cnblogs里有篇帖子http://idior.cnblogs.com/articles/436801.htmlApplied WSE 3.0 to Web Service Project ),對(duì)于學(xué)習(xí)WS-Addressing是篇不錯(cuò)的帖子。按照此貼的方法進(jìn)行,在追蹤Soap消息時(shí),拋出異常。在未開(kāi)啟Client端WSE功能時(shí),Soap Toolkit 3.0能追蹤到soap消息,而且,response顯示了wse的特性。

             
                為了使用Soap Toolkit 3.0,我們?cè)赪S client端輸入的目標(biāo)地址為:http://localhost:8080/WSEWebService/Service.asmx
                Soap Toolkit 3.0設(shè)置為:
                 
                 Listen
                 Local port:8080

                 Forward to
                 Destination:localhost
                 Destination:80
                 之所以這樣設(shè)置,因?yàn)樵贗IS里設(shè)置的本機(jī)Web Services為:http://localhost:80/WSEWebService/Service.asmx。Soap Toolkit 在8080端口監(jiān)聽(tīng)來(lái)自client端的消息,并將消息遞交到IIS監(jiān)聽(tīng)的80端口。

                 可當(dāng)開(kāi)啟client端wse功能時(shí),拋出如下異常:

          Microsoft.Web.Services3.Addressing.AddressingFault: Destination Unreachable ---> System.Exception:

          WSE816:

          The <To> header must match the value of an incoming message's HTTP Request Url if the soap receiver does not have an actor name.

          The <To> header received contained "http://localhost:8080/WSEWebService/Service.asmx"

          while the HTTP Request Url was "http://localhost/WSEWebService/Service.asmx".


                  查看 Soap Toolkit 監(jiān)聽(tīng)到的SOAP消息可以發(fā)現(xiàn),Request消息的SoapHeader中, 目標(biāo)地址仍然為<wsa:To>http://localhost:8080/WSEWebService/Service.asmx</wsa:To> ,而不是<wsa:To>http://localhost:80/WSEWebService/Service.asmx</wsa:To>.因此,destination不可達(dá),拋出如上異常。
                   在網(wǎng)上查了資料發(fā)現(xiàn):
                    “

          WS-Addressing moves the destination URL of the message into the message to enable routing and scenarios where messages are delivered over multiple protocols. Before WS-Addressing the URL of the destination was only available in the protocol part of the message. Is you were sending a SOAP message over HTTP, the URL was stored in the HTTP part of the message. You had no access to the URL from within your SOAP processor – unless your Web server vendor chose to give you access to the HTTP headers.

          Now with WS-Addressing built into WSE, the Web service platform can actually determine if a message was indeed intended for the service that received it because WSE adds the <to> element to the header of the SOAP message:

                <wsa:To xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing">

          http://MyServer/MyService/Service.asmx</wsa:To>

          WSE is actually being smart about the header and rejects messages where the destination in the <wsa:To> header and the URL in the HTTP header do not match.

          One unfortunate consequence of this behavior is that you cannot use transparent tracing tools like tcpTrace and MSSoapT for message debugging. These tools act like an intermediary receiver and they do cause the URLs in the <To> header and in the HTTP header to not match.

          ”,大概意思也就是MSSoapt(Soap Toolkit )不支持WSE中WS-Addressing<wsa:To>。所以在調(diào)試WSE提供的特性時(shí),不能再用 tcpTrace或者MSSoapT這樣的工具來(lái)追蹤Soap消息。

                   不過(guò),好的消息是,WSE從2.0開(kāi)始就提供了可以追蹤到SOAP消息的診斷工具。


          勾選Enable Message Trace,在調(diào)試過(guò)程中,將生成InputTrace.webinfo和OutputTrace.webinfo文件,里面記錄了我們想要的信息,到此,不需要借助其他Trace工具便可追蹤到Soap消息。
                  
          posted on 2008-01-11 10:17 放水老倌 閱讀(1439) 評(píng)論(0)  編輯  收藏 所屬分類: Web Services&SOA
          主站蜘蛛池模板: 南昌市| 上蔡县| 本溪市| 正蓝旗| 菏泽市| 馆陶县| 平顺县| 东明县| 平南县| 大埔县| 南乐县| 景德镇市| 康平县| 大渡口区| 枝江市| 石狮市| 忻州市| 新和县| 合江县| 二手房| 德保县| 海原县| 安阳市| 金堂县| 麟游县| 彭泽县| 凯里市| 贺兰县| 长宁县| 高台县| 霍林郭勒市| 临漳县| 富民县| 太原市| 军事| 江阴市| 灯塔市| 抚宁县| 三穗县| 龙川县| 阜宁县|