Search in sources :

Example 1 with WSDLDiscoveryHelper

use of org.talend.designer.webservice.ws.WSDLDiscoveryHelper in project tdi-studio-se by Talend.

the class RepositoryWebService method getLastFunction.

private void getLastFunction() {
    //$NON-NLS-1$
    IElementParameter METHODPara = connector.getElementParameter("METHOD");
    Object obj = METHODPara.getValue();
    if (obj == null) {
        return;
    }
    if (obj instanceof String) {
        String str = (String) obj;
        //$NON-NLS-1$
        String wsdlUrl = (String) connector.getElementParameter("ENDPOINT").getValue();
        //$NON-NLS-1$
        String currentURL = (String) connector.getElementParameter("PORT_NAME").getValue();
        WSDLDiscoveryHelper ws = new WSDLDiscoveryHelper();
        List<Function> funList = new ArrayList<Function>();
        WebServiceComponent webServiceComponent = connector;
        boolean isUseProxy = webServiceComponent.getElementParameter("USE_PROXY").getValue().toString().equals("true");
        boolean isUseAuth = webServiceComponent.getElementParameter("NEED_AUTH").getValue().toString().equals("true");
        boolean isUseNTLM = webServiceComponent.getElementParameter("USE_NTLM").getValue().toString().equals("true");
        boolean isUseSSL = webServiceComponent.getElementParameter("NEED_SSL_TO_TRUSTSERVER").getValue().toString().equals("true");
        if (isUseProxy) {
            useProxy();
        }
        if (isUseAuth && !isUseNTLM) {
            useAuth();
        }
        if (isUseSSL) {
            useSSL();
        }
        if (serverConfig != null) {
            if (wsdlUrl != null && !wsdlUrl.contains("\"")) {
                funList = ws.getFunctionsAvailable(parseContextParameter(wsdlUrl), serverConfig);
            } else {
                funList = ws.getFunctionsAvailable(wsdlUrl, serverConfig);
            }
        } else {
            if (wsdlUrl != null && !wsdlUrl.contains("\"")) {
                funList = ws.getFunctionsAvailable(parseContextParameter(wsdlUrl));
            } else {
                funList = ws.getFunctionsAvailable(wsdlUrl);
            }
        }
        PortNames retrivePortName = new PortNames();
        retrivePortName.setPortName(currentURL);
        allPortNames.clear();
        allPortNames.add(retrivePortName);
        for (Function fun : funList) {
            if (fun.getName().equals(str)) {
                allfunList.clear();
                allfunList.add(fun);
                if (fun != null) {
                    currentFunction = fun;
                }
                return;
            }
        }
    }
}
Also used : Function(org.talend.designer.webservice.ws.wsdlinfo.Function) PortNames(org.talend.designer.webservice.ws.wsdlinfo.PortNames) WSDLDiscoveryHelper(org.talend.designer.webservice.ws.WSDLDiscoveryHelper) WebServiceComponent(org.talend.designer.webservice.WebServiceComponent) ArrayList(java.util.ArrayList) IElementParameter(org.talend.core.model.process.IElementParameter)

Example 2 with WSDLDiscoveryHelper

use of org.talend.designer.webservice.ws.WSDLDiscoveryHelper in project tdi-studio-se by Talend.

the class RepositoryWebService method getDataFromNet.

private void getDataFromNet() {
    List<Function> funList = new ArrayList<Function>();
    List<PortNames> portNameList = new ArrayList<PortNames>();
    URLValue = wsdlField.getText();
    if (URLValue == null) {
        //$NON-NLS-1$
        URLValue = "";
    }
    final WSDLDiscoveryHelper ws = new WSDLDiscoveryHelper();
    WebServiceComponent webServiceComponent = connector;
    boolean isUseProxy = webServiceComponent.getElementParameter("USE_PROXY").getValue().toString().equals("true");
    boolean isUseNTLM = webServiceComponent.getElementParameter("USE_NTLM").getValue().toString().equals("true");
    boolean isUseAuth = webServiceComponent.getElementParameter("NEED_AUTH").getValue().toString().equals("true");
    if (isUseProxy) {
        useProxy();
    }
    if (isUseAuth && !isUseNTLM) {
        useAuth();
    }
    boolean isUseSSL = webServiceComponent.getElementParameter("NEED_SSL_TO_TRUSTSERVER").getValue().toString().equals("true");
    if (isUseSSL) {
        useSSL();
    }
    if (serverConfig != null) {
        if (URLValue != null && !URLValue.contains("\"")) {
            funList = ws.getFunctionsAvailable(parseContextParameter(URLValue), serverConfig);
        } else {
            funList = ws.getFunctionsAvailable(URLValue, serverConfig);
        }
    } else {
        if (URLValue != null && !URLValue.contains("\"")) {
            funList = ws.getFunctionsAvailable(parseContextParameter(URLValue));
        } else {
            funList = ws.getFunctionsAvailable(URLValue);
        }
    }
    if (!funList.isEmpty()) {
        if (funList.get(0) != null) {
            if (funList.get(0).getPortNames() != null) {
                portNameList = funList.get(0).getPortNames();
            }
        }
    }
    ExtendedTableModel<Function> listModel = listTableView.getExtendedTableModel();
    ExtendedTableModel<PortNames> portListModel = portListTableView.getExtendedTableModel();
    listModel.removeAll();
    listModel.addAll(funList);
    portListModel.removeAll();
    portListModel.addAll(portNameList);
    connection.setPortName(portNameList.get(0).getPortName());
}
Also used : Function(org.talend.designer.webservice.ws.wsdlinfo.Function) PortNames(org.talend.designer.webservice.ws.wsdlinfo.PortNames) WSDLDiscoveryHelper(org.talend.designer.webservice.ws.WSDLDiscoveryHelper) WebServiceComponent(org.talend.designer.webservice.WebServiceComponent) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)2 WebServiceComponent (org.talend.designer.webservice.WebServiceComponent)2 WSDLDiscoveryHelper (org.talend.designer.webservice.ws.WSDLDiscoveryHelper)2 Function (org.talend.designer.webservice.ws.wsdlinfo.Function)2 PortNames (org.talend.designer.webservice.ws.wsdlinfo.PortNames)2 IElementParameter (org.talend.core.model.process.IElementParameter)1