tailieunhanh - Network Programming in .NET With C# and Visual Basic .NET phần 10

Chọn tab Thiết kế mẫu, và loại bỏ các hộp văn bản (tbMessage) từ biểu mẫu. Bây giờ kéo vào hai hộp văn bản có tên là tbName và tbOccupants. Nếu bạn muốn, bạn có thể sử dụng các nhãn để chỉ ra những gì mỗi hộp văn bản được sử dụng cho, mặc dù điều này là không cần thiết. Vẽ trên dtArrival Ngày Picker điều khiển được đặt tên | Creating a Web service 485 http ASMX file function name function parameters It is possible to use a GET request to invoke a Web service programmatically but this is ill advised. Using the query string to pass objects is only possible with primitive types and there are better ways to use a Web service programmatically. Another HTTP GET request can be made against the Web service in the form http ASMX file WSDL This displays the formal definition of the Web service in Web Service Definition Language WSDL format. The WSDL definition allows Visual Studio .NET to determine the methods exposed by the Web service and to generate a suitable wrapper or proxy class for it. This step is generally done behind the scenes but for the interested reader it is possible to perform this step manually using the utility provided with .NET. The calling syntax is as follows WSDL http ASMX file WSDL This will generate a C proxy class in the same folder as . To generate a class precede the URL with Language VB. Deploying a Web service Having a Web service running on your local machine is fine for development purposes but in order to make the service meaningful it should be uploaded to a publicly accessible IIS server. Web services that are deployed publicly must have a unique namespace to distinguish them from other Web services on the Internet. Coding convention dictates that the namespace should be in the form of a domain name that you control. The namespace may look like a URL but it does not need to point to anything on the Web in particular. C WebService Namespace http I Chapter 17 486 Using a Web service WebService Namespace http If you want to make it easy for people to find your Web service one of the first places you should advertise it is at http or http . These are public

TỪ KHÓA LIÊN QUAN