Tiêu thụ 13,3 XML Web Services tôi đã tạo ra dịch vụ này web mà có các tên người dùng và mật khẩu và trả về True hay False dựa vào việc tên người dùng và mật khẩu kiểm tra. Tôi đã thậm chí đã thử nghiệm dịch vụ Web để đảm bảo rằng nó hoạt động chính xác. | Consume XML Web Services I have created this Web Service that takes the username and password and returns True or False based on whether the username and password check out. I have even tested the Web Service to make sure it works correctly. How do I use or consume this Web Service in another application Technique To use a Web Service you need to create a reference to it. Setting Up the Web Reference to the Web Service To set up a Web reference you choose Add Web Reference from the Project menu. You are then presented with the Add Web Reference dialog box which allows you to browse for Web Services using the Universal Description Discovery Integration UDDI directories as described in the beginning of the chapter. However you will be able to browse to the Web Service you created and supply the name of the full URL using localhost to the name of the .asmx file you created in this case http localhost securitywebservice After you have specified this you will see the methods appear for your Web Service see Figure . Figure . You can test the Web Service right in this dialog box. Note You can see two methods for this Web Service TestUserPassword and GetUserInfo. The second method is discussed in How-To . After you have clicked Add Reference to accept the new reference you can use the methods in your application. You can double-check that the reference is there by looking for it under the Web Reference node that appears in the Solution Explorer see Figure . Figure . You can see the reference created in the Solution Explorer. Calling Web Service Methods After you have created the reference to the Web Service you will create a reference within your application much like you would to other object models. Following is a snippet of code that performs this very task Dim wsSec As wsSec New If Then As you can see the .