I am modifying a dashboard application to access a web service rather than use XML. It works in the debugger but stops working as soon as I deploy the HTML/SWF to a web server.
If I access the html file from the local filesystem it works. (file://path/swf.html) As soon as I try that by loading it from the web server, the SWF loads, but the call to the web service just never occurs. (http://localhost/swf.html) I have used a packet sniffer to look for the call to the web service and I have tried watching from the web service side. I can see the call when I use the "file:" method or debugging from Flex Builder, but not using the "http:" method.
I imported the WSDL so I am using generated code.
I have the following in the crossdomain.xml files on both the server hosting the SWF and the server hosting the web service. (I don't think it's required to be on both but I am pretty much out of ideas.)
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<allow-access-from domain="*" />
Any help here would be appreciated.
Try adding an <mx:TraceTarget level="0" /> to your MXML, launch your application in debug from Flex Builder and watch the console for detailed trace information.
Have you registered fault event listeners on your service to report any faults?
If you do have a remote web service you will also need to allow the SOAPAction HTTP request header to be sent from your hosted SWF's domain too. See:
Thanks for the quick response.
This was the key:
"If you do have a remote web service you will also need to allow the SOAPAction HTTP request header to be sent from your hosted SWF's domain too. See:
I hadn't seen that before. I put it in the crossdomain file and it started working.