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 create Silverlight WCF correctly

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

Share

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

This article introduces the relevant knowledge of "how to create Silverlight WCF correctly". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

If you want to fully understand what Silverlight WCF does, or you can have a stronger understanding of Silverlight WCF by making your own case, most people will encounter a lot of headaches when doing Silverlight WCF, typically the problem of cross-domain access.

When you create a Silverlight WCF application project, VS asks you whether to generate a test page to host Silverlight WCF or automatically create an ASP.NET project to host Silverlight WCF while debugging. If you just do the interaction between the Silverlight WCF interface and the client, use a separate test page to load it, so it's easy to debug, press CTRL+F5 to OK, but if you want to use WCF, or do something dynamic through ASP.NET, then use the ASP.NET project to host it, so you can simulate the effect of loading Silverlight WCF to the site as much as possible.

After creating the Silverlight WCF, you can see that there are two XAML files in the project and corresponding .CS files, one is APP.XAML and the other is the constructor of Page.XAML,APP.XAML.CS that initializes the Silverlight WCF project, and then

You can see that behind new is the class where Page.xaml.cs is located. What he means, of course, is to create a Page example so that your Page is instantiated, much like WINFORM.

After that, I think people who have developed .NET should be familiar with it. It should be noted that, unlike developing ASP.NET, all the code in Silverlight WCF runs on the client side, which may not be used to many people who are used to developing ASP.NET, but if you do WINFORM, forget it.

Try to write a Mini Program to play.

When something is done, of course, it needs to be compiled. After Silverlight WCF is generated, it will generate an APPMAINFEST.XAML under BIN, which is the path to some configurations such as DLL, a DLL, needless to say, the logic code is here. In addition, there will be a XAP, what is this? in fact, it is a compressed package of the two files mentioned just now, which can be opened by the ZIPRAR tool, and it just uses the suffix as XAP, so that when called on the page, SOURCE will point to the XAP package.

As simple as that, you can display Silverlight WCF on WEB by hosting the generated XAP package. Silverlight WCF WCF first taste summary collection

I've been waiting for a stable version of Silverlight WCF for more than a year, but I've been attracted to 3.0BETA since 1.02.0, so I can't help but catch a glimpse of the charm of Silverlight WCF.

What is Silverlight WCF? It's hard to say? Perhaps people who have developed WPF will have a more thorough understanding. Silverlight WCF is like a plug-in extracted by WPF and applied to WEB. Interface development, program part of the development are integrated with the WPF set, however, since it is applied to WEB, naturally follow a lot of WEB rules, so it is also a little different from WPF, at least they are conceptually completely two things, such a comparison is similar to WINFORM and ACTIVEX.

Silverlight WCF can make dazzling client effects like FLASH, and has a perfect development framework. Programmers can easily deal with events in Silverlight WCF and call system libraries, which is incomparable to FLASH. Of course, compared with Silverlight WCF, FLASH may be more handy in animation and vector design.

For the client, Silverlight WCF is basically the same as FLASH, users need to install the corresponding plug-ins on the browser (Silverlight WCF plug-ins are much smaller), showing the same visual impact. So for users, apart from the different plug-ins installed, there does not seem to be much difference, which is also the purpose of MS, as long as users do not think there is any difference between the two or even Silverlight WCF is better, then the convenience for developers is the convenience of MS.

Try to write a Mini Program to play. When something is done, of course, it needs to be compiled. After Silverlight WCF is generated, it will generate an APPMAINFEST.XAML under BIN, which is the path to some configurations such as DLL, a DLL, needless to say, the logic code is here. In addition, there will be a XAP, what is this? in fact, it is a compressed package of the two files mentioned just now, which can be opened by the ZIPRAR tool, and it just uses the suffix as XAP, so that when called on the page, SOURCE will point to the XAP package.

As simple as that, you can display Silverlight WCF on WEB by hosting the generated XAP package. There seems to be too little content to feel the charm of Silverlight WCF. Then try to make a Silverlight WCF with WCF.

What is WCF? As far as I know, WCF is a unified WEBSERVICE-like solution, and WEBSERVICE is a subset of WCF.

He provides more and stronger service solutions.

This is the end of "how to create Silverlight WCF correctly". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

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