Solved

FLEX and MS-SQL webServices - Security error

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to setup a password to enter my web page? 3 121
Play RTMP without Flash 3 748
Select distinct 25 119
WCAG (Web Content Accessibility Guidelines) levels 3 116
Article by: Matthew
I am a very big proponent of technology compliance standards and strive to meet such criteria in all of my work. That includes my site, which is 100% XHTML 1.0 compliant as determined by the World Wide Web Consortium. https://www.matthewstevenkel…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

762 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