REST API call from oxygen plugin using org.springframework.web.client.RestTemplate
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 168
- Joined: Fri Feb 28, 2020 4:02 pm
REST API call from oxygen plugin using org.springframework.web.client.RestTemplate
Post by vishwavaranasi »
Hello Team ,
We have a oxygen Plugin , where We have a REST API to be called , used the client org.springframework.web.client.RestTemplate
String RestEndpoint ="http://servername:8080/RestAPI/names";
RestTemplate restTemplate = new RestTemplate();
List<Name> allNames=Arrays.stream(restTemplate.getForObject(RestEndpoint, Name[].class)).collect(Collectors.toList());
and we have POM.xml dependency
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.0.1.RELEASE</version>
</dependency>
the standalone call from Eclipse works fine , where when we have our plugin jar under oxygen plugin , nothing is happening , the rest call not even throwing any exception.
would be great if any inputs here.
Thanks,
vishwa
We have a oxygen Plugin , where We have a REST API to be called , used the client org.springframework.web.client.RestTemplate
String RestEndpoint ="http://servername:8080/RestAPI/names";
RestTemplate restTemplate = new RestTemplate();
List<Name> allNames=Arrays.stream(restTemplate.getForObject(RestEndpoint, Name[].class)).collect(Collectors.toList());
and we have POM.xml dependency
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.0.1.RELEASE</version>
</dependency>
the standalone call from Eclipse works fine , where when we have our plugin jar under oxygen plugin , nothing is happening , the rest call not even throwing any exception.
would be great if any inputs here.
Thanks,
vishwa
Thanks,
vishwa
vishwa
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: REST API call from oxygen plugin using org.springframework.web.client.RestTemplate
Hi,
So you have a plugin for Oxygen XML Editor (or Author) standalone right?
Have you added System.out logging to your plugin to see if your code is called? You can start Oxygen using the "oxygen.bat" executable from the Oxygen installation folder if you want to see the logging in the Windows Command Prompt window.
If your code is called but it does not seem to do anything, Oxygen uses for HTTP connections the Apache HTTP client libraries which may have a different behavior than the regular Java HTTP connection libraries.
We have a plugin extension which allows you to take control over the HTTP connection created by Oxygen and use the base "sun.net.www.protocol.http.Handler" handler instead of the Apache HTTP Component libraries:
https://www.oxygenxml.com/doc/versions/ ... lugin.html
Regards,
Radu
So you have a plugin for Oxygen XML Editor (or Author) standalone right?
Have you added System.out logging to your plugin to see if your code is called? You can start Oxygen using the "oxygen.bat" executable from the Oxygen installation folder if you want to see the logging in the Windows Command Prompt window.
If your code is called but it does not seem to do anything, Oxygen uses for HTTP connections the Apache HTTP client libraries which may have a different behavior than the regular Java HTTP connection libraries.
We have a plugin extension which allows you to take control over the HTTP connection created by Oxygen and use the base "sun.net.www.protocol.http.Handler" handler instead of the Apache HTTP Component libraries:
https://www.oxygenxml.com/doc/versions/ ... lugin.html
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 168
- Joined: Fri Feb 28, 2020 4:02 pm
Re: REST API call from oxygen plugin using org.springframework.web.client.RestTemplate
Post by vishwavaranasi »
Thanks Radu , this debug tip "You can start Oxygen using the "oxygen.bat" executable from the Oxygen installation folder if you want to see the logging in the Windows Command Prompt window" helped me to know the errors.
it's nothing to do with Oxygen , i have fixed with using some other 3rd party jar to get the rest call output.
thanks for your help.
Thanks,
vishwa
it's nothing to do with Oxygen , i have fixed with using some other 3rd party jar to get the rest call output.
thanks for your help.
Thanks,
vishwa
Thanks,
vishwa
vishwa
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