Hi Peter and Steven,

First, thanks for the assistance and for Pete, the very eloquent response.

2. A Flex-specific RemoteObject envelope is being sent to a CFC - this
is not supported. The idea of a "stateless-class" or "stateful-class" is
a Flex-only consideration for the Java adapters. You have either
specified this directly as a "type" attribute to your <mx:RemoteObject>
tag or perhaps registered it in the entry for the named service in
flex-config.xml's remote-objects whitelist. It should be removed in any
event.
 
Removed

3. The Status error returned suggests a strange location for your
"usersService" CFC. While the CFC has to be available under the webroot,
the service name for the CFC should not include the webroot directory in
its name. (This error also suggests that your <mx:RemoteObject> tag was
using named services... more on this below).

The path is to my model folder within the mach-ii application framework. For example, the directory path is:
I added the wwwroot to the application awhile back and have not changed it in the CF admin/directory structure to reflect a root. I'll add it to my list of clean-up needed this week. Currently, I am running Flex on port 8700 and CF on 8300.


You're running Flex 1.5 and CFMX 7 right?


Correct

Did you combine the two J2EE web applications of Flex and CFMX or have
you left them separate?


Sep. Jrun 4 instances
 

Or are you planning on compiling the MXML
application offline using mxmlc (requires a Flex license) and then
simply deploying the resulting SWF to a CFMX 7 web app that contains
your CFC based service?

 Yes

In any event, there are two configuration considerations.

1. The MXML compiler validates named <mx:RemoteObject> services at
compile time. This validation requires a correctly configured
flex-config.xml file containing your named object entry in the
remote-objects whitelist. We understand this isn't exactly helpful for
he non-local deployment of RemoteObject services and have already
received complaints, but this is how Flex 1.5 works so it's something
you'll need to consider for now. (Note that the validation was added to
help the developer catch typos in service names at compile time...)

I cut down the code into what works (login returns true or false in my result handler) and the way I *think it should be done.
 
1) improve security. Security is important on this app if it sees production (*crosses fingers)
2) rebuild the VOs so I can work with direct databinding

After reading (http://www.macromedia.com/devnet/flex/articles/data_binding/ch18_data_binding.pdf), I realized that I needed to really solidify my service names in the flex-config file and services.mxml file before I could proceed with the databinding.

First, I have most of my framework complete (20 views, viewHelpers, VOs, commands, lots of delegates, etc.) and I want to do the following before I continue:

Works
Services.mxml
   <mx:RemoteObject id="loginService"
                          endpoint="http://localhost:8300/flashservices/gateway"
                          protocol="http"
                          showBusyCursor="true"
                          result="event.call.resultHandler( event )"
                          fault="event.call.faultHandler( event )">
   </mx:RemoteObject>

Flex FlexConfig.xml
        <object>
            <source>*</source>
         </object>

CF GatewayConfig.xml
  Standard Setup

        <whitelist>
            <source>*</source>
        </whitelist>

CF FlexConfig.xml
 
Standard Setup


Fails
Services.mxml
   <mx:RemoteObject id="loginService"
named="usersService"
                          endpoint="http://localhost:8300/flashservices/gateway"
                          protocol="http"
                          showBusyCursor="true"
                          result="event.call.resultHandler( event )"
                          fault="event.call.faultHandler( event )">
   </mx:RemoteObject>

FlexConfig.xml
       <object name="usersService">
              <source>wwwroot.MYDOMAIN.model.user.usersService</source>
        </object>

GatewayConfig.xml
  Standard Setup

        <whitelist>
            <source>*</source>
        </whitelist>

CF FlexConfig.xml
    <remote-objects>

        <amf-gateway>{context.root}/amfgateway</amf-gateway>
 
        <amf-https-gateway>{context.root}/amfgateway</amf-https-gateway>

        <allow-url-override>false</allow-url-override>
    
        <whitelist>
         
            <unnamed>
                <source>*</source>
             
            </unnamed>
        <named>
               <object name="usersService">
                   <source>*</source>
                    <!-- the type of the source being accessed - e.g. stateful-class or stateless-class -->
                    <!-- <type>stateless-class</type> -->

                    <!-- instructs the gateway to only allow authenticated users to invoke this service
                         this is required when using normal J2EE Basic authentication -->
                    <!-- <use-basic-authentication>true</use-basic-authentication> -->

                    <!-- informs the gateway that is should attempt to use its own custom authentication mechansim
                         as configured in the login-command section of gateway-config.xml -->
                    <!-- <use-custom-authentication>true</use-custom-authentication> -->

                    <!-- Adds the service's source to the unnamed whitelist.  If false, these can never be used as unnamed sources -->
                    <!-- This will be forced to false if this named object requires authentication -->
                    <!-- <allow-unnamed-access>true</allow-unnamed-access> -->

                    <!-- custom authorization roles can be specified when using custom authentication -->
                    <!--
                    <roles>
                        <role></role>
                    </roles>
                    -->
                <!-- </object> -->
        </object>
            <!-- </named> -->
        </named>
        </whitelist>
    </remote-objects>


2. The CFMX 7 version of the Flash Remoting gateway is (almost)
identical to the Flex 1.5 version. It now has a configuration file and
the concept of a whitelist. It is for these reasons that you must now
consider CFMX's flex-config.xml file as you MUST register a named
service for your CFC to support your RemoteObject request. The whitelist
is there to stop arbitrary requests to services.

I made changes to the CFMX flex-config.xml file. (begin wink and pitch) Without a tutorial on how these files are supposed to be structured, I'm only guessing about the structure and paths.(end wink. end pitch. consider begging mode)




Yahoo! Groups Links

Reply via email to