Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8737097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:26:20+00:00 2026-06-13T10:26:20+00:00

We are integrating with a third party that is sending xml with the content-type

  • 0

We are integrating with a third party that is sending xml with the content-type header as text/html. We were planning on using Spring’s RestTemplate to map it to classes we’ve generated from xsds, but the RestTemplate fails to find an appropriate converter to use for the content. The third party refuses to fix the content-type because it might break other partners’ integration.

Is there a way with Spring’s RestTemplate to force it to use a specific converter?
We are basically just doing the following:

RestTemplate restTemplate = new RestTemplate();
XmlClass xmlClass = restTemplate.getForObject("http://example.com/", XmlClass.class);

And get the following exception:

org.springframework.web.client.RestClientException: Could not extract
response: no suitable HttpMessageConverter found for response type
[XmlClass] and content type [text/html;charset=ISO-8859-1] at
org.springframework.web.client.HttpMessageConverterExtractor.extractData(HttpMessageConverterExtractor.java:84)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T10:26:20+00:00Added an answer on June 13, 2026 at 10:26 am

    The solution we implemented was to add a Jaxb2RootElementHttpMessageConverter with MediaType.TEXT_HTML to the RestTemplate HttpMessageConverters. It’s not ideal since it creates a redundant jaxb message converter but it works.

    RestTemplate restTemplate = new RestTemplate();
    List<HttpMessageConverter<?>> messageConverters = new ArrayList<HttpMessageConverter<?>>();
    Jaxb2RootElementHttpMessageConverter jaxbMessageConverter = new Jaxb2RootElementHttpMessageConverter();
    List<MediaType> mediaTypes = new ArrayList<MediaType>();
    mediaTypes.add(MediaType.TEXT_HTML);
    jaxbMessageConverter.setSupportedMediaTypes(mediaTypes);
    messageConverters.add(jaxbMessageConverter);
    restTemplate.setMessageConverters(messageConverters);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm integrating with a third party WCF service that is using Mtom as the
So, integrating this third party tracking service that passes a $_GET parameter to our
I'm using capybara-webkit to test integration with a third party website (I need javascript).
I have a third party api, which has a class that returns an enumerator
I am interacting with a third party application using it's API, and would like
I have read-only access to a database that was set up for a third-party,
Background We are integrating third party email solution into our site. When a user
I am integrating third party code into the web application I am writing in
I'm currently integrating information from a third party API into a wordpress site. What
I am integrating with a third party order management system and I have to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.