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 use ASP.NET AJAX's WCF service

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

Share

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

This article is about how to use ASP.NET AJAX's WCF service. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Now that we have defined all the data needed to run our TODO application, it is time to expose the service to the client as an ASP.NET AJAX-enabled WCF service. For this, we will add a WCF service svc file with ASP.NET AJAX enabled. In the meantime, we will remove the code separation file.

Alternatively, we can add a XML file or a text file and rename the file to ToDoService.svc. Open it using the XML editor and add the directive as follows:

Now we will place the necessary configuration information to run the service in the web.config file. The code is as follows:

Behavior >

Behavior >

EndpointBehaviors >

Behaviors >

Service >

Service >

Services >

System.serviceModel >

Now, right-click the properties on the file and select View in the browser to see the running service. There are a few things that must be mentioned before moving on to the next stage. In some of the features that come with ASP.NET, such as HTTP Context, Session, etc., you need to add a serviceHostingEnvironment and set aspNetCompatibilityEnabled= "true" to enable ASP.NET AJAX's WCF service.

Thank you for reading! This is the end of the article on "how to use ASP.NET AJAX's WCF service". 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