ASP.NET Web Services

2012 年 11 月 18 日7570

MSDN

12 out of 31 rated this helpful -

ASP.NET Web Services

Other Versions

Visual Studio 2008

Visual Studio 2005

Note

Note

This topic pertains to a legacy technology. XML Web services and XML Web service clients should now be created using Windows Communication Foundation.

Web services are components on a Web server that a client application can call by making HTTP requests across the Web. ASP.NET enables you to create custom Web services or to use built-in application services, and to call these services from any client application. We suggest the following progression of documentation to help you navigate through the related topics.

Getting started

Creating and using Web services

Creating and using Web services in AJAX

Using application services in AJAX

Using application services as WCF services


Other Resources

Web Services in ASP.NET AJAX

Community Content

Add

Annotations

FAQ

TempConvert

The following operations are supported. For a formal definition, please review the Service Description.

CelsiusToFahrenheit

FahrenheitToCelsius

This web service is using http://http://www.zjjv.com/// as its default namespace.

Recommendation: Change the default namespace before the XML Web service is made public.

Each XML Web service needs a unique namespace in order for client applications to distinguish it from other services on the Web. http://http://www.zjjv.com/// is available for XML Web services that are under development, but published XML Web services should use a more permanent namespace.

Your XML Web service should be identified by a namespace that you control. For example, you can use your company's Internet domain name as part of the namespace. Although many XML Web service namespaces look like URLs, they need not point to actual resources on the Web. (XML Web service namespaces are URIs.)

For XML Web services creating using ASP.NET, the default namespace can be changed using the WebService attribute's Namespace property. The WebService attribute is an attribute applied to the class that contains the XML Web service methods. Below is a code example that sets the namespace to "http://http://www.zjjv.com///webservices/":

C#[WebService(Namespace="http://http://www.zjjv.com///webservices/")]

public class MyWebService {

// implementation

}

Visual Basic<WebService(Namespace:="http://http://www.zjjv.com///webservices/")> Public Class MyWebService

' implementation

End Class

C++[WebService(Namespace="http://http://www.zjjv.com///webservices/")]

public ref class MyWebService {

// implementation

};

For more details on XML namespaces, see the W3C recommendation on Namespaces in XML.

For more details on WSDL, see the WSDL Specification.

For more details on URIs, see RFC 2396.

History

5/27/2011

Gaurav Badhani

0 0