3
votes

Yesterday I spent half of day trying to force Flex Remoting to use HTTPS with no success.

Today I tried to connect to other domain. I changed url of endpoint, but it looks like flex just ignores my changes. I am sure that an old url doesn't exist in any file in src directory, I even renamed services-config.xml to services-config2.xml, cleaned and rebuilded project many times, even made a release build, but it still connects to the same domain.

I have tested flex application in localhost and in the same domain, that has AMF services, but it works in the same way.

My services-config.xml is:

<?xml version="1.0" encoding="UTF-8"?>
<services-config>
    <services>
        <service id="amfphp-flashremoting-service" class="flex.messaging.services.RemotingService" messageTypes="flex.messaging.messages.RemotingMessage">
            <destination id="amfphp">
                <channels>
                    <channel ref="my-amfphp-secure"/>
                    <channel ref="my-amfphp"/>
                </channels>
                <properties>
                    <source>*</source>
                </properties>
            </destination>
        </service>
    </services>
    <channels>
        <channel-definition id="my-amfphp-secure" class="mx.messaging.channels.SecureAMFChannel">
            <endpoint uri="https://xxx.dev.company.com:443/AMF" class="flex.messaging.endpoints.SecureAMFEndpoint"/>
            <properties>
                <polling-enabled>false</polling-enabled>
                <serialization>
                    <instantiate-types>false</instantiate-types>
                    <log-property-errors>true</log-property-errors>
                </serialization>
                <add-no-cache-headers>false</add-no-cache-headers>
            </properties>
        </channel-definition>
        <channel-definition id="my-amfphp" class="mx.messaging.channels.AMFChannel" >
            <endpoint uri="http://xxx.dev.company.com/AMF" class="flex.messaging.endpoints.AMFEndpoint" />
            <properties>
                <polling-enabled>false</polling-enabled>
                <serialization>
                    <instantiate-types>false</instantiate-types>
                    <log-property-errors>true</log-property-errors>
                </serialization>
                <add-no-cache-headers>false</add-no-cache-headers>
            </properties>
        </channel-definition>
    </channels>
</services-config>

RemoteObject definition in mxml:

<mx:RemoteObject id="Agentrpc" destination="amfphp" source="Agentrpc" showBusyCursor="true">
    <mx:method name="getAgentID" result="getAgentID_resultHandler(event)" fault="faultHandler(event)"/>
</mx:RemoteObject>

I'm using Flex 3.

Edit: I took a look at generated/ dir and I see that FlexInit files (like MainModule_FlexInit-generated.as) contains code:

ServerConfig.xml =
<services>
    <service id="amfphp-flashremoting-service">
        <destination id="amfphp">
            <channels>
                <channel ref="my-amfphp-secure"/>
                <channel ref="my-amfphp"/>
            </channels>
        </destination>
    </service>
    <channels>
        <channel id="my-amfphp-secure" type="mx.messaging.channels.SecureAMFChannel">
            <endpoint uri="https://gintautas.dev.company.com:443/AMF"/>
            <properties>
                <polling-enabled>false</polling-enabled>
            </properties>
        </channel>
        <channel id="my-amfphp" type="mx.messaging.channels.AMFChannel">
            <endpoint uri="http://gintautas.dev.company.com/AMF"/>
            <properties>
                <polling-enabled>false</polling-enabled>
            </properties>
        </channel>
    </channels>
</services>;

That's correct, but application doesn't make requests to gintautas.dev.company.com

Edit 2: I installed Flash Builder 4 and tried to compile using 3.5 and 4.0(in compatibility mode) compilers, but both has the same problem :(

3
This may or may not help (since we avoid services-config as much as we can and do as much as we can programatically), but I know that issues that I had a couple of years ago had to do with the AMFChannel class vs the SecureAMFChannel class. I'm not sure how your remoteObject's channelSet is initialized when the services-config xml file is parsed, but I know that I feel as though I have a lot more control when these things are done programatically.jeremy.mooer

3 Answers

1
votes

Can you try to clear your browser cache ? The content of the services.xml is injected into the SWF at compile time.

1
votes

you can check what is being compiled into flex from the *-config.XML files with the following:

trace( ServerConfig.XML );

Also, if using WTP with tomcat, check if server is using the actual installation of tomcat, or a temp eclipse folder to run. that can sometimes cause mix ups.

0
votes

You must "clean project" in Flex Builder when you change services-config.xml