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


Java SOAPAddress类代码示例

本文整理汇总了Java中javax.wsdl.extensions.soap.SOAPAddress的典型用法代码示例。如果您正苦于以下问题:Java SOAPAddress类的具体用法?Java SOAPAddress怎么用?Java SOAPAddress使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: selectPort

import javax.wsdl.extensions.soap.SOAPAddress; //导入依赖的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.extensions.soap.SOAPAddress; //导入依赖的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: createService

import javax.wsdl.extensions.soap.SOAPAddress; //导入依赖的package包/类
public Service createService(Definition localdef, String serviceName, Binding bind, String mySOAPAddress) {
    Port p = localDef.createPort();
    p.setName(serviceName + "Port");
    try {

        SOAPAddress soapAddress = (SOAPAddress) extensionRegistry.createExtension(Port.class, new QName(NameSpacesEnum.SOAP.getNameSpaceURI(), "address"));
        soapAddress.setLocationURI(mySOAPAddress);
        p.addExtensibilityElement(soapAddress);
    } catch (WSDLException ex) {
        ex.printStackTrace();
    }
    p.setBinding(bind);
    Service s = new ServiceImpl();
    QName serviceQName = new QName(serviceName);
    s.setQName(serviceQName);
    s.addPort(p);
    localDef.addService(s);
    return s;
}
 
开发者ID:jolie,项目名称:jolie,代码行数:20,代码来源:WSDLDocCreator.java

示例4: testEJB3Endpoint

import javax.wsdl.extensions.soap.SOAPAddress; //导入依赖的package包/类
@Test
@RunAsClient
public void testEJB3Endpoint() throws Exception
{
   String soapAddress = "http://" + baseURL.getHost() + ":" + baseURL.getPort() + "/earejb3/EndpointService/Endpoint";
   QName serviceName = new QName("http://eardeployment.jaxws/", "EndpointService");
   Service service = Service.create(new URL(soapAddress + "?wsdl"), serviceName);
   Endpoint port = service.getPort(Endpoint.class);

   //check soap address rewrite to verify jboss-webservices.xml override
   Definition wsdl = getWSDLDefinition(soapAddress + "?wsdl");
   SOAPAddress sa = (SOAPAddress)wsdl.getService(serviceName).getPort("EndpointPort").getExtensibilityElements().iterator().next();
   assertEquals("https://foo-jar:" + JBossWSTestHelper.getSecureServerPort(null, null) + "/earejb3/EndpointService/Endpoint", sa.getLocationURI());

   BindingProvider bp = (BindingProvider)port;
   bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, soapAddress);

   String helloWorld = "Hello world!";
   String retObj = port.echo(helloWorld);
   assertEquals(helloWorld, retObj);
}
 
开发者ID:jbossws,项目名称:jbossws-cxf,代码行数:22,代码来源:JBossWebServicesEarTestCase.java

示例5: testJSEEndpoint

import javax.wsdl.extensions.soap.SOAPAddress; //导入依赖的package包/类
@Test
@RunAsClient
public void testJSEEndpoint() throws Exception
{
   String soapAddress = baseURL + "JSEBean";
   QName serviceName = new QName("http://eardeployment.jaxws/", "EndpointService");
   Service service = Service.create(new URL(soapAddress + "?wsdl"), serviceName);
   Endpoint port = service.getPort(Endpoint.class);

   //check soap address rewrite to verify jboss-webservices.xml override
   Definition wsdl = getWSDLDefinition(soapAddress + "?wsdl");
   SOAPAddress sa = (SOAPAddress)wsdl.getService(serviceName).getPort("EndpointPort").getExtensibilityElements().iterator().next();
   assertEquals("https://foo-test:" + JBossWSTestHelper.getSecureServerPort(null, null) + "/earjse2/JSEBean", sa.getLocationURI());

   BindingProvider bp = (BindingProvider)port;
   bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, soapAddress);

   String helloWorld = "Hello world!";
   String retObj = port.echo(helloWorld);
   assertEquals(helloWorld, retObj);
}
 
开发者ID:jbossws,项目名称:jbossws-cxf,代码行数:22,代码来源:JBossWebServicesEarTestCase.java

示例6: importService

import javax.wsdl.extensions.soap.SOAPAddress; //导入依赖的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

示例7: getSoapPort

import javax.wsdl.extensions.soap.SOAPAddress; //导入依赖的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

示例8: filterWSDL

import javax.wsdl.extensions.soap.SOAPAddress; //导入依赖的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

示例9: getEPRfromWSDL

import javax.wsdl.extensions.soap.SOAPAddress; //导入依赖的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

示例10: getBindingURL

import javax.wsdl.extensions.soap.SOAPAddress; //导入依赖的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

示例11: generateService

import javax.wsdl.extensions.soap.SOAPAddress; //导入依赖的package包/类
private void generateService()
        throws SchemaGenerationException {
    // now add the binding portType and messages corresponding to every operation
    javax.wsdl.Service service = this.wsdlDefinition.createService();
    service.setQName(new QName(this.service.getNamespace(), this.service.getName()));

    Port port = this.wsdlDefinition.createPort();
    port.setName(this.service.getName() + "HttpSoapPort");
    port.setBinding(this.httpSoapBinding);
    ExtensionRegistry extensionRegistry = null;
    try {
        extensionRegistry = WSDLFactory.newInstance().newPopulatedExtensionRegistry();
        SOAPAddress soapAddress = (SOAPAddress) extensionRegistry.createExtension(
                Port.class, new QName("http://schemas.xmlsoap.org/wsdl/soap/", "address"));
        soapAddress.setLocationURI("http://localhost:8080/axis2/services/" + this.service.getName());
        port.addExtensibilityElement(soapAddress);
    } catch (WSDLException e) {
        throw new SchemaGenerationException("Can not crete a wsdl factory");
    }
    service.addPort(port);
    this.wsdlDefinition.addService(service);
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:23,代码来源:WSDL11DefinitionBuilder.java

示例12: getSOAPLocation

import javax.wsdl.extensions.soap.SOAPAddress; //导入依赖的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

示例13: getSOAPLocation

import javax.wsdl.extensions.soap.SOAPAddress; //导入依赖的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

示例14: getEndpointAddress

import javax.wsdl.extensions.soap.SOAPAddress; //导入依赖的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

示例15: getPortAddress

import javax.wsdl.extensions.soap.SOAPAddress; //导入依赖的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


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