Class ServiceUtils


  • public final class ServiceUtils
    extends Object
    • Method Detail

      • isSchemaValidationEnabled

        public static boolean isSchemaValidationEnabled​(SchemaValidation.SchemaValidationType type,
                                                        Message message)
        A short cut method to be able to test for if Schema Validation should be enabled for IN or OUT without having to check BOTH and IN or OUT.
        Parameters:
        message -
        type -
      • getSchemaValidationType

        public static SchemaValidation.SchemaValidationType getSchemaValidationType​(Message message)
        A convenience method to check for schema validation config in the message context, and then in the service model. Does not modify the Message context (other than what is done in the getContextualProperty itself)
        Parameters:
        message -
      • makeServiceNameFromClassName

        public static String makeServiceNameFromClassName​(Class<?> clazz)
        Generates a suitable service name from a given class. The returned name is the simple name of the class, i.e. without the package name.
        Parameters:
        clazz - the class.
        Returns:
        the name.
      • makeNamespaceFromClassName

        public static String makeNamespaceFromClassName​(String className,
                                                        String protocol)
        Generates the name of a XML namespace from a given class name and protocol. The returned namespace will take the form protocol://domain, where protocol is the given protocol, and domain the inversed package name of the given class name.

        For instance, if the given class name is org.codehaus.xfire.services.Echo, and the protocol is http, the resulting namespace would be http://services.xfire.codehaus.org.

        Parameters:
        className - the class name
        protocol - the protocol (eg. http)
        Returns:
        the namespace