HeaderValidator

public class HeaderValidator

Class for validating the header of an ebXML message. EbxmlValidationException will be thrown in case of error.

Author:Frankie Lam

Methods

validate

public void validate(EbxmlMessage ebxmlMessage)

Validate the header of an ebXML message.

Parameters:
  • ebxmlMessage – The header of the EbxmlMessage object to be validated.

validatePartyId

protected void validatePartyId(Iterator partyIds)

Validates the list of party IDs. The following rules are enforced:

  • Attribute “type” MUST be unique within the list of party IDs.
  • The party ID without the “type” attribute MUST be a URI.
Parameters:
  • partyIds

validatePayload

protected void validatePayload(EbxmlMessage ebxmlMessage)

Validate payload. The following checks are applied: - All payload references with “cid:” as the prefix must exist. - All payload references must be a valid URI.

validateService

protected void validateService(String service, String serviceType)

Validate service element. The following rules are enforced: - Service attribute must be a URI in the absence of type attribute.

Parameters:
  • service

validateURI

protected boolean validateURI(String uri)

Check if a URI is valid.

Parameters:
  • uri – URI in string format to be validated.
Returns:

true if the URI is valid; false otherwise.