What is web services?

xiaoxiao2021-03-06  69

Web Services suddenly hot, especially M $ .NET descriptions of a world-shared world, in fact, these beautiful prospects have been born in Java, but the ideal implementation process is always rugged.

We look at how Web Services work from an app:

There is a boss of a coffee chain called Coffee Break, to expand its own coffee variety, he instructs his procurement manager to find some new coffee providers, get all of their coffee, and can immediately place orders immediately, Coffee Break can analyze their prices and decide which company to purchase from which company is purchased.

Inquiry Procurement Manager assigned specific tasks to software engineers, software engineers think that the best way to find new coffee providers is to search for UDDI registry.

UDDI Registration Center: (Universal Description, Discovery, And Integration (UDDI) Registry, UDDI Registry is a logically unified body, which is implemented in the architecture of the distributed system, while the different sites are P2P (Pertile network) architecture is implemented, so accessing any site is basically equal to accessing UDDI Registry.

Of course, Coffee Break registers themselves in the UDDI Registry.

The software engineer issued a JAXR (Java API for XML Registries) to query all coffee providers, JAXR issued a message in the background using JAXM (Java API for XML Messaging), which is based on SOAP to send XML text.

The UDDI Registration Center accepts this XML text and starts an accurate search, but after the search is complete, the registration center will send back information about how to contact those coffee dealers. Also based on SOAP to send back XML text.

The next step of the engineer is to list their coffee sales prices from the list of these distributors, this work is two steps:

1. Services Description Language (WSDL) Document is completed through JAX-RPC (Java API for XML-based RPC). This is also an XML text, which gives all information about Web Service: Tell Access What services they provide, what is the service content, how to get these service content, and more.

2. After the engineer analyzed the WSDL text, I got the method of obtaining coffee sales prices and the corresponding URL. He issued a request to the specific coffee dealers website to obtain the coffee prices of its sales.

Each coffee distributor accepts this request. Before he issued a sales price, he will first check the current futures price of the product, so Coffee Break has got the latest XML text format coffee price. As follows:

<单 price> <仑 比> 19.20 ....

XML is the latest browser language that is about to replace HTML, and we usually browse through your browser, see all the files written by HTML, and the files written in XML in the future.

There are two ways to analyze the price and order read XML text: SAX and DOM, for simple prices, use SAX more efficient than DOM, but if you want to modify the price list, you should use the DOM, Coffee Break engineers to compare these The price list sent by the distributor and got a result of the results, reported to the procurement manager or the boss Coffee Break. Once you decide to order coffee, you can contact the XML text and the dealer.

Sales of Coffee Break through Internet Sales Coffee varieties, need to release this coffee variety on his website. The Coffee Break must not sell coffee with its own purchase price. Engineers use DOM to modify the above XML. Documentation, multiply each price 125%, this is the coffee sales price of Coffee Break.

Engineers have used JSP to make an order form. In this JSP program, he can read each coffee name and price from the XML document modified above. Customer Just choose the number of purchases, then press Submit to put themselves in the current coffee Shopping cart started shopping online.

Web service is to transmit and accept XML text between various websites to achieve the purpose of information exchange. There is a protocol when accepting and transmitting, is SOAP (Simple Object Access Protocol), which is an XML HTTP protocol. Current us The website is published, which is sent to the user's browser through the HTTP protocol, so SOAP has a wide range of application bases, and now the popularity of XML. However, because XML is a pure data structure, but only the data of the data will go back. The era of academic research, therefore, similar to FrontPage Dreamweaver-based XML-based powerful page design tools is important, but such visualization tools are difficult to design.

So XML's popularity has time problems, then the true implementation of the above-mentioned beautiful prospects provided by Web Services, I am afraid that it will be reached in more than two years.

However, Web Services will bring opportunities to engage in companies engaged in Internet services, because their customers are a commercial website, so they can develop a commercial application without having to install these applications in their customers like ordinary software. On, but let their client websites call these software functions through SOAP and take a certain amount of use.

For the website as a customer, I purchased a new Internet service. It doesn't have to set up the server. You have to purchase a lot of software, but also maintain them, as long as you provide the web services that provides this feature, such as shopping cart function, this is every An online store must be, but each business does not necessarily purchase this software, as long as you directly call the web services of the online store directly in your own webpage.

But now the most deadly is the security of Web Services.

Sun's Web Service: http://java.sun.com/webservices/docs/ea2/tutorial/index.html

Open Source Web Service Server, Tomcat is required to run at the same time: http://xml.apache.org/Axis

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

New Post(0)