留言板
DownloadUtil auth error
Hi,
I'm developing an Android App with a liferay 7 backend.
Until now I have succesfully used severl Liferay screenlest like Login, and even my own built services with Services Builder.
But I'm trying to use the DownloadUtil class to download a .pdf document from my backend, and allways get the same error. The error is "java.net.ProtocolException: Too many follow-up requests: 21" but debugging I found that this error is caused by another one related with the authentication.
Error 401 (Athentication) in the response value at line 299 in the class com.squareup.okhttp.Call
All parameters looks ok, because I debugged the Liferay code and the formed url to call HttpUtil.download method inside DownloadUtil.downloadWebDAVFile method, is OK (I tested it with mi internet browser and its shows my pdf document).
Regards,
Ibon.
I'm developing an Android App with a liferay 7 backend.
Until now I have succesfully used severl Liferay screenlest like Login, and even my own built services with Services Builder.
But I'm trying to use the DownloadUtil class to download a .pdf document from my backend, and allways get the same error. The error is "java.net.ProtocolException: Too many follow-up requests: 21" but debugging I found that this error is caused by another one related with the authentication.
Error 401 (Athentication) in the response value at line 299 in the class com.squareup.okhttp.Call
Session session = new SessionImpl(context.getString(R.string.liferay_server), new DigestAuthentication("user","pass"));
Callback sessioncallback = new StringCallback() {
public void onFailure(Exception exception) {
// Implement exception handling code
exception.printStackTrace();
}
public void onSuccess(String result) {
Log.d("TRACE--", result);
}
};
session.setCallback(sessioncallback);
DownloadUtil.downloadWebDAVFile(
session,
PortalVersion.V_7,
"guest",
"Folder",
"File.pdf",
callback
);
All parameters looks ok, because I debugged the Liferay code and the formed url to call HttpUtil.download method inside DownloadUtil.downloadWebDAVFile method, is OK (I tested it with mi internet browser and its shows my pdf document).
Regards,
Ibon.