use of javax.wsdl.extensions.soap12.SOAP12Address in project tesb-studio-se by Talend.
the class WSDLUtils method getPortAddress.
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;
}
use of javax.wsdl.extensions.soap12.SOAP12Address in project tesb-studio-se by Talend.
the class ComponentBuilder method populateComponent.
private static ServiceInfo populateComponent(Service service) {
ServiceInfo serviceInfo = new ServiceInfo();
serviceInfo.setServiceName(service.getQName());
Collection<Port> ports = service.getPorts().values();
for (Port port : ports) {
String soapLocation = null;
SOAPAddress soapAddress = findExtensibilityElement(port.getExtensibilityElements(), SOAPAddress.class);
if (null != soapAddress) {
soapLocation = soapAddress.getLocationURI();
} else {
SOAP12Address soap12Address = findExtensibilityElement(port.getExtensibilityElements(), SOAP12Address.class);
if (null != soap12Address) {
soapLocation = soap12Address.getLocationURI();
}
}
Binding binding = port.getBinding();
for (BindingOperation operation : (Collection<BindingOperation>) binding.getBindingOperations()) {
SOAPOperation soapOperation = findExtensibilityElement(operation.getExtensibilityElements(), SOAPOperation.class);
if (null != soapOperation && OPERATION_TYPE_RPC.equalsIgnoreCase(soapOperation.getStyle())) {
// TESB-6151 disable display of unsupported RPC type.
serviceInfo.setHasRpcOperation(true);
continue;
}
OperationInfo operationInfo = new OperationInfo(operation.getOperation());
operationInfo.setPortName(port.getName());
operationInfo.setNamespaceURI(binding.getPortType().getQName().getNamespaceURI());
if (soapOperation != null) {
operationInfo.setSoapActionURI(soapOperation.getSoapActionURI());
} else {
SOAP12Operation soap12Operation = findExtensibilityElement(operation.getExtensibilityElements(), SOAP12Operation.class);
if (soap12Operation != null) {
operationInfo.setSoapActionURI(soap12Operation.getSoapActionURI());
}
}
operationInfo.setTargetURL(soapLocation);
serviceInfo.addOperation(operationInfo);
}
}
return serviceInfo;
}
use of javax.wsdl.extensions.soap12.SOAP12Address in project tdi-studio-se by Talend.
the class ComponentBuilder method populateComponent.
private ServiceInfo populateComponent(ServiceInfo component, Service service) {
QName qName = service.getQName();
String namespace = qName.getNamespaceURI();
String name = qName.getLocalPart();
component.setServerName(name);
component.setServerNameSpace(namespace);
Map ports = service.getPorts();
Iterator portIter = ports.values().iterator();
while (portIter.hasNext()) {
Port port = (Port) portIter.next();
Binding binding = port.getBinding();
if (port.getName() != null && component.getPortNames() == null) {
List<PortNames> portNames = new ArrayList();
PortNames portName = new PortNames();
portName.setPortName(port.getName());
portNames.add(portName);
component.setPortNames(portNames);
} else if (port.getName() != null && component.getPortNames() != null) {
PortNames portName = new PortNames();
portName.setPortName(port.getName());
component.getPortNames().add(portName);
}
List operations = buildOperations(binding);
Iterator operIter = operations.iterator();
while (operIter.hasNext()) {
OperationInfo operation = (OperationInfo) operIter.next();
Vector addrElems = findExtensibilityElement(port.getExtensibilityElements(), "address");
ExtensibilityElement element = (ExtensibilityElement) addrElems.elementAt(0);
if (element != null && element instanceof SOAPAddress) {
SOAPAddress soapAddr = (SOAPAddress) element;
operation.setTargetURL(soapAddr.getLocationURI());
} else if (element != null && element instanceof SOAP12Address) {
SOAP12Address soapAddr = (SOAP12Address) element;
operation.setTargetURL(soapAddr.getLocationURI());
}
component.addOperation(operation);
}
}
return component;
}
Aggregations