0

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"

3 Answers 3

4

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.

Sign up to request clarification or add additional context in comments.

1 Comment

I'll second Erik's answer here. We wrote a filter (we're using Tomcat) that changes all 500s to 200s and that allows you on the Flex side to access the wealth of information returned from a SOAP fault.
2

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.

1 Comment

Try accessing the webservice via your browser/libcurl.
1

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.