Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

FLEX and MS-SQL webServices - Security error

Posted on 2007-11-20
5
Medium Priority
?
5,260 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 1500 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

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

609 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