use of javax.wsdl.extensions.soap.SOAPAddress in project tdi-studio-se by Talend.
the class DynamicInvoker method selectPort.
/**
* 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;
}
use of javax.wsdl.extensions.soap.SOAPAddress in project Activiti by Activiti.
the class WSDLImporter method importService.
/**
* 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;
}
use of javax.wsdl.extensions.soap.SOAPAddress in project cxf by apache.
the class FailoverTest method updateWsdlExtensors.
/**
* Exchange the port number in all service addresses on the bus.
* @param port1 current port
* @param port2 new port
*/
private void updateWsdlExtensors(String port1, String port2) {
try {
Definition def = bus.getExtension(WSDLManager.class).getDefinition(wsdlLocation);
Map<?, ?> map = def.getAllServices();
for (Object o : map.values()) {
Service service = (Service) o;
Map<?, ?> ports = service.getPorts();
for (Object p : ports.values()) {
Port port = (Port) p;
List<?> l = port.getExtensibilityElements();
for (Object e : l) {
if (e instanceof SOAPAddress) {
String add = ((SOAPAddress) e).getLocationURI();
int idx = add.indexOf(":" + port1);
if (idx != -1) {
add = add.substring(0, idx) + ":" + port2 + add.substring(idx + port1.length() + 1);
((SOAPAddress) e).setLocationURI(add);
}
}
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
use of javax.wsdl.extensions.soap.SOAPAddress in project Lucee by lucee.
the class WSUtil method getSoapPort.
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");
}
use of javax.wsdl.extensions.soap.SOAPAddress in project cxf by apache.
the class PartialWSDLProcessor method doAppendService.
public static javax.wsdl.Service doAppendService(Definition wsdlDefinition, String existPortName, ExtensionRegistry extReg, Binding binding) throws Exception {
javax.wsdl.Service wsdlService = wsdlDefinition.createService();
wsdlService.setQName(new QName(wsdlDefinition.getTargetNamespace(), existPortName + serviceName));
Port port = wsdlDefinition.createPort();
port.setName(existPortName + portName);
port.setBinding(binding);
SOAPAddress address = PartialWSDLProcessor.setAddrElement(wsdlDefinition, port, extReg);
port.addExtensibilityElement(address);
wsdlService.addPort(port);
return wsdlService;
}
Aggregations