1. #1
    Sencha Premium Member
    Join Date
    Apr 2012
    Location
    Germany
    Posts
    103
    Vote Rating
    4
    Answers
    3
    clifficious is on a distinguished road

      0  

    Default Unanswered: ST2 and OpenLayers Proxy for WMS services

    Unanswered: ST2 and OpenLayers Proxy for WMS services


    Hi there,

    I'm using OpenLayers for an application I want to develop. Now I want to query a WMS-Service. My problem is, that I'm not allowed to access data on another server because of security reasons concerning XSS

    Origin http://localhost:8080 is not allowed by Access-Control-Allow-Origin.

    When I run my code inside a Tomcat I can add a proxy.cgi. But eventually I need to build a proper app and I do not have the option to run a Tomcat inside my app. So what option do I have to get the connection right to connect to a different domain?

    Here is my code for the Tomcat:

    Code:
    OpenLayers.ProxyHost = "./cgi-bin/proxy.cgi?url=";
    info = new OpenLayers.Control.WMSGetFeatureInfo({
        url: wmsURL, 
        // url: 'http://www.wms.nrw.de/wms/uebersicht_nrw2?',
        title: 'More Information',
        infoFormat: 'application/vnd.ogc.gml',
        layers: [poisWMS],
        queryVisible: false,
        maxFeatures: 5,
        vendorParams: {buffer: 15},
        eventListeners: {
            getfeatureinfo: function(event) {
                setPOIHTML(event.text,map.getLonLatFromPixel(event.xy));
            }
        }
    });
    I would be very thankful for any solution to this problem.
    Thanks in advance!

    Cliff

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,637
    Vote Rating
    435
    Answers
    3106
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    You need to have your server support CORS. Some info: http://enable-cors.org/
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.

Tags for this Thread