How to use ASP. net ajax to access Web Services (1)

Source: Internet
Author: User

Web Services

Use a client script to call ASP. NET Web services (. asmx and Windows Communication Foundation (WCF) services (. svc ). script Reference is automatically added to the page, and they automatically generate the Web service proxy class, you can use the client script to call the Web service from here.

You can also access ASP. NET Web Servicce does not use ASP. net ajax server controls (for example, if you use different Web development environments ). in this way, you can reference the Microsoft AJAX Library, reference the script file, and configure your own Web service. ASP. NET generate proxy class call service.

ASP. NET Web services is a method called HTTP under the component. Next you will learn how to create a Web service and how to use client scripts to call WebSerice in an AJAX-enabled Web application.

Using Web Services in ASP. NET AJAX

In fact, ASP.. net ajax uses client scripts to call the service. This service includes both the services defined by the user and the application services. application Service in ASP. net ajax, including authentication, roles, and profile services.

You can also create Web Services in ASP. NET Web Services or Windows Communication Foundation (WCF) services (. svc services ).

I. Application scenarios

You use WCF and ASP. NET with the following case:

A. If you have created a WCF Service, you can add it to the AJAX-enabled Web pages page of the terminal to allow access to the service;

B. If you have created ASP. NET Web (. asmx) services, you can modify them to allow scripts to access the same service;

C. If you want to use a script on ASP. net ajax Web pages to access your own custom service, you can implement it like a WCF service or an ASP. NET Web service;

D. You can use the services built by ASP. NET application to access the authentication, roles, and profile information of the AJAX-enabled Web page user.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.