我想問 .net 結構入面既 web service 同 web forms

2007-10-19 7:20 am
我想問呢二個有咩分別...不明...

唔該晒

回答 (2)

2007-10-19 8:53 am
✔ 最佳答案
Reference of web service in .NET
http://msdn2.microsoft.com/en-us/library/aa480728.aspx#wsmsplat_topic2

Web services are based on a core set of standards that describe the syntax and semantics of software communication: XML provides the common syntax for representing data; the Simple Object Access Protocol (SOAP) provides the semantics for data exchange; and the Web Services Description Language (WSDL) provides a mechanism to describe the capabilities of a Web service. Additional specifications, collectively referred to as the WS-* architecture, define functionality for Web services discovery, eventing, attachments, security, reliable messaging, transactions, and management.

Web form link:
http://msdn2.microsoft.com/en-us/library/65tcbxz3(VS.71).aspx
Web Forms are the dynamic web interface to allow users to interacte with the web applications or web services.

The difference is web forms provided an interface layer for the users to use the web services. .Net also provided a rich library for web application programmers to build web forms. Web services involved the main program and the data interpretation and the web forms provided a user friendly interface to users who want to use the web services.
2007-10-19 4:11 pm
A simple example of Web Service.

Suppose you have an on-line shop that accepts Visa card payment. When the customer sends in his credit card number and expiry date, your program needs to validate if the card is valid. You cannot access Visa Card Company's database, of course. How can you validate the customer's credit card?

Visa Card Company can provide a web service. You can just think of a web service as a function like this in VB:

Function ValidateCard(ByVal CardNumber As String, ByVal ExpiryDate As String) As Boolean
If the card info is valid Then
Return True
Else
Return False
End If
End Function

This piece of code is located on Visa Card Company's web server, which can be thousands of miles away from your on-line shop server.

Your process-payment page may have codes like this:

If VisaCard.ValidateCard("1234567890123456", "0709") = True Then
payment is successful
Else
payment is not successful
End If

When the customer submits his credit card information, you call Visa Card's web service, that is, a remote function call.

Web service is not a human interface, it is not a web page. It is an interface for computer programs.

A web form, on the other hand, is an interface for human beings. It can be used to input data, like a shopping card. It can also be used only to display data.

The difference is web service is for computer programs and web forms are for human beings.


收錄日期: 2021-04-13 14:00:16
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20071018000051KK04232

檢視 Wayback Machine 備份