This content has been marked as final. Show 6 replies
This is difficult under the current player/browser techmology.
The problem is that the browser does not pass the full data on to the player when a fault is received.
There are some workarounds involving tricking the server into returning a different status code.
Consider trapping the errors server side and returning a valid result with the fault information included.
Thanks for the reply.
Some questions though,
>>>The problem is that the browser does not pass the full data on to the player when a fault is received.
Which one do you mean by the player and which one do you mean by the browser ?
>>> Consider trapping the errors server side and returning a valid result with the fault information included.
Do you mean instead of the ws throwing the exception, it put the exception info to the return value ? I thought about this too , but i was hoping of a better way to do it.
>>> There are some workarounds involving tricking the server into returning a different status code.
Can you tell me what's the code ?
I saw somewhere that we have to set the status code to 200 so that the exception would be added to the body of the response.
I tried putting this on the .NET code but does not work :
MyBase.Context.Response.StatusCode = 200
Ah ok. I made a mistake by setting the StatusCode inside the Catch clause.
When I set the StatusCode in Application_EndRequest, it does work.
But now I need to find how to check whether the request come from a Flex app and whether it's a request for a webservice.
My portal contains both aspx and webservice , so I can't set StatusCode = 200 for every request.
Sorry this become a lot of discussion about .NET
I'm working with .Net and Flex and webservices.
I don't know if you are trying to get error exceptions or ,for instance ,get something like record from a database doesn't exist.
Because the on fault event is triggered when something has gone wrong with the comunication with the webservice.
To get the errors i set it as my return object
The way you're doing it is one way i thought about too.
I just prefer to throw an exception from the ws when there is an error instead of putting the error message into the return value.
But after googling for sometime , i saw that people having this problem too , and havent found a good solution for this. I might gonna do it like you said.
Some useful links I found :