Chapter 3. SOAP Handling

SOAP: Hidden or Not?

Until now we have looked at SOAP messages only to see how SOAP-based web services operate under the hood. After all, the point of JWS is to develop and consume web services, ignoring infrastructure whenever possible. It is one thing to track web service messages at the wire level in order to see what is really going on. It is quite another to process SOAP messages in support of application logic.

At times, however, a web service or a client might need to process a SOAP envelope. For example, a client might need to add security credentials to the header of a SOAP message before sending the message; and the web service that receives the message then might need to validate these security credentials after extracting them from the header of the incoming SOAP message. How to add, extract, and otherwise process information in a SOAP message is the main topic in this chapter. The goal is to illustrate techniques for dealing directly with SOAP messages in SOAP-based web services. This chapter also examines SOAP attachments, particularly for large binary payloads.

SOAP 1.1 and SOAP 1.2

SOAP now comes in two versions, 1.1 and 1.2. There is debate within the W3C about whether a version 1.3 is needed. The good news is that the differences between SOAP 1.1 and SOAP 1.2 have minor impact on programming web services in general and programming JAX-WS in particular. There are exceptions. For example, the structure of the SOAP header differs between the versions, ...

Get Java Web Services: Up and Running now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.