Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Security error accessing url" faultCode="Channel.Security.Error" faultDetail="Unable to load WSDL

Avatar

Level 1

[Thread Edited By Adobe]

/*Don’t forget to meet and greet your fellow peers virtually by telling them about yourself here

Go ahead and to it now: https://adobe.ly/3eDnB4v */

 

Actual Question:

HI



I am using a webservice(.net webservice) that is on my
localhost and using it in flex application that is also on my
system. Means both the webservice and flex application are on the
same system.

But when i gives the reference of the webservice using the
system ip and run the application by the flex builder it generates
the error as:



mx.messaging.messages::ErrorMessage)#0

body = (Object)#1

clientId = "DirectHTTPChannel0"

correlationId = "24CD6542-F141-1A05-BA35-00A108CB30A0"

destination = ""

extendedData = (null)

faultCode = "Channel.Security.Error"

faultDetail = "Destination: DefaultHTTP"

faultString = "Security error accessing url"

headers = (Object)#2

messageId = "CC123DF0-0E6C-05FF-7894-00A109676283"

rootCause = (flash.events::SecurityErrorEvent)#3

bubbles = false

cancelable = false

currentTarget = (flash.net::URLLoader)#4

bytesLoaded = 0

bytesTotal = 0

data = (null)

dataFormat = "text"

eventPhase = 2

target = (flash.net::URLLoader)#4

text = "Error #2170: Security sandbox violation:
http://localhost:3000/MYCIMS/flex_bin/Design.swf
cannot send HTTP headers to
http://myip/MyServer/AdminWS.asmx."

type = "securityError"

timestamp = 0

timeToLive = 0



I have put crossdomain.xml file in the root of the localhost
and made every changes possible in the crossdomain.xml file but the
application is not running.

Please somebody provide an effective solution, I have spend
lots of time to resolve the problem but its not being....



Thanks in advance

Gopi Saini

1 Accepted Solution

Avatar

Correct answer by
Level 1
Hi..



replace crossdomain.xml

if test success then apply to your security setting

---------------------------------

<?xml version="1.0"?>

<!DOCTYPE cross-domain-policy SYSTEM
"/xml/dtds/cross-domain-policy.dtd">

<cross-domain-policy>

<site-control permitted-cross-domain-policies="all"/>

<allow-access-from domain="*" to-ports="*" />

<allow-http-request-headers-from domain="*"
headers="*"/>

</cross-domain-policy>

---------------------------------

View solution in original post

23 Replies

Avatar

Level 2
when you use the ip instead of "localhost", flash player
recognize it as a different host. either change the wsdl address to
localhost or put a crossdomain.xml file under you web root

Avatar

Level 1
Hi

I am still getting the same error.

I placed crossdomain.xml file in the root of the server. But
it still generating the same error.

The application is executing fine locally. But when I acceess
the application through the ip It gives the same error.



Plz. provide some solution.

Avatar

Level 1

quote:




Originally posted by:
G S SAINI


Hi

I am still getting the same error.

I placed crossdomain.xml file in the root of the server. But
it still generating the same error.

The application is executing fine locally. But when I acceess
the application through the ip It gives the same error.



Plz. provide some solution.








Avatar

Level 1
Hi G S Saini did you ever resolve this issue?

Avatar

Level 1
No my friend this problem could not be resolved.

Every where it is said that place the crossdomain.xml file in
the root. I have done it. But still the application not running.

If u have the solution then u r welcome..........

Avatar

Level 2
Can you post your x-domain file here? also, can you use a
http proxy, such as the charles debug proxy, to see if the x-domain
file is indeed fetched. it could be just a permission issue with
the file.

Avatar

Level 1
Hi Zee Yang

The crossdomain.xml file is as follow. I placed this file in
the www root folder in Inetpub.

/*****crossdomain.xml****/

<?xml version="1.0"?>

<!DOCTYPE cross-domain-policy SYSTEM "
http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">

<cross-domain-policy>

<allow-access-from domain="192.168.1.117" />

<allow-http-request-headers-from domain="192.168.1.117"
headers="SOAPAction"/>

</cross-domain-policy>

/***************************************************************/



/*********My Flex Application ********************/

<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute">

<mx:Script>

<![CDATA[

import mx.rpc.*;

import mx.rpc.events.*;

import mx.collections.*;

import mx.controls.*;

import flash.events.Event;



import flash.net.SharedObject;

public var myLocalSharedObject:SharedObject;



private var ReqObj:Object;

private var ResObj:Object;



private function Login_Click():void

{

ReqObj = new Object();

ReqObj.AuthLocationId = 0;

ReqObj.UserName1 = "gopi123";//User1.text;

ReqObj.Password1 = "delhi2";//password1.text;

ReqObj.UserName2 = "rajan123";//User2.text;

ReqObj.Password2 = "delhi2";//password2.text;

ReqObj.ConsoleType = 1;

ReqObj.UserToken = null;

UserAuth.AuthenticateUser(ReqObj);

}



private function AuthenticateUser(Response:ResultEvent):void

{

ResObj = new Object();

ResObj = Response.result;

Alert.show(ResObj.StatusMessage);

if(ResObj.StatusCode == 0)

{

var i:int = 0;

while(ResObj.UserRights.length >i)

{

var id:int ;

var str:String= null;

id = ResObj.UserRights
.RightId;

str = ResObj.UserRights
.DisplayText;

arrRightId.push(id);

arrDisplayText.push(str);

i++;

}

myLocalSharedObject=SharedObject.getLocal("mylso");

myLocalSharedObject.data.Token=ResObj.Token

}



}

]]>

</mx:Script>



<mx:WebService id="UserAuth" wsdl="
http://192.168.1.117/CIMSServer/UserAuthWS.asmx?WSDL"
showBusyCursor="true">

<mx:operation name="AuthenticateUser"
result="AuthenticateUser(event)"/>

</mx:WebService>

<mx:Array id = "arrRightId">

</mx:Array>

<mx:Array id="arrDisplayText">

</mx:Array>

<mx:Form id="frm1" x="74" y="11">

<mx:FormItem label="User 1">

</mx:FormItem>

<mx:FormItem label="User Name">

<mx:TextInput id="User1" width="210"/>

</mx:FormItem>

<mx:FormItem label="Password">

<mx:TextInput displayAsPassword="true" id="password1"
width="210"/>

</mx:FormItem>

</mx:Form>

<mx:Form id="frm2" x="73" y="130">

<mx:FormItem label="User 2">

</mx:FormItem>

<mx:FormItem label="User Name">

<mx:TextInput id="User2" width="210"/>

</mx:FormItem>

<mx:FormItem label="Passowrd">

<mx:TextInput id="password2" displayAsPassword="true"
width="210"/>

</mx:FormItem>

</mx:Form>

<mx:HBox x="175" y="253">

<mx:Button click="Login_Click()" label="Login"/>

</mx:HBox>

</mx:Application>

/**********************************************************/



I am using a .NET Webservice and configured in IIS. It's
working well and can be accessed on the web.

You can check it, I have mentioned my ip.



NOTE: I am executing the flex application by the flex
builder, its not the release and not configured in iis, but simply
executing the flex application by the flex builder, then these
problems are occuring.

Problem-------->>>

When I execute my .net webservice application(CIMSServer) by
the dot net framework and gives the reference of the webservice in
the flex application as
http://localhost:2488/CIMSServer//UserAuthWS.asmx?WSDL
then the flex application works fine. It's when the webservice is
running by the visual studio dot net.

But If I configures the webservice in iis and the gives the
reference of the webservice as
http://localhost/CIMSServer//UserAuthWS.asmx?WSDL
in the flex application then it gives the following error:



TypeError: Error #1010: A term is undefined and has no
properties.

at Test/AuthenticateUser()[C:\Documents and
Settings\SAINI\My Documents\Flex Builder 3\MYCIMS\src\Test.mxml:38]

at Test/___Test_Operation1_result()[C:\Documents and
Settings\SAINI\My Documents\Flex Builder 3\MYCIMS\src\Test.mxml:57]

at flash.events::EventDispatcher/dispatchEventFunction()

at flash.events::EventDispatcher/dispatchEvent()

at mx.rpc::AbstractOperation/
http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()[E:\dev\3.1.0\frameworks\projects\rpc\...

at mx.rpc::AbstractInvoker/
http://www.adobe.com/2006/flex/mx/internal::resultHandler()[E:\dev\3.1.0\frameworks\projects\rpc\src...

at
mx.rpc::Responder/result()[E:\dev\3.1.0\frameworks\projects\rpc\src\mx\rpc\Responder.as:43]

at
mx.rpc::AsyncRequest/acknowledge()[E:\dev\3.1.0\frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:74]

at
DirectHTTPMessageResponder/completeHandler()[E:\dev\3.1.0\frameworks\projects\rpc\src\mx\messaging\channels\DirectHTTPChannel.as:381]

at flash.events::EventDispatcher/dispatchEventFunction()

at flash.events::EventDispatcher/dispatchEvent()

at flash.net::URLLoader/onComplete()

/******************************************************************/



And if I changes the reference of the webservice as
http://192.168.1.117/CIMSServer/UserAuthWS.asmx?WSDL

then the following error occurs:



[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://192.168.1.117/CIMSServer/UserAuthWS.asmx?WSDL)"

at
mx.rpc.wsdl::WSDLLoader/faultHandler()[E:\dev\3.1.0\frameworks\projects\rpc\src\mx\rpc\wsdl\WSDLLoader.as:98]

at flash.events::EventDispatcher/dispatchEventFunction()

at flash.events::EventDispatcher/dispatchEvent()

at mx.rpc::AbstractInvoker/
http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()[E:\dev\3.1.0\frameworks\projects\rpc\...

at mx.rpc::AbstractInvoker/
http://www.adobe.com/2006/flex/mx/internal::faultHandler()[E:\dev\3.1.0\frameworks\projects\rpc\src\...

at
mx.rpc::Responder/fault()[E:\dev\3.1.0\frameworks\projects\rpc\src\mx\rpc\Responder.as:53]

at
mx.rpc::AsyncRequest/fault()[E:\dev\3.1.0\frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:103]

at
DirectHTTPMessageResponder/securityErrorHandler()[E:\dev\3.1.0\frameworks\projects\rpc\src\mx\messaging\channels\DirectHTTPChannel.as:368]

at flash.events::EventDispatcher/dispatchEventFunction()

at flash.events::EventDispatcher/dispatchEvent()

at flash.net::URLLoader/redirectEvent()

/**********************************************************************/



Please provide some solution.




.NET Webservice

Avatar

Correct answer by
Level 1
Hi..



replace crossdomain.xml

if test success then apply to your security setting

---------------------------------

<?xml version="1.0"?>

<!DOCTYPE cross-domain-policy SYSTEM
"/xml/dtds/cross-domain-policy.dtd">

<cross-domain-policy>

<site-control permitted-cross-domain-policies="all"/>

<allow-access-from domain="*" to-ports="*" />

<allow-http-request-headers-from domain="*"
headers="*"/>

</cross-domain-policy>

---------------------------------

Avatar

Level 1
Hi Saini,



Did you resolve this issue yet? I tried putting the
crossdomain.xml in my web server but that didn't help!!

Avatar

Level 1
Hi gbhk

In my application I was having security issue that has been
resolved by putting crossdomain file provided by gstarclub and
thanks to gstarclub.

<?xml version="1.0"?>

<!DOCTYPE cross-domain-policy SYSTEM
"/xml/dtds/cross-domain-policy.dtd">

<cross-domain-policy>

<site-control permitted-cross-domain-policies="all"/>

<allow-access-from domain="*" to-ports="*" />

<allow-http-request-headers-from domain="*"
headers="*"/>

</cross-domain-policy>



Earlier I was understanding that in my application there is
only the security issue, but actually there was some problem in
WebService and finally I find that and Now my application is
working fine.

If u are having security issue then put the crossdomain file
given above in iis root (on the system where your webservice exist)
otherwise there may be some other issue.



Regards

Gopi Saini

Avatar

Level 1
Hi gstarclub

Thanks for your help.

I placed the crossdomain.xml file in my web server root
provided by you, so the security issue is resolved.

Earlier I was understanding that in my application there is
only the security issue, but actually there was some problem in my
Web Service and finally I find out the problem and Now my
application is working fine.

Avatar

Level 1

Hello, no update about this problem? I've tryed to find thw solution on the web but all people with the same problem.

On my machine I can put the crossdomain.xml on the root of IIS but if I need to put my application on another server and i cannot put the file on the root of IIS (for many ISP I'd have this problem) what can I do? Is this a bug about flex?

thanks in advance

andrea

Avatar

Level 3

It's the expected behavior if you have an app in any hosting you get access

to a your website wwwroot in there you can place anything you want. Unless

you're trying to access info from a domain you don't own or manage.

Avatar

Former Community Member

Try to change the directory structure under your Apache/j2ee server. I was having similar issues when accessing it on Unix server. But when I put the swf file directly under the root, it allowed the access and no more security error.

Avatar

Level 1

hiii.......

Thanks to u all....You all save my Day......

Avatar

Level 1

I had the same error and crossdomain.xml worked. Thanks a lot for your help.

Avatar

Level 1

Awesome, this post helped me too.


Avatar

Level 1

thanks a lot, this solved also our problem...