use of org.talend.designer.esb.webservice.ws.wsdlinfo.Function 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.Function in project tesb-studio-se by Talend.
the class TESBConsumerNodeAdapter method loadCurrentFunction.
@Override
public Function loadCurrentFunction() {
String operationName = node.getParamStringValue(METHOD);
if (operationName == null) {
return null;
}
String portName = node.getParamStringValue(PORT_NAME);
if (portName == null) {
return null;
}
String serviceName = node.getParamStringValue(SERVICE_NAME);
String targetNamespace = node.getParamStringValue(SERVICE_NS);
if (serviceName == null || targetNamespace == null) {
return null;
}
QName serviceQName = new QName(targetNamespace, serviceName);
return new Function(operationName, portName, serviceQName);
}
use of org.talend.designer.esb.webservice.ws.wsdlinfo.Function in project tesb-studio-se by Talend.
the class WebServiceUIPresenter method initWithCurrentSetting.
void initWithCurrentSetting() {
Function function = nodeAdapter.loadCurrentFunction();
if (function != null) {
String port = function.getPortName();
currentSetting.setPort(port);
currentSetting.setFunction(function);
functionTableModel.add(function);
portTableModel.add(port);
portFunctionsMap = Collections.singletonMap(port, Collections.singletonList(function));
}
}
use of org.talend.designer.esb.webservice.ws.wsdlinfo.Function in project tesb-studio-se by Talend.
the class CSOAPNodeAdapter method loadCurrentFunction.
@Override
public Function loadCurrentFunction() {
String operationName = node.getParamStringValue(OPERATION_NAME);
if (operationName == null) {
return null;
}
operationName = getExpressionParamValue(operationName);
String portName = node.getParamStringValue(PORT_NAME);
if (portName == null) {
return null;
}
portName = getExpressionParamValue(portName);
portName = portName.substring(portName.indexOf('}') + 1);
portName = TalendQuoteUtils.removeQuotes(portName);
String serviceName = node.getParamStringValue(SERVICE_NAME);
// String targetNamespace = node.getParamStringValue(SERVICE_NS);
if (serviceName == null) /* || targetNamespace == null */
{
return null;
}
QName serviceQName = QName.valueOf(serviceName);
return new Function(operationName, portName, serviceQName);
}
use of org.talend.designer.esb.webservice.ws.wsdlinfo.Function in project tesb-studio-se by Talend.
the class CSOAPNodeAdapter method setNodeSetting.
@Override
public IStatus setNodeSetting(ServiceSetting setting) {
Function currentFunction = setting.getFunction();
node.setParamValue("WSDL_FILE", setting.getWsdlLocation());
String operationName = currentFunction.getName();
operationName = operationName.substring(0, operationName.indexOf('('));
String fullOperationName = "{" + currentFunction.getNameSpaceURI() + "}" + operationName;
node.setParamValue(OPERATION_NAME, TalendTextUtils.addQuotes(fullOperationName));
String fullServiceName = "{" + currentFunction.getServiceNameSpace() + "}" + currentFunction.getServiceName();
node.setParamValue(SERVICE_NAME, TalendTextUtils.addQuotes(fullServiceName));
String fullPortName = "{" + currentFunction.getServiceNameSpace() + "}" + currentFunction.getPortName();
node.setParamValue(PORT_NAME, TalendTextUtils.addQuotes(fullPortName));
final String endpoint = node.getParamStringValue("ADDRESS");
if (endpoint == null || !endpoint.startsWith("context.")) {
node.setParamValue("ADDRESS", TalendTextUtils.addQuotes(currentFunction.getAddressLocation()));
}
IRepositoryViewObject resourceNode = setting.getResourceNode();
if (resourceNode != null) {
final Item item = resourceNode.getProperty().getItem();
String id = item.getProperty().getId();
node.setParamValue("WSDL_FILE_REPO:ROUTE_RESOURCE_TYPE_ID", id);
node.setParamValue("WSDL_FILE_REPO:ROUTE_RESOURCE_TYPE_VERSION", item.getProperty().getVersion());
String classpathUrl = RouteResourcesHelper.getClasspathUrl(item);
if (classpathUrl != null) {
node.setParamValue("WSDL_FILE_REPO:ROUTE_RESOURCE_TYPE_RES_URI", classpathUrl);
}
}
return Status.OK_STATUS;
}
Aggregations