Class MetadataClient


  • public class MetadataClient
    extends Object
    Class used for retrieving metadata at runtime. The intended usage is:

    MetadataClient mClient = new MetadataClient();
    Metadata mData = mClient.retrieveMetadata(someAddress);

    Utility methods will be added for common usages of the metadata. For instance, the service and port QNames from the endpoint can be retrieved from the metadata with:

    Map<QName, List<PortInfo>> names = mClient.getServiceAndPortNames(mData);

    • Constructor Detail

      • MetadataClient

        public MetadataClient()
        Default constructor.
    • Method Detail

      • retrieveMetadata

        public Metadata retrieveMetadata​(@NotNull
                                         String address)
        Method used to load the metadata from the endpoint. First soap 1.2 is used, then 1.1. If both attempts fail, the client will try again adding "/mex" to the address.

        If any wsdl or schema import elements are found with empty location attributes, these attributes are removed. In the case of data returned to JAX-WS through ServiceDescriptorImpl, these attributes are added back in with appropriate location information.

        Parameters:
        address - The address used to query for Metadata
        Returns:
        The metadata object, or null if no metadata could be obtained from the service
        See Also:
        ServiceDescriptorImpl
      • getServiceInformation

        public List<PortInfo> getServiceInformation​(@NotNull
                                                    Metadata data)
        Used to retrieve the service and port names and port addresses from metadata.
        Returns:
        A list of PortInfo objects
        See Also:
        PortInfo