Solved

FLEX and MS-SQL webServices - Security error

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

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…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will learn how to count occurrences of each item in an array.

705 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

15 Experts available now in Live!

Get 1:1 Help Now