WebdavHttpURLConnection vs HttpURLConnection
Posted: Mon Sep 14, 2015 10:51 am
Hello,
I am currently developing an Oxygen Author CMS plugin, and I use web services to communicate with the CMS.
More precisely, I use "Spring Rest Template client" for communicate with the CMS.
And I have some strange behavior with this web services...
For example, I implemented a unit test for use the retrieveFunction() method that retrieve me a Function object (Function.class) from the CMS.
I receive a json response that represent a function object.
So the unit test work well.
But when I use the same method (retrieveFunction()) from Oxygen Author CMS plugin, the web service send me an xml response... Of course, in the method we have the same headers, parameters, ...
I find a difference when Spring rest template instantiate a connection
HttpURLConnection connection = openConnection(uri.toURL(), this.proxy);
Unit Test : => sun.net.www.protocol.http.HttpURLConnection
From CMS : => ro.sync.net.protocol.http.WebdavHttpURLConnection
I have find others problems like that, for example with an other WS that retrieve me a list of function object, that can't be parse to a list of object (but in JSON format in this case !).
So, How I can use HttpURLConnection by default ? or If you have an other idea...
Thanks in advance for your help.
Sébastien.L
I am currently developing an Oxygen Author CMS plugin, and I use web services to communicate with the CMS.
More precisely, I use "Spring Rest Template client" for communicate with the CMS.
And I have some strange behavior with this web services...
For example, I implemented a unit test for use the retrieveFunction() method that retrieve me a Function object (Function.class) from the CMS.
I receive a json response that represent a function object.
So the unit test work well.
But when I use the same method (retrieveFunction()) from Oxygen Author CMS plugin, the web service send me an xml response... Of course, in the method we have the same headers, parameters, ...
I find a difference when Spring rest template instantiate a connection
HttpURLConnection connection = openConnection(uri.toURL(), this.proxy);
Unit Test : => sun.net.www.protocol.http.HttpURLConnection
From CMS : => ro.sync.net.protocol.http.WebdavHttpURLConnection
I have find others problems like that, for example with an other WS that retrieve me a list of function object, that can't be parse to a list of object (but in JSON format in this case !).
So, How I can use HttpURLConnection by default ? or If you have an other idea...
Thanks in advance for your help.
Sébastien.L