Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-3243

FIWARE.Request.Tech.WebUI.XML3D.ExternalUrlRequests

    Details

    • Type: extRequest
    • Status: Closed
    • Priority: Major
    • Resolution: Done
    • Fix Version/s: 2021
    • Component/s: FIWARE-TECH-HELP
    • Labels:
      None

      Description

      Hi,

      I am working on a FIWARE project using the XML3D GE.

      I am trying to load an external model using the MODEL tag:

      <group style="transform: translate3d(0px,0px,0px)" >
      <model src="
      http://server1.uv.es/FIWARE/Assets/Models/Axes/Axes.xml#Axes"></model>
      </group>

      I am not using FILAB yet.
      I am using a local WAMP server where I store the .html code that makes use
      of the XML3D GE. The external machine (server1.uv.es) is a different
      machine with another webserver.

      However. It does not work, because of Access-Control restrictions. This is
      the Chrome console message that I get:

      XMLHttpRequest cannot load
      http://server1.uv.es/FIWARE/Assets/Models/Axes/Axes.xml. No
      'Access-Control-Allow-Origin' header is present on the requested resource.

      I was wondering if I need to add something to the document for that to work.

      It works like a charm when you load models without using an external URL.
      I just would like to use also external URLs

      The funny part is that I load the XML3D from an external URL, and that's OK
      for the browser:

      <script type="text/javascript" src="
      http://www.xml3d.org/xml3d/script/xml3d.js"></script>

      I just don't know why an XML model is different...

      I am sure it is possible to load external URLs.
      I just would like to know how.

      Thanks in advance!

      _______________________________________________
      Fiware-tech-help mailing list
      Fiware-tech-help@lists.fi-ware.org
      https://lists.fi-ware.org/listinfo/fiware-tech-help

      [Created via e-mail received from: Sergio Casas <scasas@robotica.uv.es>]

        Activity

        Hide
        fw.ext.user FW External User added a comment -

        hi

        Thanks for contacting us. I will put you in direct contact with the Ge support.

        Regards,

        Miguel

        El 09/06/2015 a las 11:38, Sergio Casas escribió:
        Hi,

        I am working on a FIWARE project using the XML3D GE.

        I am trying to load an external model using the MODEL tag:

        <group style="transform: translate3d(0px,0px,0px)" >
        <model src="http://server1.uv.es/FIWARE/Assets/Models/Axes/Axes.xml#Axes"></model>
        </group>

        I am not using FILAB yet.
        I am using a local WAMP server where I store the .html code that makes use of the XML3D GE. The external machine (server1.uv.es<http://server1.uv.es>) is a different machine with another webserver.

        However. It does not work, because of Access-Control restrictions. This is the Chrome console message that I get:

        XMLHttpRequest cannot load http://server1.uv.es/FIWARE/Assets/Models/Axes/Axes.xml. No 'Access-Control-Allow-Origin' header is present on the requested resource.

        I was wondering if I need to add something to the document for that to work.

        It works like a charm when you load models without using an external URL.
        I just would like to use also external URLs

        The funny part is that I load the XML3D from an external URL, and that's OK for the browser:

        <script type="text/javascript" src="http://www.xml3d.org/xml3d/script/xml3d.js"></script>

        I just don't know why an XML model is different...

        I am sure it is possible to load external URLs.
        I just would like to know how.

        Thanks in advance!

        Show
        fw.ext.user FW External User added a comment - hi Thanks for contacting us. I will put you in direct contact with the Ge support. Regards, Miguel El 09/06/2015 a las 11:38, Sergio Casas escribió: Hi, I am working on a FIWARE project using the XML3D GE. I am trying to load an external model using the MODEL tag: <group style="transform: translate3d(0px,0px,0px)" > <model src="http://server1.uv.es/FIWARE/Assets/Models/Axes/Axes.xml#Axes"></model> </group> I am not using FILAB yet. I am using a local WAMP server where I store the .html code that makes use of the XML3D GE. The external machine (server1.uv.es< http://server1.uv.es >) is a different machine with another webserver. However. It does not work, because of Access-Control restrictions. This is the Chrome console message that I get: XMLHttpRequest cannot load http://server1.uv.es/FIWARE/Assets/Models/Axes/Axes.xml . No 'Access-Control-Allow-Origin' header is present on the requested resource. I was wondering if I need to add something to the document for that to work. It works like a charm when you load models without using an external URL. I just would like to use also external URLs The funny part is that I load the XML3D from an external URL, and that's OK for the browser: <script type="text/javascript" src="http://www.xml3d.org/xml3d/script/xml3d.js"></script> I just don't know why an XML model is different... I am sure it is possible to load external URLs. I just would like to know how. Thanks in advance!
        Hide
        slusallek0 Philipp Slusallek added a comment -

        Hi,

        This is due to the security measures built in to WebGL. A Web site has
        to explicitly allow its content to be accessible from other sites.
        Otherwise it will be blocked. You need to configure your Web server to
        include the relevant headers in the HTTP response
        (Access-Control-Allow-Origin: *). For details please search Google for
        "WebGL" and "CORS".

        This should already be docuemnted for XML3D, btw.

        Hope this helps. Let us know if you need more help here.

        Best,

        Philipp

        -------------------------------------------------------------------------
        Deutsches Forschungszentrum für Künstliche Intelligenz (DFKI) GmbH
        Trippstadter Strasse 122, D-67663 Kaiserslautern

        Geschäftsführung:
        Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster (Vorsitzender)
        Dr. Walter Olthoff
        Vorsitzender des Aufsichtsrats:
        Prof. Dr. h.c. Hans A. Aukes

        Sitz der Gesellschaft: Kaiserslautern (HRB 2313)
        USt-Id.Nr.: DE 148646973, Steuernummer: 19/673/0060/3
        ---------------------------------------------------------------------------

        _______________________________________________
        Fiware-tech-help mailing list
        Fiware-tech-help@lists.fi-ware.org
        https://lists.fi-ware.org/listinfo/fiware-tech-help

        Show
        slusallek0 Philipp Slusallek added a comment - Hi, This is due to the security measures built in to WebGL. A Web site has to explicitly allow its content to be accessible from other sites. Otherwise it will be blocked. You need to configure your Web server to include the relevant headers in the HTTP response (Access-Control-Allow-Origin: *). For details please search Google for "WebGL" and "CORS". This should already be docuemnted for XML3D, btw. Hope this helps. Let us know if you need more help here. Best, Philipp – ------------------------------------------------------------------------- Deutsches Forschungszentrum für Künstliche Intelligenz (DFKI) GmbH Trippstadter Strasse 122, D-67663 Kaiserslautern Geschäftsführung: Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster (Vorsitzender) Dr. Walter Olthoff Vorsitzender des Aufsichtsrats: Prof. Dr. h.c. Hans A. Aukes Sitz der Gesellschaft: Kaiserslautern (HRB 2313) USt-Id.Nr.: DE 148646973, Steuernummer: 19/673/0060/3 --------------------------------------------------------------------------- _______________________________________________ Fiware-tech-help mailing list Fiware-tech-help@lists.fi-ware.org https://lists.fi-ware.org/listinfo/fiware-tech-help
        Hide
        tospie Torsten Spieldenner added a comment -

        Hi,

        exactly as Philipp pointed out, this is because AJAX requests used by
        JavaScript (and actually used in xml3d.js to request external resources)
        do have stricter restrictions when it comes to accessing external
        resources than HTML 'internal' requests, as for example including
        JavaScripts or CSS files. This is also while for example including
        xml3d.js from the public location works, whereas the request for the
        model file does not.

        The solution is to configure the Web server that serves the model file
        to add an access control header to the reply that contains the requested
        document.

        A good entry point to further links related to the topic of CORS (cross
        origin resource sharing) and solution of your issue is for example the
        respective Wikipedia article:
        http://en.wikipedia.org/wiki/Cross-origin_resource_sharing

        Best,
        Torsten

        PS: Second reply to topic to include Sergio into list of recipients


        Torsten Spieldenner, M.Sc.

        Tel.: +49 6 81 / 8 57 75 - 77 48
        Fax.: +49 6 81 / 8 57 75 - 22 35

        Internet: http://www.dfki.de/web/forschung/asr/

        -------------------------------------------------------------
        Deutsches Forschungszentrum fuer Kuenstliche Intelligenz GmbH
        Trippstadter Strasse 122, D-67663 Kaiserslautern, Germany

        Geschaeftsfuehrung:
        Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster (Vorsitzender)
        Dr. Walter Olthoff

        Vorsitzender des Aufsichtsrats:
        Prof. Dr. h.c. Hans A. Aukes

        Amtsgericht Kaiserslautern, HRB 2313
        -------------------------------------------------------------

        Show
        tospie Torsten Spieldenner added a comment - Hi, exactly as Philipp pointed out, this is because AJAX requests used by JavaScript (and actually used in xml3d.js to request external resources) do have stricter restrictions when it comes to accessing external resources than HTML 'internal' requests, as for example including JavaScripts or CSS files. This is also while for example including xml3d.js from the public location works, whereas the request for the model file does not. The solution is to configure the Web server that serves the model file to add an access control header to the reply that contains the requested document. A good entry point to further links related to the topic of CORS (cross origin resource sharing) and solution of your issue is for example the respective Wikipedia article: http://en.wikipedia.org/wiki/Cross-origin_resource_sharing Best, Torsten PS: Second reply to topic to include Sergio into list of recipients – Torsten Spieldenner, M.Sc. Tel.: +49 6 81 / 8 57 75 - 77 48 Fax.: +49 6 81 / 8 57 75 - 22 35 Internet: http://www.dfki.de/web/forschung/asr/ ------------------------------------------------------------- Deutsches Forschungszentrum fuer Kuenstliche Intelligenz GmbH Trippstadter Strasse 122, D-67663 Kaiserslautern, Germany Geschaeftsfuehrung: Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster (Vorsitzender) Dr. Walter Olthoff Vorsitzender des Aufsichtsrats: Prof. Dr. h.c. Hans A. Aukes Amtsgericht Kaiserslautern, HRB 2313 -------------------------------------------------------------

          People

          • Assignee:
            tospie Torsten Spieldenner
            Reporter:
            fw.ext.user FW External User
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: