WebdavHttpURLConnection vs HttpURLConnection
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 124
- Joined: Tue May 29, 2012 5:42 pm
WebdavHttpURLConnection vs HttpURLConnection
Post by sebastienlavandier »
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
Re: WebdavHttpURLConnection vs HttpURLConnection
Hi Sébastien,
Indeed when the Oxygen standalone is started, it registers its own HTTP(S) handlers based on the Apache Components HTTP Client.
And our implementation may not be 100% similar to the Oracle HTTP url connection implementation.
To workaround that you can create directly a sun.net.www.protocol.http.HttpURLConnection class and use it.
Of course you could also send us some sample Java code of how you are using the connection and we could investigate why our connection behaves differently in this case, possibly fix it.
Regards,
Radu
Indeed when the Oxygen standalone is started, it registers its own HTTP(S) handlers based on the Apache Components HTTP Client.
And our implementation may not be 100% similar to the Oracle HTTP url connection implementation.
To workaround that you can create directly a sun.net.www.protocol.http.HttpURLConnection class and use it.
Of course you could also send us some sample Java code of how you are using the connection and we could investigate why our connection behaves differently in this case, possibly fix it.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “SDK-API, Frameworks - Document Types”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service