What is Web Services for Devices?
Web Service is a platform-independent, low-coupling, self-contained, programmable web-based application that can use open XML (a subset of the standard universal markup language) standard to describe, publish, discover, and coordinate And configure these applications for developing distributed, interoperable applications. [1]
Web Service
- Content is more dynamic
- These trends mentioned above mean that smarter processing, manipulation, and aggregation of content becomes very important. Let's look at four trends foretold from the perspective of Web services:
- Content is more dynamic: a web service must be able to merge content from multiple different sources, which can include stocks, weather, news, etc., in traditional environments, such as inventory levels, shopping orders, or catalog information, all from back-end systems Come
- Bandwidth is cheaper: web services can distribute various types of content (
- What exactly is a web service; and under what circumstances should you use a web service.
- If you look at current application development, you will find an absolute tendency: people are beginning to prefer browser-based client applications. This is certainly not because the client provides a better user interface, but because it avoids the high costs of desktop application publishing. Publishing desktop applications is costly, partly because of application installation and configuration issues, and partly because of communication issues between the client and server.
- Traditional Windows client applications use DCOM to communicate with the server and call remote objects. Configuring DCOM to work properly in a large network will be a very challenging task and a nightmare for many IT engineers. In fact, many IT engineers would rather endure the functional limitations brought by the browser than run a DCOM on a local area network. In my opinion, the result is an application that is easy to publish, but difficult to develop and has a very limited user interface. In the extreme, you spend more money and time developing applications that are less functional from the user's perspective. Do not believe? Ask your accountant what he thinks of the new browser-based accounting software: The vast majority of commercial program users want a more user-friendly Windows user interface.
- Regarding the communication between the client and the server, a perfect solution is to use the HTTP protocol to communicate. This is because any machine running a web browser is using the HTTP protocol. At the same time, many firewalls are currently configured to allow only HTTP connections.
- Many commercial applications face another problem, and that is interoperability with other programs. If all applications are written in COM or .NET languages and run on Windows platforms, then the world is peaceful. However, in fact, most commercial data is still stored on the mainframe in the form of non-relational files (VSAM) and accessed by mainframe programs written in COBOL language. Moreover, many commercial programs continue to be written in C ++, Java, Visual Basic, and various other languages. With the exception of the simplest programs, all applications need to integrate and exchange data with applications running on other heterogeneous platforms. Such tasks are usually performed by special methods, such as file transfer and analysis, message queues, and APIs that are only applicable in certain situations, such as IBM's "Advanced Program to Program Communication (APPC)". Previously, no application communication standard was platform-independent, building-model, and programming language. Only through the Web Service can the client and server communicate freely using HTTP, regardless of the platform and programming language of the two programs.
- What is Web Service
- We have at least two answers to this question. On the surface, a Web service is an application that exposes an API that can be called through the Web to the outside world. This means that you can call this application programmatically via the Web. We call the application that calls this Web service a client. For example, you want to create a Web service that returns the current weather conditions. Then you can build an ASP page that accepts the zip code as a query string, and then returns a comma separated string containing the current temperature and weather. To call this ASP page, the client needs to send the following HTTP GET
- The returned data should look like this:
- The ASP page should be considered a Web service. Because it is based on HTTP GET requests, it exposes an API that can be called via the Web. Of course, Web services have more to offer.
- Here is a more precise explanation of Web services: Web services are a new platform for building interoperable, distributed applications. As a Windows programmer, you may have built component-based distributed applications using COM or DCOM. COM is a very good component technology, but we can easily cite situations where COM does not meet the requirements.
- The Web service platform is a set of standards that defines how applications implement interoperability on the Web. You can write Web services in any language you like and on any platform you like, as long as we can query and access these services through the Web service standard.
- New platform
- The Web service platform requires a set of protocols to enable the creation of distributed applications. The Web service platform must provide a standard type system for communicating different types of systems in different platforms, programming languages, and component models. In traditional distributed systems, interface-based platforms provide methods to describe interfaces, methods, and parameters (translation: such as the IDL language in COM and COBAR). Similarly, the Web service platform must also provide a standard to describe Web services, so that customers can get enough information to call this Web service. Finally, we must have a way to make remote calls to this Web service. This method is actually a remote procedure call protocol (RPC). To achieve interoperability, this RPC protocol must also be platform and programming language independent. The following sections briefly introduce the three technologies that make up the Web service platform.
- XML and XSD
- Extensible markup language (a subset of the standard universal markup language) is the basic format for representing data in the Web service platform. In addition to being easy to build and easy to analyze, the main advantage of XML is that it is both platform-independent and vendor-independent. Irrelevance is more important than technological superiority: software vendors will not choose a technology invented by a competitor.
- XML solves the problem of data representation, but it does not define a standard set of data types, let alone how to extend this set of data types. For example, what exactly does an integer number represent? 16-bit, 32-bit, or 64-bit? These details are important for interoperability. W3C's XML Schema (XSD) is a set of standards specifically addressing this issue. It defines a standard set of data types and gives a language to extend this set of data types. The Web service platform uses XSD as its data type system. When you construct a Web service in some language (such as VB. NET or C #), in order to conform to the Web service standard, all the data types you use must be converted to XSD types. The tool you use may have already done this conversion for you automatically, but you will most likely modify the conversion process according to your needs.
- SOAP
- After the Web service is built, you or others will call it. Simple Object Access Protocol (SOAP) provides standard RPC methods to call Web services. In fact, SOAP is a bit of a misnomer here: it means that the following web service is represented as an object, but this is not necessarily the case: you can write your web service as a series of C functions and still Call using SOAP. The SOAP specification defines the format of SOAP messages and how to use SOAP through the HTTP protocol. SOAP is also based on XML (a subset of the standard universal markup language) and XSD. XML is a data encoding method for SOAP.
- WSDL
- How would you introduce to others what your Web service does and the parameters for each function call? You might write a set of documents yourself, and you might even verbally tell people who need to use your Web service. These informal methods have at least one serious problem: when programmers sit at the computer and want to use your Web service, their tools (such as Visual Studio) cannot help them, because these tools are not I don't know your web service.
- The solution is to provide a formal description document in a machine-readable way. Web Services Description Language (WSDL) is such an XML-based (a subset of the standard universal markup language) language used to describe Web services and their functions, parameters, and return values. WSDL is both machine-readable and human-readable, which would be a great benefit. Some of the latest development tools can both generate WSDL documents based on your Web service, and import WSDL documents to generate code that calls the corresponding Web service.
- UDDI
- Universal Description, Discovery and Integration
- A plan launched to accelerate the promotion of Web Services and strengthen the interoperability of Web Services, based on standards for service description and discovery specifications.
- UDDI business registration center is operated by multiple operators in the form of Web Service in a resource sharing manner.
- The core component of the UDDI program is the UDDI Business Registration, which uses XML documents to describe the enterprise and the Web Services it provides.
- UDDI Business Registration provides three types of information:
- White Page contains the address, contact information, and known corporate identity.
- Yellow Page contains industry categories based on standard taxonomy.
- The Green Page contains technical information about the web services provided by the enterprise, which may be in the form of pointers to files or URLs that serve the service discovery mechanism.
- Web Service Development Example
- Adding data using WebService
- Data deletion using WebService
- Send text messages to mobile phones using WebService [2]
- When to use Web Services
- Cross a firewall
- Application integration
- B2B integration;
- Software reuse
- Not suitable for web services
- Stand-alone application
- Homogeneous applications on the LAN
- Web Service is a
- Web widely used technologies: