Get the App
SLTechnology News&Howtos  ›  Development  › 

Case Analysis of WCF Service Control Program

Shulou Source: shulou.com Published: 2022-06-02 06:41:31 10月03日 Update

This article mainly explains the "WCF service control program case analysis", the content of the article is simple and clear, easy to learn and understand, now please follow the editor's train of thought slowly in depth, together to study and learn "WCF service control program case analysis"!

In this example, a simple Web service and console client are created that are stored on the Web server. We used the default VS template for the WCF service project, which means you don't need to add any code, but use an operation GetData () defined in this default template.

◆ defines WCF service contract

◆ self-storage WCF service

Try it: a simple WCF service and client

(1) create a new WCF service application project Ch45Ex01 under the directory C:BegVCSharp\ Chapter35

(2) add a console application Ch45Ex01Client to the solution.

(3) Click Build Solution option on the Build menu.

(4) right-click Ch45Ex01Client in Solution Explorer and select the Add Service Reference option.

(5) in the Add Service Reference dialog box, click Discover.

(6) start developing the Web server. After loading the information for the WCF service, expand the reference and view its details, as shown in figure 35-2 (the reader's port number may be different from that in this figure).

(7) Click the OK button to add a service reference.

(8) modify the code in Pragram.cs in the Ch45Ex01Client application, as follows:

Thank you for your reading, the above is the content of "WCF service control program case analysis". After the study of this article, I believe you have a deeper understanding of the WCF service control program case analysis, and the specific use needs to be verified by practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Service program control control program instance case analysis analysis application learning application code content client console server template project storage different center right Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Shulou Technology MariaDB MySQL NVidia