When should I use Web Service?

zhaozj2021-02-11  171

When should I use web service to reprint 01-12-02 15:45 2860P author is not detailed

(CCIDNET Cola November 01, 2001) Now I will listed three situations. In these three situations, you will find great benefits to use Web Service. Since then, I will also give some situations that should not use the Web Service. Communication across the firewall If your application has thousands of users, and they are distributed around the world, the communication between the client and the server will be a tricky problem. That is because the client and server usually have a firewall or proxy server. In this case, you want to use DCOM, it is not so simple, and usually you don't want to post your client program into such a huge number of each user. So, you finally chose the browser as the client, write a bunch of ASP pages, exposing the intermediate layer of the application to the end user. The results of it? If you are lucky, it's just that the development is difficult, if you are not lucky, you will get an application that is not maintained. Imagine how you should join a new page in your application: You must first create a good user interface (web page), and behind this page, the intermediate layer component of the corresponding business logic. This is not enough, you have to build at least one ASP page, used to accept the information entered by the user, call the intermediate layer component, format the result to HTML form, and finally send the "result page" back to the browser. If the client code is no longer so depending on the HTML form, is the client programming not simple? Also, can the step in establishing an ASP page can be omitted? of course. If your intermediate component is a web service, you can completely call the intermediate layer components directly from the user interface, so that the step of establishing an ASP page is eliminating. To call the Web Service, you can use the SOAP client like Microsoft SOAP Toolkit or .NET, you can also use the SOAP client you develop, then connect it to your application. In this way, not only shorten the development cycle, but also reduce the complexity of the code and enhance the maintenanceability of the entire application. At the same time, your application no longer needs to jump to the corresponding "result page" when the intermediate layer component is called each time. From my experience, in a user interface and intermediate layer, there is more interaced applications, using the web service, can easily save 20% of the 20% development time of user interface programming. There is another benefit that you will get an intermediate layer consisting of Web Service, which is fully reused in applications or other occasions. Finally, the logic and data of your application will be exposed through Web Service, and you can reuse your applications on other platforms. Both app integration enterprise-class application developers know that companies often integrate various programs written on different platforms in different languages, and this integration will cost large development. Your application often needs to get data from the program running on an old IBM host; or send data to the host or UNIX application. Even on the same platform, various software produced by different software vendors often need to integrate. Through Web Service, applications can expose functions and data to other applications with standard methods for other applications. For example, you have an order login program for logging in to new orders from customers, including customer information, delivery addresses, quantities, prices, and payment methods. At the same time, you have an order executive for the management of actual goods. These two programs are from different software vendors.

After a new order comes in, the order login program needs to notify the order execution program to send the goods. The order executor can expose the "Addorder" function by adding a layer of Web Service above the order executor. This way, whenever there is a new order arrival, the order login program can call this function to send the goods. In turn, the Web Service integration application B2B integration can be more automated with Web Service integration applications. But when the transaction spans your suppliers and customers, what will it take to break through the company's boundaries? Integration of business transactions across companies is usually called B2B integration. Web service is the key to the success of B2B integration. With Web Service, your company can expose key business applications to the designated suppliers and customers. For example, exposing your electronic ordering system and an electronic invoice system, your customers can send you purchase orders in electronics, and your supplier can send the invoice purchased by ingredients in electronics. you. Of course, this is not a new concept: electronic document exchange (EDI) is like this. The main difference between Web Service and EDI is that the Web Service is more simpler than EDI, and Web Service is running on the Internet, which can be easily implemented anywhere in the world, so that its operating cost is relatively low. However, Web Service is not like edi, a complete solution for document exchange or B2B integration. Web service is just a key section of B2B integration, and many other parts can be needed to complete this integration. The greatest advantage of implementing B2B integration with Web Service is that interoperability can be easily achieved. Just expose your business logic, become Web Service, you can make any specified partners to easily call your business logic, regardless of their system running on what platform, what development language is used. This greatly reduces the time and cost of spending the integration of B2B. Such low-cost makes many small and medium-sized enterprises that cannot withstand investment costs of EDI. Software reuse software reuse is a big topic, there are many forms and degrees. The most basic form is a reuse of the source code module or class level. Another form is a component reuse of binary form. Currently, a reusable software component such as a table control or user interface control has a lot of share in the market. However, there is a very serious restriction of reuse: reuse is limited to code, and data cannot be reused. The reason is that you can easily publish components or even source code, but it is not so easy to publish data unless those data do not change frequently. Web service allows you to reuse the data behind the code while reused code. Using Web Service, you are no longer as before, you must first purchase, install software components from a third party, then call these components from your application. You only need to call the remote web service directly. For example, you want to confirm the email address entered in your app, then you just send this address directly to the corresponding Web Service, this web service will help you check the street address, city, provincial regions And postal coding and other information, confirm that this address is indeed in the corresponding postal coding area. The web service provider can charge this service by time or number of times. Such services should be reused by component reuse, because you have to download and install a database containing information such as street addresses, cities, provinces, and postal codes, and this database is still updated in real time. Another software reuse is to integrate the functions of several applications.

For example, you want to create a site site application on a local area, allowing users to query their federal express parcels, see the stock market, and manage their schedule, and purchase movie tickets online. Now there are many application vendors on the Web, all of which implements these features in its application. Once they expose these features through the web service, you can easily integrate all these features to your portal to provide users with a unified, friendly interface. With Web Service to integrate features in a variety of applications, providing users with a unified interface Many applications utilize Web services, extending the current component-based application structure into a mixed structure of components and web services. You can also use the features provided by third-party Web Service in your application. You can also provide your own application to others via Web Service. In all these cases, you can reuse the data behind the code and the code. In short, Web Service will be a very powerful form of software reuse. When should I use a full introduction to Web Service, I should include when I should use Web Service. After the introduction, we know that the Web Service is most useful when interoperable or remote calls via the web. However, there are many situations that Web Service can't bring you any benefits. Single-machine applications are currently available in we have many desktop applications for commercial and personal use. Some of them only need to communicate with other programs running on this machine. In this case, we should do not use the Web Service again, just use the local API. COM is very suitable for working in this case because it is small and fast. The server software running on a server is also the case: It is best to use COM or other local API to make calls between applications. Of course, Web Service can also be used in these situations, but not only consumes too much, but will not bring you any benefits. LAN's consted applications in many applications, all your programs are developed with VB or VC, all using COM under the Windows platform, running on the same LAN. For example, you have two server applications to communicate with each other, or you have a Win32 or WinForm client to connect to another server program on the LAN. Using DCOM in these programs is much more effective than SOAP / HTTP. Similarly, if you want a .NET program to connect to another .NET program on the LAN, you should use .NET Remoting. Interestingly, in .Net Remoting, you can also specify using SOAP / HTTP to make a web service call. However, it is best to use the TCP to perform RPC calls, which will be much more effective. In short, as long as you look from the application structure, some ways are more effective than the web service, and then don't use the Web Service. Summary Web Service is a new platform for creating interoperable distributed applications. The main goal of Web Service is interoperable cross-platform interoperability. In order to achieve this goal, the Web Service is based entirely in the platform, independent of the software vendor. Web Service is very useful when communicating with a cross-platform and cross-network. Web Service is suitable for application integration, B2B integration, code, and data reuse, and communication with clients and servers via web. Of course, Web Service is not universal, you can't abuse the Web Service everywhere. In some cases, Web Service will reduce the performance of the application without any benefit.

转载请注明原文地址:https://www.9cbs.com/read-5792.html

New Post(0)