Examples of XmlRpcClient


Examples of org.ofbiz.service.xmlrpc.XmlRpcClient

    private Map<String, Object> serviceInvoker(ModelService modelService, Map<String, Object> context) throws GenericServiceException {
        if (modelService.location == null || modelService.invoke == null)
            throw new GenericServiceException("Cannot locate service to invoke");
       
        XmlRpcClientConfigImpl config = null;
        XmlRpcClient client = null;
        String serviceName = modelService.invoke;
        String engine = modelService.engineName;
        String url = null;
        String login = null;
        String password = null;
        String keyStoreComponent = null;
        String keyStoreName = null;
        String keyAlias  = null;
        try {
            url = ServiceConfigUtil.getEngineParameter(engine, "url");
            login = ServiceConfigUtil.getEngineParameter(engine, "login");
            password = ServiceConfigUtil.getEngineParameter(engine, "password");
            keyStoreComponent = ServiceConfigUtil.getEngineParameter(engine, "keyStoreComponent");
            keyStoreName = ServiceConfigUtil.getEngineParameter(engine, "keyStoreName");
            keyAlias = ServiceConfigUtil.getEngineParameter(engine, "keyAlias");
            config = new XmlRpcClientConfigImpl();
            config.setBasicUserName(login);
            config.setBasicPassword(password);
            config.setServerURL(new URL(url));
        }catch (MalformedURLException e) {
            throw new GenericServiceException("Cannot invoke service : engine parameters are not correct");
        }
        catch (GenericConfigException e) {
            throw new GenericServiceException("Cannot invoke service : engine parameters are not correct");
        }
        if(UtilValidate.isNotEmpty(keyStoreComponent) && UtilValidate.isNotEmpty(keyStoreName) && UtilValidate.isNotEmpty(keyAlias)){
            client = new XmlRpcClient(config, keyStoreComponent, keyStoreName, keyAlias);
        }
        else{
            client = new XmlRpcClient(config);
        }
        List<ModelParam> inModelParamList = modelService.getInModelParamList();

        if (Debug.verboseOn()) {
            Debug.logVerbose("[XMLRPCClientEngine.invoke] : Parameter length - " + inModelParamList.size(), module);
            for (ModelParam p: inModelParamList) {
                Debug.logVerbose("[XMLRPCClientEngine.invoke} : Parameter: " + p.name + " (" + p.mode + ")", module);
            }
        }

        Map<String, Object> result = null;
        Map<String, Object> params = FastMap.newInstance();
        for (ModelParam modelParam: modelService.getModelParamList()) {
            // don't include OUT parameters in this list, only IN and INOUT
            if ("OUT".equals(modelParam.mode) || modelParam.internal) continue;

            Object paramValue = context.get(modelParam.name);
            if (paramValue != null) {
                params.put(modelParam.name, paramValue);
            }
        }
       
        List<Map<String,Object>> listParams = UtilMisc.toList(params);
        try{
            result = UtilGenerics.cast(client.execute(serviceName, listParams.toArray()));
        }catch (XmlRpcException e) {
            result = ServiceUtil.returnError(e.getLocalizedMessage());
        }
        return result;
    }
View Full Code Here

Examples of org.ofbiz.service.xmlrpc.XmlRpcClient

        if (password != null) {
            config.setBasicPassword(password);
        }

        if (keyStoreComponent != null && keyStoreName != null && keyAlias != null) {
            return new XmlRpcClient(config, keyStoreComponent, keyStoreName, keyAlias);
        } else {
            return new XmlRpcClient(config);
        }
    }
View Full Code Here

Examples of org.ofbiz.webapp.xmlrpc.XmlRpcClient

        if (password != null) {
            config.setBasicPassword(password);
        }

        if (keyStoreComponent != null && keyStoreName != null && keyAlias != null) {
            return new XmlRpcClient(config, keyStoreComponent, keyStoreName, keyAlias);
        } else {
            return new XmlRpcClient(config);
        }
    }
View Full Code Here

Examples of org.xmlrpc.android.XMLRPCClient

  @Override
    public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
   
    uri = URI.create("http://10.0.2.2:8888");
    client = new XMLRPCClient(uri);

    setContentView(R.layout.main);
        testResult = (TextSwitcher) findViewById(R.id.text_result);
       
        LayoutInflater inflater = LayoutInflater.from(this);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.