use of org.talend.designer.esb.webservice.ws.wsdlinfo.ServiceInfo in project tesb-studio-se by Talend.
the class WebServiceUIPresenter method retrieveData.
public void retrieveData(String wsdlLocation) throws WSDLException, InvocationTargetException {
String wsdlLocationTemp = TalendQuoteUtils.removeQuotesIfExist(wsdlLocation);
Definition definition = nodeAdapter.generateDefinition(wsdlLocationTemp);
currentSetting.setWsdlLocation(TalendQuoteUtils.addQuotes(wsdlLocationTemp));
currentSetting.setDefinition(definition);
List<Function> functionsAvailable = new ArrayList<Function>();
boolean hasRpcOperation = false;
for (ServiceInfo serviceInfo : ComponentBuilder.buildModel(definition)) {
if (serviceInfo.isHasRpcOperation()) {
hasRpcOperation = true;
}
for (OperationInfo oper : serviceInfo.getOperations()) {
Function f = new Function(serviceInfo, oper);
functionsAvailable.add(f);
}
}
currentSetting.setHasRcpOperation(hasRpcOperation);
portFunctionsMap = new LinkedHashMap<String, List<Function>>();
for (Function f : functionsAvailable) {
List<Function> functions = portFunctionsMap.get(f.getPortName());
if (functions == null) {
functions = new ArrayList<Function>();
portFunctionsMap.put(f.getPortName(), functions);
}
functions.add(f);
}
}
use of org.talend.designer.esb.webservice.ws.wsdlinfo.ServiceInfo 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;
}
Aggregations