ddl_ex5
asked on
Flex app accessing webORB from .NET website on same server (the "Error: Send Failed" message)
Hi,
I have a standard weborb setup on my test server (dbtest).
My Flex app calls a server side asp.net class to go "get data".
This works fine running the Flex app from my local FlexBuilder calling the remote service on dbtest.
It also works if I browse to the debug build of the app on the remote server (http://dbtest.office.ddl/weborb30/PrintAimsCharting-debug/PrintAimsCharting.html#)
However, the app actually has to be embedded within an existing .NET website (so the PrintAimsCharting.swf will actually be embedded into the page http://dbtest.office.ddl/portal/applications/tools/AimsGraphing.aspx). In other words I now have a copy of PrintAimsCharting.swf (and associated html page) in dbtest's c:/Inetpub/wwwroot/portal/ applicatio ns/tools directory.
This means I have a Flex app embedded into a .NET site in c:/Inetpub/wwwroot/portal calling a weborb server side object in c:/Inetpub/wwwroot/weborb3 0.
However, if I now run the Flex app from either the .NET application (portal) or directly (as http://dbtest.office.ddl/portal/applications/tools/PrintAimsCharting.html#) I get the famous "Error: Send Failed" message.
All help I've seen so far talks about changing the server-config.xml files to repoint to a specific instance of weborb.aspx, but in my case weborb.aspx is where it usually is.
HELP!
I have a standard weborb setup on my test server (dbtest).
My Flex app calls a server side asp.net class to go "get data".
This works fine running the Flex app from my local FlexBuilder calling the remote service on dbtest.
It also works if I browse to the debug build of the app on the remote server (http://dbtest.office.ddl/weborb30/PrintAimsCharting-debug/PrintAimsCharting.html#)
However, the app actually has to be embedded within an existing .NET website (so the PrintAimsCharting.swf will actually be embedded into the page http://dbtest.office.ddl/portal/applications/tools/AimsGraphing.aspx). In other words I now have a copy of PrintAimsCharting.swf (and associated html page) in dbtest's c:/Inetpub/wwwroot/portal/
This means I have a Flex app embedded into a .NET site in c:/Inetpub/wwwroot/portal calling a weborb server side object in c:/Inetpub/wwwroot/weborb3
However, if I now run the Flex app from either the .NET application (portal) or directly (as http://dbtest.office.ddl/portal/applications/tools/PrintAimsCharting.html#) I get the famous "Error: Send Failed" message.
All help I've seen so far talks about changing the server-config.xml files to repoint to a specific instance of weborb.aspx, but in my case weborb.aspx is where it usually is.
HELP!
The Error event contains more information that will help isolate the problem, put a breakpoint in the error handler and inspect the error object for additional information, there should be a verbose description in there somewhere, post that along with your services-config.xml file
ASKER
Hi hobbit72,
I've managed to get the following error out;
[SWF] /portal/applications/tools /PrintAims Charting/P rintAimsCh arting.swf - 849,414 bytes after decompression
[SWF] /portal/applications/tools /PrintAims Charting/P rintAimsCh arting.swf - 1,101,587 bytes after decompression
Warning: Failed to load policy file from https://dbtest.office.ddl/crossdomain.xml
*** Security Sandbox Violation ***
Connection to https://dbtest.office.ddl/portal/applications/tools/PrintAimsCharting/weborb.aspx halted - not permitted from http://dbtest.office.ddl/portal/applications/tools/PrintAimsCharting/PrintAimsCharting.swf
Error: Request for resource at https://dbtest.office.ddl/portal/applications/tools/PrintAimsCharting/weborb.aspx by requestor from http://dbtest.office.ddl/portal/applications/tools/PrintAimsCharting/PrintAimsCharting.swf is denied due to lack of policy file permissions.
I've created a crossdomain.xml file which i've stuck in the root of weborb, i.e. in c:/Inetpub/wwwroot/weborb3 0, but this makes no difference. The crossdomain.xml contains;
<?xml version="1.0"?>
<cross-domain-policy>
<allow-access-from domain="*" />
</cross-domain-policy>
The services-config.xml is as follows;
<?xml version="1.0" encoding="UTF-8"?>
<services-config>
<services>
<service-include file-path="remoting-config .xml" />
<service-include file-path="data-management -config.xm l" />
</services>
<channels>
<channel-definition id="my-amf" class="mx.messaging.channe ls.AMFChan nel">
<endpoint uri="weborb.aspx" class="flex.messaging.endp oints.AMFE ndpoint"/>
<properties>
<polling-enabled>false</po lling-enab led>
</properties>
</channel-definition>
<channel-definition id="amf-sessionactivation" class="mx.messaging.channe ls.AMFChan nel">
<endpoint uri="weborb.aspx?activate= session" class="flex.messaging.endp oints.AMFE ndpoint"/>
<properties>
<polling-enabled>false</po lling-enab led>
</properties>
</channel-definition>
<channel-definition id="amf-singletonactivatio n" class="mx.messaging.channe ls.AMFChan nel">
<endpoint uri="weborb.aspx?activate= applicatio n" class="flex.messaging.endp oints.AMFE ndpoint"/>
<properties>
<polling-enabled>false</po lling-enab led>
</properties>
</channel-definition>
<channel-definition id="my-secure-amf" class="mx.messaging.channe ls.SecureA MFChannel" >
<endpoint uri="weborb.aspx" class="flex.messaging.endp oints.Secu reAMFEndpo int"/>
</channel-definition>
<channel-definition id="air-http" class="mx.messaging.channe ls.AMFChan nel">
<endpoint uri="http://localhost:80/weborb30/weborb.aspx" class="flex.messaging.endp oints.AMFE ndpoint"/>
<properties>
<polling-enabled>false</po lling-enab led>
</properties>
</channel-definition>
</channels>
</services-config>
I think I'm misunderstanding what/where the weborb.aspx file should be referenced. I thought this should be part of the weborb30 install, rather than being tied to the location of the *.swf file?
Thanks.
I've managed to get the following error out;
[SWF] /portal/applications/tools
[SWF] /portal/applications/tools
Warning: Failed to load policy file from https://dbtest.office.ddl/crossdomain.xml
*** Security Sandbox Violation ***
Connection to https://dbtest.office.ddl/portal/applications/tools/PrintAimsCharting/weborb.aspx halted - not permitted from http://dbtest.office.ddl/portal/applications/tools/PrintAimsCharting/PrintAimsCharting.swf
Error: Request for resource at https://dbtest.office.ddl/portal/applications/tools/PrintAimsCharting/weborb.aspx by requestor from http://dbtest.office.ddl/portal/applications/tools/PrintAimsCharting/PrintAimsCharting.swf is denied due to lack of policy file permissions.
I've created a crossdomain.xml file which i've stuck in the root of weborb, i.e. in c:/Inetpub/wwwroot/weborb3
<?xml version="1.0"?>
<cross-domain-policy>
<allow-access-from domain="*" />
</cross-domain-policy>
The services-config.xml is as follows;
<?xml version="1.0" encoding="UTF-8"?>
<services-config>
<services>
<service-include file-path="remoting-config
<service-include file-path="data-management
</services>
<channels>
<channel-definition id="my-amf" class="mx.messaging.channe
<endpoint uri="weborb.aspx" class="flex.messaging.endp
<properties>
<polling-enabled>false</po
</properties>
</channel-definition>
<channel-definition id="amf-sessionactivation"
<endpoint uri="weborb.aspx?activate=
<properties>
<polling-enabled>false</po
</properties>
</channel-definition>
<channel-definition id="amf-singletonactivatio
<endpoint uri="weborb.aspx?activate=
<properties>
<polling-enabled>false</po
</properties>
</channel-definition>
<channel-definition id="my-secure-amf" class="mx.messaging.channe
<endpoint uri="weborb.aspx" class="flex.messaging.endp
</channel-definition>
<channel-definition id="air-http" class="mx.messaging.channe
<endpoint uri="http://localhost:80/weborb30/weborb.aspx" class="flex.messaging.endp
<properties>
<polling-enabled>false</po
</properties>
</channel-definition>
</channels>
</services-config>
I think I'm misunderstanding what/where the weborb.aspx file should be referenced. I thought this should be part of the weborb30 install, rather than being tied to the location of the *.swf file?
Thanks.
ASKER
Further question - the first part of the error is the following;
Warning: Failed to load policy file from https://dbtest.office.ddl/crossdomain.xml
Why is the app trying to load the policy file from https rather than http...?
Warning: Failed to load policy file from https://dbtest.office.ddl/crossdomain.xml
Why is the app trying to load the policy file from https rather than http...?
ASKER
NB - seems to be using https even if I set secure="false" in the cross-domain-policy
The crossdomain file must go in the root directory of the web server, try copying it to
c:/Inetpub/wwwroot
also, did you try secure="true"
Try that so long, I'll be thinking some more...
c:/Inetpub/wwwroot
also, did you try secure="true"
Try that so long, I'll be thinking some more...
ASKER
Hi Hobbit72,
Tried moving crossdomain file out of application directory and into wwwroot to no effect. Also, whether secure is true or false, no effect.
And if I trace using firebug in firefox, this confirms that the post is being made from the Flex app to http://dbtest.office.ddl/portal/applications/tools/weborb.aspx. Again, it shouldn't be looking here, should it? Weborb.aspx should be in the weborb30 directory shouldn't it? Or am I misunderstanding what weborb.aspx is for?
Any further suggestions?
Tried moving crossdomain file out of application directory and into wwwroot to no effect. Also, whether secure is true or false, no effect.
And if I trace using firebug in firefox, this confirms that the post is being made from the Flex app to http://dbtest.office.ddl/portal/applications/tools/weborb.aspx. Again, it shouldn't be looking here, should it? Weborb.aspx should be in the weborb30 directory shouldn't it? Or am I misunderstanding what weborb.aspx is for?
Any further suggestions?
there isn't perhaps a .htaccess file in the weborb directory with a rewrite rule?
ASKER
No, there is no .htaccess file.
I wonder if I have done something silly in my Flex Builder project settings? They are as follows;
(a) Flex Build Path -> Source Path ->Output Folder;
Set to where I want the CLIENT app deployed i.e. \\dbtest\c$\Inetpub\wwwroo t\portal\a pplication s\tools
(b) Flex Compiler -> Additional Compiler arguments;
-locale en_US -services \\dbtest\c$\Inetpub\wwwroo t\weborb30 \web-inf\f lex\servic es-config. xml
(c) Flex Server -> Root Folder;
\\dbtest\c$\Inetpub\wwwroo t\weborb30
(d) Flex Server -> Root URL;
http://dbtest.office.ddl/weborb30/
I have also tried changing (c) and (d) to point to the portal\applications\tools location. When I do this, I now get the Error: Send Failed message from the app running in Flex builder too.
I wonder if I have done something silly in my Flex Builder project settings? They are as follows;
(a) Flex Build Path -> Source Path ->Output Folder;
Set to where I want the CLIENT app deployed i.e. \\dbtest\c$\Inetpub\wwwroo
(b) Flex Compiler -> Additional Compiler arguments;
-locale en_US -services \\dbtest\c$\Inetpub\wwwroo
(c) Flex Server -> Root Folder;
\\dbtest\c$\Inetpub\wwwroo
(d) Flex Server -> Root URL;
http://dbtest.office.ddl/weborb30/
I have also tried changing (c) and (d) to point to the portal\applications\tools location. When I do this, I now get the Error: Send Failed message from the app running in Flex builder too.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Changing the services-config.xml (and weborb-services-config.xml
<channel-definition id="my-amf" class="mx.messaging.channe
<endpoint uri="weborb.aspx" class="flex.messaging.endp
to;
<channel-definition id="my-amf" class="mx.messaging.channe
<endpoint uri="http://dbtest.office.ddl/weborb30/weborb.aspx" class="flex.messaging.endp
doesn't fix the problem.