Bước 2: Mã để lấy dữ liệu giá cổ phiếu / / Mã đi ở đây (không được hiển thị) / / Bước 3: Trở về q trở lại Trích dẫn dân cư đối tượng; / / Quay trở lại một đối tượng dân cư Trích dẫn}} Phần còn lại của dịch vụ Web SOAPService là tiêu chuẩn, như đã được trình bày trong Chương 3, với ví dụ StockTrader dịch vụ Web. | CHAPTER 8 SOAP MESSAGES ADDRESSING MESSAGING AND ROUTING 193 Step 2 Code to retrieve stock quote data Code goes here not shown Step 3 Return a populated Quote object return q Return a populated Quote object The rest of the SOAPService Web service is standard as was presented in Chapter 3 with the StockTrader Web service example. The only significant difference is this addition of the SoapActor attribute to the Web service methods. Overview of the SOAPRouter The SOAPRouter implements a configuration file called the referral cache which stores destination endpoints for the message to be routed to. Listing 8-13 provides an example of a referral cache for a chain SOAP router that forwards incoming messages on to a single backend service. Listing 8-13. The Referral Cache Configuration File xml version r referrals xmlns r http ws 2001 10 referral r ref r for r exact http localhost SOAPRouter r exact r for r if r go r via http localhost SOAPService r via r go r refId uuid fa469956-0057-4e77-962a-81c5e292f2ae r refId r ref r referrals This configuration file is stored as a separate configuration file within the SOAPRouter project. In order to find it you also need to update the project s or files to point to the location of the referral cache file. Listing 8-14 provides an example of how to update the file. You do not need to do most of this work manually. Instead you can use the WSE Settings Tool to implement most of these tags. Note that the Settings Tool has a limitation when it comes to specifying the httpHandler in that it does not allow you to type a custom path in this case . So you will need to accept the default path of .ashx and then update the actual path once you have applied the settings to the file. 194 CHAPTER 8 SOAP MESSAGES ADDRESSING MESSAGING AND ROUTING Listing 8-14. The SOAPRouter File Including Location of Referral Cache