5 Replies Latest reply on Dec 21, 2006 11:50 PM by See4th

    HTTP: 405 Error

    KomputerMan.com Level 1
      Greetings Flex peoples!!!

      I have a pretty simple SWF file that works fine on my laptop, where I developed it, but it doesn't run on the production web server. I have ran the following test.cfm template to test my web service and it worked fine.

      <cfinvoke component="UserData" method="getUsers" returnvariable="list"> </cfinvoke>
      <cfdump var="#list#">

      I have checked the CF Admin and the Flash Remoting Services are enabled as is the Flex Data Management Services. Server Identity is set to default as there is only on CF server instance running on the machine. Nothing else is selected in the Flex Integration area.

      I checked my Services-Config file on the web server and it looks fine to me. I am including it here...
      <?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>true</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>

      And last but not least here is the servces-config file on the development machine...
      <?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>true</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>


      Am I missing something here??? Thanks in advance for any help you can offer.

      Have an Ordinary Day...
      KomputerMan ~|:-)
        • 1. Re: HTTP: 405 Error
          ntsiii Level 3
          Probably a security issue.

          You will need a crossdomain.xml file on the server that has the web service.

          I am on a different machine now and don't have my handy shortcuts available, but search here and google for crossdomain.

          Tracy
          • 2. Re: HTTP: 405 Error
            KomputerMan.com Level 1
            I thought about that but the server making the Web Service request is the same server serving the Web Service. Do I need a crossdomain.xml file for a server to talk to itself???

            Have an Ordinary Day...
            KomputerMan ~|:-)
            • 3. Re: HTTP: 405 Error
              ntsiii Level 3
              What matters is the domain, not the server.

              Tracy
              • 4. Re: HTTP: 405 Error
                KomputerMan.com Level 1
                Finally found the root of this problem. This problem was caused by a incomplete Web.xml file located in the CFusionMX7\wwwroot\WEB-INF\ folder. All I did was compared the Web.xml file on the server that was not working to a Web.xml file from a machine that was serving up Flex pages. There was about 50 lines missing in the Web.xml file from the machine that did not work. I made a copy of the old Web.xml file and copied over the Web.xml file from the working server, restarted my CF Server and life was good. I hope this helps somebody else besides myself!!!

                Have an Ordinary Day...
                KomputerMan ~|:-)
                • 5. Re: HTTP: 405 Error
                  See4th Level 1
                  Can you supply the 50 lines of code so that I can do a comparison? I have been pulling my hair out for 3 days on this crazy issue.

                  Thanks,

                  Jeff