code: private SOAPElement constructSoapHeader(
        Map<String, Object> headerData, AdManagerServiceDescriptor adManagerServiceDescriptor) {
      String requestHeaderNamespace =
          adManagerApiConfiguration.getNamespacePrefix()
              + "/"
              + adManagerServiceDescriptor.getVersion();
  
      try {
        SOAPFactory soapFactory = SOAPFactory.newInstance();
        SOAPElement requestHeader =
            soapFactory.createElement(REQUEST_HEADER_LOCAL_PART, "ns1", requestHeaderNamespace);
        for (String headerElementName : headerData.keySet()) {
          if (headerData.get(headerElementName) != null) {
            SOAPElement newElement =
                requestHeader.addChildElement(headerElementName, "ns1", requestHeaderNamespace);
            newElement.addTextNode(headerData.get(headerElementName).toString());
          }
        }
        return requestHeader;
      } catch (SOAPException e) {
        throw new ServiceException("Unexpected exception.", e);
      }
    }
docs: Constructs a SOAP header object ready to be attached to a JAX-WS client.
  
  @param headerData a map of SOAP header element names to values
  @param adManagerServiceDescriptor the descriptor of which service's headers are being created
  @return a SOAP header object