当前位置: 首页>>代码示例>>Java>>正文


Java Port.getExtensibilityElements方法代码示例

本文整理汇总了Java中javax.wsdl.Port.getExtensibilityElements方法的典型用法代码示例。如果您正苦于以下问题:Java Port.getExtensibilityElements方法的具体用法?Java Port.getExtensibilityElements怎么用?Java Port.getExtensibilityElements使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.wsdl.Port的用法示例。


在下文中一共展示了Port.getExtensibilityElements方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: selectPort

import javax.wsdl.Port; //导入方法依赖的package包/类
/**
 * Method selectPort
 *
 * @param ports
 * @param portName
 *
 * @return
 *
 * @throws Exception
 */
public Port selectPort(Map ports, String portName) throws Exception {
    Iterator valueIterator = ports.keySet().iterator();
    while (valueIterator.hasNext()) {
        String name = (String) valueIterator.next();

        if ((portName == null) || (portName.length() == 0)) {
            Port port = (Port) ports.get(name);
            List list = port.getExtensibilityElements();

            for (int i = 0; (list != null) && (i < list.size()); i++) {
                Object obj = list.get(i);
                if (obj instanceof SOAPAddress) {
                    return port;
                }
            }
        } else if ((name != null) && name.equals(portName)) {
            return (Port) ports.get(name);
        }
    }
    return null;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:32,代码来源:DynamicInvoker.java

示例2: importService

import javax.wsdl.Port; //导入方法依赖的package包/类
/**
 * Imports the service from the WSDL service definition
 */
protected WSService importService(Service service) {
    String name = service.getQName().getLocalPart();
    Port port = (Port) service.getPorts().values().iterator().next();
    String location = "";

    List extensionElements = port.getExtensibilityElements();
    for (Object extension : extensionElements) {
        if (extension instanceof SOAPAddress) {
            SOAPAddress address = (SOAPAddress) extension;
            location = address.getLocationURI();
        }
    }

    WSService wsService = new WSService(this.namespace + name, location, this.wsdlLocation);
    return wsService;
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:20,代码来源:WSDLImporter.java

示例3: importService

import javax.wsdl.Port; //导入方法依赖的package包/类
/**
 * Imports the service from the WSDL service definition
 */
private WSService importService(Service service) {
  String name = service.getQName().getLocalPart();
  Port port = (Port) service.getPorts().values().iterator().next();
  String location = "";
  
  List extensionElements = port.getExtensibilityElements();
  for (Object extension : extensionElements) {
    if (extension instanceof SOAPAddress) {
      SOAPAddress address = (SOAPAddress) extension;
      location = address.getLocationURI();
    }
  }

  WSService wsService = new WSService(this.namespace + name, location, this.wsdlLocation);
  return wsService;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:20,代码来源:WSDLImporter.java

示例4: getSoapPort

import javax.wsdl.Port; //导入方法依赖的package包/类
public static Port getSoapPort(javax.wsdl.Service service) throws RPCException {
	String name = null;
	Port port = null;
	List list = null;
	Map ports = service.getPorts();
	Iterator it;
	Iterator<Port> itr = ports.values().iterator();
	Object v;
	while(itr.hasNext()) {
		port = itr.next();
		
		list=port.getExtensibilityElements();
		if(list != null) {
			it = list.iterator();
			while(it.hasNext()) {
				v=it.next();
				if(v instanceof SOAPAddress) {
					return port;
				}
			}

		}
	}
	throw new RPCException("Can't locate port entry for service " + service.getQName().toString() + " WSDL");
}
 
开发者ID:lucee,项目名称:Lucee4,代码行数:26,代码来源:WSUtil.java

示例5: filterWSDL

import javax.wsdl.Port; //导入方法依赖的package包/类
/**
 * Filters the WSDL document.
 *
 * @param definition location pointing to a WSDL XML definition.
 * @param propertyResolver the Property Resolver
 */
public static void filterWSDL(Definition definition, PropertyResolver propertyResolver) {
    for (Object serviceObject : definition.getServices().values()) {
        Service service = (Service) serviceObject;
        for (Object portObject : service.getPorts().values()) {
            Port port = (Port) portObject;
            for (Object extObject : port.getExtensibilityElements()) {
                if (extObject instanceof SOAPAddress) {
                    SOAPAddress address = (SOAPAddress) extObject;
                    String toReplace = Strings.replaceProperties(address.getLocationURI(), propertyResolver);
                    if (!toReplace.isEmpty() && !toReplace.equals(address.getLocationURI())) {
                        address.setLocationURI(toReplace);
                    }
                }
            }
        }
    }
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:24,代码来源:WSDLUtil.java

示例6: getBindingId

import javax.wsdl.Port; //导入方法依赖的package包/类
/**
 * Get the SOAP Binding Id for the specified {@link Port}.
 *
 * @param port The WSDL port.
 * @param mtomEnabled MTOM feature boolean
 * @return The SOAPBinding Id found on the port.
 */
public static String getBindingId(Port port, Boolean mtomEnabled) {
    String bindingId = null; 
    List<ExtensibilityElement> extElements = port.getExtensibilityElements();
    for (ExtensibilityElement extElement : extElements) {
        if (extElement instanceof SOAP12Address) {
            if (mtomEnabled) {
                bindingId = javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_MTOM_BINDING;
            } else {
                bindingId = javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_BINDING;
            }
            break;
        } else {
            if (mtomEnabled) {
                bindingId = javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_MTOM_BINDING;
            } else {
                bindingId = javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_BINDING;
            }
            break;
        }
    }
    return bindingId;
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:30,代码来源:WSDLUtil.java

示例7: getEPRfromWSDL

import javax.wsdl.Port; //导入方法依赖的package包/类
/**
 * Get the EPR of this service from the WSDL.
 *
 * @param wsdlDef     WSDL Definition
 * @param serviceName service name
 * @param portName    port name
 * @return XML representation of the EPR
 */
public static String getEPRfromWSDL(
        final Definition wsdlDef,
        final QName serviceName,
        final String portName) {
    Service serviceDef = wsdlDef.getService(serviceName);
    if (serviceDef != null) {
        Port portDef = serviceDef.getPort(portName);
        if (portDef != null) {
            for (Object extElmt : portDef.getExtensibilityElements()) {
                if (extElmt instanceof SOAPAddress) {
                    return ((SOAPAddress) extElmt).getLocationURI();
                } else if (extElmt instanceof HTTPAddress) {
                    return ((HTTPAddress) extElmt).getLocationURI();
                } else if (extElmt instanceof SOAP12Address) {
                    return ((SOAP12Address) extElmt).getLocationURI();
                }
            }
        }
    }
    return null;
}
 
开发者ID:wso2,项目名称:carbon-business-process,代码行数:30,代码来源:AxisServiceUtils.java

示例8: getBindingURL

import javax.wsdl.Port; //导入方法依赖的package包/类
/**
 * Obtains the accessUrl from the WSDL
 *
 * @param port
 * @return a string url
 * @throws MalformedURLException
 */
private String getBindingURL(Port port) throws MalformedURLException {

        String bindingUrl = null;
        for (Object element : port.getExtensibilityElements()) {
                if (element instanceof SOAPAddress) {
                        SOAPAddress address = (SOAPAddress) element;
                        URL locationURI = new URL(address.getLocationURI());
                        if (locationURI != null) {
                                bindingUrl = urlLocalizer.rewrite(locationURI);
                                break;
                        }
                }
        }
        return bindingUrl;
}
 
开发者ID:apache,项目名称:juddi,代码行数:23,代码来源:WSDL2UDDI.java

示例9: getWSDLSOAPAddress

import javax.wsdl.Port; //导入方法依赖的package包/类
/**
 * Return the SOAP Address from the WSDL for this port.
 *
 * @return The SOAP Address from the WSDL for this port or null.
 */
public String getWSDLSOAPAddress() {
    if (wsdlSOAPAddress == null) {
        Port wsdlPort = getWSDLPort();
        if (wsdlPort != null) {
            // The port is in the WSDL, so see if it has a SOAP address extensibility element specified.
            List extElementList = wsdlPort.getExtensibilityElements();
            for (Object listElement : extElementList) {
                ExtensibilityElement extElement = (ExtensibilityElement)listElement;
                if (isSOAPAddressElement(extElement)) {
                    String soapAddress = getSOAPAddressFromElement(extElement);
                    if (!DescriptionUtils.isEmpty(soapAddress)) {
                        wsdlSOAPAddress = soapAddress;
                    }
                }
            }
        }
    }
    return wsdlSOAPAddress;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:25,代码来源:EndpointDescriptionImpl.java

示例10: getSOAPLocation

import javax.wsdl.Port; //导入方法依赖的package包/类
/**
 * @param port analyzed port
 * @return Returns the endpoint URL of the given Port
 */
private String getSOAPLocation(Port port) {
    String endpoint = null;
    @SuppressWarnings("unchecked") // Can't change the API
    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;
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:19,代码来源:ServiceRefFactory.java

示例11: getSOAPLocation

import javax.wsdl.Port; //导入方法依赖的package包/类
/**
 * @param port analyzed port
 * @return Returns the endpoint URL of the given Port
 */
private String getSOAPLocation(Port port) {
    String endpoint = null;
    List extensions = port.getExtensibilityElements();
    for (Iterator i = extensions.iterator(); i.hasNext();) {
        ExtensibilityElement ext = (ExtensibilityElement) i.next();
        if (ext instanceof SOAPAddress) {
            SOAPAddress addr = (SOAPAddress) ext;
            endpoint = addr.getLocationURI();
        }
    }
    return endpoint;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:17,代码来源:ServiceRefFactory.java

示例12: getEndpointAddress

import javax.wsdl.Port; //导入方法依赖的package包/类
/**
 * 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;
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:21,代码来源:WSDLUtil.java

示例13: getPortAddress

import javax.wsdl.Port; //导入方法依赖的package包/类
public static String getPortAddress(final Port port) {
    final Collection<?> extensibilityElements = port.getExtensibilityElements();
    SOAPAddress soapAddress = findExtensibilityElement(extensibilityElements, SOAPAddress.class);
    if (null != soapAddress) {
        return soapAddress.getLocationURI();
    }
    SOAP12Address soap12Address = findExtensibilityElement(extensibilityElements, SOAP12Address.class);
    if (null != soap12Address) {
        return soap12Address.getLocationURI();
    }
    return null;
}
 
开发者ID:Talend,项目名称:tesb-studio-se,代码行数:13,代码来源:WSDLUtils.java

示例14: getWSDLPortsUsingSOAPAddress

import javax.wsdl.Port; //导入方法依赖的package包/类
public List<Port> getWSDLPortsUsingSOAPAddress(List<Port> wsdlPorts) {
    ArrayList<Port> portsUsingAddress = new ArrayList<Port>();
    if (wsdlPorts != null && !wsdlPorts.isEmpty()) {
        for (Port checkPort : wsdlPorts) {
            List extensibilityElementList = checkPort.getExtensibilityElements();
            for (Object checkElement : extensibilityElementList) {
                if (EndpointDescriptionImpl
                        .isSOAPAddressElement((ExtensibilityElement)checkElement)) {
                    portsUsingAddress.add(checkPort);
                }
            }
        }
    }
    return portsUsingAddress;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:16,代码来源:ServiceDescriptionImpl.java

示例15: getServiceDetails

import javax.wsdl.Port; //导入方法依赖的package包/类
/**
 * Reads the WSDL and determines the target namespace.
 * 
 * @param locator
 *            The URL of the WSDL.
 * @param host
 *            optional the host to be used when the one from the wsdl must
 *            not be used
 * @return The service's target namespace.
 * @throws WSDLException
 *             Thrown in case the WSDL could not be evaluated.
 */
private WSPortDescription getServiceDetails(WSDLLocator locator, String host)
        throws WSDLException {
    WSDLFactory wsdlFactory = WSDLFactory.newInstance();

    WSDLReader wsdlReader = wsdlFactory.newWSDLReader();
    Definition serviceDefinition = wsdlReader.readWSDL(locator);
    String tns = serviceDefinition.getTargetNamespace();
    // read the port name
    String endpointURL = null;
    final Map<?, ?> services = serviceDefinition.getServices();
    if (services != null) {
        for (Object serviceValue : services.values()) {
            javax.wsdl.Service service = (javax.wsdl.Service) serviceValue;
            Map<?, ?> ports = service.getPorts();
            if (ports != null) {
                for (Object portValue : ports.values()) {
                    Port port = (Port) portValue;
                    List<?> extensibilityElements = port
                            .getExtensibilityElements();
                    for (Object ex : extensibilityElements) {
                        ExtensibilityElement ext = (ExtensibilityElement) ex;
                        if (ext instanceof SOAPAddress) {
                            SOAPAddress address = (SOAPAddress) ext;
                            endpointURL = address.getLocationURI();
                            if (host != null) {
                                int idx = endpointURL.indexOf("//") + 2;
                                String tmp = endpointURL.substring(0, idx)
                                        + host
                                        + endpointURL.substring(endpointURL
                                                .indexOf(':', idx));
                                endpointURL = tmp;
                            }
                        }
                    }
                }
            }
        }
    }

    WSPortDescription result = new WSPortDescription();
    result.setTargetNamespace(tns);
    result.setEndpointURL(endpointURL);
    Element versionElement = serviceDefinition.getDocumentationElement();
    if (versionElement != null) {
        result.setVersion(versionElement.getTextContent());
    }
    return result;
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:61,代码来源:WSPortConnector.java


注:本文中的javax.wsdl.Port.getExtensibilityElements方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。