12 Replies Latest reply on Dec 10, 2008 7:20 AM by JZBAO

    Deploy webservice client app

    JZBAO Level 1
      I built a webservice client in FB3. It works fine within FB3. I can also run it by evoking the swf file directly in the file
      directory - bin-debug (not in the FB3), and it works fine too.

      Now I copied the bin-debug directory out off the workspace of FB3 and evokes the swf file there. This time I got errors when accessing the webservice server: "Security error accessing url" faultCode="Channel.Security.Error" faultDetail="Destination: DefaultHTTP"...

      Why I can run the swf file when it is in the FB3 workspace, and can not when it is out of the workspace?

      I also did the release build and ran the swf file in bin-release directory. It gave me the error messages even when I ran it within FB3.

      Am I missing some configurations?
        • 1. Re: Deploy webservice client app
          rtalton Level 4
          Is the app on a web server?
          What is the error message.
          • 2. Re: Deploy webservice client app
            Level 7

            "JZBAO" <webforumsuser@macromedia.com> wrote in message
            news:ghfk5m$8di$1@forums.macromedia.com...
            >I built a webservice client in FB3. It works fine within FB3. I can also
            >run it
            > by evoking the swf file directly in the file
            > directory - bin-debug (not in the FB3), and it works fine too.
            >
            > Now I copied the bin-debug directory out off the workspace of FB3 and
            > evokes
            > the swf file there. This time I got errors when accessing the webservice
            > server: "Security error accessing url" faultCode="Channel.Security.Error"
            > faultDetail="Destination: DefaultHTTP"...
            >
            > Why I can run the swf file when it is in the FB3 workspace, and can not
            > when
            > it is out of the workspace?
            >
            > I also did the release build and ran the swf file in bin-release
            > directory. It
            > gave me the error messages even when I ran it within FB3.
            >
            > Am I missing some configurations?
            >

            I don't think there's any way to configure your crossdomain.xml to allow
            access from a local hard drive outside the development sandbox. If you want
            to test it outside of there, you'll need to export a release version and
            serve it from a web server that is allowed access via crossdomain.xml.

            HTH;

            Amy


            • 3. Re: Deploy webservice client app
              JZBAO Level 1
              quote:

              Originally posted by: rtalton
              Is the app on a web server?
              What is the error message.


              The production application's swf file is deployed on a public web server and is loaded to user's browser.
              The Flex runs on user's computer which talks to a third party public webservice. I can ran the Flex app
              and only get the errors when it tries to access the webservice. I do not think the hosting web server plays
              any role here because the Flex app accesses webservice directly, not through the hosting webserver.

              Here is the fault event:

              [FaultEvent fault=[RPC Fault faultString="Security error accessing url" faultCode="Channel.Security.Error" faultDetail="Destination: DefaultHTTP"] messageId="D6DEF70D-A9A4-6212-FAA6-1279E9C9E7D6" type="fault" bubbles=false cancelable=true eventPhase=2]

              • 4. Deploy webservice client app
                JZBAO Level 1
                quote:

                Originally posted by: Newsgroup User

                I don't think there's any way to configure your crossdomain.xml to allow
                access from a local hard drive outside the development sandbox. If you want
                to test it outside of there, you'll need to export a release version and
                serve it from a web server that is allowed access via crossdomain.xml.

                HTH;
                Amy



                I do not have a crossdomain.xml. My other Flex applications do not have it neither, but they are working fine. The only difference is that other applications only need to access the DB hosted in the hosting server via PHP. The webservice client application talks to a webservice server outside the hosting server. I think the once the swf file is loaded from the hosting webserver to the local computer, the hosting webserver should not be in the picture of the communication between local Flex and webservice server. Am I missing anything?

                I really think it is a client configuration issue, not a server issue because I can access the webservices from
                FB3 anyway.

                • 5. Re: Deploy webservice client app
                  Level 7

                  "JZBAO" <webforumsuser@macromedia.com> wrote in message
                  news:ghh2ev$38q$1@forums.macromedia.com...
                  >
                  quote:

                  Originally posted by: Newsgroup User
                  >
                  > I don't think there's any way to configure your crossdomain.xml to allow
                  > access from a local hard drive outside the development sandbox. If you
                  > want
                  > to test it outside of there, you'll need to export a release version and
                  > serve it from a web server that is allowed access via crossdomain.xml.
                  >
                  > HTH;
                  > Amy
                  >

                  >
                  > I do not a crossdomain.xml. My other Flex applications do not have it
                  > neither,
                  > but they are working fine. The only difference is that other applications
                  > only
                  > need to access the DB hosted in the hosting server via PHP. This
                  > webservice
                  > client talks to a webservice server outside the hosting server. Once the
                  > swf
                  > file is loaded from the hosting webserver, the hosting webserver should
                  > not be
                  > in the picture of the communication between local Flex and webservice
                  > server.
                  > Am I missing anything?

                  You need to have a croosdomain.xml on the server with the web service so
                  that it can allow communication with your swf.


                  • 6. Deploy webservice client app
                    JZBAO Level 1
                    I can not control the webservice server. If it does not have the crossdomain.xml, how can my Flex application access it within FB3?
                    The problem happens when the Flex application tries to access it outside the FB3.

                    I really think it is a client configuration issue, not a server issue.

                    Should crossdomain.xml be put in the root directory of the hosting webserver and downloaded to the client computer with the swf file?

                    • 7. Re: Deploy webservice client app
                      Level 7

                      "JZBAO" <webforumsuser@macromedia.com> wrote in message
                      news:ghhd93$ftd$1@forums.macromedia.com...
                      >I can not control the webservice server. If it does not have the
                      > crossdomain.xml, how can my Flex application access it within FB3?
                      > The problem happens when the Flex application tries to access it outside
                      > the
                      > FB3.

                      One way this is typically handled is with a proxy server.

                      > I really think it is a client configuration issue, not a server issue.

                      You're allowed to think incorrect stuff :-). We all do it from time to
                      time.


                      • 8. Re: Deploy webservice client app
                        JZBAO Level 1
                        The webservice server's crossdomain.xml is

                        <cross-domain-policy>
                        <allow-access-from domain="*" secure="true"/>
                        </cross-domain-policy>

                        The webservice I access is a HTTP service, which means that the issue is not the crossdomain.xml. The issue is on the client side.

                        • 9. Re: Deploy webservice client app
                          Level 7

                          "JZBAO" <webforumsuser@macromedia.com> wrote in message
                          news:ghi4u1$dhj$1@forums.macromedia.com...
                          > The webservice server's crossdomain.xml is
                          >
                          > <cross-domain-policy>
                          > <allow-access-from domain="*" secure="true"/>
                          > </cross-domain-policy>
                          >
                          > The webservice I access is a HTTP service, which means that the issue is
                          > not
                          > the crossdomain.xml. The issue is on the client side.

                          http://www.adobe.com/devnet/flashplayer/articles/fplayer9-10_security.html
                          http://www.adobe.com/devnet/flashplayer/articles/fplayer10_security_changes_02.html#head1


                          • 10. Deploy webservice client app
                            JZBAO Level 1
                            My Flash Player is 9,0,124,0. The crossdomain.xml should be good enough.

                            Here is the link for the crossdomain.xml:
                            http://ws.cdyne.com/crossdomain.xml

                            and wsdl:
                            http://ws.cdyne.com/WeatherWS/Weather.asmx?wsdl

                            The Error coming with the fault event is:

                            [FaultEvent fault=[RPC Fault faultString="Security error accessing url" faultCode="Channel.Security.Error" faultDetail="Destination: DefaultHTTP"] messageId="4B9DE3ED-1666-3C81-0E1F-1792E18DB871" type="fault" bubbles=false cancelable=true eventPhase=2]

                            It looks like crossdomain.xml related. But if it is because of the webservice server's crossdomain.xml, how can my flex application in the bin-debug directory of FB3 workspace access the webservice successfully?

                            • 11. Re: Deploy webservice client app
                              ntsiii Level 3
                              FlexBuilder installs into a trusted location. It can access anything. This is nice for development, but causes a lot of heartache the first time you deploy an app.

                              That crossdomain is not sufficient for FP9, especailly with WebService. There are several other settings that must be set. here is what I have:
                              <?xml version="1.0"?>
                              <!DOCTYPE cross-domain-policy SYSTEM " http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
                              <!-- Policy file for xmlsocket://socks.mysite.com -->
                              <cross-domain-policy>
                              <site-control permitted-cross-domain-policies="master-only"/>
                              <allow-access-from domain="*" to-ports="*" />
                              <allow-http-request-headers-from domain="*" headers="*" />
                              </cross-domain-policy>

                              Tracy
                              • 12. Deploy webservice client app
                                JZBAO Level 1
                                This is www.adobe.com/crossdomain

                                <?xml version="1.0"?>
                                <cross-domain-policy>
                                <site-control permitted-cross-domain-policies="by-content-type"/>
                                <allow-access-from domain="*.macromedia.com" />
                                <allow-access-from domain="*.adobe.com" />
                                <allow-access-from domain="*.adobemax08.com" />
                                <allow-access-from domain="*.photoshop.com" />
                                <allow-access-from domain="*.acrobat.com" />
                                </cross-domain-policy>

                                and ws.amazon.com/crossdomain.xml:

                                <cross-domain-policy>
                                <allow-access-from domain="*" to-ports="*"/>
                                </cross-domain-policy>

                                Are these crossdomain.xml files sufficient for webservice in Flash Player 9?

                                Tracy,

                                You are using http://www.webservicex.net/crossdomain.xml in your weather webservice demo:

                                <cross-domain-policy>
                                <allow-access-from domain="*"/>
                                </cross-domain-policy>

                                It seems work fine with your flex code.