/** * Return a single instance of WS-Addressing RelatesTo that has a relationship * type of either "http://www.w3.org/2005/08/addressing/reply" or "wsa:Reply". * If no such instance of RelatesTo can be found then return <code>null</code>. * * @return an instance of {@link RelatesTo} */ public RelatesTo getRelatesTo() { if (relationships == null && parent != null) { return parent.getRelatesTo(); } if (relationships == null) { return null; } for (int i = 0, size = relationships.size(); i < size; i++) { RelatesTo relatesTo = (RelatesTo) relationships.get(i); String relationshipType = relatesTo.getRelationshipType(); if (relationshipType.equals(AddressingConstants.Final.WSA_DEFAULT_RELATIONSHIP_TYPE) || relationshipType .equals(AddressingConstants.Submission.WSA_DEFAULT_RELATIONSHIP_TYPE)) { return relatesTo; } } return null; }
/** * Return a single instance of WS-Addressing RelatesTo that has a relationship * type of either "http://www.w3.org/2005/08/addressing/reply" or "wsa:Reply". * If no such instance of RelatesTo can be found then return <code>null</code>. * * @return an instance of {@link RelatesTo} */ public RelatesTo getRelatesTo() { if (relationships == null && parent != null) { return parent.getRelatesTo(); } if (relationships == null) { return null; } for (int i = 0, size = relationships.size(); i < size; i++) { RelatesTo relatesTo = (RelatesTo) relationships.get(i); String relationshipType = relatesTo.getRelationshipType(); if (relationshipType.equals(AddressingConstants.Final.WSA_DEFAULT_RELATIONSHIP_TYPE) || relationshipType .equals(AddressingConstants.Submission.WSA_DEFAULT_RELATIONSHIP_TYPE)) { return relatesTo; } } return null; }
/** * Get WS-Addressing RelatesTo item with a specified type. If there are * multiple RelatesTo items defined with the same type, the one returned * by this method is arbitrary - if you need to handle this case, you can * instead use the {@link #getRelationships()} to retrieve all the items * and check for multiple matches. * * @param type relationship type (URI) * @return item of specified type */ public RelatesTo getRelatesTo(String type) { if (relationships == null && parent != null) { return parent.getRelatesTo(type); } if (relationships == null) { return null; } for (int i = 0, size = relationships.size(); i < size; i++) { RelatesTo relatesTo = (RelatesTo) relationships.get(i); String relationshipType = relatesTo.getRelationshipType(); if (relationshipType.equals(type)) { return relatesTo; } } return null; }
/** * Get WS-Addressing RelatesTo item with a specified type. If there are * multiple RelatesTo items defined with the same type, the one returned * by this method is arbitrary - if you need to handle this case, you can * instead use the {@link #getRelationships()} to retrieve all the items * and check for multiple matches. * * @param type relationship type (URI) * @return item of specified type */ public RelatesTo getRelatesTo(String type) { if (relationships == null && parent != null) { return parent.getRelatesTo(type); } if (relationships == null) { return null; } for (int i = 0, size = relationships.size(); i < size; i++) { RelatesTo relatesTo = (RelatesTo) relationships.get(i); String relationshipType = relatesTo.getRelationshipType(); if (relationshipType.equals(type)) { return relatesTo; } } return null; }
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); } } } } } }