Question

Im using Flex 3 and the WebService component. I started getting the following fault

 HTTP request error

when making a call to service method. This error only showed up and i cant figure out whats causing it

 <mx:WebService
    useProxy="false"
    id= "myService">
         <mx:operation name="getName" resultFormat="object"
        result="getNameResultHandler(event)"
        fault="faultHandler(event)"/>
 </mx:WebService>

i set the wsdl im my init method which i read in as a flashvar. ANy ideas?

the code i use to make the call goes as follows;

var id:Strig = Application.application.parameters.id;
mysERVICE.getname(id);

ok im seeing the following when the error is thrown

[RPC Fault faultString="HTTP request error" faultCode="Server.Error.Request" faultDetail="Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: http://localhost:9081/app/services/RoomLookup"]. URL: http://localhost:9081/`app/services/RoomLookup`"]

the url it shows is different to teh wsdlUrl i supply as a parameter which is

app/services/RoomLookup

is flex appending the localhost or could this be something stored in cache


i already log this and get "Http Request error"

Was it helpful?

Solution

Most SOAP and RPC frameworks will set the HTTP status code of an error response to 500. The Flash Player is not able to process the contents of an HTTP response whose status code is 500, so it can be difficult to work with. Unfortunately, there is no way to work around this problem in the player, so the most common approach seems to be to ensure that the server doesn't set the HTTP status of error responses to 500 for requests whose user agent is a Flash Player.

OTHER TIPS

Add the following to faultHandler():

trace(event.fault.faultString, "Error");
if (event.fault is SOAPFault) {
    var fault:SOAPFault=event.fault as SOAPFault;
    var faultElement:XML=fault.element;
    // ...
}    

That'll give you something to start picking.

Use a http debugger like Fiddler to find out what the exact request/response is. Flex doesn't expose the details of soap errors, or at least it didn't use to. See here, for example.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top