private void processRelatesTo() { if (!isAddressingHeaderAlreadyAvailable(WSA_RELATES_TO, true)) { RelatesTo[] relatesTo = messageContextOptions.getRelationships(); if (relatesTo != null) { for (int i = 0, length = relatesTo.length; i < length; i++) { OMElement relatesToHeader = createSOAPHeaderBlock(relatesTo[i].getValue(), WSA_RELATES_TO, relatesTo[i].getExtensibilityAttributes()); String relationshipType = relatesTo[i].getRelationshipType(); if (relatesToHeader != null) { if(!includeOptionalHeaders){ if (Final.WSA_DEFAULT_RELATIONSHIP_TYPE.equals(relationshipType) || Submission.WSA_DEFAULT_RELATIONSHIP_TYPE .equals(relationshipType)) { relationshipType = null; //Omit the attribute. } } if(relationshipType != null){ relatesToHeader.addAttribute(WSA_RELATES_TO_RELATIONSHIP_TYPE, relationshipType, null); } } } } } }