1 55 56 package org.jboss.axis.utils; 57 58 import org.jboss.axis.Constants; 59 import org.jboss.logging.Logger; 60 61 import javax.wsdl.Port; 62 import javax.wsdl.extensions.UnknownExtensibilityElement; 63 import javax.wsdl.extensions.soap.SOAPAddress; 64 import javax.xml.namespace.QName ; 65 import java.util.List ; 66 import java.util.ListIterator ; 67 68 69 public class WSDLUtils 70 { 71 private static Logger log = Logger.getLogger(WSDLUtils.class.getName()); 72 73 76 public static String getAddressFromPort(Port p) 77 { 78 List extensibilityList = p.getExtensibilityElements(); 80 for (ListIterator li = extensibilityList.listIterator(); li.hasNext();) 81 { 82 Object obj = li.next(); 83 if (obj instanceof SOAPAddress) 84 { 85 return ((SOAPAddress)obj).getLocationURI(); 86 } 87 else if (obj instanceof UnknownExtensibilityElement) 88 { 89 UnknownExtensibilityElement unkElement = (UnknownExtensibilityElement)obj; 91 QName name = unkElement.getElementType(); 92 if (name.getNamespaceURI().equals(Constants.URI_WSDL12_SOAP) && 93 name.getLocalPart().equals("address")) 94 { 95 return unkElement.getElement().getAttribute("location"); 96 } 97 } 98 } 99 return null; 101 } 103 } | Popular Tags |