Java EE Web Services Principles and Architecture Overview

Source: Internet
Author: User
Tags abstract definition soap web services wsdl


Web Service (Web services) is a new technology in the field of programming, is a new distributed computing mode, interoperability between different system platforms, through the Internet, to achieve remote procedure call between different applications. Web services use xml-based message processing as the basic means of data communication, eliminating the differences between systems that use different component models, operating systems, and programming languages, enabling heterogeneous systems to work together as a single computing network. Developers can create applications that combine Web services from a variety of sources in the same way as they used to when creating distributed applications. Web services are based on general protocols such as Http,soap,xml, Wsdl,uddi, and so on. These protocols have no inclination when it comes to the choice of operating systems, object models, and programming languages, so there will be strong vitality. Web services are software architectures that do not involve specific platforms and languages, but developers must choose a language to specifically develop Web services. This paper uses the Java language to illustrate the Web service architecture.



The principle of Web service of Java EE



1. Java-EE Web service model



As you know, the system architecture of common Web services is service-oriented, and the discovery of service publishing is the first major problem to be addressed in the architecture of web systems. In the Java programming environment, WEB Services implement their own publishing through the JAXR (Java API for XML registries). Customers use the same JAXR API to look for services, using JAX-RPC bindings and invoking Web services. 



2, Java EE in the message send layer (SOAP) and Transport protocol layer (HTTP) work process



 a standard Java EE application is running on an application server with Web service functionality. In the upper-left corner of the diagram is the java,c++ or C # client, and the application now emits a SOAP request. The SOAP request encapsulates the Web service operation in an XML payload, which is then routed through the HTTP protocol. On the Web service side, the transport layer continues to transfer the call to the SOAP server, which then invokes the corresponding Java EE function that has been displayed as a Web service. Any response generated by the Web service is then encoded into a SOAP response and transmitted back to the client via the HTTP protocol.








communication within the application can be accomplished using the message sending layer (messaging layer) (SOAP) and the Transport Protocol layer (Transoort Network laver) (HTTP). The problem of internal communication within an application has been solved by some vendors ' proprietary technologies (such as CORBA and DCOM). These technologies are cumbersome to operate and cannot be passed through firewalls. So now, with soap, with simple XML as an open standard, we can effectively communicate within the application and not lock ourselves into a vendor's proprietary mechanism.



3. The working process of Java EE in message sending layer (SOAP), Transport protocol layer (HTTP) and Web Service description (WSDL)



 a simple extension of the Web service pattern described earlier, and there is a tight coupling between the SOAP messages that are passed between two applications . Now, with an additional Web Service description layer, service providers can describe their Web services in a way that creates and publishes WSDL documents. The WSDL document contains not only the abstract definition of the Web service, but also the details of the implementation (binding) of the Web service. This means that the consumer of the service (that is, the client application in the example) needs to get a WSDL document, not only can it get a different operation of the message and data type of the Web service from this document, but it can also regain the terminal (such as the URL) of the Web service, and the SOAP message can be exchanged on the terminal. The WSDL document also describes this if the Java service is displayed through the SMTP message.








4. Java EE work process using UDDI, WSDL, and soap three technologies



assume that the service provider has decided to show a business function as a Web service. The Web service resides in a java-based Web service system. Take a look at the whole mechanism of work through the sequential steps in the diagram.








1 The first step for a service provider is to write a WSDL file. There are several tools available on the market to help us generate WSDL files with existing object definitions. Then, you need to publish information about itself and publish the technical specification of the business and the Web service as a WSDL file to the central Uddl registry. In this way, the method of writing a WSDL file makes the description of the Web service occupy the service description layer. However, we see in the Web services stack that the published business information and WSDL file represent the service publishing layer in the Web service stack.



2 Service consumer applications can discover the Web services it is interested in using. Discovery involves not only searching for business and its services, but also downloading the technical specifications mentioned in the WSDL file. The discovered steps correspond to the service discovery layer in the Web service stack.



3 Finally, the service consumer application uses a WSDL file to determine what messages need to be delivered in order to communicate with the service provider's Web service, and it also determines the binding information. For this purpose, the binding information is soap on HTTP. This step corresponds to the XML message and Transport layer in the Web service stack.





Related Article

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.