9 Replies Latest reply on Jun 23, 2008 3:55 PM by base698

    Ye Olde crossdomain.xml

    base698
      An App I was working on just went into production on Saturday. We have this setup: A weblogic application server (Server A) running on Machine A (a solaris OS). We have a separate weblogic server located on Machine B.

      Machine A's weblogic hosts the web application and one of the pages has a Flex app built in Flex Builder 2.0. This app accesses a webservice located on Machine B. In our system test environment this worked fine. It also works fine running it with the Run button in Flex Builder. When it was deployed to production this weekend, I get this error: Unable to load WSDL. If currently online, please verify the URL and/or format of the WSDL. I figure it is something wrong with crossdomain.xml. I have tried everything.

      Machine A: Port 7001 (crossdomain.xml accessible at machinea:7001/crossdomain.xml).
      Machine B: port 4444 (crossdomain.xml accessible at machineb:4444/crossdomain.xml).
      I've also tried to load it with Security.loadPolicyFile(url). None of this has worked and it always returns the same error. I'd really like to get this resolved, as like I said it worked in our test environment but is broken in production.

        • 1. Re: Ye Olde crossdomain.xml
          matthew horn Level 3
          To further test if it's a policy file problem, try this:

          1) Upgrade to player 9.0.124 on the client.
          2) Add the following line to the client's mm.cfg file:

          PolicyFileLog=1
          PolicyFileLogAppend=1

          3) Rerun deployed example.
          4) Look in your policyfiles.txt file (same location as the flashlog.txt file) for error or warning messages.

          Let us know what you find.

          matt horn
          flex docs
          • 2. Ye Olde crossdomain.xml
            base698 Level 1
            I've now worked on this problem all day. Is there a way to dump to see the security settings of my Flex app? I'm seeing that it's of sandbox type localTrusted when running local and remote when running from the web server. I would like some way to see what crossdomain.xml file is loaded to verify it actually loaded. I've also tried to use Security.allowAccess()

            I've tried: Security.allowAccess("*"), Security.allowAccess(["*"]) although I think that is for a different case, and I've also tried Security.loadPolicyFile for an array of situations.
            • 3. Re: Ye Olde crossdomain.xml
              StevenErat Level 1
              Just to cover the basics, can you:

              1) test using a wide open cross-domain.xml on machineb?
              <allow-access-from domain="*" />

              2) confirm the URL of the service port at the bottom of the wsdl?

              The service port defines where the actual webservice can be found and may or may not be on the same server that hosts the wsdl. One problem might be that in testing the service port was using a canonical domain name that only resolvable on a private intranet, and breaks on public facing servers.

              3) run a packet sniffer on the client where Flash Player is running and trace connections from the client to machineb ?

              a) you should see an HTTP request / response for crossdomain.xml on machineb over port 4444
              b) you should see an HTTP request / response for the wsdl on machineb over port 4444
              c) you should see the HTTP req as a POST to the service port URL that sends the SOAP Request embedded in the SOAP envelope.
              d) you should see the HTTP response from the service port URL with the SOAP response inside a SOAP envelope

              4) Run the Eclipse WTP WebService Explorer from the same machine as the client with Flash Player. Type in the WSDL URL into the designated field, and Eclipse WTP will parse the wsdl and provide a form to permit you to enter data to properly fulfill the SOAP Request.

              Eclipse WTP is a great reference tool for testing webservices and can be used for troubleshooting by comparison.

              Please let me know how it goes.



              • 4. Re: Ye Olde crossdomain.xml
                StevenErat Level 1
                Also, if you cannot use Eclipse WTP to fully exercise the web service between the client and machineb, then perhaps you can confirm that from the client you can enter the WSDL in a browser address bar and successfully get it, and copy the exact service port URL from the wsdl to enter that into the browser address bar (this will obviously fail webservice invocation, but will test basic connectivity from the client to the service port URL).

                Testing connectivity of the wsdl and the service port URL from a browser doesn't exercise the webservice the way Eclipse WTP can, but its a decent test.
                • 5. Re: Ye Olde crossdomain.xml
                  base698 Level 1
                  1) test using a wide open cross-domain.xml on machineb?
                  <allow-access-from domain="*" />

                  I've tried this and it still doesn't work.

                  2) confirm the URL of the service port at the bottom of the wsdl?

                  Service port is the same as wsdl port.

                  4) Run the Eclipse WTP WebService Explorer from the same machine as the client with Flash Player. Type in the WSDL URL into the designated field, and Eclipse WTP will parse the wsdl and provide a form to permit you to enter data to properly fulfill the SOAP Request.

                  Weblogic has functionality to do that. Webservice works fine both through the testing mechanism and in the actual flex application when run local.
                  • 6. Re: Ye Olde crossdomain.xml
                    StevenErat Level 1
                    quote:

                    Service port is the same as wsdl port.


                    By "service port" I'm not referring to the webserver port number but rather the value of the location field. The wsdl defines a service port like this:

                    <service name="CompanyInfoService">
                    <port name="CompanyInfoPort"binding="tns:b1">
                    <soap:address location=" http://example.com/companyinfo"/>
                    </port>
                    </service>

                    quote:

                    Weblogic has functionality to do that.


                    Perhaps, but the point of suggesting Eclipse WTP is that you can run it on a client that exhibits the problem. Doing so will test all the connectivity between the client and the various servers/endpoints involved. Testing with the built-in Weblogic facility may only test localhost and may not take into account access over the network.

                    If you could run a packet sniffer from the client's machine, that would at least define what the Flash Player is requesting, the types of requests it making, and the status codes and content of any responses.
                    • 7. Ye Olde crossdomain.xml
                      StevenErat Level 1
                      Also, to try to test if there is a problem decoding / parsing the wsdl versus invoking the webservice endpoint defined in the service port, you could try to copy the generated wsdl and host it on a webserver directly as a static file without going through WebLogic.

                      Try hosting the static wsdl on machinea and try again with it on machineb (again, behind a webserver but not behind WebLogic)

                      Then modify the mx:Webservice url to point to the static wsdl to see if the same problem occurs regarding "unable to load wsdl".

                      This is a useful comparison to distinguish basic parsing of the wsdl versus access through Weblogic.
                      • 8. Re: Ye Olde crossdomain.xml
                        base698 Level 1
                        I'm trying the packet sniffer as we speak. This works to the production server when run from the flex builder. That means it hits the wsdl and operates as expected from the client. It also works for some reason unbeknownst to me in the system test environment. The problem is when the app is accessed from the application server. The Security.sandboxType is remote when accesed from the server and when local it's localTrusted.
                        • 9. Re: Ye Olde crossdomain.xml
                          base698 Level 1
                          I packet sniffed it, and found that the number of packets is vastly different when I run it locally, versus when it's downloaded from the server. I can see the get on the correct server at the correct port for the cross domain file and I also see the contents of the file come back. After that for whatever reason nothing happens. No data is loaded to the player.