Unity Community


Results 1 to 14 of 14

  1. Posts
    34

    Rejected because no crossdomain.xml policy file was found

    Hello,

    I've read damn near every thread I can find on crossdomain.xml and Unity3D, but I am still having problems pushing my game to my hosting site (discountasp.net). I'm using WWW calls to my .NET web service but always get 'Rejected because no crossdomain.xml policy file was found' errors.

    Example call:
    Code:  
    1. WWW www = new WWW("http://mysite.com/Service.asmx/GetData",...);

    My crossdomain.xml file:
    Code:  
    1. <?xml version="1.0" ?>
    2. <cross-domain-policy>
    3.   <allow-access-from domain="*"/>
    4.   <allow-access-from domain="mysite.com"/>
    5.   <allow-access-from domain="www.mysite.com"/>
    6.   <allow-access-from domain="mysite.webXXX.discountasp.net"/>
    7.   <allow-access-from domain="webXXX.discountasp.net"/>
    8.   <allow-access-from domain="discountasp.net"/>
    9.   <allow-access-from domain="localhost"/>
    10. </cross-domain-policy>

    Firebug shows my unity3d file coming from 'mysite.com' domain, but the crossdomain.xml file shows as coming from 'localhost'. The crossdomain file is retrieved successfully.

    I'm at a loss at this point. Should the crossdomain file show as coming from 'localhost'? I'm not doing any cross domain calls explicitly, so why is it even looking for a crossdomain file? Why doesn't it honor the '*' domain in the crossdomain file to begin with?

    Any help would be appreciated,
    bob


  2. Location
    Leeds, UK
    Posts
    147
    taken from: http://unity3d.com/support/documenta...20Sandbox.html

    The format used for the socket policy is the same as that used by the Flash player except some tags are not supported. The Unity webplayer only supports "*" as a valid value for the domain setting and the "to-ports" setting is mandatory.

    Looks like the only supported value is "*" and the "to-ports" is always required.

    HTH


  3. Location
    Zürich, Switzerland
    Posts
    26,572
    it must actually not be * (which would be there anyway, the other lines are all meaningless after the *), but the to-ports is indeed a must otherwise it has no valid port to connect to


  4. Posts
    34
    Hi Guys,

    Thanks for the responses. I was under the impression from the documentation that WWW calls didn't need the 'to-ports' attribute. I'm not using sockets, just plain old HTTP calls using the WWW class.

    I've used the example crossdomain.xml for the WWW on that page with the same results.

    Since I'm not doing any cross domain calls to begin with, why is it even checking the crossdomain.xml file? According to that page:

    The Unity webplayer expects a http served policy file named "crossdomain.xml" to be available on the domain you want to access with the WWW class, (although this is not needed if it is the same domain that is hosting the unity3d file).
    It shouldn't be needed. Even so, Firebug shows that it pulls the crossdomain.xml file successfully.

    Thanks,
    bob
    Last edited by tango209; 03-01-2011 at 11:17 PM. Reason: grammer


  5. Location
    Zürich, Switzerland
    Posts
    26,572
    and the file is at mysite.com/crossdomain.xml (more precisely mysite.com:80/crossdomain.xml)?


  6. Posts
    34
    I can pull the file with 'http://mysite.com:80/crossdomain.xml'. Though it does not pull it if the 'http://' is removed.


  7. Location
    Zürich, Switzerland
    Posts
    26,572
    I just ommited the http, I expect Unity to search on the http actually. The other protocols (ftp, file, https) wouldn't make any sense

    your webservice does not do some strange redirection or return a different url along the header so unity could get confused or alike?


  8. Posts
    34
    Quote Originally Posted by dreamora View Post
    your webservice does not do some strange redirection or return a different url along the header so unity could get confused or alike?
    It shouldn't be. They are simple ASMX calls, but I'll write a pure C# test client to see what the headers look like when I get home tonight.

    Thanks again for the help,
    bob


  9. Location
    Zürich, Switzerland
    Posts
    26,572
    using firebug and alike is likely faster for doing that or using a packet sniffer to analyze what your webplayer sends and receives in detail


  10. Posts
    34
    I used firebug and it retrieved the crossdomain.xml file. The one odd thing is that the Host is showing up as localhost. Is that normal? Here's the Request Headers:

    GET /crossdomain.xml HTTP/1.1
    Host: localhost
    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.14) Gecko/20110218 Firefox/3.6.14
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Language: en-us,en;q=0.5
    Accept-Encoding: gzip,deflate
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Keep-Alive: 115
    Connection: keep-alive
    If-Modified-Since: Wed, 02 Mar 2011 02:13:30 GMT
    If-None-Match: "e6e3636c7fd8cb1:0"
    Last edited by tango209; 03-02-2011 at 09:22 PM. Reason: grammer


  11. Posts
    34
    Well, it seems I forgot to remove the Editor setting pointing to localhost and that's why the host name was localhost. But, after removing that and uploading the new unity3d file I still get the same error with this request header for the crossdomain.xml request:

    GET /crossdomain.xml HTTP/1.1
    Host: mysite.com
    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.14) Gecko/20110218 Firefox/3.6.14
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Language: en-us,en;q=0.5
    Accept-Encoding: gzip,deflate
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Keep-Alive: 115
    Connection: keep-alive
    If-Modified-Since: Thu, 03 Mar 2011 06:19:32 GMT
    If-None-Match: "1cf5df66ad9cb1:0"


  12. Posts
    79
    Any solution to this?


  13. Location
    Zürich, Switzerland
    Posts
    26,572
    What exactly are you doing? Codewise I mean
    Relative urls (ie files on the same domain) don't need the crossdomain.xml

    How does your crossdomain.xml thats in use right now look?

    If you want to use sockets / socket clients to talk to a server, then the policy server or an own policy server integrated in your server is the way to go


  14. Posts
    79
    dreamora,

    here's a thread for my specific problem:
    http://forum.unity3d.com/threads/813...d-still-broken.

    All my stuff is using the same domain. I don't know why it's even trying to use the crossdomain. This is sort of maddening.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •