Web service essay.
1 Why do I appear web services?
Now the development of the Internet is very rapid, and its previous framework is "people to get resources on the network, such as: programs, documentation, etc.". That is, the current Web is people-centered, people to send a variety of requests. And its development trend will be the main body from "people" steering "procedures", such as media players, browsers, etc., that is, the "Application Center" Web. In fact, before Web Service appears, people have been doing this, such as Java servlet and CGI, but different program systems use different data definitions, so interaction between these systems is abnormal. . The appearance of Web Service is to solve the format issues of communication between different applications.
2 WEB SERVICE communication method?
XML communication has several different ways, such as XML Remote Procedure Calls (XML-RPC), SOAP or HTTP GET / POST.
3 Web Service properties.
The web service is an available service on the Internet, which is implemented by standardized XML communication (XML Messaging) and does not depend on any platform and any programming language.
Although not necessarily, Web Service may have two attributes:
A) Self-described. If you write Web Service, you should release the public interface of the web service, at least one natural language-based document. This way, other developers can easily integrate your service.
B) Discoverable. Others related to your Web Service (may be dispersed, or a concentrated system) can find it.
4 Architecture of Web Service
Web Service has two architectures, one is to discuss each functional role (Role) of Web Service, and the other is a protocol layer of Web Service (Protocol Stack).
For the former, Web Service has three characters: service providers, service requester and service registration agencies. Service Requests get a service provider from the service registration body and then send a request to the service provider.
For the latter, the Web Service has four layers: Service Transport, XML Communication Layer (XML Communication Layer (Service Description), Service Discovery.
A) Service Transportation: Responsible for the transfer between applications. It is now included including HTTP, FTP, SMTP, and newcomers such as Beep and other protocols.
As far as HTTP is relatively simple, stable, and widely used, most firewalls are open to the 80-port of the HTTP protocol, so HTTP is the most popular agreement for service transportation layers. Of course, it will have some security hidden dangers because the HTTP protocol is designed to meet the security of Web Service.
SOAP does not rely on specific protocols, in addition to the HTTP protocol, it can also be transmitted by FTP, SMTP, and relatively promising is the BEEP (Blocks Extensible Exchange Protocol) protocol. The Beep protocol belongs to TCP, which is more than HTTP's advantage in that it takes only 30 bytes per belonging in addition to the TCP public handshake. B) XML communication layer: The information is responsible for encoding the information in a universal XML format. Now includes XML-RPC and SOAP.
C) Service Description Layer: Responsible for using WSDL to describe the common interface to a specific Web Service.
D) Service Discovery Layer: Responsible for focusing on public registration agencies, and providing Web Service publishing and looking for functions, and now the service discovery is implemented through UDDI (Universal Description, Discovery, and Integration
).
It can be seen that the Web Service uses a similar network hierarchical structure that makes each level of functionality to interfere with each other, and it can cooperate well. Of course, with the continuous development of Web Service, there may be a new level.
We can look at the IBM's demo:
http://awwebx04.alphaworks.ibm.com/ettk/demos/wstkdoc/readme.htm
I am registered with Microsoft UDDI: http://uddi.microsoft.com
Let's take a look at the XML request
Here is a Java's SOAP call:
SOAP REQUEST:
XML Version = '1.0' encoding = 'UTF-8'?>
XMLns: soap-env = "http://www.w3.org/2001/09/soap-envelope/" XMLns: xsi = "http://www.w3.org/2001/xmlschema-instance" XMLns: xsd = "http://www.w3.org/2001/xmlschema"> XMLns: ns1 = "URN: EXAMPLES: WeatherService" SOAP-ENV: EncodingStyle = "http://www.w3.org/2001/09/soap-encoding/"> ns1: getWeather> Soap-env: body> Soap-env: envelope> SOAP RESPONSE: XML Version = '1.0' encoding = 'UTF-8'?> XMLns: soap-env = "http://www.w3.org/2001/09/soap-envelope/" XMLns: xsi = "http://www.w3.org/2001/xmlschema-instance" XMLns: xsd = "http://www.w3.org/2001/xmlschema"> SOAP-ENV: EncodingStyle = "http://www.w3.org/2001/09/soap-encoding/"> ns1: getWeatherResponse> Soap-env: body> Soap-env: envelope> And below is .NET called SOAP SOAP REQUEST: XML Version = "1.0" encoding = "UTF-8"?> 12 b> Add> soap: body> soap: envelope> SOAP RESPONSE: XML Version = "1.0" encoding = "UTF-8"?> Addresponse> soap: body> soap: envelope> It can be seen that XML communications is indeed a way to be related to the platform. WSDL: I think it is a public interface of an application. Recall that when we call a web service, we know its method, parameter, and return value in advance, but how to implement it, we don't care, this is not Do we usually say the interface? So WSDL is a public interface provided by XML format Web Service. UDDI: There are three data from UDDI: A) White pages. Basic information of the company B) Yellow pages. Basic information of the service C) green page. The technical information of the service, the address of the service. 4 What is soap? With W3C, it is nothing wrong with it. It is not officially recognized by the W3C. Even SOAP 1.1 is just Note's status, meaning it is now discussed by W3C members.