Account
I am a
Developer
Product(s)
Earned badges
Achievement: Latest Unlocked
Preferences
Replies
Topics Started
Topic Started
This user has not created any forum posts.
Replies Created
Reply to: Error while retrieving Documents Zip
Tuesday, July 2, 2019 at 02:46pmThank You Duo.
Reply to: Error while retrieving Documents Zip
Thursday, July 4, 2019 at 10:06amHi Duo,
Please let me know if you are able to check with the support team?
Thanks
Rajesh
Reply to: Error while retrieving Documents Zip
Monday, July 8, 2019 at 10:00amHi Duo,
we are passing the below headers in the request, are we sending it correct? Also can you take a look at the below code and let me know if you see any issues. I tried different ways but still get "406" in the response.
headers.add("Accept", "application/zip");
headers.add("Content-Type", "application/json");
import java.nio.charset.Charset;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.util.HashMap;
import java.util.Map;
import javax.crypto.BadPaddingException;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import org.jboss.resteasy.util.Base64;
import org.springframework.core.io.Resource;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.HttpStatusCodeException;
import org.springframework.web.client.RestTemplate;
import com.unionbank.soa.eip.common.utils.DataEncrypter;
import com.unionbank.soa.eip.constants.IWebserviceConstants;
public class GetZipAkana {
public static void main(String args[]){
String url = "https://ssdfsd.com/ESignGetDocV1/packages/{packageId}/documents/zip";
RestTemplate restTemplate = new RestTemplate();
try{
HttpHeaders headers = new HttpHeaders();
String auth;
auth = DataEncrypter.decode("dasdadadada") + ":" + DataEncrypter.decode("-fsdfsfsfs");
String encodedAuth = Base64.encodeBytes(auth.getBytes(Charset.forName("US-ASCII")));
String authHeader = IWebserviceConstants.BASIC + encodedAuth;
headers.set(IWebserviceConstants.AUTHORIZATION , authHeader);
//headers.setAccept(Arrays.asList(MediaType.APPLICATION_JSON));
headers.add("Content-Type", "application/json");
headers.add("Accept", "application/zip");
HttpEntity entity = new HttpEntity("parameters", headers);
Map params = new HashMap();
params.put("packageId", "Df_zVT0bSq1IFLFAz4ZdQ1q1HOg=");
// ResponseEntity result = restTemplate.exchange(url, HttpMethod.GET, entity, String.class,params);
ResponseEntity result = restTemplate.exchange(url, HttpMethod.GET, entity, Resource.class,params);
System.out.println(result);
}catch(HttpStatusCodeException e){
int statusCode = e.getStatusCode().value();
String errorMessage = e.getResponseBodyAsString();
System.out.println(statusCode + " : " + errorMessage);
}catch (InvalidKeyException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (NoSuchPaddingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (NoSuchAlgorithmException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (BadPaddingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalBlockSizeException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
Thanks
Rajesh
Reply to: Error while retrieving Documents Zip
Monday, July 8, 2019 at 10:39amSure, thank you Duo. I should just send an email to the support team?
Reply to: Error while retrieving Documents Zip
Monday, July 8, 2019 at 11:02amHi Duo,
CS0007605 has been created.
Subscriptions
This user is not subscribed to any release notes.
Subscriptions Release Notes
This user is not subscribed to any release notes.