Solved

FLEX and MS-SQL webServices - Security error

Posted on 2007-11-20
5
5,238 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
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 …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

912 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

21 Experts available now in Live!

Get 1:1 Help Now