* Gets the service name of the provided endpoint reference.
* @param ref the endpoint reference.
* @return the service name.
*/
public static QName getServiceName(EndpointReferenceType ref, Bus bus) {
MetadataType metadata = ref.getMetadata();
if (metadata == null) {
return null;
}
for (Object obj : metadata.getAny()) {
if (obj instanceof Element) {
Node node = (Element)obj;
if ((node.getNamespaceURI().equals(JAXWSAConstants.NS_WSAW)
|| node.getNamespaceURI().equals(NS_WSAW_2005))
&& node.getLocalName().equals("ServiceName")) {