Web Service, WebService

Source: Internet
Author: User

Web Service, WebService
Appears

 

Browser-based client applications are becoming increasingly popular. From the perspective of development, on the one hand, the installation and configuration of Client browsers no longer require us to spend a lot of energy; the other party is responsible for communication between the client and the server.

 

Traditional Windows client applications use DCOM to communicate with servers and call remote objects. However, using DCOM to complete communication is particularly cumbersome and inconvenient. In this case, the http protocol perfectly solves the communication problem between the client and the server, this is because all web browsers running the task are using the http protocol. At present, many firewalls are configured to only allow HTTP connections.

 

In addition to communication, applications also have a serious problem, that is, the interoperability of heterogeneous systems. If all applications are on the same platform or language, this problem will not occur, but this is not the case. COM or. the NET language also writes applications written in C ++, Java, VisualBasic, and other languages, all applications written in different languages need to be integrated and interact with each other in a variety of ways. There is no unified application communication standard, which is independent of the platform and language.

 

Therefore, WebService came into being. The Web Service client and server can freely communicate with each other over HTTP, regardless of the platform and programming language of the two programs.

 

What is

 

Since childhood, Web Service is a technology that exposes an api that can be called through the Web. We can directly call the api of this Web Service for development.


In general, WebService is a platform that can be used to build distributed applications that can interoperate with each other. Therefore, the WebService platform is a set of standards that define how applications implement interoperability on the Web. You can use any language you like to write Web Services on any platform you like, as long as we can query and access these services through Web service standards.

 

WebService is a remote calling technology that spans programming languages and operating systems.

 

 

 

Platform technology

 

XML + XSD, SOAP and WSDL are the three major technologies that constitute the WebService platform.

 

XML + XSD:

 

WebService uses the HTTP protocol to transmit data, and uses XML format to encapsulate data (that is, the XML shows which method of the remote service object is called and what parameters are transmitted, and what is the returned result of the service object ). XML is the format of data in the WebService platform. In addition to ease of establishment and analysis, XML has the primary advantage of being platform-independent and vendor-independent. Independence is more important than technical superiority: software vendors will not choose a technology invented by competitors.

 

XML solves the problem of data representation, but it does not define a set of standard data types, let alone how to extend this set of data types. For example, what is the integer number? 16-bit, 32-bit, 64-bit? These details are important for achieving interoperability. XMLSchema (XSD) is a set of standards dedicated to solving this problem. It defines a set of standard data types and provides a language to extend this data type. The WebService platform uses XSD as its data type system. When you construct a Webservice in a certain language (such as VB. NET or C #), to comply with the WebService standard, all the data types you use must be converted to the XSD type. The tool you use may have automatically completed the conversion, but you may modify the conversion process as needed.

 

SOAP:

 

When WebService sends requests and receives results over HTTP, the content and results of the sent requests are encapsulated in XML format, and some specific HTTP message headers are added, to describe the content format of HTTP messages, these specific HTTP message headers and XML content formats are the SOAP protocol. SOAP provides standard RPC methods to call WebService.

 

SOAP protocol = HTTP protocol + XML data format

 

The SOAP Protocol defines the format of SOAP messages. The SOAP protocol is based on the HTTP protocol, SOAP is based on XML and XSD, and XML is the data encoding method of SOAP. The following is a metaphor: HTTP is a common highway, XML is the green isolation belt in the middle and the protection bar on both sides. SOAP is a highway transformed by the isolation belt and protection bar of a Common Highway.


WSDL:

For example, when we go to the store to buy things, we first need to know what is available in the store, and then buy again. The Merchant's approach is to post advertisement posters. The same is true for WebService. To call a WebService, the WebService client must first know where the service address is and how the service can be called, the WebService server first needs to use a WSDL file to describe what services are available in its own house for external calls and what services are (which methods are available in the service and what parameters are accepted by the method, what is the return value), which url is used for the Service's network address, and how the service is called.


Web Services DescriptionLanguage is an XML-based language used to describe WebService and its functions, parameters, and return values. It is a standard format that can be understood by both the WebService client and the server. Because it is based on XML, WSDL is both readable and readable, which is a great benefit. Some of the latest development tools can generate the WSDL document based on your Webservice, and import the WSDL document to generate the proxy code that calls the corresponding WebService.


The WSDL file is stored on the Web server and can be accessed through a url. Before the client calls a WebService, it must know the address of the Service's WSDL file. WebService providers can expose their WSDL file addresses in two ways: 1. Register with the UDDI server to be searched; 2. directly notify the client caller.

 

 

 

Application scenarios

 

The http Communication and cross-platform communication of WebService determine its application scenarios.

 

As mentioned above, many firewalls are configured to allow only HTTP connections, so WebService is used for cross-firewall communication;

 

The cross-language feature of WebService makes it unique in the integration of heterogeneous systems, so it is used to integrate applications of different operating systems in different languages;

 

Web Services implement business logic interoperability. As long as the business logic is "Exposed" and becomes a WebService, any designated partner can call these business logic, regardless of the platform on which their systems run and the development language they use, this field is now widely used in B2B integration. Cross-company business transaction integration is usually called B2B integration. Through WebService, logical business interoperability is achieved, which greatly reduces the time and cost spent on B2B integration, enable B2B integration for many small and medium-sized enterprises that cannot afford EDI;

 

This is essentially the same as the above, and uses the interoperability of WebService. WebService applications can be used to expose functions and data in a standard way, used by other applications to achieve business-Level Reuse.

 

 

Last

 

This article mainly introduces the emergence of WebService in order to solve the problem, introduces the definition and core technology of Web Service, and finally introduces the use cases of Web Service, if you have any questions, please correct them.

 

 

 

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.