use of org.talend.designer.webservice.ws.wsdlinfo.PortNames 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;
}
use of org.talend.designer.webservice.ws.wsdlinfo.PortNames 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;
}
}
}
}
Aggregations