Unsupported content type: text / plain; encoding = ISO-8859-1

I have a web service that should return the player’s data in response. The problem is that when I send the same request to SoapUI, I get a valid response, but when I do this using Java, I return this message to

<faultstring> Unsupported content type: text/plain; charset=ISO-8859-1 </faultstring>.

Any ideas why this is a problem?

This is the request I'm sending:

> <soapenv:Envelope
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:gen=" ">   
> <soapenv:Header/>   
> <soapenv:Body>
>       <gen:GetPlayerDetails>
>          <request>
>             <systemUID>C_GS01</systemUID>
>             <sessionID>TVM0MgAAB9IAAAFEjXyfxbvZ2oU_</sessionID>
>          </request>
>       </gen:GetPlayerDetails>    
> </soapenv:Body>
> </soapenv:Envelope>

SOLVED thanks to @helderdarocha Made some changes (last line) in my HTTP client class:

        HttpClient httpclient = HttpClientBuilder.create().build();
        StringEntity strEntity = new StringEntity(request);
        HttpPost post = new HttpPost("http://10.47.44.163:8080" + endPointURI);
        post.addHeader("Content-type", "text/xml");
+4
source share
1 answer

, . , , Accept:

Accept: application/xml; application/json;

, , Content-type , , , .

Content-type: application/xml

XML, .

+4

Source: https://habr.com/ru/post/1530057/


All Articles