4 Replies Latest reply on Jan 29, 2007 9:09 AM by davidmedifit

    Once and for All ---- Please

    halodev Level 1
      Hello all,

      I have used CF for several years now and bought Flex as soon as it was released. In my process of understanding how Flex handled Remote objects for CF I decided to use the CF Builder wizard for Flex that creates all kinds of nice CFC's and stuff for me to connect to a database and CRUD the data within. Ok all fine and dandy on the local machine, works great, I am impressed! That is until I try to upload the app to my Shared Server (HMS) and I get all kinds of cryptic error messages like:

      (mx:rpc:Fault)#0 error id = 0
      faultCode ='Client.Error.MessageSend"
      faultDetail = "Channel.Connect.Failed error
      NetConnection.Call.Failed :HTTP:Status 500"
      faultString = "Send Failed"
      message = "faultCode.Client.Error.MessageSend faultString:'Send Failed'
      faultDetail:'Channel.Connect.Failed error
      NetConnection.CallFailed: HTTP: Status 500" name = "Error"
      rootCause = (Object)#1
      code = NetConnection.Call.Failed"
      description = "HTTP: Status 500"
      details = " http://www.MYDOMIAN.com/flex2gateway/" level = "error"

      So I have read the DOCs and read all the blogs I can find on the subject but no one can clearly answer as to why I can not make this work on a Shared Server if I can make it work on my local box, Heck I can even tap into the MySQL database on the Shared Server via the Flex builder. I use HostMySite.com with the CF package if that helps.

      If it is just a matter of something on my hosts end I need them to configure for me that would be nice to know, or if I simply can't use Flex and CF together on a Shared Server all together. That would be nice to know. But for all the hype Flex is getting and how easy it supposed to be to create an app with CF, I am wondering why someone can not answer this question once and for all. I know others have posted to this and many other forums asking the same things I am. Is it too much to ask one of the Flex Gurru's of Adobe, or anywhere else for that matter to help us out?

      Not everyones wants to run their own server and I would think that Adobe would have kept that in mind when creating Flex, and how it would run on shared servers.

      So please if anyone can help understand this please let me know.

      Thanks
        • 1. Re: Once and for All ---- Please
          peterent Level 2
          When you compile your Flex app for use with CF, you specify a services-config.xml file, right? Inside that file you'll see references server and port. I don't have a file to reference right now, so I'm adivising on memory, here.

          The point is, in the config file are variables that are set to the host that is being used when compiling the file - your local machine. What you need to do is change those variables to the name of the CF server you'll be using. Compile the SWF and now it is ready to connect to that server.

          I hope that makes sense. I normally try to be explicit, but without a file in front of me I can't be precise. But I think you'll figure out what to change.
          • 2. Once and for All ---- Please
            halodev Level 1
            peterent, thank you for replying to my post.

            Ok, yes I do understand that you specify a services-config.xml file when you compile. It is defaulted to the CFMX7\wwwroot\WEB-INF\flex folder I believe. I have also seen and read about the server and port variables inside the XML doc. Where you loose me is when you say to change those variables to the name of the CF server. I am not sure how I would know what the name is and what port it is on seeing as it is a shared server. Is this information something a web host would normally give out freely?

            Would I need to ask my host where the services-config.xml is located on the Shared Server? Am I to understand that I would be using their services-config.xml file and would need to map my Flex project to that absolute path? Or do you mean something more along the lines of me editing a copy of my services-config.xml file and placing it somewhere under my remote web root, if so where?

            thanks

            An example in this case would be nice to see.
            • 3. Re: Once and for All ---- Please
              peterent Level 2
              Whoever "owns" the computer running CF should tell you its name or IP address and the port number for the CF instance you want to use. For example: vega:8500 or 192.168.0.203:8500 something like that.

              Use the services-config.xml file that comes with your local CF in the wwwroot/WEB-INF/flex directory. Just make a copy of it and modify the copy. Find the channel-definition for my-cfamf and in the endpoint tag, change {server.name} to the machine's name (eg, vega) and the {server.port} to the port (eg, 8500). The {context.root} is probably OK.

              to verify that you have it correct, take the resulting URI and paste into a browser (you will need to substitute {context.root}, so I would just leave it out). If you get a blank page you're all set.

              For example, on your local machine you can do:

              http://localhost:8500/flex2gateway and you'll get a blank page (assuming CF is running on port 8500 on your local machine).

              But here's the catch. The {server.name} and {port.number} must be the values the user of your Flex app would need. That is, if on your own network the CF machine is vega:8500, but to the outside world it is yourdomain.com:8500 or even simply yourdomain.com because you have a proxy server, then you must use the externally visible name and port.

              Just remember where the Flex SWF will be running and use that point of view.


              • 4. Re: Once and for All ---- Please
                davidmedifit Level 1
                Halodev / Peter,
                I was JUST about to ask the same question. The problem I was having was migrating a Flex app created on my local machine, connecting with my local CF app, to a test (model of production) server.

                I knew the following:
                1) The flex app worked as expected
                2) The data was not an issue, as I mapped a datasource to my production DB

                My main concern was getting the Flex app to work on the test server, but my biggest issue was the fact that the setup of my local and test servers are different. Example, I have a single instance locally, running off localhost. On my test server, I have multiple JRUN instances on the D-drive (as opposed to the c-drive, locally).

                From this post, I figured out that I needed to change the project properties to account for the different location of the flex-config file. I right clicked on the project and selected properties, and altered the values in the "Flex Compiler" and "Flex Server" sections to reflect the TEST server locations of the flex-config file.

                Now, to make life hard on myself, the "d" drive on my laptop is the CD ROM, and when I tried to enter the path in FB, I got an error saying that the path was invalid. I looked into partitioning my drive, but I was warned off it by our tech guy here (besides, it seemed too much like real work!). SO, I burned a CD with the proper path, just as a temporary solution.

                I re-built the app, and deployed ALL of the files in the local projects "bin" directory. It worked, eventually, but there are some questions I have, maybe, Peter, if you read this you could help.

                1) I had trouble with SSL - my test servers use them (as do the production servers). The SWF started to load but I got a 403 error (that is SSL related, I believe). I'm not sure if that was when it was loading, or trying to access the CFC. Any thoughts on this? Are there known SSL issues?

                2) The whole "D" drive thing was a pain. As I mentioned, I have multpile JRUN instances on my Test (and Dev) server - one for each site. If I created a single generic site on the c-drive, would all sites that access flex be able to use that flex-config file, or do they need to access the local file? I'm not really getting how the flex services-config.xml file relates. Maybe I'll re-read your posts in this thread.

                3) Do I need to copy all the files from the bin directory, or is that over-kill? What is the bare-minimum code I need to get the Flex SWF to run? Could I just copy a sub-set of the HTML to a content management system?

                Any help with the above is appreciated.

                I'm not sure if I answered the original question, or contributed positively to this post - I hope I did, and that someone will find this information useful in the future.

                Cheers guys,

                David