return String.format("{\"input\": %s}", json.toString());
}
- public HashMap<String, String> execute(String payload, String rpc) throws Exception{
+ public HashMap<String, String> execute(String payload, String rpc) throws Exception{
log.info("Configuring Rest Operation for Payload " + payload + " RPC : " + rpc );
HashMap<String, String> outputMessage = new HashMap<String, String>();
Client client = null;
WebResource webResource = null;
ClientResponse clientResponse = null;
+ EncryptionTool et = EncryptionTool.getInstance();
String responseDataType=MediaType.APPLICATION_JSON;
String requestDataType=MediaType.APPLICATION_JSON;
com.sun.jersey.client.urlconnection.HTTPSProperties.PROPERTY_HTTPS_PROPERTIES,
new com.sun.jersey.client.urlconnection.HTTPSProperties(getHostnameVerifier(), sslContext));
client = Client.create(defaultClientConfig);
- client.addFilter(new HTTPBasicAuthFilter(props.getProperty("appc.upload.user"), props.getProperty("appc.upload.pass")));
+ String password = et.decrypt(props.getProperty("appc.upload.pass"));
+ client.addFilter(new HTTPBasicAuthFilter(props.getProperty("appc.upload.user"),password));
webResource = client.resource(new URI(props.getProperty("appc.upload.provider.url")));
webResource.setProperty("Content-Type", "application/json;charset=UTF-8");
-
log.info("Starting Rest Operation.....");
if(HttpMethod.GET.equalsIgnoreCase(rpc)){
clientResponse = webResource.accept(responseDataType).get(ClientResponse.class);