/** * Get the SOAP address location for the specified port. * * @param p * A WSDL Port instance. * @return The SOAP address URI. */ protected static String getSOAPAddress( Port p ) { ExtensibilityElement e = findExtensibilityElement( p, SOAP_PORT_ADDRESS_NAME ); if ( e instanceof SOAP12Address ) { return ( (SOAP12Address) e ).getLocationURI(); } else if ( e instanceof SOAPAddress ) { return ( (SOAPAddress) e ).getLocationURI(); } return null; }
public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, PrintWriter pw, Definition def, ExtensionRegistry extReg) throws WSDLException { SOAPAddress soapAddress = (SOAPAddress)extension; if (soapAddress != null) { String tagName = DOMUtils.getQualifiedValue(SOAPConstants.NS_URI_SOAP, "address", def); pw.print(" <" + tagName); DOMUtils.printAttribute(Constants.ATTR_LOCATION, soapAddress.getLocationURI(), pw); Boolean required = soapAddress.getRequired(); if (required != null) { DOMUtils.printQualifiedAttribute(Constants.Q_ATTR_REQUIRED, required.toString(), def, pw); } pw.println("/>"); } }
address = ((SOAP12Address)e).getLocationURI(); } else if (e instanceof SOAPAddress) { address = ((SOAPAddress)e).getLocationURI(); } else if (e instanceof HTTPAddress) { address = ((HTTPAddress)e).getLocationURI();
protected boolean filterPortElement(ExtensibilityElement element) { if (element instanceof HTTPAddress) { return true; } if (element instanceof SOAPAddress) { String uri = ((SOAPAddress) element).getLocationURI(); if (uri.startsWith("http://") || uri.startsWith("https://")) { return true; } } return false; }
private String getAddressLocation(final List extensibilityElements) throws OpenEJBException { final SOAPAddress soapAddress = getExtensibilityElement(SOAPAddress.class, extensibilityElements); final String locationURIString = soapAddress.getLocationURI(); return locationURIString; }
/** * @param port analyzed port * @return Returns the endpoint URL of the given Port */ private String getSOAPLocation(Port port) { String endpoint = null; @SuppressWarnings("unchecked") List<ExtensibilityElement> extensions = port.getExtensibilityElements(); for (Iterator<ExtensibilityElement> i = extensions.iterator(); i.hasNext();) { ExtensibilityElement ext = i.next(); if (ext instanceof SOAPAddress) { SOAPAddress addr = (SOAPAddress) ext; endpoint = addr.getLocationURI(); } } return endpoint; }
public static String getPortAddress(Port port) { List<?> es = port.getExtensibilityElements(); if (es != null && es.size() > 0) { Object ext = es.get(0); if (ext instanceof SOAPAddress) { return ((SOAPAddress)ext).getLocationURI(); } if (ext instanceof SOAP12Address) { return ((SOAP12Address)ext).getLocationURI(); } } return null; }
public static String getPortAddress(Port port) { Object ext = port.getExtensibilityElements().get(0); if (ext instanceof SOAPAddress) { return ((SOAPAddress)ext).getLocationURI(); } if (ext instanceof SOAP12Address) { return ((SOAP12Address)ext).getLocationURI(); } return null; }
public static String getPortAddress(Port port) { Object ext = port.getExtensibilityElements().get(0); if (ext instanceof SOAPAddress) { return ((SOAPAddress)ext).getLocationURI(); } if (ext instanceof SOAP12Address) { return ((SOAP12Address)ext).getLocationURI(); } return null; }
/** * Returns the endpoint of a given port. */ private static URI getEndpoint(Port wsdlPort) { if (wsdlPort != null) { List<?> wsdlPortExtensions = wsdlPort.getExtensibilityElements(); for (Object extension : wsdlPortExtensions) { if (extension instanceof SOAPAddress) { String uri = ((SOAPAddress)extension).getLocationURI(); return (uri == null || "".equals(uri)) ? null : URI.create(uri); } if (extension instanceof SOAP12Address) { SOAP12Address address = (SOAP12Address)extension; String uri = address.getLocationURI(); return (uri == null || "".equals(uri)) ? null : URI.create(uri); } } } return null; }
/** * Return the endpoint address from a <soap:address location="..."> tag */ public static String getAddressFromPort(Port p) { // Get the endpoint for a port List extensibilityList = p.getExtensibilityElements(); for (ListIterator li = extensibilityList.listIterator(); li.hasNext();) { Object obj = li.next(); if (obj instanceof SOAPAddress) { return ((SOAPAddress) obj).getLocationURI(); } else if (obj instanceof UnknownExtensibilityElement){ //TODO: After WSDL4J supports soap12, change this code UnknownExtensibilityElement unkElement = (UnknownExtensibilityElement) obj; QName name = unkElement.getElementType(); if(name.getNamespaceURI().equals(Constants.URI_WSDL12_SOAP) && name.getLocalPart().equals("address")) { return unkElement.getElement().getAttribute("location"); } } } // didn't find it return null; } // getAddressFromPort
static String getSOAPAddressFromElement(ExtensibilityElement extElement) { String returnAddress = null; if (extElement != null) { if (SOAP_11_ADDRESS_ELEMENT.equals(extElement.getElementType())) { returnAddress = ((SOAPAddress)extElement).getLocationURI(); } else if (SOAP_12_ADDRESS_ELEMENT.equals(extElement.getElementType())) { returnAddress = ((SOAP12Address)extElement).getLocationURI(); } } return returnAddress; }
static String getSOAPAddressFromElement(ExtensibilityElement extElement) { String returnAddress = null; if (extElement != null) { if (SOAP_11_ADDRESS_ELEMENT.equals(extElement.getElementType())) { returnAddress = ((SOAPAddress)extElement).getLocationURI(); } else if (SOAP_12_ADDRESS_ELEMENT.equals(extElement.getElementType())) { returnAddress = ((SOAP12Address)extElement).getLocationURI(); } } return returnAddress; }
private Object getAddress() { List<?> list = port.getExtensibilityElements(); for (Object ep : list) { ExtensibilityElement ext = (ExtensibilityElement)ep; if (ext instanceof SOAPAddress) { return ((SOAPAddress)ext).getLocationURI(); } if (ext instanceof AddressType) { return ((AddressType)ext).getLocation(); } } return null; }
private String getPortAddress(Port port) { Iterator it = port.getExtensibilityElements().iterator(); String address = null; while (it.hasNext()) { Object obj = it.next(); if (obj instanceof SOAPAddress) { address = ((SOAPAddress)obj).getLocationURI(); } if (obj instanceof JMSAddress) { address = ((JMSAddress)obj).getAddress(); } if (obj instanceof HTTPAddress) { address = ((HTTPAddress)obj).getLocationURI(); } } return address; }
/** * Returns the SOAP Target URL for this operation. * * @return * @throws SpecificationException */ public String getTargetURL() throws SpecificationException { List<?> extensibilityElements= fPort.getExtensibilityElements(); for (Object supposedSOAPAddress : extensibilityElements) { if (supposedSOAPAddress instanceof SOAPAddress) { SOAPAddress adr= (SOAPAddress) supposedSOAPAddress; return adr.getLocationURI(); } } throw new SpecificationException("I could not find a target URL for operation " + this); }
/** * Get the SOAP Binding Id for the specified {@link Port}. * * @param port The WSDL port. * @return The endpoint address. */ public static String getEndpointAddress(Port port) { String address = null; List<ExtensibilityElement> extElements = port.getExtensibilityElements(); for (ExtensibilityElement extElement : extElements) { if (extElement instanceof SOAPAddress) { address = ((SOAPAddress)extElement).getLocationURI(); break; } else if (extElement instanceof SOAP12Address) { address = ((SOAP12Address)extElement).getLocationURI(); break; } } return address; }
private URL getAddressLocation(Port port) throws DeploymentException { SOAPAddress soapAddress = (SOAPAddress) getExtensibilityElement(SOAPAddress.class, port.getExtensibilityElements()); URL location = null; if (soapAddress != null) { String locationURIString = soapAddress.getLocationURI(); location = getURL(locationURIString); } return location; }
public List<String> getOperationEndpointLocations(String operationName) { List<String> result = new ArrayList<String>(); Collection<Service> services = getDefinition().getServices().values(); Binding binding = getBinding(operationName); for (Service service : services) { Collection<Port> ports = service.getPorts().values(); for (Port port : ports) { if (port.getBinding().equals(binding)) { for (Object obj : port.getExtensibilityElements()) { if (obj instanceof SOAPAddress) { SOAPAddress address = (SOAPAddress) obj; String endpoint = address.getLocationURI(); result.add(endpoint); } } } } } return result; }
protected void visit(Port port) { SOAPAddress add = DefinitionsHelper.getSOAPAddress(port); SOAPBinding sbind = DefinitionsHelper.getSOAPBinding(port.getBinding()); org.codehaus.xfire.service.Binding binding = getService().getBinding(port.getBinding().getQName()); if (binding != null) { Endpoint ep = new Endpoint(new QName(getService().getTargetNamespace(), port.getName()), binding, add.getLocationURI()); getService().addEndpoint(ep); } } }