Question
· Sep 1, 2021

Change Content-Type in webservice call

Hello!

I call a Java-based web service from HC and get an error message back:

"ERROR # 6243: HTTP request to SOAP WebService returned response with unexpected CONTENT-TYPE: text / html; charset = utf-8."


The content (payload) that is sent from my HC-client is coded in iso-8859-1 but SOAP debug shows that Soap envelope  to be sent with:

"Output from Web client with SOAP action = urn: submitFile
<? xml version = "1.0" encoding = "UTF-8"?> etc "

and I guess that's what is causing the error message?

How can I change from "UTF-8 to ISO-8859-1 in the soapcall??

Grateful for answers!

Regards Michael

Product version: IRIS 2020.1
Discussion (5)2
Log in or sign up to continue

Hi Michael,

It's a little difficult to tell just from the description you provided what the problem exactly is, but my guesstimate would be that it actually is not related to the encoding (UTF8 vs ISO-8859-1) of what you are sending, but something to do with the response you are getting back.

As the error you quoted mentions - "... returned response with unexpected...".

And specifically the error is complaining about the content-type being text/html where it should probably be expected to be (in the case of SOAP) xml.

So it looks like you provided an extract from the SOAP log - but of what was sent (Output) but not what was received back.

Maybe share that part and we'd be able to help a little more.

Hello and thank you very much for your answer! That/this was/is the response in SOAP log (I just deleted Style/css info): 

****************************************************
Input to Web client with SOAP action = urn: submitFile ERROR # 6243: HTTP request to SOAP WebService returned response with unexpected CONTENT-TYPE: text / html; charset = utf-8.
Input to Web client with SOAP action = urn: submitFile ERROR # 6243: HTTP request to SOAP WebService returned response with unexpected CONTENT-TYPE: text / html; charset = utf-8.
HTTP Status 500 - Internal Server Error.
The server encountered an unexpected condition that prevented it from fulfilling the request. javax.servlet.ServletException: An error occurred
see.fohm.sminet.util.CheckFilter.doFilter (CheckFilter.java:38)
org.apache.catalina.filters.ExpiresFilter.doFilter (ExpiresFilter.java:1232). Apache Tomcat / 8.5.39 (Ubuntu) End.
************************************************
We run in windows, not Ubuntu so it must come from their service 
Regards Michael

Thanks for filling in the picture Michael.
So this seems to fit into the theory I had about the error indicating your SOAP client is not receiving the response it expected.

You can see the server (the SOAP service) you are turning to is running into an internal error (HTTP status 500) and you also have details about the error they ran into "javax.... " and their relevant stack.

I suggest, if it is possible, that you turn to the entity that is behind this service and report to them the error you are getting (makes sense also to share with them what you see in the log that you are sending to them).

And they might be able to help you.