Link to home
Start Free TrialLog in
Avatar of ddl_ex5
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/applications/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/weborb30.

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!
Avatar of ddl_ex5
ddl_ex5

ASKER

Additional - I suspect the PrintAimsCharting.swf thinks that the weborb.aspx is in within the dbtest/c$/Inetpub/wwwroot/portal directory structure rather than in the dbtest/c$/Inetpub/wwwroot/weborb30 directory structure.

Changing the services-config.xml (and weborb-services-config.xml) from;
<channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
            <endpoint uri="weborb.aspx" class="flex.messaging.endpoints.AMFEndpoint"/>
to;
<channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
            <endpoint uri="http://dbtest.office.ddl/weborb30/weborb.aspx" class="flex.messaging.endpoints.AMFEndpoint"/>

doesn't fix the problem.
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
Avatar of ddl_ex5

ASKER

Hi hobbit72,

I've managed to get the following error out;

[SWF] /portal/applications/tools/PrintAimsCharting/PrintAimsCharting.swf - 849,414 bytes after decompression
[SWF] /portal/applications/tools/PrintAimsCharting/PrintAimsCharting.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/weborb30, 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.xml" />
    </services>

    <channels>
        <channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
            <endpoint uri="weborb.aspx" class="flex.messaging.endpoints.AMFEndpoint"/>
            <properties>
                <polling-enabled>false</polling-enabled>
            </properties>
        </channel-definition>
       
        <channel-definition id="amf-sessionactivation" class="mx.messaging.channels.AMFChannel">
            <endpoint uri="weborb.aspx?activate=session" class="flex.messaging.endpoints.AMFEndpoint"/>
            <properties>
                <polling-enabled>false</polling-enabled>
            </properties>
        </channel-definition>

        <channel-definition id="amf-singletonactivation" class="mx.messaging.channels.AMFChannel">
            <endpoint uri="weborb.aspx?activate=application" class="flex.messaging.endpoints.AMFEndpoint"/>
            <properties>
                <polling-enabled>false</polling-enabled>
            </properties>
        </channel-definition>

        <channel-definition id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel">
            <endpoint uri="weborb.aspx" class="flex.messaging.endpoints.SecureAMFEndpoint"/>
        </channel-definition>
       
        <channel-definition id="air-http" class="mx.messaging.channels.AMFChannel">
            <endpoint uri="http://localhost:80/weborb30/weborb.aspx" class="flex.messaging.endpoints.AMFEndpoint"/>
              <properties>
                 <polling-enabled>false</polling-enabled>
              </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.
Avatar of ddl_ex5

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...?
Avatar of ddl_ex5

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...
Avatar of ddl_ex5

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?
there isn't perhaps a .htaccess file in the weborb directory with a rewrite rule?
Avatar of ddl_ex5

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\wwwroot\portal\applications\tools

(b) Flex Compiler -> Additional Compiler arguments;
-locale en_US -services \\dbtest\c$\Inetpub\wwwroot\weborb30\web-inf\flex\services-config.xml

(c) Flex Server -> Root Folder;
\\dbtest\c$\Inetpub\wwwroot\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.

ASKER CERTIFIED SOLUTION
Avatar of ddl_ex5
ddl_ex5

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial