What is WEB services?

Source: Internet
Author: User
Tags soap web services wsdl
Services|web Web Services suddenly hot, especially m$.net for us to describe an interconnected world, in fact, these beautiful prospects in Java was born early already dreamed of, but the ideal process is always rugged long.

Let's look at how Web services works from one application:

A coffee chain owner called Coffee break to expand his own sales of coffee varieties, he instructed his purchasing manager to find some new coffee providers, get their coffee full price, and when needed to immediately place orders, Coffee break can analyze their prices, and decided to choose which kind of coffee, from which company purchase.

Inquiry
The purchasing manager assigns specific tasks to software engineers, who think the best way to find new coffee providers is to search the UDDI registry.

UDDI Registries: (Universal Description, Discovery, and Integration (UDDI) registry), UDDI registry is a logical continuum, It is physically implemented as a distributed system architecture, and Peer-to-peer (Peer-to-peer) architectures are implemented between different sites, so access to any one of these sites is essentially equivalent to accessing the UDDI Registry.


Of course, the Coffee break also registers itself with the UDDI registry.

Software engineers use JAXR (Java API for XML registries) to send out a query for all coffee providers, JAXR in the background using JAXM (Java API for XML messaging) to send messages, That is, the XML text is sent based on soap.

The UDDI registry accepts this XML text and begins an accurate search, but after the search is complete, the registry sends back information about how to contact the eligible coffee dealers. It is also based on soap to send back XML text.

The next step for engineers is to list their coffee sales prices from these distributors ' lists, which are two steps:

1. Obtain and parse WSDL text (Services Description Language (WSDL) document) through Jax-RPC (Java API for xml-based RPC). This is also an XML literal, It gives all the information about the Web service: telling visitors what they are offering, what they are serving, how to get those services, and so on.

2. After analyzing the WSDL text, the engineer obtained the method of obtaining the selling price of the coffee and the corresponding Web site. He made a request to the specific coffee dealer website to get the price of the coffee he sold.

Every coffee distributor would receive such a request, before he issued the sales price, he will first check the product's current futures price, so coffee break to get the latest XML text format of the coffee price. as follows:

<coffee>

< price >
< Colombia coffee >19.20</Coffee >
</Price >

....

</coffee>

XML is about to replace the latest browser language of HTML, we usually browse the Internet through the browser, we see all the HTML written files, the future is written in XML files.

Analyze prices and order
There are two ways to read XML text: Sax and Dom, and for simple parity, sax is more efficient than DOM, but if you want to modify the price list, the engineers using Dom,coffee break use Sax to compare the price lists sent by these distributors and draw a table of results. Submit to purchasing manager or boss Coffee break. Once you decide to order your coffee, you are also contacted by sending the XML text and reseller.

Selling over the internet
Coffee break is ready for a new breed of coffee that needs to be posted on his website for the new price of the coffee variety. Coffee break of course can not sell coffee at the price of their own purchase, engineers use DOM to modify the above XML document, each price by 125%, this is Coffee break coffee sales price.

The engineer used JSP to make an order form. In this JSP program, he can read the name and price of each coffee from the modified XML document. The customer simply chooses to buy the quantity, then presses submit on the current coffee into his cart and starts shopping online.

Web service is the transfer and acceptance of XML text between Web sites for the purpose of exchanging information. There is a protocol to accept and transfer, which is soap (simple Object Access Protocol), which is a xml+ HTTP protocol. The current information on our website is sent to the user's browser via the HTTP protocol, so SOAP has a wide application base and now spreads XML.

However, because XML is a pure data structure, but only the data of the Internet will regress to the academic research era, so, like FrontPage Dreamweaver xml-based powerful page design tools are important, but such a visual tool is difficult to design.

So there is a time problem with the popularity of XML, and the real realization of the good prospects offered by Web services is not likely to be achieved in a year or two.

But Web services provide the opportunity for companies that specialize in Internet service, because their customers are commercial websites, so they can develop commercial applications without having to install them on their client's servers like ordinary software. Instead, they have their client Web site invoke these software functions through soap and draw on a certain amount of royalty.

For a customer's web site, the purchase of an Internet service, do not have to set up a server, purchase a large number of software, but also to maintain them, as long as through direct call to provide the functionality of the Web services can, such as shopping cart function, which is required for every online store, But every business does not have to buy the software, as long as the Web services of the online store are called directly on their own pages.

But now the most lethal 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 that requires Tomcat to run at the same time: Http://xml.apache.org/axis




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.