WAS v8.5 > Develop applications > Develop web services > Develop JAX-WS clients > Implement extensions to JAX-WS web services clientsReceive implicit SOAP headers with JAX-WS
We can enable an existing JAX-WS web services client to receive values from implicit SOAP headers. By modifying your client code to receive implicit SOAP headers, we can receive specific information within an incoming web service response.
To complete this task, you need a web services client that we can enable to receive implicit SOAP headers.
An implicit SOAP header is a SOAP header that fits one of the following descriptions:
- A message part that is declared as a SOAP header in the binding in the Web Services Description Language (WSDL) file, but the message definition is not referenced by a portType element within a WSDL file.
- An element not contained in the WSDL file.
Handlers and service endpoints can manipulate implicit or explicit SOAP headers using the SOAP with Attachments API for Java (SAAJ) data model.
Using JAX-WS, there is no restriction on types of headers that we can manipulate.
The client application sets properties on the Dispatch or Proxy object to send and receive implicit SOAP headers.
- Issue a remote method call with the Dispatch or Proxy object.
- Using the property name, com.ibm.wsspi.websvcs.Constants.JAXWS_INBOUND_SOAP_HEADERS, retrieve the Map<QName, List<String>> from the ResponseContext of the Dispatch or Proxy object.
- From the Map<QName, List<String>> value, retrieve a List<String> using the QName of the SOAP header. If the List<String> value is present, that value contains zero or more String objects containing the XML text of the SOAP headers for the corresponding QName.
Results
You have a JAX-WS web services client that can receive values from implicit SOAP headers.
Related concepts:
SOAP with Attachments API for Java interface
Related
Sending implicit SOAP headers with JAX-WS
Implement extensions to JAX-WS web services clients