WAS v8.5 > Develop applications > Develop web services > Develop JAX-WS clientsImplement extensions to JAX-WS web services clients
WebSphere Application Server provides extensions to web services clients using the Java API for XML-based Web Services (JAX-WS) programming model. We can customize web services using the following extensions to the JAX-WS client programming model.
- Set the JAXWS_OUTBOUND_SOAP_HEADERS and JAXWS_INBOUND_SOAP_HEADERS properties on the request context of the Dispatch or Proxy object to enable a JAX-WS web services client to send or retrieve implicit SOAP headers.
An implicit SOAP header is a SOAP header not explicitly defined in the WSDL file. An implicit SOAP header file fits one of the following descriptions:
- A message part that is declared as a SOAP header in the binding in the WSDL file, but the message definition is not referenced by a portType 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.
To learn how to modify your client code to send or retrieve transport headers, see the information on sending implicit SOAP headers with JAX-WS or receiving implicit SOAP headers with JAX-WS.
- Set the REQUEST_TRANSPORT_PROPERTIES and RESPONSE_TRANSPORT_PROPERTIES properties to enable a web services client to send or retrieve transport headers.
Set the properties on the BindingProvider instance.
By modifying your client code to send or retrieve transport headers, we can send or receive specific information within the transport headers of outgoing requests or incoming responses from the server. For requests or responses that use the HTTP transport, the information is sent or retrieved in an HTTP header. Similarly, for a request or response that uses the JMS transport, the information is sent or retrieved in a JMS message property.
To learn how to modify your client code to send or retrieve transport headers, see the information on sending transport headers with JAX-WS or retrieving transport headers with JAX-WS.
To learn how to enable a web services client to send or retrieve transport headers, see the transport header properties best practices information.
Subtopics
- Example: Using JAX-WS properties to manipulate SOAP headers in a JAX-WS handler
WAS provides extensions to the JAX-WS and Web Services for Java EE client programming models, including the jaxws.binding.soap.headers.outbound and jaxws.binding.soap.headers.inbound properties. This example shows how to use these two properties to manipulate SOAP headers in a JAX-WS handler.- Sending implicit SOAP headers with JAX-WS
We can enable an existing JAX-WS web services client to send values in implicit SOAP headers. By modifying your client code to send implicit SOAP headers, we can send specific information within an outgoing web service request.- Receive 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.- Transport header properties best practices
We can set the REQUEST_TRANSPORT_PROPERTIES property and RESPONSE_TRANSPORT_PROPERTIES property on a JAX-RPC client Stub, a Call instance, or a Java API for XML-Based Web services (JAX-WS) BindingProvider's RequestContext instance to enable a web services client to send or retrieve transport headers.- Sending transport headers with JAX-WS
We can enable an existing JAX-WS web services client to send application-defined information along with the web services requests using transport headers. In addition, we can enable a JAX-WS Web services endpoint to send application-defined information along with the Web services response message using transport headers.- Retrieving transport headers with JAX-WS
You can enable a JAX-WS web services client to retrieve values from transport headers. For a request that uses HTTP, the transport headers are retrieved from HTTP headers found in the HTTP response message. For a request that uses JMS, the transport headers are retrieved from the JMS message properties found on the JMS response message.
Related concepts:
SOAP with Attachments API for Java interface
Related
Implement static JAX-WS web services clients
Reference:
Additional Application Programming Interfaces (APIs)
Web services specifications and APIs