!--a11y-->
Using the SOAP Headers Protocol 
In some scenarios, the client may need to add SOAP headers to the request. This can be done using the SOAP headers protocol, which can be accessed by SOAP Web services. This protocol is not available to Web services with HTTP GET or POST bindings.
The SOAP headers protocol is a client runtime plugin located in com.sap.engine.services.webservices.jaxrpc.wsdl2java.features.builtin.SoapHeadersProtocol .
To get an instance of the protocol, use:

|
SoapHeadersProtocol headers = (SoapHeadersProtocol) ((BaseGeneratedStub) client)._getGlobalProtocols().getProtocol("SoapHeadersProtocol"); |
The Service Endpoint Interface (SEI) is typecasted to BaseGeneratedStub , which exposes the internal plugin methods of the client:
The basic methods of the SOAP headers protocol are as follows:
· headers.setOutputHeader(new Name("urn:myuri.com","myHeader"),value) – With this method you can pass, as a value, any schema-derived element type that is generated by the proxy generator for your client or generic DOM element.

Remember that all header elements must be namespace-qualified and, if you use a schema-derived value, it must be declared by the schema element as follows:
<xs:element name="myHeader" namespace="urn:myuri.com" type=”tns:myType”/>
· The methods for getting response headers are as follows:
¡ headers.getInputHeader(headerName:QName):Element – Returns the DOM element with the header content response
¡ headers.getInputHeader(headerName:QName,headerClass:Class):Object – Deserializes the schema-declared header in the response class
