Results 1 to 1 of 1

Thread: RESTTemplate / Message Converter: text/plain to Source

  1. #1
    Join Date
    Jul 2008
    Posts
    2

    Default RESTTemplate / Message Converter: text/plain to Source

    I have a web service that returns an XML document and I'd like the RESTTemplate to convert the content of the document to javax.xml.transform.Source. Unfortunately, the web service encodes the document as text/plain. This causes the SourceHTTPMessageConverter to reject the message.

    My initial solution is to use StringHTTPMessageConverter and then parse the document using a DOMBuilder. Another solution seems to be to override the readInternal() method in StringHTTPMessageConverter, performing the conversion there.

    Is there a more elegant way to do this?
    Last edited by sffil; Oct 5th, 2010 at 07:17 PM. Reason: Spelling error

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •