5 Replies Latest reply on Aug 8, 2006 9:29 AM by peterent

    CFCs work localy but not on hosted server

    CL65 Captain
      I made two simple Flex aps. One I wrote that populates a datagrid and one using the CF Wizard. They both work localy, but when I upload them to my hosted server (using 7.02) I get connection (mx.rpc:Fault)#0 errors, including

      rootCause=(Object)#1 code = "NetConnection.Call.Failed" description = "HTP: Status 500" details = " http://dentalsales.com/flex2gateway" level = "error"

      Host is running 7.02 and I have been able to use CF Flash Forms connecting to CFCs, but not flex.

      Is there something the host has to configure or add to get Flex2 to work? Is it something I am doing?

      Jim

        • 1. Re: CFCs work localy but not on hosted server
          peterent Level 2
          Take a look at the services gateway file you used to build your Flex 2 application. If you look at the ColdFusion destination you'll see that it names the localhost. You need to change this to be your CF host and rebuild the Flex 2 SWF.
          • 2. Re: CFCs work localy but not on hosted server
            CL65 Captain Level 1
            I tried this and it still gives me the same error. I asked my host tech support and their response is that CF 7.02 is installed but they don't support Flex2 at this time.

            Here is my services-config.xml. Did I do this right?

            <?xml version="1.0" encoding="UTF-8"?>
            <services-config>

            <services>
            <service id="coldfusion-flashremoting-service"
            class="flex.messaging.services.RemotingService"
            messageTypes="flex.messaging.messages.RemotingMessage">

            <adapters>
            <adapter-definition id="cf-object" class="coldfusion.flash.messaging.ColdFusionAdapter" default="true"/>
            </adapters>

            <destination id="ColdFusion">
            <channels>
            <channel ref="my-cfamf"/>
            </channels>
            <properties>
            <source>*</source>
            <!-- define the resolution rules and access level of the cfc being invoked -->
            <access>
            <!-- Use the ColdFusion mappings to find CFCs, by default only CFC files under your webroot can be found. -->
            <use-mappings>false</use-mappings>
            <!-- allow "public and remote" or just "remote" methods to be invoked -->
            <method-access-level>remote</method-access-level>
            </access>

            <property-case>
            <!-- cfc property names -->
            <force-cfc-lowercase>false</force-cfc-lowercase>
            <!-- Query column names -->
            <force-query-lowercase>false</force-query-lowercase>
            <!-- struct keys -->
            <force-struct-lowercase>false</force-struct-lowercase>
            </property-case>
            </properties>
            </destination>

            </service>
            </services>

            <channels>
            <channel-definition id="my-cfamf" class="mx.messaging.channels.AMFChannel">
            <endpoint uri=" http://dentalsales.com/flex2gateway/" class="flex.messaging.endpoints.AMFEndpoint"/>
            <properties>
            <polling-enabled>false</polling-enabled>
            <serialization>
            <instantiate-types>false</instantiate-types>
            </serialization>
            </properties>
            </channel-definition>
            </channels>

            <logging>
            <target class="flex.messaging.log.ConsoleTarget" level="Error">
            <properties>
            <prefix>[Flex] </prefix>
            <includeDate>false</includeDate>
            <includeTime>false</includeTime>
            <includeLevel>false</includeLevel>
            <includeCategory>false</includeCategory>
            </properties>
            <filters>
            <pattern>Endpoint.*</pattern>
            <pattern>Service.*</pattern>
            <pattern>Configuration</pattern>
            <pattern>Message.*</pattern>
            </filters>
            </target>
            </logging>

            <system>
            </system>

            </services-config>
            Here is my services-config.xml. Did I do this right?
            • 3. Re: CFCs work localy but not on hosted server
              peterent Level 2
              Can you ask your host tech support if wwwroot/WEB-INF/flex directory is present and if so, to send you the services-config.xml file located there?
              • 4. Re: CFCs work localy but not on hosted server
                CL65 Captain Level 1
                Here is the contents of that file. Do you know if it requires the Enterprise Edition or the Standard Edition?:

                <?xml version="1.0" encoding="UTF-8"?>
                <services-config>

                <services>
                <service id="coldfusion-flashremoting-service"
                class="flex.messaging.services.RemotingService"
                messageTypes="flex.messaging.messages.RemotingMessage">

                <adapters>
                <adapter-definition id="cf-object" class="coldfusion.flash.messaging.ColdFusionAdapter" default="true"/>
                </adapters>

                <destination id="ColdFusion">
                <channels>
                <channel ref="my-cfamf"/>
                </channels>
                <properties>
                <source>*</source>
                <!-- define the resolution rules and access level of the cfc being invoked -->
                <access>
                <!-- Use the ColdFusion mappings to find CFCs, by default only CFC files under your webroot can be found. -->
                <use-mappings>false</use-mappings>
                <!-- allow "public and remote" or just "remote" methods to be invoked -->
                <method-access-level>remote</method-access-level>
                </access>

                <property-case>
                <!-- cfc property names -->
                <force-cfc-lowercase>false</force-cfc-lowercase>
                <!-- Query column names -->
                <force-query-lowercase>false</force-query-lowercase>
                <!-- struct keys -->
                <force-struct-lowercase>false</force-struct-lowercase>
                </property-case>
                </properties>
                </destination>

                </service>
                </services>

                <channels>
                <channel-definition id="my-cfamf" class="mx.messaging.channels.AMFChannel">
                <endpoint uri=" http://{server.name}:{server.port}{context.root}/flex2gateway/" class="flex.messaging.endpoints.AMFEndpoint"/>
                <properties>
                <polling-enabled>false</polling-enabled>
                <serialization>
                <instantiate-types>false</instantiate-types>
                </serialization>
                </properties>
                </channel-definition>
                </channels>

                <logging>
                <target class="flex.messaging.log.ConsoleTarget" level="Error">
                <properties>
                <prefix>[Flex] </prefix>
                <includeDate>false</includeDate>
                <includeTime>false</includeTime>
                <includeLevel>false</includeLevel>
                <includeCategory>false</includeCategory>
                </properties>
                <filters>
                <pattern>Endpoint.*</pattern>
                <pattern>Service.*</pattern>
                <pattern>Configuration</pattern>
                <pattern>Message.*</pattern>
                </filters>
                </target>
                </logging>

                <system>
                </system>

                </services-config>

                • 5. Re: CFCs work localy but not on hosted server
                  peterent Level 2
                  You don't need FDS installed for this. I wanted to make sure that there was in fact a wwwroot/WEB-INF/flex directory on your host system and that its config file was present and correct.

                  I think this may be your problem:
                  <!-- Use the ColdFusion mappings to find CFCs, by default only CFC files under your webroot can be found. -->
                  <use-mappings>false</use-mappings>

                  Are your CFCs somewhere under wwwroot?

                  Next, can you use the CF administrator on your host machine? If so, take a look at Flex Integration under Data & Services. Make sure the "Enable Flash Remoting support" is checked.

                  One more thing: make sure ColdFusion is running on port 80 since you don't have a port number in the endpoint for your local services config file.