Invoking Web Services with Java clients: Introduction to Web Service clients in J2SE and EE environments

Source: Internet
Author: User
Tags soap web services java web wsdl

The power of WEB services is interoperability. Because of the industry's collaboration in Web Services technology (SOAP, WSDL, UDDI), more specifically because of the Web Service Interoperability Organization (Web Services Interoperability Organization, ws-i.org, Web services can interact with other Web services regardless of the platform on which the Web service is developed and running (for example, Microsoft. NET or IBM WebSphere). Web service clients are divided into several types, such as another Web service, a client written in a scripting language, a C # client, a Java client, and so on. This article focuses on the Java client, which can be used to access any Web service that follows a Web service specification (not just a Java Web service). By reading this article, you will learn about the Web service client code that you need to use to invoke the same Web service through different lookup and access methods. The example used in this article is the "Hello" Web service, which provides a "getgreeting" operation. This action takes a string parameter (for example, Jane) and then returns a greeting "Hello jane!".

Web Service Role

This section describes the process of invoking a WEB service. Web service providers describe Web services using Web Service Description Language (Web Services Description language,wsdl) documents. WEB services are generally published to the unified description, Discovery, and integration (Universal Description, Discovery and Integration,uddi) registry. The Web service requester looks for the Web service in the UDDI registry, binds to the Web service, and calls it. The Web service role is shown in Figure 1. This article will focus on the horizontal arrows (bindings) from the service requester to the service provider. This article will refer to the requester as a client and it can also be called a consumer.

For

The development of Java technical standards appears as the Java specification proposal (Java Specification REQUEST,JSR) is submitted to the Java Community Process (JCP). The two JSR covers the Java Web services Architecture:

JSR 101: Java API for xml-based RPC (Java API for XML based RPC,JAX-RPC)

JSR 109: Implementing the Enterprise Web Service (implementing Enterprise Web Services)

The two specifications provide consistency and interoperability requirements for vendor implementations.

Jax-rpc--java to XML and XML to Java mapping API

Jax-RPC is an xml-based remote procedure call (remote Procedure CALL,RPC) and Java application programming interface (Java application programming Interface,api):

WSDL to Java and Java to WSDL mapping: For example, the WSDL port type is mapped to the Java Service endpoint interface (Java Services Endpoint Interface,sei).

XML data types to Java data types and Java data types to XML data type mappings, including simple types, complex types, and arrays.

In addition to XML mappings, Jax-RPC also defines the server-side programming model and API, which I will describe in more detail in the later sections. AX-RPC 1.1 Adds interoperability requirements based on the basic Profile version of the Web Service Interoperability Organization (Web Services Interoperability Organization,ws-i) 1.0 (Basic. Version 1.0).

JSR 109--J2EE API for Environment

JSR 109 Specifies the WEB services programming model and architecture for the Java 2 Enterprise Edition (EE) environment. JSR 109 builds on SOAP 1.1 and WSDL 1.1, which covers the use of Jax-RPC in the Java environment (Figure 2). It also defines the deployment model in the Java EE application Server. The client-side programming model of JSR 109 (which I will describe in the following sections) is JAX-RPC compliant.

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.