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

How to learn WCF

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

Share

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

This article is about how to learn WCF. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

For WCF learning, the technical attitude should be solid. If you are a novice and have enough time, it is recommended that you start from the basics and now understand Enterprise Sevices (COM+). Net Remoting, Web Service (ASMX), WSE3.0 and MSMQ message queues and other related concepts, and then learn WCF technology.

What is WCF:

Some time ago, I learned a little bit of WebService. I felt very advanced, and I was a little proud. As a result, after reading some relevant articles today, I know that WebService has lagged behind, and now what is more advanced is WCF.

So I found the simplest example of WCF to learn. After studying it for half a year, I was still confused and felt more complicated than WebService.

It seems that this thing has to be learned systematically. It is impossible for me to let such advanced technology be missed. You have to learn it!

There is no research head in the stock market recently, so this BLOG is also suitable for writing some study notes. Taking notes can help you organize your thoughts, and at the same time, it can also help some new friends like me to avoid detours, which is a matter of self-interest.

Explanation of WCF Learning nouns

There is no need for me to explain nouns, they are available on the Internet. Here is mainly to sort out the train of thought. WCF is a way of exchanging information between programs. Due to the use of open and rigorous protocol mechanism, WCF can not only provide operations and data across platforms, but also achieve security.

After looking at the sample code learned by WCF, it feels like it's just some classes. Only a prefix such as _ _ has been added to make it public on the network. After creating a new WCF project, what exactly do the two automatically generated files do? Obviously, Service1.VB is a class. It's closed. There are some functions defined in the class to return values, nothing special.

In particular, another file, IService.VB. In terms of name, it is related to Service1.VB, as a matter of fact. In IService, many methods are exposed with the _ prefix. I think it is possible to expose attributes with the same prefix. It seems that this IService file is actually an external interface of the Service class. It specifies which methods and properties are public. This is slightly different from WebService. In addition, in this Service.VB, there is an example of how to return a specific type of value. I think this is probably for the convenience of external reference. As I do not have a good understanding of this paragraph, I will put it aside for the time being and first experiment on how to quote it.

OK, tested successfully with the client-side testing tool that comes with .NET. How to release the experiment now, and how to start the service after release? Does it start automatically or how?

After the release, I generated a WcfServiceLibrary1.dll file under the target folder. I think, as long as this DLL works, the WCF learning service will be started. The question now is how to start the service. If the WCF service is written in a Web site project, you should be able to start the service by adding some lines to the Web.Config. But now I'm just a separate WCF learning service, and there's no launcher to bind, so I should bind it to IIS.

The default way is to bind to IIS. In other words, the service starts automatically as soon as it is released. How convenient. When referencing, it is the referenced svc file, which is a little different from WebService. After testing, the reference is successful. It turns out that WCF is that simple. When the notes are finished, the concept of WCF learning is understood. I see. In the future, we will no longer use WebService, but will all use WCF to study. With such a good thing, we must make good use of it in the future.

Of course, what WCF learns is much more than that. For example, the security mechanism is not yet understood. We will talk about this later, first to solve the actual needs. Next, you should learn a little more about WPF. How to combine these two sharp tools in future programming? the software compiled is really awesome!

Thank you for reading! This is the end of the article on "how to learn WCF". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

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