Here you can find the source of getWSAAddress(W3CEndpointReference ref)
public static String getWSAAddress(W3CEndpointReference ref)
//package com.java2s; //License from project: Open Source License import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.transform.dom.DOMResult; import javax.xml.ws.wsaddressing.W3CEndpointReference; import org.apache.log4j.Level; import org.apache.log4j.Logger; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; public class Main { final static Logger log = Logger.getLogger("WS-NotificationBroker"); public static String getWSAAddress(W3CEndpointReference ref) { try {// www.j a va 2s.c o m Document xmlDocument = null; xmlDocument = DocumentBuilderFactory.newInstance() .newDocumentBuilder().newDocument(); Element element = xmlDocument.createElement("elem"); ref.writeTo(new DOMResult(element)); NodeList nl = element.getElementsByTagNameNS( "http://www.w3.org/2005/08/addressing", "Address"); if (nl != null && nl.getLength() > 0) { Element e = (Element) nl.item(0); log.log(Level.DEBUG, "return " + e.getTextContent().trim() + " for a callback address"); return e.getTextContent().trim(); } } catch (Exception ex) { log.log(Level.WARN, "unable to obtain a WS-Addressing endpoint", ex); ex.printStackTrace(); } return null; } }