9.1.2 SOAP-Based Web Services
In SOAP-based Web services, Java utilities create a WSDL file based on the Java code in the Web service. The WSDL is exposed on the net. Parties interested in using the Web service create a Java client based on the WSDL. Messages are exchanged in SOAP format. The range of operations that can be passed in SOAP is much broader than what is available in REST, especially in security.
SOAP-based Web services are suitable for heavyweight applications using complicated oper-ations and for applications requiring sophisticated security, reliability or other WS-* standards-supported features. They are also suiTable when a transport protocol other than HTTP has to be used. Many of Amazon’s Web services, particularly those involving commercial transactions, and the Web services used by banks and government agencies are SOAP based.
The Java API for XML Web Services is the current model for SOAP-based Web services in Metro. JAX-WS is built on the earlier Java API for XML Remote Procedure Call (JAX-RPC) model but uses specific Java EE 7 features, such as annotations, to simplify the task of developing Web services. Because it uses SOAP for messaging, JAX-WS is transport neutral. It also supports a wide range of modular WS-* specifications, such as WS-Security and WS-ReliableMessaging.
When you create a Web service client, you have the option of using either the JAX-WS or JAX-RPC model. This is because some older JAX-RPC services use a binding style that is not supported by JAX-WS. These services can only be consumed by JAX-RPC clients.
Metro Web services are interoperable with Apache Axis2 Web services. Apache Axis2 is an open-source implementation of the SOAP submission to the W3C. Two popular implementations of the Apache Axis2 Web services engine are Apache Axis2/Java and Apache Axis2/C. In addition,
Axis2 not only supports SOAP 1.1 and SOAP 1.2, it also has integrated support for RESTful Web services.
Because SOAP-based Web services are suiTable for heavyweight applications using complicated operations and applications requiring sophisticated security and reliability, in this chapter, we will concentrate on this kind of Web service.