Implementing extensions to JAX-RPC Web services clients
WAS provides extensions to Web services clients using the JAX-RPC model.
We can customize Web services by using the following extensions to the JAX-RPC client model.
- Set the REQUEST_SOAP_HEADERS and RESPONSE_SOAP_HEADERS properties in a JAX-RPC client Stub to enable a 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.
See Sending implicit SOAP headers with JAX-RPC or Receiving implicit SOAP headers with JAX-RPC to learn how to modify your client code to send or retrieve transport headers.
- 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 Stub or Call object.
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.
See Sending transport headers with JAX-RPC or Retrieving transport headers with JAX-RPC to learn how to modify the client code to send or retrieve transport headers. See Transport header properties best practices to learn how to enable a Web services client to send or retrieve transport headers.
- Implement support for javax.xml.rpc.ServiceFactory.loadService() methods.
The loadService methods create an instance of the generated service implementation class in an implementation-specific manner. The loadService methods are new for JAX-RPC 1.1 and include three signatures:
- public.javax.xml.rpc.Service loadService (Class serviceInterface)
As documented in the JAX-RPC specification, this method returns the generated service implementation for the service interface. See the Web services specifications and API documentation to review the JAX-RPC specification.
- public.javax.xml.rpc.Service loadService (URL wsdlDocumentLocation, Class serviceInterface, Properties properties)This method behaves like the loadService (Class serviceInterface) because the following parameters are ignored:
- wsdlDocumentLocation
- properties
- public.javax.xml.rpc.Service loadService (URL wsdlDocumentLocation, QName serviceName, Properties properties)
This method returns the generated service implementation for the specified service by using optional namespace-to-package mapping information.
- wsdlDocumentLocation - ignored
- serviceName - QName (namespace, localpart) of the service
- properties - If this parameter is non-null, it contains namespace-to-package mapping entries. Each Property entry key is a String corresponding to the namespace. Each Property entry value is a String corresponding to the Java package name.
If the properties argument contains an entry with a key (namespace) that matches the namespace portion of the QName serviceName argument, the entry value (javaPackage) is used as the package name when trying to locate the service implementation.
See on these methods, see the JAX-RPC specification.
- Implement the CustomBinder interface to provide concrete custom data binders for a specific XML schema type (JAX-RPC applications only). Custom data binders are used to map XML schema types with Java objects. Custom data binders provide bindings for XML schema types that are not supported by the current Java API for XML-based Remote Call Procedure (JAX-RPC) specification. WAS provides an extension to the Web Services for Java EE model called the CustomBinder interface that implements these custom bindings for a specific XML schema type. The CustomBinder interface has three properties, in addition to deserialize and serialize methods:
- QName for the XML schema type
- QName scope
- Java type
The custom data binder defines serialize and deserialize methods to convert between a Java object and a SOAPElement interface. A custom data binder is added to the runtime system and interacts with the Web services runtime using a SOAPElement. They are added to the runtime by using custom binding providers. Read about the custom data binders and the custom binding provider to learn more. See the CustomBinder interface documentation to learn more about how we can implement this interface to provide concrete custom data binders for a specific XML schema type.
Custom data binders for JAX-RPC applications
Custom binding providers for JAX-RPC applications
CustomBinder interface for JAX-RPC applications
Usage patterns for deploying custom data binders for JAX-RPC applications
Example: Using JAX-RPC properties to send and receive SOAP headers
Sending implicit SOAP headers with JAX-RPC
Receiving implicit SOAP headers with JAX-RPC
Sending transport headers with JAX-RPC
Retrieving transport headers with JAX-RPC
Related tasks
Implementing JAX-RPC Web services clients
Related
Transport header properties best practices
Additional Application Programming Interfaces (APIs)
Web services specifications and APIs 
Related information
SOAP with Attachments API for Java interface