Hi, just as title state, I have problem during web service --> Flex communication. I am using WebService ActionScript class, to make a connection to it, but I got some odd behavior. When I try to access remote web service (particulary : http://109.74.206.146:8080/jax_ws/quarkservice?wsdl ) from my Flex Builder IDE, everything is fine. Even more, when I goes to my project folder and click ProjectName.swf file, without any server running on my pc, the file is executed, communication with web service is faultless performed, and response is retrieved. However, when I try to export as a build release, and to engage it to my localhost Tomcat, or if i try to copy ProjectName.swf to any another location on my had drive, from the project place, where is stored, I got :
1. [RPC Fault faultString="Security error accessing url" faultCode="Channel.Security.Error" faultDetail="Unable to load WSDL. If currently online, please verify the URI and/or format of the WSDL (http://109.74.206.146:8080/jax_ws/quarkservice?wsdl)"]
2. at mx.rpc.wsdl::WSDLLoader/faultHandler()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\wsdl\WSDLLoader.as:98]
3. at flash.events::EventDispatcher/dispatchEventFunction()
4. at flash.events::EventDispatcher/dispatchEvent()
5. at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:168]
6. at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:220]
7. at mx.rpc::Responder/fault()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\Responder.as:49]
8. at mx.rpc::AsyncRequest/fault()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:103]
9. at DirectHTTPMessageResponder/securityErrorHandler()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\messaging\channels\DirectHTTPChannel.as:368]
10. at flash.events::EventDispatcher/dispatchEventFunction()
11. at flash.events::EventDispatcher/dispatchEvent()
12. at flash.net::URLLoader/redirectEvent()
[RPC Fault faultString="Security error accessing url" faultCode="Channel.Security.Error" faultDetail="Unable to load WSDL.
<br /> If currently online, please verify the URI and/or format of the WSDL (http://109.74.206.146:8080/jax_ws/quarkservice?wsdl)"] at
mx.rpc.wsdl::WSDLLoader/faultHandler()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\wsdl\WSDLLoader.as:98]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent() at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:168]
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc \AbstractInvoker.as:220]
at mx.rpc::Responder/fault()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\Responder.as:49]
at mx.rpc::AsyncRequest/fault()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:103]
at DirectHTTPMessageResponder/securityErrorHandler()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\messaging\channels\DirectHTTPChannel.as:368]
at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/redirectEvent()
So, the same file engaged from the FlexBuilder or directly invoked from the project's folder, where it reside, works perfectly. When I try to invoke it from ANY OTHER location, including deployment on my local Tomcat (or even simply from my desktop), I got the exception above. So, does anyone know what is the problem? Thanks
Solved! Go to Solution.
Views
Replies
Total Likes
There is implicit trust when you run the application from Flex Builder. Outside of Flex Builder, if the call to the Web service is not proxied by LiveCycle Data Services, Flash Player security will not allow connection to the remote service.
Try adding a crossdomain.xml to the ROOT.war of your respective application server. Something like this...
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<site-control permitted-cross-domain-policies="all" />
<allow-access-from domain="*" secure="false" />
<allow-http-request-headers-from domain="*" headers="*"/>
</cross-domain-policy>
Steve
Views
Replies
Total Likes
Hi. I thought that was only when I access the web service, outside localhost, but also error occurs when I try to access also the Servlet, outside the localhost ( my faultHandler is invoked, when I try that).
I do not get it, what is a problem, since I can access everything from my Flex Builder, but cannot anything outside of it?
Views
Replies
Total Likes
There is implicit trust when you run the application from Flex Builder. Outside of Flex Builder, if the call to the Web service is not proxied by LiveCycle Data Services, Flash Player security will not allow connection to the remote service.
Try adding a crossdomain.xml to the ROOT.war of your respective application server. Something like this...
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<site-control permitted-cross-domain-policies="all" />
<allow-access-from domain="*" secure="false" />
<allow-http-request-headers-from domain="*" headers="*"/>
</cross-domain-policy>
Steve
Views
Replies
Total Likes
Thank you Steve. I just did it. All the time, I have tried to add it into the 'root' of the application I was invoking. It was logical to me Then, I figure out using firebird debugger that crossdomain.xml file is requested, as a root application file : http://mydomain:8080/crossdomain.xml.
Then I put it into ROOT forled of my Tomcat. and it works
However, thanks again on your answer!
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies