A call to the webservice in C # returns the found content type of the response "', but the expected' text / xml '

I am currently calling the ColdFusion web service in C #. A web service is simply a simple query used to find users. I can do the search just fine, and it returns the users I'm looking for if I don't try to find Johnson, and then it returns:

Client found response content type of '', but expected 'text/xml'. The request failed with the error message: -- --. 

I do not know why this does not work when searching for this particular string. I thought it might be a timeout, but the error appears immediately after sending the request. Any ideas ???

+4
source share
4 answers

I found a problem, it turned out that in one of the query lines there was an invalid character that could not be placed in xml. Removed an invalid character, and now it works great.

+1
source

can be disabled. try the WireShark network analyzer to see what happens behind the scenes.

+1
source

I would start by calling the service manually and see what the raw return value is. Is there an error? Return null? Some third option?

+1
source

Just to guess. Could it be that this particular request did not find matches, so the web service returns the result without XML (an empty sting in your case)? Does this happen when you ask for any other non-existent name (some "blah blah blah")? If this is correct, it is definitely a logical error in the utility code.

0
source

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


All Articles