Error while retrieving Documents Zip
Tuesday, July 2, 2019 at 11:32amHi,
We are getting the below error when trying to retrieve documents zip. I have copied my code below. We are using a proxy to connect to one span sandbox url. Can you please help with this issue.
Error:
"406 : {"messageKey":"http.status.406","technical":"","packageId":null,"messageLanguage":null,"entity":null,"parameters":{},"code":406,"message":"Not Acceptable","name":"Not Acceptable"}"
public class GetZipAkana {
public static void main(String args[]){
String url = "https://xxxxx.xxxxxx.com:9905/ESignGetDocV1/packages/{packageId}/documents/zip";
RestTemplate restTemplate = new RestTemplate();
try{
HttpHeaders headers = new HttpHeaders();
String auth;
auth = DataEncrypter.decode("our encrypted username") + ":" + DataEncrypter.decode("password");
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.set("Accept","application/json");
headers.set("Content-type","application/json");
headers.set("X-MUFG-Application-Id" , "soa");
headers.set("X-MUFG-ChannelId", "22");
headers.set("X-MUFG-Request-Uuid", "22");
headers.set("X-MUFG-Request-Ts", "22");
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);
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();
}
}
}
Reply to: Error while retrieving Documents Zip
Tuesday, July 2, 2019 at 11:45amheaders.set(“Accept”,”application/zip”);
? This 406 Not Accept error is returned from OneSpan Sign, which means your connection with OSS was fine. And from the message, it looks like your request header was not set properly. I saw the "Accept" attribute was commented out, could you make the change and restart the server to make sure the code is properly deployed? DuoReply to: Error while retrieving Documents Zip
Tuesday, July 2, 2019 at 12:34pmReply to: Error while retrieving Documents Zip
Tuesday, July 2, 2019 at 12:40pmReply to: Error while retrieving Documents Zip
Tuesday, July 2, 2019 at 12:52pmReply to: Error while retrieving Documents Zip
Tuesday, July 2, 2019 at 01:01pmReply to: Error while retrieving Documents Zip
Tuesday, July 2, 2019 at 02:46pmReply to: Error while retrieving Documents Zip
Thursday, July 4, 2019 at 10:06amReply to: Error while retrieving Documents Zip
Thursday, July 4, 2019 at 10:30amReply to: Error while retrieving Documents Zip
Monday, July 8, 2019 at 10:00amReply to: Error while retrieving Documents Zip
Monday, July 8, 2019 at 10:22am200,Byte array resource [resource loaded from byte array],[Server:"nginx", Date:"Mon, 08 Jul 2019 19:16:55 GMT", Content-Type:"application/zip", Content-Length:"544981", Connection:"keep-alive", Expires:"Thu, 01 Jan 1970 00:00:00 GMT", Cache-control:"no-store, no-cache, must-revalidate", X-Powered-By:"Undertow", Content-Disposition:"attachment; filename="package.zip"", Strict-Transport-Security:"max-age=31536000; includeSubdomains;", Allow:"GET, POST, HEAD, PUT, PATCH, DELETE", P3P:"CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT""]>
So if nothing is changed but the url, we'd better to have an online troubleshooting session to see your actual environment. You can create a support ticket at [email protected] and I will work with our support team to troubleshoot the issue for you. DuoReply to: Error while retrieving Documents Zip
Monday, July 8, 2019 at 10:39amReply to: Error while retrieving Documents Zip
Monday, July 8, 2019 at 11:02am