code: private SOAPElement constructSoapHeader(Map<String, Object> headerData,
        AdWordsServiceDescriptor adWordsServiceDescriptor) {
      String requestHeaderNamespace =
          adWordsApiConfiguration.getNamespacePrefix() + "/"
              + adWordsServiceDescriptor.getPackageGroup() + "/"
              + adWordsServiceDescriptor.getVersion();
  
      String requestElementsNamespace =
          adWordsApiConfiguration.getNamespacePrefix() + "/cm/"
              + adWordsServiceDescriptor.getVersion();
  
      try {
        SOAPFactory soapFactory = SOAPFactory.newInstance();
        SOAPElement requestHeader = soapFactory.createElement(new QName(requestHeaderNamespace,
            REQUEST_HEADER_LOCAL_PART));
        for (String headerElementName : headerData.keySet()) {
          if (headerData.get(headerElementName) != null) {
            SOAPElement newElement = requestHeader.addChildElement(headerElementName, null,
                requestElementsNamespace);
            newElement.addTextNode(headerData.get(headerElementName).toString());
          }
        }
        return requestHeader;
      } catch (SOAPException e) {
        throw new ServiceException(
            "Unexpected exception constructing SOAP header for: " + adWordsServiceDescriptor, 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 adWordsServiceDescriptor the descriptor of which service's headers
  are being created
  @return a SOAP header object