WebService is a common technology in Web development. For most web developers, it should be no stranger to Java programmers or. NET programmers. Today, I will join you to learn the basic content of WebService. This article is the beginning of WebService. First, let's take a look at what is WebService. What can he do?
What is WebService?
Web services are online application services released by enterprises to meet their specific business needs. Other companies or application software can access and use this online service over the Internet. Simply put, it is an external interface of the system! After an enterprise develops a function, I provide an interface to external users. If others want this function, they can directly call the interfaces I provide over the Internet. You can achieve the same function. Of course, these functions are charged.
It is a universal model for building applications and can be run in any operating system that supports network communication. It is a new Web Application Branch, it is a self-contained, self-describing, and modular application that can be released, located, and called through the Web. WebService is an application component that logically provides data and services for other applications. each application accesses the WebService through the network protocol and some standard data formats (HTTP, XML, and SOAP). The results are obtained through the internal execution of WebService. web services can execute any function from simple requests to complex business processing. After deployment, other WebService applications can discover and call the services deployed by the application.
WebService related technologies
The following key technologies and rules are used to build and use web services:
1. xml:The standard method used to describe data. It can be used to mark data and define data types. It is a source language that allows users to define their own Markup languages.
2. SoapSimple Object Access Protocol is a lightweight, simple, XML-based protocol designed to exchange structured and solidified information on the Web.
SOAP protocol = http protocol + XML data format
WebService transmits data over HTTP and encapsulates data in XML format
3. WSDL: Web service description language. It is an XML language used to describe Web Services and describe how to communicate with Web Services. Provides you with detailed interface instructions.
It is a standard format that can be understood by both the WebService client and the server. The information described can be divided into what, where, and how!
What: What is the service (which methods are in the service, what are the parameters accepted by the method, and what are the returned values)
Where: The URL used to represent the Service's network address
How: how to call a service
The WSDL file is stored on the Web server. You can access the Web service provider through a URL address to expose its WSDL file address in two ways: register it with the UDDI server for human search. Direct notification to the client caller, for example, giving information or email notification on your website.
4. UDDI(Universal Description, discovery and integration): Universal Description, discovery and integration. It is a platform-independent, XML-based protocol used to describe commerce on the Internet. Can be translated as "general description, discovery and integration service ".
In fact, the main goal of WebService is cross-platform interoperability. To achieve this goal, WebService is fully based on XML (Extensible Markup Language), XSD (XMLSCHEMA), and other standards independent of the platform and software vendors, is a new platform for creating interoperable and distributed applications.
WebService workflow:
Below we will use several graph examples to briefly understand WebService
How to implement real-time weather forecasting?
How can I use Alibaba Cloud to pay for the payment?
Web services play the following roles:
From the figure above, we can see that the emergence of Web Service
1. Let services written in any language on any platform interact.
2. Define application functions into tasks to form task-oriented development and workflows. This allows more abstract software to be used by users who have less software analysis technology at the business level.
3. Loose coupling is allowed, which means that the interaction between service applications is not interrupted whenever one or more services change in design or implementation.
4. Make existing applications adapt to changing business conditions and customer needs.
5. Provide service interfaces to existing or legacy software applications without changing the original applications, so that these applications can run completely in such a service environment.
6. Introduce other management or operation management functions unrelated to the original functions, such as reliability, accountability, and security, so as to increase the universality and practicability of the Business computing environment.
WebService application scenarios
1. Cross-firewall communication
If the application has thousands of users distributed all over the world, communication between the client and the server will be a tough problem. Because there is usually a firewall or proxy server between the client and the server. In this case, using DCOM is not that simple, and usually it is not easy to publish the client program to every user with such a large number. The traditional approach is to use a browser as the client, write a lot of JSP pages, and expose the middle layer of the application to the end user. The result is that development is difficult and programs are difficult to maintain.
If the middle layer component is changed to WebService, you can directly call the middle layer component from the user interface, thus saving the step for creating a JSP page. To call WebService, you can directly use a client such as soap, or use a self-developed soap client to connect it to the application. This not only shortens the development cycle, but also reduces Code complexity and enhances the maintainability of applications. At the same time, the application does not need to jump to the corresponding "result page" every time it calls the middle layer components ".
2. Application Integration
Enterprise-level application developers know that enterprises often need to integrate various programs written in different languages and run on different platforms, this integration will take a lot of development effort. Applications often need to obtain data from programs running on IBM hosts, or send data to hosts or Unix applications. Even on the same platform, various software products produced by different software vendors often need to be integrated. Through WebService, applications can expose functions and data in a standard way for other applications.
Item 3: B2B Integration
Using WebService to integrate applications can automate business processing within the company. But what happens when transactions cross the supplier and customer boundaries and break through the company's boundaries? Cross-company business transaction integration is usually called B2B integration.
WebService is the key to successful B2B integration. Through WebService, the company can "expose" key business applications to specified suppliers and customers. For example, if the electronic order system and electronic invoice system are "Exposed", the customer can send orders electronically, and the supplier can send raw material procurement invoices electronically. Of course, this is not a new concept. EDI (Electronic document exchange) is just like this. However, the implementation of WebService is much simpler than that of EDI, and WebService runs on the Internet and can be easily implemented anywhere in the world, resulting in relatively low operating costs. However, WebService is not a complete solution for document exchange or B2B integration like EDI. WebService is only a key part of B2B integration. It requires many other parts for integration.
Item 4: software and data Reuse
Software reuse is a big topic. There are many forms of reuse, and the degree of reuse is small. The most basic form is source code module or class-Level Reuse, And the other form is binary form Component reuse. Currently, reusable software components such as table controls or user interface controls have a large share in the market. However, the reuse of such software has a major limitation, that is, the reuse is limited to code, and the data cannot be reused. The reason is that it is easier to publish components or even the source code, but it is not so easy to publish data unless it is static data that will not change frequently.
Reference: Baidu Baike WebService