String appSID = "***********************************************";
String appKey = "****************************************";
String fileName = "chinainformation.doc";
//build URI to convert MS Word file to other format using storage
try
{
String strURI = "http://api.aspose.com/v1.1/words/" + fileName + "?format=pdf";
//Use the following line to use API version 1.1
//String strURI = "http://api.aspose.com/v1.1/words/" + fileName + "?format=pdf";
//sign URI
String signedURI = Sign(strURI, appSID, appKey);
InputStream responseStream = ProcessCommand(signedURI, "GET");
boolean response = SaveStreamToFile("c:\\verbingProjects\\MyFile.pdf", responseStream);
responseStream.close();
}
catch(Exception ex)
{
ex.printStackTrace();
}
i get following error::
Forbidden
java.io.IOException: Server returned HTTP response code: 403 for URL: http://api.aspose.com/v1.1/words/chinainformation.doc?format=pdf&appSID=*****************************&signature=****************************************
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1675)
at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1673)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1671)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1244)
at com.aspose.cloud.common.Utils.ProcessCommand(Utils.java:297)
at aposeword.AposeWord.main(AposeWord.java:38)
Caused by: java.io.IOException: Server returned HTTP response code: 403 for URL: http://api.aspose.com/v1.1/words/chinainformation.doc?format=pdf&appSID=*****************************signature=****************************************
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1626)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)
at java.net.HttpURLConnection.getResponseMessage(HttpURLConnection.java:534)
at com.aspose.cloud.common.Utils.ProcessCommand(Utils.java:295)
... 1 more