use of lucee.runtime.net.rpc.client.WSClient in project Lucee by lucee.
the class RemoteClientImpl method getId.
@Override
public String getId(Config config) {
if (id != null)
return id;
Struct attrColl = new StructImpl();
attrColl.setEL(KeyConstants._action, "getToken");
Struct args = new StructImpl();
args.setEL(KeyConstants._type, getType());
args.setEL(RemoteClientTask.PASSWORD, getAdminPasswordEncrypted());
args.setEL(RemoteClientTask.CALLER_ID, "undefined");
args.setEL(RemoteClientTask.ATTRIBUTE_COLLECTION, attrColl);
try {
WSClient rpc = WSClient.getInstance(null, getUrl(), getServerUsername(), getServerPassword(), getProxyData());
Object result = rpc.callWithNamedValues(config, KeyConstants._invoke, args);
return id = IdentificationImpl.createId(securityKey, Caster.toString(result, null), false, null);
} catch (Throwable t) {
ExceptionUtil.rethrowIfNecessary(t);
return null;
}
}
use of lucee.runtime.net.rpc.client.WSClient in project Lucee by lucee.
the class Invoke method doWebService.
/**
* @param webservice
* @throws PageException
*/
private void doWebService(String webservice) throws PageException {
if (username != null) {
if (password == null)
password = "";
}
ProxyData pd = StringUtil.isEmpty(proxy.getServer()) ? null : proxy;
WSClient ws = username != null ? WSClient.getInstance(pageContext, webservice, username, password, pd) : WSClient.getInstance(pageContext, webservice, null, null, pd);
Object rtn = ws.callWithNamedValues(pageContext, KeyImpl.init(method), data);
// return
if (!StringUtil.isEmpty(returnvariable))
pageContext.setVariable(returnvariable, rtn);
// throw new ApplicationException("type webservice is not yet implemented for tag invoke");
}
Aggregations