RAD Studio for Microsoft .NET
ContentsIndex
PreviousUpNext
ASP.NET Web Services Overview

Web Services is an Internet-based integration methodology that enables applications, independent of any platform or language, to connect and exchange information. Web Services is tightly integrated with the ASP.NET model used for the .NET Framework. Unlike traditional native Windows applications, ASP.NET Web Services applications contain objects and methods that are exposed over the Web using simple messaging protocol stacks. Any client can invoke a Web Services application over HTTP using a WebMethod. Like any method that can be accessed by way of a simple Windows Form application, a WebMethod provides some defined functionality. Unlike other types of methods, however, the WebMethod is accessed by way of a web browser. For more general information about Web Services, refer to the Microsoft .NET Framework SDK Documentation. 

CodeGear provides tools to develop and access ASP.NET Web Services using a variety of techniques. As modular objects, web services can be reused without additional coding. 

The following topics provide a brief introduction to the architecture of ASP.NET Web Services, the basic fundamentals of Web Services communication, and to the files created when you develop ASP.NET Web Services. 

This topic introduces:

  • ASP.NET Web Services Architecture
  • Web Services Prerequisites
  • Web Services Scenarios
  • ASP.NET Web Services Files

 

WebServicesArchitecture 

The major components of the ASP.NET Web Services architecture include a client application, an ASP.NET Web Services application, several files such as code files in the development language, .asmx files, and compiled .dll files. You need a web server to house both ASP.NET Web Services application and the client. Optionally, you might include a database server for storage and access of ASP.NET Web Services data.

Before you begin developing a Web Services application, become familiar with the following concepts:

  • XML (Extensible Markup Language). XML is a user-defined, human-readable structural description of data. Any data, dataset, or document that you intend to send to, or receive from, a web service is formatted in XML.
  • SOAP (Simple Object Access Protocol). SOAP is the standard messaging protocol that is used for communication between web services and their clients. SOAP uses XML to format its messages, and contains the parameters or return values needed by servers and clients.
  • WSDL (Web Services Description Language). WSDL is the language that describes a web service. A web service can be defined in any number of implementation languages. As a single-purpose utility, each web service must publish a description of its interface, which allows clients to interact with it. The WSDL document, at a minimum, describes the required parameters a client must provide and the result a client can expect to receive. The result description typically consists of the return data type.
  • UDDI (Universal Description, Discovery, and Integration). UDDI is an industry initiative that provides a standard repository where businesses can publish web services for use by other companies. The UDDI repository contains links to, and descriptions of, a variety of web services. You can use the UDDI browser in the IDE to locate web services, download WSDL documents, and access additional information about web services and the companies that provide them.

Current web services provide simple information sources that you can easily incorporate into applications, such as stock quotes, weather forecasts, and sports scores. As the demand for access to business logic over the web increases, companies are finding ways of providing their customers with a class of applications to analyze and aggregate information. For example, a financial institution might provide a web service to consolidate and continuously update customer financial information, such as stock portfolio, 401(k), bank account, and loan information for display in a spreadsheet, web site, or a personal digital assistant (PDA). This saves customer from having to manually collect and combine the information on their own. Although much of this information is available through the web today, a web service will simplify accessing and consolidating information and will ensure greater reliability. 

You can use web services for solutions in the following areas:

  • Enterprise Application Integration (EAI). A web service could allow multiple business partners to exchange inventory, order, or financial data, for example, without specifically knowing the precise data layout in which data is stored for each partner. For instance, many customer relationship management (CRM) or other front-end applications store customer data in a format that is not entirely compatible with the way a back-end enterprise resource planning (ERP) system stores its financial or inventory information. However, a sales organization may wish to use its CRM solution to process real-time orders with up-to-date inventory information from the ERP system. A web service could be a solution to managing the transformation of CRM requests to ERP storage and from ERP responses to CRM confirmations.
  • Business-to-business (B2B) integration. Similar to the EAI solution, a B2B solution could take advantage of a Web Services capability to provide cached data for large orders. B2B transactions, unlike business-to-consumer (B2C) transactions, often consist of high-volume transactions that would be prohibitive to execute at the level of a B2C transaction. For instance, a consumer might order one box of pencils from an online stationery store, but a business might order a thousand boxes monthly, with multiple shipping addresses. The scale and complexity of a B2B transaction requires the intervention of a web service to help simplify and process the transaction quickly and with consistency.
  • Business-to-consumer integration. B2C web services typically manage web-based transactions. For example, a web service that allows you to look up postal codes eliminates the need for businesses to create a new program every time the service is included on a web site. Some commerce sites might use web services to help manage currency conversion when taking international sales orders.
  • Mobile (Smart client applications). Because the small footprint of a mobile client requires that memory usage be reserved for only the most important system functions, and because mobile clients are, by definition, linked to the Internet by way of their wireless communication protocols, Web services play a vital role in providing lightweight but powerful applications to mobile devices. Web services allow mobile device users to perform a variety of tasks which require little more than data input at the device and data display of the results. All processing can occur on a remote web service, thus decreasing bandwidth requirements on the mobile device itself.
  • Distributed and Peer-to-Peer. For certain types of distributed and peer-to-peer applications, web services play an important role. If you use distributed computing over an uncontrolled network (such as the Internet) rather than over a LAN or corporate network, you might use web services. Web services do not require state maintenance, thus offering potentially improved performance, particularly where a request-response behavior is not absolutely required. For applications that require strict request-response behavior and high security, you should consider using an older, more controlled model, such as COM or .NET remoting.

Certain files are automatically generated when you create applications with ASP.NET Web Services. These files enable the ASP.NET Web Services to render their services through a web server. The following table lists the files and their descriptions.

File 
Description 
.asmx  
When you create an ASP.NET Web Services application, a text file is automatically generated with the .asmx extension. The required Web Services directive is placed at the top of this file to correlate between the URL address of the web service and its implementation. Within the .asmx file, you add Web Services logic to the methods visible by the client application. The .asmx file acts as the base URL for clients calling the XML web service. This file is compiled into an assembly, along with other files, for deployment.  
code-behind  
When you create an ASP.NET Web Service application, a code-behind file is generated with a language-specific extension. You add your Web Services logic to the public method to process Web Services requests and responses.  
compiled DLL files  
Web Services DLL files provide dynamic services on the web server.  
.wsdl  
This file is generated when you click the Add Web Reference feature to add the web service to your client application. It describes the Web Services interface available to the client.  
.map  
This file enables the discovery of a web service that is exposed on a given server. It also contains links to other resources that describe the web service.  
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!