public void setHeaderChildString ( BindingProvider soapClient , final String headerName , String childNamespace , String childName , String childValue ) { // Find the parent header SOAPElement SOAPElement parentHeader = ( SOAPElement ) getHeader ( soapClient , headerName ) ; Preconditions . checkNotNull ( parentHeader , "No header element found with name: %s" , headerName ) ; // Add a SOAPElement for the child try { SOAPElement childElement = parentHeader . addChildElement ( new QName ( childNamespace , childName ) ) ; childElement . setTextContent ( childValue ) ; } catch ( SOAPException e ) { throw new ServiceException ( "Failed to set header for child " + childName , e ) ; } }
Adds a child text node named childName to the existing header named headerName .