Web service that little thing

Source: Internet
Author: User
Tags soap wsdl

appear

Now browser-based client applications are becoming more popular, and from a development perspective, the client browser installation configuration no longer requires us to spend a lot of effort; the other forest is the problem of communication between the client and the server.

Traditional Windows client applications use DCOM to communicate with the server and invoke remote objects. The use of DCOM to complete communication is a particularly cumbersome and troublesome work, especially inconvenient, in this case,theHTTP protocol perfectly solves the client-server communication problems, This is because the Web browser in which the task runs is using the HTTP protocol, and many firewalls are currently configured to allow only HTTP connections.

In addition to the problem of communication, the application has a particularly serious problem, that is, the interoperability of heterogeneous systems. This problem does not occur if all applications are the same platform or language, but this is not the case, and there are applications written in the COM or. NET language that are written in C + +, Java, VisualBasic, and a variety of other languages. Applications written in all these languages need to be integrated and interact with each other in a variety of different ways. Without a unified application communication standard, it is independent and platform, language.

So webservice came into being, and the Web service client and server were free to communicate with HTTP, regardless of the platform and programming language of the two programs.

is what

from a small age, Web service is a technology that exposes the outside world to a Web of the calling API , we can call this Web service directly. API for development.


From the big say, WebService is a platform that can be used to build interoperable distributed applications. So the WebService platform is a set of standards that defines how applications can interoperate on the web. You can write Web services on any platform you like, in any language you like, as long as we can query and access them through the Web service standard.

To summarize the WebService definition, WEB service is a remote invocation technique that spans the programming language and across the operating system platform.

Platform Technology

Xml+xsd,soap and WSDL are the three major technologies that make up the WebService platform.

Xml+xsd:

WebService transmits data using the HTTP protocol, encapsulating the data in XML format (that is, what method of invoking the remote service object in XML, what parameters are passed, and what the service object returns). XML is the format for representing data in the WebService platform. In addition to being easy to establish and easy to analyze, the main advantage of XML is that it is platform-independent and vendor-independent. Independence is more important than technical superiority: Software vendors do 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, much less how to extend this set of data types. For example, what does shaping number mean? 16-bit, 32-bit, 64-bit? These details are important for interoperability. XmlSchema (XSD) is a set of standards specifically designed to address this problem. It defines a standard set of data types and gives a language to extend this set of data types. The WebService platform uses XSD as its data type system. When you construct a webservice in a language such as vb.net or C #, all the data types you use must be converted to the XSD type in order to conform to the WebService standard. The tool you used may have automatically helped you with the conversion, but you will probably have to modify the conversion process to suit your needs.

Soap:

WebService sends requests and receives results through the HTTP protocol, both the requested content and the resulting content are encapsulated in XML format, and some specific HTTP message headers are added to describe the content format of the HTTP message. These specific HTTP message headers and XML content formats are the SOAP protocol. SOAP provides the standard RPC method to invoke WebService.

SOAP protocol = HTTP protocol + XML data format

The SOAP protocol defines the format of the SOAP message, the SOAP protocol is based on the HTTP protocol, and SOAP is based on XML and XSD, and XML is the data encoding method of soap. A metaphor: HTTP is the normal highway, XML is the middle of the green barrier and both sides of the fence, soap is the ordinary highway through the belt and the fence has been modified highway.


Wsdl:

Like we go to the store to buy things, first of all, we have to know what is in the store to buy, and then to buy, the way the merchant is to put up advertising posters. WebService also, the WebService client to invoke a WebService service, first of all have to know the address of the service where, and what the method can be called in this service, so, The WebService server is the first to use a WSDL file to explain what services in their home can be called externally, what the service is (what methods are available in the service, what parameters are accepted by the method, what the return value is), which URL address the service's network address is represented by, and how the service is invoked.


WSDL (Web Services descriptionlanguage) is an XML-based language that describes WebService and its functions, parameters, and return values. It is a standard format that can be understood by both the WebService client and server side. Because it is XML-based, WSDL is both machine readable and human readable, which is a great benefit. Some of the latest development tools can generate WSDL documents based on your WebService, import WSDL documents, and generate proxy class code that calls the corresponding webservice.


The WSDL file is saved on the Web server and can be accessed through a URL address. Before the client wants to invoke a WebService service, it needs to know the address of the WSDL file for the service. The WebService service provider can expose its WSDL file address in two ways: 1. Register to a UDDI server for lookup; 2. Directly to the client caller.

Application Scenarios

WebService's http Communication and cross-platform determine its application scenarios.

As mentioned earlier, many firewalls are also configured to allow only HTTP connections, so webservice is used to communicate across firewalls;

WebService's cross-language features make it unique in the integration of heterogeneous systems, so it integrates applications from different languages with different operating systems;

WEB Service interoperability of business logic, as long as the business logic "exposed" to become webservice, you can let any designated partners invoke these business logic, regardless of their system on what platform to run, use what development language, this piece now in Business -to-business integration is particularly extensive. Cross-company business transaction integration is often called-to-business integration, through the webservice to achieve the interoperability of logical services, which greatly reduces the cost of the time and costs of the enterprise integration, so many small and medium-sized enterprises can not afford EDI to achieve business integration;

This is essentially the same as the above, all leveraging the interoperability of WebService, using the WebService application to "expose" functions and data in a standard way for use by other applications and to achieve business-level reuse.

finally

This article mainly introduced WebService in order to solve what problem appeared, at the same time introduced the definition of Web service, the core technology finally introduced the use of the Web service scene, about WebService learning has just begun, there are wrong please make a lot of corrections.

Web service that little thing

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.