java - Invalid byte 1 of 1-byte UTF-8 sequence: RestTemplate -
i integrating third party api using rest template, send response in format of xml. of request, getting below error.
could not unmarshal [class com.xxx.searchresponse]: null; nested exception javax.xml.bind.unmarshalexception\n - linked exception:\n[com.sun.org.apache.xerces.internal.impl.io.malformedbytesequenceexception: invalid byte 1 of 1-byte utf-8 sequence.
i tried contenttype "application/xml", "text/plain", "text/xml" , "text/xml,charset=utf-8"
only of response, getting error , xml response has many lines. hard detect characters facing problem. guess content type missing it.
xml element:
<search-response xmlns="" xmlns:info="" xmlns:common=""> <search-response>
when hit third party api in postman, getting content type "text/xml;charset=iso-8859-1"
Comments
Post a Comment