Java Code Examples for javax.wsdl.Port#getName()

The following examples show how to use javax.wsdl.Port#getName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ManagementBusInvocationPluginSoapHttp.java    From container with Apache License 2.0 6 votes vote down vote up
private String getPortName(Definition wsdl, BindingOperation operation) {
    Binding binding = null;
    final Map<QName, ?> bindings = wsdl.getBindings();
    for (Map.Entry<QName, ?> entry : bindings.entrySet()) {
        Binding examined = wsdl.getBinding((QName) entry.getKey());
        if (examined.getBindingOperations().contains(operation)) {
            binding = examined;
            break;
        }
    }
    Map<QName, Service> services = wsdl.getServices();
    for (Service service : services.values()) {
        Map<QName, Port> ports = service.getPorts();
        for (Port port : ports.values()) {
            if (port.getBinding().equals(binding)) {
                return port.getName();
            }
        }
    }
    return "";
}
 
Example 2
Source File: ODEEndpointUpdater.java    From container with Apache License 2.0 6 votes vote down vote up
/**
 * Checks whether the given Port is defined inside the given WSDL Definition
 *
 * @param port    the Port to check with as QName
 * @param wsdlDef the WSDL Definition to check in
 * @return true if the Port is found inside the given WSDL Definition, else false
 */
private boolean checkIfPortIsInWsdlDef(final QName port, final Definition wsdlDef) {
    for (final Object serviceObj : wsdlDef.getServices().values()) {
        final Service service = (Service) serviceObj;
        for (final Object portObj : service.getPorts().values()) {
            final Port wsdlPort = (Port) portObj;
            final String namespace = wsdlDef.getTargetNamespace();
            final String name = wsdlPort.getName();
            LOG.debug("Checking if port {} matches port with name {} and namespace {} ",
                port.toString(), name, namespace);
            if (name.equals(port.getLocalPart()) && namespace.equals(port.getNamespaceURI())) {
                return true;
            }
        }
    }
    return false;
}
 
Example 3
Source File: CorbaObjectReferenceHelper.java    From cxf with Apache License 2.0 5 votes vote down vote up
public static String getEndpointName(Binding binding, Definition wsdlDef) {
    LOG.log(Level.FINE, "Getting endpoint name for an object reference");
    Collection<Service> services = CastUtils.cast(wsdlDef.getServices().values());
    for (Service serv : services) {
        Collection<Port> ports = CastUtils.cast(serv.getPorts().values());
        for (Port pt : ports) {
            if (pt.getBinding().equals(binding)) {
                return pt.getName();
            }
        }
    }
    return null;
}
 
Example 4
Source File: DynamicWebServiceStubGenerator.java    From openbd-core with GNU General Public License v3.0 4 votes vote down vote up
private String findStubName(Port port) {
	String portName = port.getName();
	if (!JavaUtils.isJavaId(portName))
		portName = Utils.xmlNameToJavaClass(portName);
	return portName;
}