What did Web Services bring?
Author: Wang Yu
Abstract: This article describes the origins and basic principles of Web Services, and analyzes the impact and change of Web Services in enterprise applications, pointing out some of the advantages and disadvantages of Web Services and how to properly apply Web Services.
Whether in the computer magazine or on the Internet, the hottest topic is now "Web Services". The arms between the platforms, the release of each new product, the formulation of many new standards, mostly related to Web Services.
Some of my friends is such a person, they always use the latest platforms, try the latest technology, they like to change, like popular, use their own words, new technologies create new life! However, when my friend, leading their department's developers, spent two months, re-designing their internal management systems, but found that system performance in the actual use Very bad. He proposed such a question: Is Web Services now is still in the experiment and market speculation, does not enter the practical phase at all? The simple answer is: Web Services is not universal, it has its application and advantageous disadvantages.
Web Services originated
The huge success and continuous development of web applications make it penetrate into all aspects of business sector and individual life. People can enjoy a wide variety of web services as long as they use a browser, such as online shopping, online transactions, online games, scheduled tickets, online chats and dating, and more. At the same time, due to the advantages of Web technology (unified clients and better maintenance), some traditional applications have been transformed into the BS structure.
However, in development, some issues have gradually exposed. All of these web pages are ready to read, go to enter, and judge. Therefore, various contents reflecting the visual effects take up a large number of network bandwidth, such as various pictures, font information, text typing style, and the like. Some information that really contains high value is deeply buried in these display information, it is difficult to be used by other applications and procedures. More importantly, there is a lack of interaction and communication between various web services.
Is it important to communicate between the program? Simply raise an example.
Suppose you often go abroad, after you return home, the first thing is the cost reimbursement. And your company has such a financial regulation, all of the reimbursement is settled according to the foreign exchange price of the reimbursement. Therefore, when you fill out the reimburse, you must first fill in the flower of each country, then check the foreign exchange price on the same day, fill in the reimbursement. The rest of the thing may not have to do it, your reimbursement is automatically converted and statistics.
What do you think is wrong? As an employee of IT, maybe there is a feature that the computer can do, try to do it. The query of the foreign exchange price allows the computer to do it! However, let your program automatically go to the webpage to find the specified foreign exchange price is not an easy task. Because these pages are giving people to read, how fast, the response speed of the human eye and the brain can be quickly positioned from a full page information to what you want, and no matter how changes and revisions are changed regardless of the web page. Impact. It is too far from the application to do the same thing. Therefore, it is now desirable to be a web service that is specifically developed for the application.
As the demand between the communication is getting bigger and bigger, this requires the development of unified standards and protocols. HP is the first company that first proposes this view, and they have developed standards for "E-Speak" to ensure interaction between applications, and claim to become the next-generation Internet information interaction. And then, Microsoft realized the beautiful future of this program, launched the .NET strategy; IBM quickly released Web Services Toolkit (WSTK), and Web Services Development Environment (WSDE), which stated that the Web Services is fully supported. At the same time, Oracle also developed its Dynamic Services and integrated with Oracle 8i Release 2. Since then, W3C uniformly develops various standards of Web Services. SUN has announced its own Web Services framework, SUN will dissolve Web Services into J2EE, so that Web Services has widely supported foundations and platforms. Basic Principles for Web Services
Web Services is a dynamic connection between programs through a range of standards and protocols. The most basic protocols include: SOAP, WSDL, UDDI
SOAP: is an abbreviation of "Simple Object Access Protocol", SOAP is the protocol of messaging, which specifies how the web services communicates with information. Simply put, SOAP specifies: 1. The format of passing information is XML. This makes Web Services to be implemented in any platform. 2. The format of the remote object method call. The method name and parameter type of the called object and the call are specified. 3. Parameter type and mapping between XML formats. This is because, the method called is sometimes necessary to deliver a complex parameter, for example, a Person object. How to use XML to represent an object parameter and the range defined by SOAP. 4. Exception handling and other related information. WSDL: is an abbreviation for "Web Services Description Language". Yes, WSDL is the definition language of Web Services. When you implement some kind of service (eg, the stock query service), in order to make another program to call, you must tell you the interface of your service. For example, the service name, the machine name, monitor port number, transfer The type, number, and order of the parameters, the type of return result, and more. Do not call your service. The WSDL protocol is to specify the criteria for Web Services description. UDDI: It is the abbreviation of Universal Description, discovery, and integration. Simply put, UDDI is used to centrally store and find the WSDL description file, play the role of the directory server.
As shown in the figure above, a Web Services life cycle is:
Implement a Web Services to accept and respond to SOAP messages (now there are many tools to help implement). Write a WSDL file for describing this web service. (Now there are many tools to automatically generate a WSDL file). Publish this WSDL to UDDI. Other applications (clients) searched from UDDI to your WSDL. Depending on your WSDL, the client can write a program (now there are many tools to automatically generate call programs) call your web services.
Disadvantages of Web Services
Since the XML-based application, Web Services will inevitably inherit some of the restrictions brought about by XML while having all the advantages brought by XML.
Web Services usually requires a lot of CPU resources. Because XML data should be used multiple steps to be used by the system. The first is the validate, check whether its format meets XML specification, and checks if the application definition (DTD or Schema) is checked in a semantic specification; then parsing (PARSE), decompose a single from XML document The element; finally converts the binary expression required for the application (for example, converting "12" into a binary representation of an integer 12). Web Services also means more memory resources. At the time of XML analysis, a large amount of temporary memory object is generated. Especially when processing DOM objects. These large amounts of temporary objects are actuated for the language and system of automatic recycling memory such as Java, and a large number of temporary objects will make the system to recover every time, thereby reducing the performance of the system. Of course, now there is now the Web Services (such as AXIS) adopted SAX technology, which greatly reduces the amount of memory. For more information, please refer to: (http://xml.apache.org/axis/index.html). The consumption of network resources is also some restrictions on Web Services applications. Since the transmission of XML data-based transmission usually is much larger than binary protocols (such as RMI / IIOP). This additional consumption will have a certain impact in applications where network resources is more tense or frequent network transmissions. In addition to the limit brought to XML, Web Services itself has some shortcomings:
So far, Web Services can also be said to be a stateful service. The so-called stateless means that no information for the client service caller is not saved. This is determined by the essence of Web Services. Web Services is essentially a standard for providing data communication between applications, dynamically providing large-grained services between enterprise applications, so Web Services is not suitable for very fine session-based method calls and complex Among the transaction processing. Maybe someone will disconnect me! Because now there are many web services products (such as WASD), not only saving session information, making services to stateful services, but also implemented Remote Interface, can pass remote objects in the web service session Handle allows the client to manipulate the remote object (please refer to: http://www.systinet.com). In principle, this is not difficult to implement, because in XML data, any data can be transmitted to each other, including sessionid and transactionid, these IDs, from the technical perspective, implement stateful service and transaction processing Not complicated. However, such a function lacks standard support, the current version of WSDL can not represent these complex services. Inside the company, you can use these special features to define the interactive protocols of the session state, because the communication between the server and the service caller is in your control; however, to publish these services on the Internet Other applications are unable to identify these special features based on standards. There are also shortcomings in data binding. Because all data transfer uses an XML format, there is a conversion between binary data and XML data. However, not all binary data can be easily represented by XML, not all Java objects can be represented by XML. Therefore, semantic loss is often occurring during the conversion process. High technical requirements, long learning curves. Each Web Services product has a rich tool that can easily generate a client program according to the definition of Web Services (such as WSDL files); you can pack the general service programs, you can easily package into a Web Services service. Therefore, all Web Services's products claim that their platform is easy to use. You don't need to understand XML at all, and you don't need to know what WSDL, UDDI, and SOAP can use the release web services. Especially a friend told me that if he didn't understand anything, I took a web service for 15 minutes! Don't be drunk, this is simple, this is perhaps the simple Demo, but for the truly serious application, we must understand all aspects of Web Services, design the overall structure and solution, and must also apply according to specific applications. Adjustability. All of this requires a comprehensive master of Web Services knowledge. What application is suitable for Web Services
WEB SERVICES So much shortcoming is that it makes you discouraged? In fact, there are many successful Web Services applications and more and more developers to join, which will definite Web Services will become the mainstream of the new generation of web information communication. After continuous development, Web Services will be able to overcome their weaknesses to get wider applications. However, for the current Web Services, it is more suitable for the following forms: WAN and Internet applications
To create a binary-based RMI / IIOP application on the Internet, it is generally encountered a big trouble - firewall. The client browser is very large. After the ISP firewall, most firewalls can only allow and external HTTP connections, so they want to connect to the client after the ISP firewall and the RMI / IIOP application port outside the firewall. To change the security policy of the ISP, let the client can connect other ports other than 80. However, when running the RMI / IIOP server is in the DMZ after the firewall, the connection is more complicated, and the connection should be across two firewalls. Web Services passed the XML data of plain text due to the use of the HTTP protocol, so it has a good performance of the firewall.
Based on heterogeneous platform
The XML language itself is a cross-platform, cross-language data representation, plus common HTTP and other protocols, making Web Services to be born with a heterogeneous platform. If your client contains a variety of different platforms, for example, you want your service to be called by the Java program, and can be called by VB and COM programs. You have two options: one is to provide the corresponding API for different platforms, but also provide API for different languages; if you provide web services, all platforms and languages can be called!
Applies to strong security features
Many people think that security is the Web Services' weakness. In fact, after the continuous improvement and the introduction of various new agreements, Web Services can be used in an application environment with strong security. Also, since Web Services is transmitted using the HTTP protocol, it can be used with easy use of HTTP-based various security technologies.
EAI (Enterprise Application Integration) This is one of the most optimistic directions of Web Services applications. Most companies have a variety of application systems, which are developed by different leaders in ten, so that they are running on different platforms and systems, and the system's development language is different. Due to the improvement of modern enterprise information automation, interaction between each system is mentioned on the agenda. Therefore, protecting the original investment, reusing the legacy system is an important task of current large-scale enterprises. Since the running platform of the legacy system is a heterogeneous environment, the cost of enterprise application integration is generally very high. But if you use web services as a means of application integration, it will greatly reduce integrated consumption. Web Services and platforms and language-independent features, as well as various platforms and environmental development tools are integrated weapons for enterprise applications. In addition, when developing new application systems, it is still necessary to consider integration with other systems, and you need to consider the functionality of calling other systems, and is called by other systems. Using Web Services as an interface between the system and external AC, it is possible to maintain a loosely coupled relationship between the new system and other systems, maintain high scalability. The application interior in the industry's internal B2B application industry is another direction of Web Services. Because commercial business is very similar in a industry, it is easy to form a standard in the industry, so that all industry companies are complied with; but how to achieve service and what kind of system is used, the decision is that each company himself. For example, the settlement service between the telecom operators, the transfer service between the banks can form industry standards, published in WSDL. Different platforms can be selected for different platforms. Improve Web Services performance
To improve the performance of the Web Services application, you need to consider the entire system. In general, there is a need to pay attention to:
Web Services's granularity Selection of Web Services is the primary means of improving the performance of Web Services applications. Because the transfer protocol used by Web Services is HTTP or SMTP, these protocols are all-oriented connection protocols, and each request has a new connection. Therefore, the Web Services can not be called as fine and complex method (for example, get the connection first, then obtain the result set, and then get the result). Web Services is more applicable to large particle size applications, and all information is obtained in a call (such as transfer between banks, all information including amounts and authentication) is transmitted in the one call). Carefully use the interface between the XML interface system to use XML, which can increase the flexibility of the system; but do not use XML as an interface inside the system, because this will not bring any benefits, try to use binary as an interface inside the system, avoid Unnecessary XML document parsing and papers; when processing XML, convert XML into internal objects as soon as possible, XML transmission will only increase the system overhead. Maximum likely to use Cache When some information is read-only, or can be used in a period of time, you can use Cache. Whether it is the client's Cache or the server-side Cache, it can greatly improve the performance of the system.
to sum up
Once Web Services get a more wide application, make various services can dynamically look up and position, which provides a wide variety of information interactions between different devices, which will greatly change the style of business operations and information exchange. .
You can use others that have matured to provide you with better service, such as Google, and its search engine can be accessed through Web Services. This means that in your system, you can easily embed the powerful search function of Google, regardless of your system is running on what platform, making Google's search engine a part of your system, (please refer to http: // www.google.com/apis/). Standing on the shoulders of others, after all, we must see it! In the face of Web Services, you can do not act now, but you must be ready!