com.sun.xml.ws.mex.client
Class MetadataClient

java.lang.Object
  extended by com.sun.xml.ws.mex.client.MetadataClient

public class MetadataClient
extends java.lang.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 Summary
MetadataClient()
          Default constructor.
 
Method Summary
 java.util.List<PortInfo> getServiceInformation(Metadata data)
          Used to retrieve the service and port names and port addresses from metadata.
 Metadata retrieveMetadata(MetadataReference reference)
          Currently only supports Get requests (not Get Metadata), so we only need the reference's address.
 Metadata retrieveMetadata(java.lang.String address)
          Method used to load the metadata from the endpoint.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetadataClient

public MetadataClient()
Default constructor.

Method Detail

retrieveMetadata

public Metadata retrieveMetadata(@NotNull
                                 java.lang.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

retrieveMetadata

public Metadata retrieveMetadata(@NotNull
                                 MetadataReference reference)
Currently only supports Get requests (not Get Metadata), so we only need the reference's address. Any metadata about the request is ignored.

See Also:
retrieveMetadata(String)

getServiceInformation

public java.util.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