Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cfhttp data lost

Status
Not open for further replies.

chebbi

Programmer
Feb 6, 2002
98
IN
Hi

Iam using cfhttp to talk to a .net web service which returns either string or exception. When it returns string i get data correctly but when it returns exception i need to capture the exception string. Somehow cold fusion loses that data and returns me "500 Internal Server Error" when webservice returns a exception. I used all the cfhttp variables to see if that data is given back in some variable but i dont see it anywhere.

The exception my .net webservice returns is "Divide by zero". I need that sentence as it is captured but instead i get 500 internal server error. Any ideas?

Thanks


Badrinath Chebbi
 
I would guess that the web service is returning a 500 header as well as the string (it probably shouldn't, but it sounds like it does).

Try outputing:
Code:
#cfhttp.header#<br />

<CFDUMP var=&quot;#cfhttp.responseHeader#&quot;>
without doing
Code:
#cfhttp.fileContent#

and seeing if one of those doesn't actually contain an error code (and it's going to be a code, like &quot;500&quot;, not the &quot;Divide by Zero&quot; string you're looking for).





-Carl
 
Hi Carl

Thanks for your time. I actually need the exception sentence &quot;Divide by zero&quot;. I dont find it in any cfhttp variable coming back. Iam getting 500 as status code but i really need that exception sentence. I dont know where that is getting lost.



Badrinath Chebbi
 
It's not in CFHTTP.filecontent either?!?

Try something like:
Code:
<CFIF FindNoCase(&quot;divide by zero&quot;,CFHTTP.filecontent)>
    Divide by zero error
<CFELSE>
    Success, or some other error
</CFIF>

just to make sure.


-Carl
 
Hmmmm... sounds like you'd really need to get deep into the .NET code for the web service in order to figure out what's going on.

At this point, it's probably better to ask the question in the .NET forum.

Or, if you're running MX, have you tried using:
Code:
<CFOBJECT name=&quot;wsMyService&quot; webservice=&quot;...&quot;>
<CFINVOKE webservice=&quot;#wsMyService#&quot; ...>
rather than
Code:
<CFHTTP>
? It's a much more robust solution.


-Carl
 
Hi carl

Thanks gfor ur time but ya this has nothing to do with .net service since when i get the result back in a .net page it works. It is cold fusion which is losing data. Ya i could have tried cfinvoke but unfortunately we dont run mx. Anyways thanks for ur time.

Badrinath Chebbi
 
That's not entirely true. Since .NET ignores a lot of standards, I could very easily see where a .NET service would be able to talk to a .NET page and not be able to talk to a .cfm page. MS made up their own standards and extended others when they developed .NET... whereas ColdFusion needs a service to adhere to standards (at least where webservices are concerned) in order for ColdFusion to understand it.

The very fact that it sounds like (from what you're saying) .NET can send an exception response header AND send content in the same response is highly suspicious. Usually a web service will return one or the other.


-Carl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top