Loading ...
Sorry, an error occurred while loading the content.

Re: Cairngorm .99 + Flex-Config + Services.mxml

Expand Messages
  • Daniel Harfleet
    Hey Dave, hate to ask the standard question, but here goes ..... what are the symptoms you are getting ? Is it an error message, timeout, or what ? thanks dan
    Message 1 of 26 , Jun 1, 2005
    • 0 Attachment
      Hey Dave,

      hate to ask the standard question, but here goes .....


      what are the symptoms you are getting ? Is it an error message,
      timeout, or what ?

      thanks

      dan



      --- In flexcoders@yahoogroups.com, dave buhler <pedalspeed@g...> wrote:
      > Hi,
      >
      > I am attempting to update the configuration for my services, both the
      > flex-config.xml and services.mxml. This first example works fine,
      thanks to
      > the trusty wildcard. However, this week, I'll need to work on
      security and
      > databinding (this begins the segway into my next post) so it's time to
      > rebuild both files.
      >
      > I know the cfc exists because I can access it at:
      >
      http://localhost:8300/wwwroot.myDomain.model.user.usersService.cfc?wsdl
      and
      > I can access it in the first example.
      >
      > Any help is appreciated.
      >
      > I'm running:
      >
      > - Flex (stand-alone) on JRun4 (port: 8700)
      > - CF 7 on JRun4 (port: 8300)
      > - Cairngorm .99
      > - mach-ii
      >
      >
      > Does Work: :)
      >
      > Services.mxml 1
      > <cairngorm:ServiceLocator
      xmlns:mx="http://www.macromedia.com/2003/mxml"
      > xmlns:cairngorm="http://www.iterationtwo.com/cairngorm">
      >
      > <mx:RemoteObject id="loginDelegate"
      > endpoint="http://localhost:8300/flashservices/gateway"
      > source="wwwroot.myDomain.model.user.usersService
      > protocol="http"
      > showBusyCursor="true"
      > result="event.call.resultHandler( event )"
      > fault="event.call.faultHandler( event )">
      > </mx:RemoteObject>
      >
      > <mx:RemoteObject id="ownersDelegate"
      > endpoint="http://localhost:8300/flashservices/gateway"
      > source="wwwroot.myDomain.model.owner.ownersService"
      > protocol="http"
      > showBusyCursor="true"
      > result="event.call.resultHandler( event )"
      > fault="event.call.faultHandler( event )">
      > </mx:RemoteObject>
      >
      > </cairngorm:ServiceLocator>
      >
      > Flex-Config.mxml 1
      > <remote-objects>
      >
      > <whitelist>
      > <named>
      > <object>
      > <source>*</source>
      > <type>stateless-class</type>
      > </object>
      > </named>
      > </whitelist>
      >
      > <amf-gateway>{context.root}/amfgateway</amf-gateway>
      > <amf-https-gateway>{context.root}/amfgateway</amf-https-gateway>
      > <allow-url-override>false</allow-url-override>
      >
      > </remote-objects>
      >
      >
      -----------------------------------------------------------------------------------------------------------
      >
      > Does Not Work: :( - -
      >
      > Services.mxml 2
      > <cairngorm:ServiceLocator
      xmlns:mx="http://www.macromedia.com/2003/mxml"
      > xmlns:cairngorm="http://www.iterationtwo.com/cairngorm">
      >
      > <mx:RemoteObject id="loginService" named="usersService"
      > protocol="http"
      > showBusyCursor="true"
      > result="event.call.resultHandler( event )"
      > fault="event.call.faultHandler( event )">
      > </mx:RemoteObject>
      >
      > <mx:RemoteObject id="ownersService" named="ownersService"
      > protocol="http"
      > showBusyCursor="true"
      > result="event.call.resultHandler( event )"
      > fault="event.call.faultHandler( event )">
      > </mx:RemoteObject>
      >
      >
      > </cairngorm:ServiceLocator>
      >
      > Flex-Config.mxml 2
      > <remote-objects>
      >
      > <whitelist>
      > <named>
      >
      > <object name="usersService">
      > <source>wwwroot.myDomain.model.user.usersService</source>
      > <type>stateless-class</type>
      > </object>
      >
      > <object name="ownersService">
      > <source>wwwroot.myDomain.model.owner.ownersService</source>
      > <type>stateless-class</type>
      > </object>
      >
      > </named>
      > </whitelist>
      >
      > <amf-gateway>{context.root}/amfgateway</amf-gateway>
      > <amf-https-gateway>{context.root}/amfgateway</amf-https-gateway>
      > <allow-url-override>false</allow-url-override>
      >
      > </remote-objects>
      >
      > Dave
    • dave buhler
      Hi Dan, MethodName: usersService.loginUser Parameters (object #2) .....[0] (object #3) .........._flag: Envelope ..........data (object #4)
      Message 2 of 26 , Jun 1, 2005
      • 0 Attachment
        Hi Dan,

        MethodName: "usersService.loginUser"
        Parameters (object #2)
        .....[0] (object #3)
        .........._flag: "Envelope"
        ..........data (object #4)
        ...............[0]: (undefined)
        ..........headers (object #5)
        ...............[0] (object #6)
        ....................[0]: "ServiceType"
        ....................[1]: (boolean) false
        ....................[2]: "stateless-class"

        Status (object #2)
        .....code: "Server.ResourceNotFound"
        .....description: "Service wwwroot.myDomain.model.user.usersService not found."
        .....details: ""
        .....level: "error"
        .....type: ""

        On 6/1/05, Daniel Harfleet <dharfleet@...> wrote:
        Hey Dave,

        hate to ask the standard question, but here goes .....


        what are the symptoms you are getting ? Is it an error message,
        timeout, or what ?

        thanks

        dan



        --- In flexcoders@yahoogroups.com, dave buhler <pedalspeed@g...> wrote:
        > Hi,
        >
        > I am attempting to update the configuration for my services, both the
        > flex-config.xml and services.mxml. This first example works fine,
        thanks to
        > the trusty wildcard. However, this week, I'll need to work on
        security and
        > databinding (this begins the segway into my next post) so it's time to
        > rebuild both files.
        >
        > I know the cfc exists because I can access it at:
        >
        http://localhost:8300/wwwroot.myDomain.model.user.usersService.cfc?wsdl
        and
        > I can access it in the first example.
        >
        > Any help is appreciated.
        >
        > I'm running:
        >
        >    - Flex (stand-alone) on JRun4 (port: 8700)
        >    - CF 7 on JRun4 (port: 8300)
        >    - Cairngorm .99
        >    - mach-ii
        >
        >
        > Does Work: :)
        >
        > Services.mxml 1
        > <cairngorm:ServiceLocator
        xmlns:mx="http://www.macromedia.com/2003/mxml"
        >  xmlns:cairngorm=" http://www.iterationtwo.com/cairngorm">
        >
        >  <mx:RemoteObject id="loginDelegate"
        >  endpoint=" http://localhost:8300/flashservices/gateway"
        >  source="wwwroot.myDomain.model.user.usersService
        >  protocol="http"
        >  showBusyCursor="true"
        >  result="event.call.resultHandler ( event )"
        >  fault="event.call.faultHandler( event )">
        >  </mx:RemoteObject>
        >
        >  <mx:RemoteObject id="ownersDelegate"
        >  endpoint=" http://localhost:8300/flashservices/gateway"
        >  source="wwwroot.myDomain.model.owner.ownersService"
        >  protocol="http"
        >  showBusyCursor="true"
        >  result=" event.call.resultHandler( event )"
        >  fault="event.call.faultHandler( event )">
        >  </mx:RemoteObject>
        >
        > </cairngorm:ServiceLocator>
        >
        > Flex-Config.mxml 1
        > <remote-objects>
        >
        >  <whitelist>
        >  <named>
        >  <object>
        >  <source>*</source>
        >  <type>stateless-class</type>
        >  </object>
        >  </named>
        >  </whitelist>
        >
        >  <amf-gateway>{context.root}/amfgateway</amf-gateway>
        >  <amf-https-gateway>{context.root}/amfgateway</amf-https-gateway>
        >  <allow-url-override>false</allow-url-override>
        >
        > </remote-objects>
        >
        >
        -----------------------------------------------------------------------------------------------------------
        >
        > Does Not Work: :( - -
        >
        > Services.mxml 2
        > <cairngorm:ServiceLocator
        xmlns:mx="http://www.macromedia.com/2003/mxml"
        > xmlns:cairngorm="http://www.iterationtwo.com/cairngorm">
        >
        > <mx:RemoteObject id="loginService" named="usersService"
        > protocol="http"
        > showBusyCursor="true"
        > result="event.call.resultHandler( event )"
        > fault="event.call.faultHandler( event )">
        > </mx:RemoteObject>
        >
        > <mx:RemoteObject id="ownersService" named="ownersService"
        > protocol="http"
        > showBusyCursor="true"
        > result="event.call.resultHandler( event )"
        > fault="event.call.faultHandler( event )">
        > </mx:RemoteObject>
        >
        >
        > </cairngorm:ServiceLocator>
        >
        > Flex-Config.mxml 2
        > <remote-objects>
        >
        >  <whitelist>
        >  <named>
        >
        >  <object name="usersService">
        >  <source>wwwroot.myDomain.model.user.usersService</source>
        >  <type>stateless-class</type>
        >  </object>
        >
        >  <object name="ownersService">
        >  <source>wwwroot.myDomain.model.owner.ownersService</source>
        >  <type>stateless-class</type>
        >  </object>
        >
        >  </named>
        >  </whitelist>
        >
        >  <amf-gateway>{context.root}/amfgateway</amf-gateway>
        >  <amf-https-gateway>{context.root}/amfgateway</amf-https-gateway>
        >  <allow-url-override>false</allow-url-override>
        >
        > </remote-objects>
        >
        > Dave





        Yahoo! Groups Links

        <*> To visit your group on the web, go to:
            http://groups.yahoo.com/group/flexcoders/

        <*> To unsubscribe from this group, send an email to:
             flexcoders-unsubscribe@yahoogroups.com

        <*> Your use of Yahoo! Groups is subject to:
            http://docs.yahoo.com/info/terms/





      • Krzysztof Szlapinski
        hi, my application is basically a viewstack with many external componet children:
        Message 3 of 26 , Jun 1, 2005
        • 0 Attachment
          hi,
          my application is basically a viewstack with many external componet
          children:

          <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"
          xmlns:local="*" >
          <mx:Panel id="pan" width="900" height="560"
          horizontalAlign="center" verticalAlign="middle" >
          <mx:ViewStack id="vs" widthFlex="0" borderStyle="none"
          width="{pan.width*0.95}" height="{pan.height*0.85}"
          creationPolicy="all" >
          <local:test00027vb00000 id="vb0" vs="{vs}"/>
          <local:test00027vb00001 id="vb1" vs="{vs}"/>
          ....
          ....
          <local:test00027vb00016 id="vb16" vs="{vs}"/>
          <local:test00027vb00018 id="vb18" vs="{vs}"/>
          </mx:ViewStack>
          <mx:Button id="nextButton" label="NEXT" width="300"
          click="Next();" />
          </mx:Panel>
          </mx:Application>

          one of these comonents has a media display component and the problem is
          that the media starts to play for one second and then stops when the
          application is being initialized even when its autoplay property is set
          to false.
          when I change the creation policy of the viewstack to auto the media
          starts to play for a second when this component is being displayed
          (initilized)

          krzysiek
        • Dirk Eismann
          Hi Dave, make sure to configure the named object in the gateway-config.xml file of your ColdFusion MX 7 server and not in the flex-config.xml Dirk. ... From:
          Message 4 of 26 , Jun 1, 2005
          • 0 Attachment
            Hi Dave,

            make sure to configure the named object in the gateway-config.xml file of your ColdFusion MX 7 server and not in the flex-config.xml

            Dirk.

            -----Original Message-----
            From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com]On Behalf Of dave buhler
            Sent: Wednesday, June 01, 2005 3:33 PM
            To: flexcoders@yahoogroups.com
            Subject: Re: [flexcoders] Re: Cairngorm .99 + Flex-Config + Services.mxml


            Hi Dan,

            MethodName: "usersService.loginUser"
            Parameters (object #2)
            .....[0] (object #3)
            .........._flag: "Envelope"
            ..........data (object #4)
            ...............[0]: (undefined)
            ..........headers (object #5)
            ...............[0] (object #6)
            ....................[0]: "ServiceType"
            ....................[1]: (boolean) false
            ....................[2]: "stateless-class"

            Status (object #2)
            .....code: "Server.ResourceNotFound"
            .....description: "Service wwwroot.myDomain.model.user.usersService not found."
            .....details: ""
            .....level: "error"
            .....type: ""
          • dave buhler
            Hi Dirk When I looked in the Cairngorm store example, the Flex-Config was modified with names that I think had to map to names in my Services.mxml. I am @ work
            Message 5 of 26 , Jun 1, 2005
            • 0 Attachment
              Hi Dirk

              When I looked in the Cairngorm store example, the Flex-Config was modified with names that I think had to map to names in my Services.mxml.

              I am @ work right now, so the gateway-config.xml isn't in front of me. Do I need to modify a whitelist within the Gateway-Config AND the Flex-Config or should I backtrack, return the Flex-Config to its original settings, and define the service names in the gatway-config file?

              Services, Flex-Config and Gateway-Config = Lions and Tigers and Bears, oh my!

              Dave


              On 6/1/05, Dirk Eismann <DEismann@...> wrote:
              Hi Dave,

              make sure to configure the named object in the gateway-config.xml file of your ColdFusion MX 7 server and not in the flex-config.xml

              Dirk.

              -----Original Message-----
              From: flexcoders@yahoogroups.com [mailto: flexcoders@yahoogroups.com]On Behalf Of dave buhler
              Sent: Wednesday, June 01, 2005 3:33 PM
              To: flexcoders@yahoogroups.com
              Subject: Re: [flexcoders] Re: Cairngorm .99 + Flex-Config + Services.mxml


              Hi Dan,

              MethodName: "usersService.loginUser"
              Parameters (object #2)
              .....[0] (object #3)
              .........._flag: "Envelope"
              ..........data (object #4)
              ...............[0]: (undefined)
              ..........headers (object #5)
              ...............[0] (object #6)
              ....................[0]: "ServiceType"
              ....................[1]: (boolean) false
              ....................[2]: "stateless-class"

              Status (object #2)
              .....code: "Server.ResourceNotFound"
              .....description: "Service wwwroot.myDomain.model.user.usersService not found."
              .....details: ""
              .....level: "error"
              .....type: ""




              Yahoo! Groups Links

              <*> To visit your group on the web, go to:
                  http://groups.yahoo.com/group/flexcoders/

              <*> To unsubscribe from this group, send an email to:
                  flexcoders-unsubscribe@yahoogroups.com

              <*> Your use of Yahoo! Groups is subject to:
                  http://docs.yahoo.com/info/terms/





            • dave buhler
              Hi, I typically use creationPolicy= all for my viewstack. With your situation, you have options. If you want the mediaDisplay to load the content in the
              Message 6 of 26 , Jun 1, 2005
              • 0 Attachment
                Hi,

                I typically use creationPolicy="all" for my viewstack.

                With your situation, you have options. If you want the mediaDisplay to load the content in the background, use creationPolicy="all" and have a viewHelper load the FLV (setMedia or contentPath) when the button to the view is clicked.

                Or, you can use creationPolicy="none" and call the setMedia when the component (the view) is first created, and you can instantiate the view with createComponent.

                Info: http://livedocs.macromedia.com/flex/15/flex_docs_en/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Flex_Documentation&file=00001145.htm

                If you're are requesting remoting, you could set the MediaDisplay when you receive a result from the server in a result handler.

                Dave

                On 6/1/05, Krzysztof Szlapinski <thx1140@...> wrote:
                hi,
                my application is basically a viewstack with many external componet
                children:

                  <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"
                xmlns:local="*"  >
                   <mx:Panel id="pan"  width="900"  height="560"
                horizontalAlign="center"  verticalAlign="middle"  >
                    <mx:ViewStack id="vs"  widthFlex="0"  borderStyle="none"
                width="{pan.width*0.95}"  height="{pan.height*0.85}"
                creationPolicy="all"  >
                    <local:test00027vb00000 id="vb0" vs="{vs}"/>
                    <local:test00027vb00001 id="vb1" vs="{vs}"/>
                    ....
                    ....
                    <local:test00027vb00016 id="vb16" vs="{vs}"/>
                    <local:test00027vb00018 id="vb18" vs="{vs}"/>
                    </mx:ViewStack>
                    <mx:Button id="nextButton"  label="NEXT"  width="300"
                click="Next();"  />
                   </mx:Panel>
                  </mx:Application>

                one of these comonents has a media display component and the problem is
                that the media starts to play for one second and then stops when the
                application is being initialized even when its autoplay property is set
                to false.
                when I change the creation policy of the viewstack to auto the media
                starts to play for a second when this component is being displayed
                (initilized)

                krzysiek





                Yahoo! Groups Links

                <*> To visit your group on the web, go to:
                    http://groups.yahoo.com/group/flexcoders/

                <*> To unsubscribe from this group, send an email to:
                    flexcoders-unsubscribe@yahoogroups.com

                <*> Your use of Yahoo! Groups is subject to:
                    http://docs.yahoo.com/info/terms/




              • Peter Farland
                Hey Dave, Lots to discuss here. There are compile time considerations and runtime considerations. Firstly, from the AMF trace that you posted I see several
                Message 7 of 26 , Jun 1, 2005
                • 0 Attachment
                  Hey Dave,

                  Lots to discuss here. There are compile time considerations and runtime
                  considerations.


                  Firstly, from the AMF trace that you posted I see several things worth
                  mentioning:

                  1. The "MethodName" is listed as "usersService.loginUser" which implies
                  the service name was "usersService" and the function invoked was
                  "loginUser". This will mean CFMX will need to understand what
                  "usersService" means (see later).

                  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.

                  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).


                  Next, I have some questions.

                  You're running Flex 1.5 and CFMX 7 right?

                  Did you combine the two J2EE web applications of Flex and CFMX or have
                  you left them separate? 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?


                  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...)


                  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.


                  As for Cairngorm considerations, I can't comment on those but this list
                  seems very capable of helping out in that regard.

                  Pete





                  ________________________________

                  From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On
                  Behalf Of dave buhler
                  Sent: Wednesday, June 01, 2005 11:32 AM
                  To: flexcoders@yahoogroups.com
                  Subject: Re: [flexcoders] Re: Cairngorm .99 + Flex-Config +
                  Services.mxml


                  Hi Dirk

                  When I looked in the Cairngorm store example, the Flex-Config was
                  modified with names that I think had to map to names in my
                  Services.mxml.

                  I am @ work right now, so the gateway-config.xml isn't in front of me.
                  Do I need to modify a whitelist within the Gateway-Config AND the
                  Flex-Config or should I backtrack, return the Flex-Config to its
                  original settings, and define the service names in the gatway-config
                  file?

                  Services, Flex-Config and Gateway-Config = Lions and Tigers and Bears,
                  oh my!

                  Dave



                  On 6/1/05, Dirk Eismann <DEismann@...> wrote:

                  Hi Dave,

                  make sure to configure the named object in the
                  gateway-config.xml file of your ColdFusion MX 7 server and not in the
                  flex-config.xml

                  Dirk.

                  -----Original Message-----
                  From: flexcoders@yahoogroups.com [mailto:
                  flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com> ]On
                  Behalf Of dave buhler
                  Sent: Wednesday, June 01, 2005 3:33 PM
                  To: flexcoders@yahoogroups.com
                  Subject: Re: [flexcoders] Re: Cairngorm .99 + Flex-Config +
                  Services.mxml


                  Hi Dan,

                  MethodName: "usersService.loginUser"
                  Parameters (object #2)
                  .....[0] (object #3)
                  .........._flag: "Envelope"
                  ..........data (object #4)
                  ...............[0]: (undefined)
                  ..........headers (object #5)
                  ...............[0] (object #6)
                  ....................[0]: "ServiceType"
                  ....................[1]: (boolean) false
                  ....................[2]: "stateless-class"

                  Status (object #2)
                  .....code: "Server.ResourceNotFound"
                  .....description: "Service
                  wwwroot.myDomain.model.user.usersService not found."
                  .....details: ""
                  .....level: "error"
                  .....type: ""




                  Yahoo! Groups Links

                  <http://groups.yahoo.com/group/flexcoders/>










                  ________________________________

                  Yahoo! Groups Links


                  * To visit your group on the web, go to:
                  http://groups.yahoo.com/group/flexcoders/

                  * To unsubscribe from this group, send an email to:
                  flexcoders-unsubscribe@yahoogroups.com
                  <mailto:flexcoders-unsubscribe@yahoogroups.com?subject=Unsubscribe>

                  * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
                  Service <http://docs.yahoo.com/info/terms/> .
                • Steven Webster
                  ... I ll just followup Pete s (excellent) post by saying that there s a methodology to tracking this down; I d suggest reducing your testing to a single *non
                  Message 8 of 26 , Jun 1, 2005
                  • 0 Attachment
                    >
                    > As for Cairngorm considerations, I can't comment on those but
                    > this list seems very capable of helping out in that regard.
                    >

                    I'll just followup Pete's (excellent) post by saying that there's
                    a methodology to tracking this down; I'd suggest reducing your
                    testing to a single *non cairngorm* application that successfully
                    invokes your remote object and gets some results back.

                    Once you have that working, you've confirmed that your backend
                    and frontend are talking to each other. You should then be able
                    to migrate your RemoteObject call into a Services.mxml file and
                    hook into Business Delegate/Command classes on the client.

                    But first things first ... just produce a simple TestService.mxml
                    that declares your RemoteObject, invokes it, and handles the
                    result, following all the advice that Pete gave.

                    Cheers,

                    Steven

                    --
                    Steven Webster
                    Technical Director
                    iteration::two

                    This e-mail and any associated attachments transmitted with it may contain
                    confidential information and must not be copied, or disclosed, or used by
                    anyone other than the intended recipient(s). If you are not the intended
                    recipient(s) please destroy this e-mail, and any copies of it, immediately.

                    Please also note that while software systems have been used to try to ensure
                    that this e-mail has been swept for viruses, iteration::two do not accept
                    responsibility for any damage or loss caused in respect of any viruses
                    transmitted by the e-mail. Please ensure your own checks are carried out
                    before any attachments are opened.
                  • Krzysztof Szlapinski
                    ... thanks for reply what do you mean by viewHelper ? krzysiek
                    Message 9 of 26 , Jun 1, 2005
                    • 0 Attachment
                      dave buhler wrote:
                      > With your situation, you have options. If you want the mediaDisplay to
                      > load the content in the background, use creationPolicy="all" and have a
                      > viewHelper load the FLV (setMedia or contentPath) when the button to the
                      > view is clicked.

                      thanks for reply

                      what do you mean by "viewHelper" ?

                      krzysiek
                    • Manish Jethani
                      ... Can you confirm that the media actually plays for a second by checking the value of the playheadTime property? It s odd. One workaround is to set the
                      Message 10 of 26 , Jun 1, 2005
                      • 0 Attachment
                        On 6/1/05, Krzysztof Szlapinski <thx1140@...> wrote:

                        > one of these comonents has a media display component and the problem is
                        > that the media starts to play for one second and then stops when the
                        > application is being initialized even when its autoplay property is set
                        > to false.

                        Can you confirm that the media actually plays for a second by checking
                        the value of the 'playheadTime' property?

                        It's odd. One workaround is to set the 'contentPath' property only
                        when you want to play the media (just before calling the 'play'
                        method).
                      • dave buhler
                        Hi Manish, I ve seen Krzysztof s issue in our Flex-Flashcomm apps. The FLV plays before pausing when it s first loaded, even if the command is: contentPath or
                        Message 11 of 26 , Jun 1, 2005
                        • 0 Attachment
                          Hi Manish,

                          I've seen Krzysztof's issue in our Flex-Flashcomm apps. The FLV plays before pausing when it's first loaded, even if the command is:

                          contentPath or setMedia
                          then....
                          myMediaDisplay.stop; or myMediaDisplay.pause

                          Our resolution is the same as you suggested. Load the content only when it's requested. I think what most people try to do is to expedite buffering on a non-flashcomm, non-progressive FLV by loading it in the background. My best suggestion to expedite the caching is to load the FLV into a non-visible MediaDisplay (maybe set the size to 0,0) or a non-visible MovieClip (a SWF accessed through contentPath and the loader Component). You can turn off the audio/not attach audio to eliminate that weird moment when the movie plays the first second or two and you hear static while it loads in the background.

                          viewHelper? For now, think of a function called within your MXML when the button to request that MXML is called.

                          Dave





                          On 6/1/05, Manish Jethani <manish.jethani@...> wrote:
                          On 6/1/05, Krzysztof Szlapinski <thx1140@...> wrote:

                          > one of these comonents has a media display component and the problem is
                          > that the media starts to play for one second and then stops when the
                          > application is being initialized even when its autoplay property is set
                          > to false.

                          Can you confirm that the media actually plays for a second by checking
                          the value of the 'playheadTime' property?

                          It's odd.  One workaround is to set the 'contentPath' property only
                          when you want to play the media (just before calling the 'play'
                          method).



                          Yahoo! Groups Links

                          <*> To visit your group on the web, go to:
                              http://groups.yahoo.com/group/flexcoders/

                          <*> To unsubscribe from this group, send an email to:
                               flexcoders-unsubscribe@yahoogroups.com

                          <*> Your use of Yahoo! Groups is subject to:
                              http://docs.yahoo.com/info/terms/





                        • dave buhler
                          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
                          Message 12 of 26 , Jun 1, 2005
                          • 0 Attachment
                            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)


                          • dave buhler
                            ooops.. Meant to post this WORKING code with the source inline. Works Services.mxml
                            Message 13 of 26 , Jun 1, 2005
                            • 0 Attachment
                              ooops..

                              Meant to post this WORKING code with the source inline.

                              Works
                              Services.mxml
                                 <mx:RemoteObject id="loginService"
                                                        endpoint="http://localhost:8300/flashservices/gateway"
                                                        source="wwwroot.MYDOMAIN.model.user.User"
                                                        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>


                              On 6/2/05, dave buhler <pedalspeed@... > wrote:
                              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)



                            • Krzysztof Szlapinski
                              ... yes that s right - it s about a second and the playhead is not at zero position when I start the video later in may app. So the movie doesn t start from
                              Message 14 of 26 , Jun 1, 2005
                              • 0 Attachment
                                Manish Jethani wrote:

                                > Can you confirm that the media actually plays for a second by checking
                                > the value of the 'playheadTime' property?
                                yes that's right - it's about a second and the playhead is not at zero
                                position when I start the video later in may app. So the movie doesn't
                                start from the very begining.

                                I'll try to set the contentPath as you've said.

                                thx

                                krzysiek
                              • Dirk Eismann
                                Hi Dave, to setup named remote objects with CF you ll need to 1) modify Flex s flex-config.xml file and CF s gateway-config.xml file (I wondered to which file
                                Message 15 of 26 , Jun 2, 2005
                                • 0 Attachment
                                  Hi Dave,

                                  to setup named remote objects with CF you'll need to

                                  1) modify Flex's flex-config.xml file and CF's gateway-config.xml file (I wondered to which file you are referring to when you say "CF FlexConfig.xml" as there isn't such a thing)

                                  2) adjust the structure of CF's gateway-config.xml file a bit to define your named objects.

                                  To point to the CF AMF gateway you can either use the endpoint on the RemoteObject tag (the way you did) or chnage the <amf-gateway> setting in your Flex's flex-config.xml (however, this changes the gateway for *all* applications in your Flex server)

                                  Then, you'll need to add a dummy named object entry in the flex-config.xml to get the MXML compiled.

                                  Next, you'll have to add the named object definition to the CF gateway-config.xml file. In your case something like this:

                                  ...
                                  <whitelist>
                                  <unnamed>
                                  <source></source>
                                  </unnamed>
                                  <named>
                                  <object name="Echo">
                                  <source>wwwroot.MYDOMAIN.model.user.User</source>
                                  </object>
                                  </named>
                                  </whitelist>
                                  ...

                                  restart your Flex and your CF server and you should be ready to go. Again, this is described in detail here: http://www.richinternet.de/blog/index.cfm?entry=831FE26E-0D70-9C2D-2549E1D1978CF1B0

                                  Dirk.

                                  -----Original Message-----
                                  From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com]On Behalf Of dave buhler
                                  Sent: Thursday, June 02, 2005 7:57 AM
                                  To: flexcoders@yahoogroups.com
                                  Subject: Re: [flexcoders] Re: Cairngorm .99 + Flex-Config + Services.mxml


                                  ooops..

                                  Meant to post this WORKING code with the source inline.

                                  Works
                                  Services.mxml
                                  <mx:RemoteObject id="loginService"
                                  endpoint="http://localhost:8300/flashservices/gateway"
                                  source="wwwroot.MYDOMAIN.model.user.User"
                                  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>
                                • dave buhler
                                  Hi Dirk, - I believe there is a Flex-Config file that is at the very least, part of JRun4. Can someone confirm or deny this? - There is one gateway-config.xm
                                  Message 16 of 26 , Jun 2, 2005
                                  • 0 Attachment
                                    Hi Dirk,

                                    • I believe there is a Flex-Config file that is at the very least, part of JRun4. Can someone confirm or deny this?
                                    • There is one gateway-config.xm file in my Flex web-inf folder. Is there a second one for CF that needs to be configured?
                                    I think at this point, I need to take this step-by-step.

                                    The difficulty I am having in part is because my first configuration works with the wild-card.

                                    Dave

                                    On 6/2/05, Dirk Eismann <DEismann@...> wrote:
                                    Hi Dave,

                                    to setup named remote objects with CF you'll need to

                                    1) modify Flex's flex-config.xml file and CF's gateway-config.xml file (I wondered to which file you are referring to when you say "CF FlexConfig.xml" as there isn't such a thing)

                                    2) adjust the structure of CF's gateway-config.xml file a bit to define your named objects.

                                    To point to the CF AMF gateway you can either use the endpoint on the RemoteObject tag (the way you did) or chnage the <amf-gateway> setting in your Flex's flex-config.xml (however, this changes the gateway for *all* applications in your Flex server)

                                    Then, you'll need to add a dummy named object entry in the flex-config.xml to get the MXML compiled.

                                    Next, you'll have to add the named object definition to the CF gateway-config.xml file. In your case something like this:

                                    ...
                                    <whitelist>
                                      <unnamed>
                                        <source></source>
                                      </unnamed>
                                      <named>
                                        <object name="Echo">
                                          <source>wwwroot.MYDOMAIN.model.user.User</source>
                                        </object>
                                      </named>
                                    </whitelist>
                                    ...

                                    restart your Flex and your CF server and you should be ready to go. Again, this is described in detail here: http://www.richinternet.de/blog/index.cfm?entry=831FE26E-0D70-9C2D-2549E1D1978CF1B0

                                    Dirk.

                                    -----Original Message-----
                                    From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com]On Behalf Of dave buhler
                                    Sent: Thursday, June 02, 2005 7:57 AM
                                    To: flexcoders@yahoogroups.com
                                    Subject: Re: [flexcoders] Re: Cairngorm .99 + Flex-Config + Services.mxml


                                    ooops..

                                    Meant to post this WORKING code with the source inline.

                                    Works
                                    Services.mxml
                                       <mx:RemoteObject id="loginService"
                                                              endpoint=" http://localhost:8300/flashservices/gateway"
                                                              source="wwwroot.MYDOMAIN.model.user.User"
                                                              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>




                                    Yahoo! Groups Links

                                    <*> To visit your group on the web, go to:
                                        http://groups.yahoo.com/group/flexcoders/

                                    <*> To unsubscribe from this group, send an email to:
                                         flexcoders-unsubscribe@yahoogroups.com

                                    <*> Your use of Yahoo! Groups is subject to:
                                        http://docs.yahoo.com/info/terms/




                                  • Dirk Eismann
                                    ... I would say the flex-config.xml file is part of your flex web application but not of JRun. ... true. You don t need to modify this file at all. ... Yes!
                                    Message 17 of 26 , Jun 2, 2005
                                    • 0 Attachment
                                      > I believe there is a Flex-Config file that is at
                                      > the very least, part of JRun4. Can someone confirm
                                      > or deny this?

                                      I would say the flex-config.xml file is part of your flex web application but not of JRun.

                                      > There is one gateway-config.xm file in my Flex
                                      > web-inf folder.

                                      true. You don't need to modify this file at all.

                                      > Is there a second one for CF that needs to be configured?

                                      Yes! You'll need to modify gateway-config.xml that comes with CF 7.

                                      > I think at this point, I need to take this step-by-step.

                                      yeah, that's the way to go :)

                                      > The difficulty I am having in part is because my first
                                      > configuration works with the wild-card.

                                      It works because you didn't used named services but defined the class name of the remote object directly on the RemoteObject tag. The wildcard in the Flex server's flex-config.xml just tells the compiler that any remote object may be called.

                                      Dirk.
                                    • dave buhler
                                      With regard to your PDF, Dirk: Is the Cross-Domain XML necessary when I am running two projects on a local-host with different ports? If I can access the
                                      Message 18 of 26 , Jun 2, 2005
                                      • 0 Attachment
                                        With regard to your PDF, Dirk:

                                        Is the Cross-Domain XML necessary when I am running two projects on a local-host with different ports?

                                        If I can access the server locally right now, must I add the Cross-Domain Policy file?

                                        On 6/2/05, Dirk Eismann < DEismann@...> wrote:
                                        > I believe there is a Flex-Config file that is at
                                        > the very least, part of JRun4. Can someone confirm
                                        > or deny this?

                                        I would say the flex-config.xml file is part of your flex web application but not of JRun.

                                        > There is one gateway-config.xm file in my Flex
                                        > web-inf folder.

                                        true. You don't need to modify this file at all.

                                        > Is there a second one for CF that needs to be configured?

                                        Yes! You'll need to modify gateway-config.xml that comes with CF 7.

                                        > I think at this point, I need to take this step-by-step.

                                        yeah, that's the way to go :)

                                        > The difficulty I am having in part is because my first
                                        > configuration works with the wild-card.

                                        It works because you didn't used named services but defined the class name of the remote object directly on the RemoteObject tag. The wildcard in the Flex server's flex-config.xml just tells the compiler that any remote object may be called.

                                        Dirk.



                                        Yahoo! Groups Links

                                        <*> To visit your group on the web, go to:
                                            http://groups.yahoo.com/group/flexcoders/

                                        <*> To unsubscribe from this group, send an email to:
                                            flexcoders-unsubscribe@yahoogroups.com

                                        <*> Your use of Yahoo! Groups is subject to:
                                            http://docs.yahoo.com/info/terms/




                                      • Peter Farland
                                        Hi Dave, sorry I didn t get back to you earlier on this. I started replying about 2am last night but got sidetracked playing IT-support person for my family.
                                        Message 19 of 26 , Jun 2, 2005
                                        • 0 Attachment
                                          Hi Dave, sorry I didn't get back to you earlier on this. I started replying about 2am last night but got sidetracked playing IT-support person for my family. Many thanks to Dirk for stepping in.
                                           
                                          The first configuration works with the wildcard as it is a short-hand allowed for CFMX to allow any service source (i.e., CFC path)  to be accessed, but note that source != named... named objects require specific configuration.
                                           
                                          Also note that the * wildcard is in CFMX merely because this was the equivalent behavior of earlier CF releases... if you can restrict it down to specific services (and would have to do so for named Flex RemoteObject services) it's much advised.
                                           
                                          Pete


                                          From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of dave buhler
                                          Sent: Thursday, June 02, 2005 11:37 AM
                                          To: flexcoders@yahoogroups.com
                                          Subject: Re: [flexcoders] Re: Cairngorm .99 + Flex-Config + Services.mxml

                                          Hi Dirk,

                                          • I believe there is a Flex-Config file that is at the very least, part of JRun4. Can someone confirm or deny this?
                                          • There is one gateway-config.xm file in my Flex web-inf folder. Is there a second one for CF that needs to be configured?
                                          I think at this point, I need to take this step-by-step.

                                          The difficulty I am having in part is because my first configuration works with the wild-card.

                                          Dave

                                          On 6/2/05, Dirk Eismann <DEismann@...> wrote:
                                          Hi Dave,

                                          to setup named remote objects with CF you'll need to

                                          1) modify Flex's flex-config.xml file and CF's gateway-config.xml file (I wondered to which file you are referring to when you say "CF FlexConfig.xml" as there isn't such a thing)

                                          2) adjust the structure of CF's gateway-config.xml file a bit to define your named objects.

                                          To point to the CF AMF gateway you can either use the endpoint on the RemoteObject tag (the way you did) or chnage the <amf-gateway> setting in your Flex's flex-config.xml (however, this changes the gateway for *all* applications in your Flex server)

                                          Then, you'll need to add a dummy named object entry in the flex-config.xml to get the MXML compiled.

                                          Next, you'll have to add the named object definition to the CF gateway-config.xml file. In your case something like this:

                                          ...
                                          <whitelist>
                                            <unnamed>
                                              <source></source>
                                            </unnamed>
                                            <named>
                                              <object name="Echo">
                                                <source>wwwroot.MYDOMAIN.model.user.User</source>
                                              </object>
                                            </named>
                                          </whitelist>
                                          ...

                                          restart your Flex and your CF server and you should be ready to go. Again, this is described in detail here: http://www.richinternet.de/blog/index.cfm?entry=831FE26E-0D70-9C2D-2549E1D1978CF1B0

                                          Dirk.

                                          -----Original Message-----
                                          From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com]On Behalf Of dave buhler
                                          Sent: Thursday, June 02, 2005 7:57 AM
                                          To: flexcoders@yahoogroups.com
                                          Subject: Re: [flexcoders] Re: Cairngorm .99 + Flex-Config + Services.mxml


                                          ooops..

                                          Meant to post this WORKING code with the source inline.

                                          Works
                                          Services.mxml
                                             <mx:RemoteObject id="loginService"
                                                                    endpoint=" http://localhost:8300/flashservices/gateway"
                                                                    source="wwwroot.MYDOMAIN.model.user.User"
                                                                    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>




                                          Yahoo! Groups Links

                                          <*> To visit your group on the web, go to:
                                              http://groups.yahoo.com/group/flexcoders/

                                          <*> To unsubscribe from this group, send an email to:
                                               flexcoders-unsubscribe@yahoogroups.com

                                          <*> Your use of Yahoo! Groups is subject to:
                                              http://docs.yahoo.com/info/terms/




                                        • dave buhler
                                          Thanks Peter, I m going to head down to Starbucks, buy some coffee and read through Dirk s document. From my understanding, I need to do the following: 1.
                                          Message 20 of 26 , Jun 2, 2005
                                          • 0 Attachment
                                            Thanks Peter,

                                            I'm going to head down to Starbucks, buy some coffee and read through Dirk's document.

                                            From my understanding, I need to do the following:
                                            1. Alter my services.mxml and add the object names as a 'named' source
                                            2. Alter my flex-config.xml file to add the object name as I specified it in my Services.mxml
                                            3. Dig into my JRun folder for CF and add the exact same names to the gateway-cofig.
                                            • Is the source path going to be the same as the one I had been using for my wildcard within the services.mxml that I am adding to my flex-config.xml and gateway-config.xml files?
                                            • Do I need to add a Cross-Domain Policy File?
                                            • Should I consider  a career in something easier? Maybe truck-driving?
                                            • I found a flex-config.xml file in my CF Folder for Jrun last night. Was I just in the wrong place or does this file really exist and is it important to this configuration?

                                            On 6/2/05, Peter Farland <pfarland@...> wrote:
                                            Hi Dave, sorry I didn't get back to you earlier on this. I started replying about 2am last night but got sidetracked playing IT-support person for my family. Many thanks to Dirk for stepping in.
                                             
                                            The first configuration works with the wildcard as it is a short-hand allowed for CFMX to allow any service source (i.e., CFC path)  to be accessed, but note that source != named... named objects require specific configuration.
                                             
                                            Also note that the * wildcard is in CFMX merely because this was the equivalent behavior of earlier CF releases... if you can restrict it down to specific services (and would have to do so for named Flex RemoteObject services) it's much advised.
                                             
                                            Pete


                                            From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of dave buhler
                                            Sent: Thursday, June 02, 2005 11:37 AM
                                            To: flexcoders@yahoogroups.com
                                            Subject: Re: [flexcoders] Re: Cairngorm .99 + Flex-Config + Services.mxml

                                            Hi Dirk,

                                            • I believe there is a Flex-Config file that is at the very least, part of JRun4. Can someone confirm or deny this?
                                            • There is one gateway-config.xm file in my Flex web-inf folder. Is there a second one for CF that needs to be configured?
                                            I think at this point, I need to take this step-by-step.

                                            The difficulty I am having in part is because my first configuration works with the wild-card.

                                            Dave

                                            On 6/2/05, Dirk Eismann <DEismann@...> wrote:
                                            Hi Dave,

                                            to setup named remote objects with CF you'll need to

                                            1) modify Flex's flex-config.xml file and CF's gateway-config.xml file (I wondered to which file you are referring to when you say "CF FlexConfig.xml" as there isn't such a thing)

                                            2) adjust the structure of CF's gateway-config.xml file a bit to define your named objects.

                                            To point to the CF AMF gateway you can either use the endpoint on the RemoteObject tag (the way you did) or chnage the <amf-gateway> setting in your Flex's flex-config.xml (however, this changes the gateway for *all* applications in your Flex server)

                                            Then, you'll need to add a dummy named object entry in the flex-config.xml to get the MXML compiled.

                                            Next, you'll have to add the named object definition to the CF gateway-config.xml file. In your case something like this:

                                            ...
                                            <whitelist>
                                              <unnamed>
                                                <source></source>
                                              </unnamed>
                                              <named>
                                                <object name="Echo">
                                                  <source>wwwroot.MYDOMAIN.model.user.User</source>
                                                </object>
                                              </named>
                                            </whitelist>
                                            ...

                                            restart your Flex and your CF server and you should be ready to go. Again, this is described in detail here: http://www.richinternet.de/blog/index.cfm?entry=831FE26E-0D70-9C2D-2549E1D1978CF1B0

                                            Dirk.

                                            -----Original Message-----
                                            From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com]On Behalf Of dave buhler
                                            Sent: Thursday, June 02, 2005 7:57 AM
                                            To: flexcoders@yahoogroups.com
                                            Subject: Re: [flexcoders] Re: Cairngorm .99 + Flex-Config + Services.mxml


                                            ooops..

                                            Meant to post this WORKING code with the source inline.

                                            Works
                                            Services.mxml
                                               <mx:RemoteObject id="loginService"
                                                                      endpoint=" http://localhost:8300/flashservices/gateway"
                                                                      source="wwwroot.MYDOMAIN.model.user.User"
                                                                      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>




                                            Yahoo! Groups Links

                                            <*> To visit your group on the web, go to:
                                                http://groups.yahoo.com/group/flexcoders/

                                            <*> To unsubscribe from this group, send an email to:
                                                 flexcoders-unsubscribe@yahoogroups.com

                                            <*> Your use of Yahoo! Groups is subject to:
                                                http://docs.yahoo.com/info/terms/






                                            Yahoo! Groups Links

                                          • dave buhler
                                            I tried multiple configurations and had no success when trying to configure the files again. Each time, I got the same error as I have since Monday. I m moving
                                            Message 21 of 26 , Jun 2, 2005
                                            • 0 Attachment
                                              I tried multiple configurations and had no success when trying to configure the files again. Each time, I got the same error as I have since Monday.  I'm moving on and will wait until documentation emerges from MM on how this is to be configured.

                                              Thanks for your help,
                                              Dave
                                            • Peter Farland
                                              From my understanding, I need to do the following: 1. Alter my services.mxml and add the object names as a named source 2. Alter my flex-config.xml file to
                                              Message 22 of 26 , Jun 3, 2005
                                              • 0 Attachment
                                                From my understanding, I need to do the following:

                                                1. Alter my services.mxml and add the object names as a 'named' source

                                                2. Alter my flex-config.xml file to add the object name as I specified
                                                it in my Services.mxml

                                                3. Dig into my JRun folder for CF and add the exact same names to the
                                                gateway-config.xml

                                                [Pete] Correct - (1.) is for cairngorm/your mxml app in general. (2.) is
                                                to satisfy compile time validation of MXML by the flex compiler. (3.) is
                                                to inform CFMX7 of your alias for your CFC-based service. Remember that
                                                you don't need to use named services - it's just that they're
                                                recommended so that the directory structure of your ColdFusion
                                                application isn't exposed by service names (for ease-of-maintenance and
                                                security reasons).



                                                Is the source path going to be the same as the one I had been using for
                                                my wildcard within the services.mxml that I am adding to my
                                                flex-config.xml and gateway-config.xml files?

                                                [Pete] Yes (although I believe the named service's source path to the
                                                CFC wouldn't actually be verified/used by Flex in the case of
                                                flex-config.xml... but it can't hurt to have it in there). The main
                                                requirement is that ColdFusion MX 7 knows what your named service really
                                                points to... that is, "usersService" is really an alias for
                                                "wwwroot.MYDOMAIN.model.user.usersService" - this information is
                                                specified in CFMX's gateway-config.xml file.



                                                * Do I need to add a Cross-Domain Policy File?

                                                [Pete] A crossdomain.xml policy file is something you need to consider
                                                in general for the Flash Player when it makes HTTP based requests for
                                                any type of resource. It is not uniquely related to RemoteObject or
                                                NetConnection. So, if you intend to compile your Flex application as a
                                                SWF, deploy it somewhere, then have the application contact your CFC on
                                                potentially another server then, yes, you will need a crossdomain.xml
                                                policy file on your ColdFusion server so that the SWF can contact it.

                                                There's a bit more to it than that, but it is well worth the investment
                                                spent understanding Deneb's article on this file:

                                                http://www.macromedia.com/devnet/mx/flash/articles/fplayer_security.html


                                                One HUGE point I can highlight that might save you some time:

                                                1. By default the flash player looks crossdomain.xml in the webroot of
                                                the site trying to be contacted by the flash player. In your case, this
                                                will be the CFMX 7 server, say:

                                                http://www.mycfserver.com:8700/crossdomain.xml

                                                If you've deployed the CFMX7 war file with a context root other than the
                                                default context root "" (the empty string), say, something like "/cfmx",
                                                then you've got a few options:

                                                a.) deploy another simple web application at the default context root to
                                                hold crossdomain.xml

                                                b.) change your Flex SWF to look for the policy file under your cfmx
                                                context root (well, conceptually the player doesn't know about context
                                                roots, so really it sees this as just some sub-path of the whole site):

                                                System.security.loadPolicyFile("http://www.mycfserver.com:8700/cfmx/cros
                                                sdomain.xml");



                                                * Should I consider a career in something easier? Maybe truck-driving?

                                                [Pete] The complexity largely arises from two things: a) 4 unique
                                                technologies are being used here to support your app; b) security,
                                                security, security. If you're wondering why you're asked to do any
                                                particular step - let me know.


                                                * I found a flex-config.xml file in my CF Folder for Jrun last night.
                                                Was I just in the wrong place or does this file really exist and is it
                                                important to this configuration?


                                                [Pete] CFMX 7 web applications by default have their gateway-config.xml
                                                file in the /WEB-INF directory. CFMX 7's FlashGateway servlet knows
                                                where this file is because it is specified as a servlet init-param
                                                "gateway.configuration.file" in /WEB-INF/web.xml

                                                Note that you should generally expect web-applicaton specific
                                                configuration files to live somewhere under /WEB-INF for any J2EE
                                                web-app as the contents of this directory are not browsable.
                                              • dave buhler
                                                Peter, Thanks for taking the time to respond. Is this correct, I need: 1. The Services.mxml including 1. Remove endpoint 2. Remove source 3. Give Named value
                                                Message 23 of 26 , Jun 3, 2005
                                                • 0 Attachment
                                                  Peter,

                                                  Thanks for taking the time to respond.

                                                  Is this correct, I need:
                                                  1. The Services.mxml including
                                                    1. Remove endpoint
                                                    2. Remove source
                                                    3. Give Named value (to match the named value in my Flex-Config and Gateway-Config)
                                                  2. The Flex-config.xml configuration including
                                                    1. The AMF gateway path (to point to the same path as my endpoint)
                                                    2. The source (to point to the same path as my source as originally in services.mxml)
                                                    3.  ID names (that match the object name in Services.mxml)
                                                  3. A Gateway-Config with
                                                    1. The source (to point to the same path as originally in my Source in services.mxml)
                                                    2.  ID names (that match the object name in Flex-Config.xml)
                                                  I believe these are the only three files and the above attributes I need to alter.

                                                  I'm pretty sure my issue is not the cross-domain security file because the app works across the two ports in the one configuration (embedded paths in my SWF).


                                                  On 6/3/05, Peter Farland <pfarland@...> wrote:

                                                  From my understanding, I need to do the following:

                                                  1. Alter my services.mxml and add the object names as a 'named' source

                                                  2. Alter my flex-config.xml file to add the object name as I specified
                                                  it in my Services.mxml

                                                  3. Dig into my JRun folder for CF and add the exact same names to the
                                                  gateway-config.xml

                                                  [Pete] Correct - (1.) is for cairngorm/your mxml app in general. (2.) is
                                                  to satisfy compile time validation of MXML by the flex compiler. (3.) is
                                                  to inform CFMX7 of your alias for your CFC-based service. Remember that
                                                  you don't need to use named services - it's just that they're
                                                  recommended so that the directory structure of your ColdFusion
                                                  application isn't exposed by service names (for ease-of-maintenance and
                                                  security reasons).



                                                  Is the source path going to be the same as the one I had been using for
                                                  my wildcard within the services.mxml that I am adding to my
                                                  flex-config.xml and gateway-config.xml files?

                                                  [Pete] Yes (although I believe the named service's source path to the
                                                  CFC wouldn't actually be verified/used by Flex in the case of
                                                  flex-config.xml... but it can't hurt to have it in there). The main
                                                  requirement is that ColdFusion MX 7 knows what your named service really
                                                  points to... that is, "usersService" is really an alias for
                                                  "wwwroot.MYDOMAIN.model.user.usersService" - this information is
                                                  specified in CFMX's gateway-config.xml file.



                                                  * Do I need to add a Cross-Domain Policy File?

                                                  [Pete] A crossdomain.xml policy file is something you need to consider
                                                  in general for the Flash Player when it makes HTTP based requests for
                                                  any type of resource. It is not uniquely related to RemoteObject or
                                                  NetConnection. So, if you intend to compile your Flex application as a
                                                  SWF, deploy it somewhere, then have the application contact your CFC on
                                                  potentially another server then, yes, you will need a crossdomain.xml
                                                  policy file on your ColdFusion server so that the SWF can contact it.

                                                  There's a bit more to it than that, but it is well worth the investment
                                                  spent understanding Deneb's article on this file:

                                                  http://www.macromedia.com/devnet/mx/flash/articles/fplayer_security.html


                                                  One HUGE point I can highlight that might save you some time:

                                                  1. By default the flash player looks crossdomain.xml in the webroot of
                                                  the site trying to be contacted by the flash player. In your case, this
                                                  will be the CFMX 7 server, say:

                                                  http://www.mycfserver.com:8700/crossdomain.xml

                                                  If you've deployed the CFMX7 war file with a context root other than the
                                                  default context root "" (the empty string), say, something like "/cfmx",
                                                  then you've got a few options:

                                                  a.) deploy another simple web application at the default context root to
                                                  hold crossdomain.xml

                                                  b.) change your Flex SWF to look for the policy file under your cfmx
                                                  context root (well, conceptually the player doesn't know about context
                                                  roots, so really it sees this as just some sub-path of the whole site):

                                                  System.security.loadPolicyFile("http://www.mycfserver.com:8700/cfmx/cros
                                                  sdomain.xml ");



                                                  * Should I consider  a career in something easier? Maybe truck-driving?

                                                  [Pete] The complexity largely arises from two things: a) 4 unique
                                                  technologies are being used here to support your app; b) security,
                                                  security, security. If you're wondering why you're asked to do any
                                                  particular step - let me know.


                                                  * I found a flex-config.xml file in my CF Folder for Jrun last night.
                                                  Was I just in the wrong place or does this file really exist and is it
                                                  important to this configuration?


                                                  [Pete] CFMX 7 web applications by default have their gateway-config.xml
                                                  file in the /WEB-INF directory. CFMX 7's FlashGateway servlet knows
                                                  where this file is because it is specified as a servlet init-param
                                                  "gateway.configuration.file" in /WEB-INF/web.xml

                                                  Note that you should generally expect web-applicaton specific
                                                  configuration files to live somewhere under /WEB-INF for any J2EE
                                                  web-app as the contents of this directory are not browsable.



                                                  Yahoo! Groups Links

                                                  <*> To visit your group on the web, go to:
                                                      http://groups.yahoo.com/group/flexcoders/

                                                  <*> To unsubscribe from this group, send an email to:
                                                      flexcoders-unsubscribe@yahoogroups.com

                                                  <*> Your use of Yahoo! Groups is subject to:
                                                      http://docs.yahoo.com/info/terms/





                                                • Peter Farland
                                                  1. The Services.mxml including 1. Remove endpoint 2. Remove source 3. Give Named value (to match the named value in my Flex-Config and Gateway-Config) [Pete]
                                                  Message 24 of 26 , Jun 3, 2005
                                                  • 0 Attachment
                                                    1. The Services.mxml including

                                                    1. Remove endpoint
                                                    2. Remove source
                                                    3. Give Named value (to match the named value in my
                                                    Flex-Config and Gateway-Config)

                                                    [Pete] (1.2) & (1.3) Yes... But for (1.1) if you remove the endpoint,
                                                    you then have to change the default value for all RemoteObjects'
                                                    endpoint url in flex-config.xml. If you plan to use Flex to compile
                                                    several applications, it's probably best to keep the endpoint attribute
                                                    for this CF-based RemoteObject.



                                                    2. The Flex-config.xml configuration including

                                                    1. The AMF gateway path (to point to the same path as my
                                                    endpoint)

                                                    2. The source (to point to the same path as my source as
                                                    originally in services.mxml)

                                                    3. ID names (that match the object name in Services.mxml)


                                                    [Pete] (2.1) See comment for (1.1). The entry in flex-config.xml will
                                                    look something like this:

                                                    <object name="usersService">

                                                    <source>wwwroot.MYDOMAIN.model.user.usersService</source>
                                                    </object>

                                                    (To be honest, you may not even need the source for MXML compile time
                                                    validation... I apologize for not testing it right now.)



                                                    3. A Gateway-Config with

                                                    1. The source (to point to the same path as originally in
                                                    my Source in services.mxml)

                                                    2. ID names (that match the object name in
                                                    Flex-Config.xml)

                                                    [Pete] Correct.
                                                  • dave buhler
                                                    Alas! Alas! *** Does little Square dance It works! It works! ** grabs partner and spins them round n round It turns out I had various oversights. Dirk s PDF
                                                    Message 25 of 26 , Jun 3, 2005
                                                    • 0 Attachment
                                                      Alas! Alas! *** Does little Square dance

                                                      It works! It works!

                                                      ** grabs partner and spins them 'round 'n 'round

                                                      It turns out I had various oversights. Dirk's PDF is pretty good. I think the AMF-Gateway for CF on JRun4 is different than the stand-alone or J2ee version, but I can't say that in good-faith without looking into it in more detail (my gateway path omits the cfusion folder).

                                                      Final Configuration for those with the same problem who are using Cairngorm .99 on Flex Server stand-alone with CFMX 7:

                                                      ------------------------------------------------------------------------------------------------------------------

                                                      Services.mxml
                                                      <?xml version="1.0" encoding="utf-8"?>

                                                      <cairngorm:ServiceLocator xmlns:mx="http://www.macromedia.com/2003/mxml"
                                                                                        xmlns:cairngorm="http://www.iterationtwo.com/cairngorm">
                                                        
                                                           <mx:RemoteObject id="usersDelegate" named="usersServiceImpl"
                                                                                protocol="http"
                                                                                showBusyCursor="true"
                                                                                result="event.call.resultHandler( event )"
                                                                                fault="event.call.faultHandler( event )">
                                                         </mx:RemoteObject>
                                                          
                                                      </cairngorm:ServiceLocator>

                                                      ------------------------------------------------------------------------------------------------------------------

                                                      FlexConfig.xml
                                                          <remote-objects>
                                                                
                                                              <whitelist>                
                                                                  <!-- whitelist config for named objects -->
                                                                              <named>
                                                                                  <object name="usersServiceImpl">
                                                                                          <source>foo</source>
                                                                                  </object>
                                                                  </named>
                                                                             
                                                              </whitelist>
                                                             
                                                              <amf-gateway>http://localhost:8300/flashservices/gateway</amf-gateway>  
                                                              <amf-https-gateway>http://localhost:8300/flashservices/gateway</amf-https-gateway>
                                                              <allow-url-override>false</allow-url-override>
                                                            
                                                          </remote-objects>


                                                      ------------------------------------------------------------------------------------------------------------------

                                                      Gateway-Config.xml
                                                               <whitelist>           
                                                                      <named>
                                                                          <object name="usersServiceImpl">
                                                                                  <source>MYDOMAIN.model.user.User</source>
                                                                          </object>
                                                                      </named>
                                                               </whitelist>
                                                          </security>

                                                      ------------------------------------------------------------------------------------------------------------------

                                                      Much obliged to Peter and Dirk.Thanks Peter for taking this much time and writing such detailed responses.


                                                    Your message has been successfully submitted and would be delivered to recipients shortly.