
tools.dynamia.web.util.HttpRemotingServiceClient Maven / Gradle / Ivy
/*
* Copyright (C) 2021 Dynamia Soluciones IT S.A.S - NIT 900302344-1
* Colombia / South America
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package tools.dynamia.web.util;
import com.googlecode.jsonrpc4j.spring.JsonProxyFactoryBean;
import org.apache.http.client.methods.HttpPost;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.remoting.httpinvoker.HttpComponentsHttpInvokerRequestExecutor;
import org.springframework.remoting.httpinvoker.HttpInvokerClientConfiguration;
import org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean;
import tools.dynamia.commons.BeanUtils;
import tools.dynamia.commons.logger.LoggingService;
import tools.dynamia.commons.logger.SLF4JLoggingService;
import java.io.IOException;
import java.util.Base64;
import java.util.HashMap;
import java.util.Map;
/**
* Helper class to create Spring Remoting service client. Its supports standar java serialization
* {@link HttpInvokerProxyFactoryBean} and {@link JsonProxyFactoryBean for JSONRPC }. Also you can use this class as a
* factory bean in Spring Config classes.
*
* @author Mario Serrano Leones
*/
public class HttpRemotingServiceClient implements FactoryBean {
private final static LoggingService LOGGER = new SLF4JLoggingService(HttpRemotingServiceClient.class);
private String serviceURL;
private String username;
private String password;
private FactoryBean
© 2015 - 2025 Weber Informatics LLC | Privacy Policy