use of org.pentaho.di.trans.steps.webservices.wsdl.Wsdl in project pentaho-kettle by pentaho.
the class WebServiceDialog method loadWebService.
private void loadWebService(String anURI) throws KettleException {
anURI = transMeta.environmentSubstitute(anURI);
try {
if (wProxyHost.getText() != null && !"".equals(wProxyHost.getText())) {
Properties systemProperties = System.getProperties();
systemProperties.setProperty("http.proxyHost", transMeta.environmentSubstitute(wProxyHost.getText()));
systemProperties.setProperty("http.proxyPort", transMeta.environmentSubstitute(wProxyPort.getText()));
}
wsdl = new Wsdl(new URI(anURI), null, null, wHttpLogin.getText(), wHttpPassword.getText());
} catch (Exception e) {
wsdl = null;
new ErrorDialog(shell, BaseMessages.getString(PKG, "WebServiceDialog.ERROR0009.UnreachableURI"), BaseMessages.getString(PKG, "WebServiceDialog.ErrorDialog.Title") + anURI, e);
log.logError(BaseMessages.getString(PKG, "WebServiceDialog.ErrorDialog.Title") + anURI, e.getMessage());
return;
}
String text = wOperation.getText();
wOperation.removeAll();
if (wsdl != null) {
List<WsdlOperation> listeOperations = wsdl.getOperations();
Collections.sort(listeOperations, new Comparator<WsdlOperation>() {
public int compare(WsdlOperation op1, WsdlOperation op2) {
return op1.getOperationQName().getLocalPart().compareTo(op2.getOperationQName().getLocalPart());
}
});
for (Iterator<WsdlOperation> itr = listeOperations.iterator(); itr.hasNext(); ) {
WsdlOperation op = itr.next();
wOperation.add(op.getOperationQName().getLocalPart());
if (op.getOperationQName().getLocalPart().equals(text)) {
wOperation.setText(text);
}
}
}
}
use of org.pentaho.di.trans.steps.webservices.wsdl.Wsdl in project pentaho-kettle by pentaho.
the class WebService method initWsdlEnv.
private void initWsdlEnv() throws KettleException {
if (meta.equals(cachedMeta)) {
return;
}
cachedMeta = meta;
try {
cachedWsdl = new Wsdl(new java.net.URI(data.realUrl), null, null, environmentSubstitute(meta.getHttpLogin()), Encr.decryptPasswordOptionallyEncrypted(environmentSubstitute(meta.getHttpPassword())));
} catch (Exception e) {
throw new KettleStepException(BaseMessages.getString(PKG, "WebServices.ERROR0013.ExceptionLoadingWSDL"), e);
}
cachedURLService = cachedWsdl.getServiceEndpoint();
cachedHostConfiguration = HttpClientContext.create();
cachedHttpClient = getHttpClient(cachedHostConfiguration);
// Generate the XML to send over, determine the correct name for the request...
//
cachedOperation = cachedWsdl.getOperation(meta.getOperationName());
if (cachedOperation == null) {
throw new KettleException(BaseMessages.getString(PKG, "WebServices.Exception.OperarationNotSupported", meta.getOperationName(), meta.getUrl()));
}
}
Aggregations