* Gets the service name of the provided endpoint reference.
* @param ref the endpoint reference.
* @return the service name.
*/
public static QName getServiceName(EndpointReferenceType ref) {
MetadataType metadata = ref.getMetadata();
if (metadata != null) {
for (Object obj : metadata.getAny()) {
if (obj instanceof Element) {
Node node = (Element)obj;
if (node.getNamespaceURI().equals("http://www.w3.org/2005/08/addressing/wsdl")
&& node.getLocalName().equals("ServiceName")) {
String content = node.getTextContent();