views:

280

answers:

4

I am currently calling a ColdFusion web service in C#. The web service is just a simple query used to search for users. I can search just fine and it returns the users I search for unless I try searching for 'Johnson' then it returns:

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

--.

I don't know why it doesn't work when searching for that specific string. I thought it might be timing out but the error pops up immediately after sending the request. Any ideas???

+1  A: 

may be output is corrupt. try network analyzer WireShark to see what's going on behind the scene.

Andrey
WireShark reports that it is returning a server 500 error
Scott Chantry
.net should throw more relevant exception, because 500 means error. i think something went wrong on server side, check it
Andrey
As Andrey states, 500 errors are uncaught exceptions. Basically, something went wrong (JRun crashed, syntax error, whatever) and the server stack doesn't know how to cleanly handle the error.
Ben Doom
+1  A: 

I'd start by calling the service manually, and seeing what the raw return value is. Is it throuwing an error? Returning null? Some third option?

Ben Doom
If I call the function in the web browser, it returns just fine. I just monitored the response in WireShark and I see a server 500 error. Why would that happen?
Scott Chantry
Server 500 is some sort of error happening in ColdFusion. Check the ColdFusion logs.
Terry Ryan
I found the problem in the ColdFusion logs, turns out there was an invalid character that was trying to be returned. I removed the character from the users name and it works fine now. Thanks for the help.
Scott Chantry
A: 

Just a guess. Can it be that this specific query has no matches found, so web-service returns the non-XML result (empty sting in your case)? Does this happen when you ask any other non-existing name (some "blah-blah-blah")? If this is correct, it's definitely a logical bug in service code.

Sergii
A: 

I found the problem, turns out there was an invalid character being returned in one of the rows in the query that couldn't be put in the xml. Removed the invalid character and it works fine now.

Scott Chantry