Solved

FLEX and MS-SQL webServices - Security error

Posted on 2007-11-20
5
5,240 Views
Last Modified: 2013-11-19
Hello, I am having the following issue -

I have a FLEX application that resides on a web server,

http://www.MyDomain.com

It uses a web service that resides on a DIFFERENT machine, same domain at

http://sql.MyDomain.com

I am calling the web service like this:

<mx:WebService id="ws" wsdl="http://sql.MyDomain.com/getTests?wsdl" useProxy="false">
         <mx:operation name="GetNames" resultFormat="e4x" result="start()">
         <mx:request xmlns="">
                        <c>{searchBox.text}</c>               
         </mx:request>      
         </mx:operation>
         
</mx:WebService>

When the FLEX is on my local machine, it functions without a hitch.
When I run it from the web server it tells me:

[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://myDomain.com/getTests?wsdl)"]
      at mx.rpc.wsdl::WSDLLoader/mx.rpc.wsdl:WSDLLoader::faultHandler()
      at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()
      at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()
      at mx.rpc::Responder/fault()
      at mx.rpc::AsyncRequest/fault()
      at ::DirectHTTPMessageResponder/securityErrorHandler()
      at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at flash.net::URLLoader/flash.net:URLLoader::redirectEvent()

Now I know that a cross-domain.xml file is meant to help this situation, however we are running native SQL endpoints on the sql machine and THERE IS NO WEB SERVER where the SQL web services are running on which we would put such a file.

From what I've read, this should work if the machines are in the same DOMAIN, which they are, hence this question posted here.

Thanks for any help you can give,

SG


[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://sql.totalnetworks.de/getTests?wsdl)"]
	at mx.rpc.wsdl::WSDLLoader/mx.rpc.wsdl:WSDLLoader::faultHandler()
	at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
	at flash.events::EventDispatcher/dispatchEvent()
	at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()
	at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()
	at mx.rpc::Responder/fault()
	at mx.rpc::AsyncRequest/fault()
	at ::DirectHTTPMessageResponder/securityErrorHandler()
	at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
	at flash.events::EventDispatcher/dispatchEvent()
	at flash.net::URLLoader/flash.net:URLLoader::redirectEvent()

Open in new window

0
Comment
Question by:TNetworks
  • 2
  • 2
5 Comments
 
LVL 23

Expert Comment

by:Siva Prasanna Kumar
ID: 20324829
What I can suggest id to have a local copy of the WSDL and then use that to refer in the MXML file.

Here the problem is reading the WSDL from the domain you have mentioned.

The other thing you can try is to create the Web services stubs using Flex 3 Beta which will give you the AS 3 classes which can invoke the web services with ease. Here the builder takes care of reading the WSDL for generating the stubs so may not rise any errors during that.
0
 
LVL 19

Expert Comment

by:Gary Benade
ID: 20325711
The error message says 'please verify the URI and/or format of the WSDL (http://myDomain.com/getTests?wsdl)'
yet you say the wsdl lives on sql.MyDomain.com, is that a typo or are you perhaps calling the wrong server?
0
 

Author Comment

by:TNetworks
ID: 20326329
Sorry, that's a typo.  I removed the real servers for privacy's sake.
0
 
LVL 19

Accepted Solution

by:
Gary Benade earned 500 total points
ID: 20326376
Definately a cross domain problem and you can either use a server side proxy or a shim swf to get around the problem. I prefer the proxy method but both are explained here with examples:

http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_16520&sliceId=1

A php proxy is a simple as this:


<?php
// call this php file from your webservice:
// <mx:WebService id="ws" wsdl="http://MyDomain.com/thisphp.php" 
$dataURL = "http://sql.MyDomain.com/getTests?wsdl";
readfile($dataURL);
?>

Open in new window

0
 

Author Comment

by:TNetworks
ID: 20332001
I see the point yes, but I need to support Basic authentication so the proxy will need to be a bit more advanced than that.  It's a step in the right direction however, thanks.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
PHP radio buttons with email not sending 24 99
What is Codeanywhere used for and can EE provide example of use 9 213
Problem to file 3 74
Re-position the objects 7 108
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now