Search in sources :

Example 1 with ClientInterface

use of com.dexels.navajo.client.ClientInterface in project navajo by Dexels.

the class ProxyMap method store.

@Override
public void store() throws MappableException, UserException {
    if (server == null)
        throw new UserException(-1, "ProxyMap error: no server URI specified, e.g. localhost/servlet/Postman");
    try {
        ClientInterface nc = NavajoClientFactory.createClient();
        inMessage.removeHeader();
        nc.setUsername(username == null ? access.rpcUser : username);
        nc.setPassword(password == null ? access.rpcPwd : password);
        nc.setAllowCompression(true);
        nc.setServerUrl(server);
        Navajo out = nc.doSimpleSend(inMessage, (method == null ? access.rpcName : method));
        access.setOutputDoc(out);
    } catch (Exception e) {
        throw new UserException(-1, e.getMessage());
    }
}
Also used : UserException(com.dexels.navajo.script.api.UserException) ClientInterface(com.dexels.navajo.client.ClientInterface) Navajo(com.dexels.navajo.document.Navajo) UserException(com.dexels.navajo.script.api.UserException) MappableException(com.dexels.navajo.script.api.MappableException)

Example 2 with ClientInterface

use of com.dexels.navajo.client.ClientInterface in project navajo by Dexels.

the class ScriptTestContext method callService.

public Navajo callService(String script, Navajo input, String altProfile) throws ClientException {
    if (input == null) {
        input = NavajoFactory.getInstance().createNavajo();
    }
    ClientInterface c = NavajoClientFactory.getClient();
    setupClient(c, altProfile);
    // Navajo result = c.doSimpleSend(input,"", script,"","",-1,false,false);
    Navajo result = c.doSimpleSend(input, script);
    navajoMap.put(script, result);
    return result;
}
Also used : ClientInterface(com.dexels.navajo.client.ClientInterface) Navajo(com.dexels.navajo.document.Navajo)

Aggregations

ClientInterface (com.dexels.navajo.client.ClientInterface)2 Navajo (com.dexels.navajo.document.Navajo)2 MappableException (com.dexels.navajo.script.api.MappableException)1 UserException (com.dexels.navajo.script.api.UserException)1