Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of WCF programming Application

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains the "WCF programming application example analysis", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "WCF programming application example analysis" bar!

Run the WCF programming application in the background. When prompted, click the OK button to activate debugging in Web.config. Enter a number in the console application window and press enter to show a simple WCF service and client program as shown in the following figure.

Try it: a simple WCF service and client

Perform service operations on WCF asynchronous invocations

A brief introduction to the WCF Framework Service Model

Expound the relevant experience of WCF learning

Detailed analysis of the use of WCF controls

Correct handling of WCF files and solutions

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

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

(3) WCF programming: click the Build Solution option on the Build menu.

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

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

(6) WCF programming: start developing the Web server. After loading the information of the WCF service, expand the reference and view its details, as shown in the figure

(7) WCF programming: click the OK button to add a service reference.

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

Using System

Using System.Collections.Generic

Using System.Linq

Using System.Text

Using Ch45Ex01Client.ServiceReference1

Namespace Ch45Ex01Client

{

Class Program

{

Static void Main (string [] args)

{

String numericInput = null

Int intParam

Do

{

Console.WriteLine (

"Enter an integer and press enter to call the WCF service."

NumericInput = Console.ReadLine ()

}

While (! int.TryParse (numericInput, out intParam))

Service1Client client = new Service1Client ()

Console.WriteLine (client.GetData (intParam))

Console.WriteLine ("Press an key to exit.")

Console.ReadKey ()

}

}

}

Thank you for your reading, the above is the content of "WCF programming application example analysis", after the study of this article, I believe you have a deeper understanding of the WCF programming application example analysis of this problem, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report