Discussion:
GetFeatureInfo... Access denied..
(too old to reply)
JuKiM
2009-11-19 14:46:46 UTC
Permalink
Hi list,

I know that tere are so many comments about that, but no one is solving my
problem..

I have geoserver serving a WMS vector layer that has some features... I have
the geoserver running in localhost:8080, and the application that I'm
testing, is running in localhost:3015.. And I suppose that due de different
ports, when I try to do a GetFeatureInfo (clicking anywhere on the map), it
says "access denied".. In the XMLHttpRequest.open(...).

I've added the proxy following the instructions found in "
http://geoserver.org/display/GEOS/GeoServer+Proxy+Extension".. But it still
says that there is no access..
Then I tryied to initialize the proxy host, in the "function Init()",
writing "OpenLayers.ProxyHost = "/geoserver/rest/proxy?url=";" And now what
it says, is that it can't find the resource, and suggest to verify the url
"/geoserver/rest/proxy"

What is happening with that? Any idea?

Thanks!!
stash
2009-11-19 16:36:44 UTC
Permalink
Post by JuKiM
Hi list,
I know that tere are so many comments about that, but no one is solving my
problem..
I have geoserver serving a WMS vector layer that has some features... I have
the geoserver running in localhost:8080, and the application that I'm
testing, is running in localhost:3015.. And I suppose that due de different
ports, when I try to do a GetFeatureInfo (clicking anywhere on the map), it
says "access denied".. In the XMLHttpRequest.open(...).
I've added the proxy following the instructions found in "
http://geoserver.org/display/GEOS/GeoServer+Proxy+Extension".. But it still
says that there is no access..
Then I tryied to initialize the proxy host, in the "function Init()",
writing "OpenLayers.ProxyHost = "/geoserver/rest/proxy?url=";" And now what
it says, is that it can't find the resource, and suggest to verify the url
"/geoserver/rest/proxy"
What is happening with that? Any idea?
Thanks!!
_______________________________________________
Users mailing list
http://openlayers.org/mailman/listinfo/users
Hello,
I had the same problem and I know that this can be really frustrating. But
you can try the following things.

Thereby your html site and geoserver are running on the same pc (localhost)
you don't need a proxyhost. Set it in comments in your html.

Try it out with different browsers. Firefox always blocked my request and
with Internet Explorer it worked.

Maybe this helps.

Regards
stash
--
View this message in context: http://n2.nabble.com/GetFeatureInfo-Access-denied-tp4032182p4032903.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
JuKiM
2009-11-19 17:03:23 UTC
Permalink
Hi,

I've been testing in IE.. If I create a 'test.html' file in a folder under
IIS, I get an error of denied access/resource not available.. But if I copy
that file in the www folder of geoserver, then everything works ok.. This is
quite logical, because IIS is running on port 80, and geoserver in 8080
(They are different hosts)...

Then when I declare the proxy, the IIS's test.html, the response i get is
empty..
And looking in Openlayers.js I've seen where the url is initialized before
the .open, and I think that I'm doing something wrong, because the final url
is not a correct one..


if(config.proxy&&(url.indexOf(
"http")==0)){
url=config.proxy+encodeURIComponent(url);
}
request.open(config.method,url,config.async,config.user,config.password);


before "recoding" the url, it has the value:
http://localhost:8080/geoserver/wms?REQUEST=GetFeatureInfo&EXCEPTIONS=application%2Fvnd.ogc.se_xml&BBOX=-188.610843%2C-60.534809%2C189.241843%2C149.772809&X=104&Y=236&INFO_FORMAT=text%2Fplain&QUERY_LAYERS=G4WD%3Aus_states&FEATURE_COUNT=50&Layers=G4WD%3Aus_states&Styles=&Srs=EPSG%3A4269&WIDTH=1078&HEIGHT=600&format=image%2Fpng

And after, it has the value
/geoserver/rest/proxy?url=http%3A%2F%2Flocalhost%3A8080%2Fgeoserver%2Fwms%3FREQUEST%3DGetFeatureInfo%26EXCEPTIONS%3Dapplication%252Fvnd.ogc.se_xml%26BBOX%3D-188.610843%252C-60.534809%252C189.241843%252C149.772809%26X%3D104%26Y%3D236%26INFO_FORMAT%3Dtext%252Fplain%26QUERY_LAYERS%3DG4WD%253Aus_states%26FEATURE_COUNT%3D50%26Layers%3DG4WD%253Aus_states%26Styles%3D%26Srs%3DEPSG%253A4269%26WIDTH%3D1078%26HEIGHT%3D600%26format%3Dimage%252Fpng
whichs seems not to be correct..

I don't know if i'm forgetting something.. Any idea?

Thanks!
Post by stash
Post by JuKiM
Hi list,
I know that tere are so many comments about that, but no one is solving
my
Post by JuKiM
problem..
I have geoserver serving a WMS vector layer that has some features... I have
the geoserver running in localhost:8080, and the application that I'm
testing, is running in localhost:3015.. And I suppose that due de different
ports, when I try to do a GetFeatureInfo (clicking anywhere on the map), it
says "access denied".. In the XMLHttpRequest.open(...).
I've added the proxy following the instructions found in "
http://geoserver.org/display/GEOS/GeoServer+Proxy+Extension".. But it still
says that there is no access..
Then I tryied to initialize the proxy host, in the "function Init()",
writing "OpenLayers.ProxyHost = "/geoserver/rest/proxy?url=";" And now what
it says, is that it can't find the resource, and suggest to verify the
url
Post by JuKiM
"/geoserver/rest/proxy"
What is happening with that? Any idea?
Thanks!!
_______________________________________________
Users mailing list
http://openlayers.org/mailman/listinfo/users
Hello,
I had the same problem and I know that this can be really frustrating. But
you can try the following things.
Thereby your html site and geoserver are running on the same pc (localhost)
you don't need a proxyhost. Set it in comments in your html.
Try it out with different browsers. Firefox always blocked my request and
with Internet Explorer it worked.
Maybe this helps.
Regards
stash
--
http://n2.nabble.com/GetFeatureInfo-Access-denied-tp4032182p4032903.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
http://openlayers.org/mailman/listinfo/users
Christopher Schmidt
2009-11-19 18:29:23 UTC
Permalink
Post by JuKiM
Hi,
I've been testing in IE.. If I create a 'test.html' file in a folder under
IIS, I get an error of denied access/resource not available.. But if I copy
that file in the www folder of geoserver, then everything works ok.. This is
quite logical, because IIS is running on port 80, and geoserver in 8080
(They are different hosts)...
Then when I declare the proxy, the IIS's test.html, the response i get is
empty..
Your *IIS* needs the proxy. GeoServer has one built in, but it won't help
you in the slightest if your HTML page isn't hosted on GeoServer. So
either host your page on geoserver's webserver, or get a proxy into
whatever webserver you do need.

-- Chris
Post by JuKiM
And looking in Openlayers.js I've seen where the url is initialized before
the .open, and I think that I'm doing something wrong, because the final url
is not a correct one..
if(config.proxy&&(url.indexOf(
"http")==0)){
url=config.proxy+encodeURIComponent(url);
}
request.open(config.method,url,config.async,config.user,config.password);
http://localhost:8080/geoserver/wms?REQUEST=GetFeatureInfo&EXCEPTIONS=application%2Fvnd.ogc.se_xml&BBOX=-188.610843%2C-60.534809%2C189.241843%2C149.772809&X=104&Y=236&INFO_FORMAT=text%2Fplain&QUERY_LAYERS=G4WD%3Aus_states&FEATURE_COUNT=50&Layers=G4WD%3Aus_states&Styles=&Srs=EPSG%3A4269&WIDTH=1078&HEIGHT=600&format=image%2Fpng
And after, it has the value
/geoserver/rest/proxy?url=http%3A%2F%2Flocalhost%3A8080%2Fgeoserver%2Fwms%3FREQUEST%3DGetFeatureInfo%26EXCEPTIONS%3Dapplication%252Fvnd.ogc.se_xml%26BBOX%3D-188.610843%252C-60.534809%252C189.241843%252C149.772809%26X%3D104%26Y%3D236%26INFO_FORMAT%3Dtext%252Fplain%26QUERY_LAYERS%3DG4WD%253Aus_states%26FEATURE_COUNT%3D50%26Layers%3DG4WD%253Aus_states%26Styles%3D%26Srs%3DEPSG%253A4269%26WIDTH%3D1078%26HEIGHT%3D600%26format%3Dimage%252Fpng
whichs seems not to be correct..
I don't know if i'm forgetting something.. Any idea?
Thanks!
Post by stash
Post by JuKiM
Hi list,
I know that tere are so many comments about that, but no one is solving
my
Post by JuKiM
problem..
I have geoserver serving a WMS vector layer that has some features... I have
the geoserver running in localhost:8080, and the application that I'm
testing, is running in localhost:3015.. And I suppose that due de different
ports, when I try to do a GetFeatureInfo (clicking anywhere on the map), it
says "access denied".. In the XMLHttpRequest.open(...).
I've added the proxy following the instructions found in "
http://geoserver.org/display/GEOS/GeoServer+Proxy+Extension".. But it still
says that there is no access..
Then I tryied to initialize the proxy host, in the "function Init()",
writing "OpenLayers.ProxyHost = "/geoserver/rest/proxy?url=";" And now what
it says, is that it can't find the resource, and suggest to verify the
url
Post by JuKiM
"/geoserver/rest/proxy"
What is happening with that? Any idea?
Thanks!!
_______________________________________________
Users mailing list
http://openlayers.org/mailman/listinfo/users
Hello,
I had the same problem and I know that this can be really frustrating. But
you can try the following things.
Thereby your html site and geoserver are running on the same pc (localhost)
you don't need a proxyhost. Set it in comments in your html.
Try it out with different browsers. Firefox always blocked my request and
with Internet Explorer it worked.
Maybe this helps.
Regards
stash
--
http://n2.nabble.com/GetFeatureInfo-Access-denied-tp4032182p4032903.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
http://openlayers.org/mailman/listinfo/users
_______________________________________________
Users mailing list
http://openlayers.org/mailman/listinfo/users
--
Christopher Schmidt
MetaCarta
JuKiM
2009-11-20 11:35:04 UTC
Permalink
Ok.. Then... Any hint to setup the IIS Proxy?

Thanks!
Post by Christopher Schmidt
Post by JuKiM
Hi,
I've been testing in IE.. If I create a 'test.html' file in a folder
under
Post by JuKiM
IIS, I get an error of denied access/resource not available.. But if I
copy
Post by JuKiM
that file in the www folder of geoserver, then everything works ok.. This
is
Post by JuKiM
quite logical, because IIS is running on port 80, and geoserver in 8080
(They are different hosts)...
Then when I declare the proxy, the IIS's test.html, the response i get is
empty..
Your *IIS* needs the proxy. GeoServer has one built in, but it won't help
you in the slightest if your HTML page isn't hosted on GeoServer. So
either host your page on geoserver's webserver, or get a proxy into
whatever webserver you do need.
-- Chris
JuKiM
2009-11-24 11:36:50 UTC
Permalink
Hi all,

Finally I've decided to modify the openlayers call.
Now I make the XmlHttpRequest.open against the same domain (The IIS served
application), and there I redirect the call to geoserver, and then return
the result to the client..

I've modifyed the OpenLayers.js doing this:

sUrl = "test.aspx?param=" + escape(sUrl); //Force the call to same domain
this._object.open(sMethod, sUrl, bAsync, sUser, sPassword);

And I've created a new page called test hosted in IIS, that catch the
request:
If Request.QueryString.Count <> 0 Then
Dim wsResponse As XmlDocument = New XmlDocument()
Dim param As String
param = Request.QueryString("param") 'In the param we have the
GeoServer URL
Dim url As String = param
wsResponse.Load(url)
Dim XMLDocument As String = wsResponse.InnerXml
Response.Clear()
Response.ContentType = "text/xml"
Response.Write(XMLDocument) 'We return the result from GeoServer
End If

And doing that, I can do the XMLHttpRequest and get the response from
GeoServer..

Any advice/problem with doing in that way?

Thanks!
Post by JuKiM
Post by JuKiM
Hi,
I've been testing in IE.. If I create a 'test.html' file in a folder
under
Post by JuKiM
IIS, I get an error of denied access/resource not available.. But if I
copy
Post by JuKiM
that file in the www folder of geoserver, then everything works ok..
This is
Post by JuKiM
quite logical, because IIS is running on port 80, and geoserver in 8080
(They are different hosts)...
Then when I declare the proxy, the IIS's test.html, the response i get
is
Post by JuKiM
empty..
Your *IIS* needs the proxy. GeoServer has one built in, but it won't help
you in the slightest if your HTML page isn't hosted on GeoServer. So
either host your page on geoserver's webserver, or get a proxy into
whatever webserver you do need.
-- Chris
b***@osgis.nl
2009-11-24 11:53:04 UTC
Permalink
Hi,

why don't you set:

OpenLayers.ProxyHost = 'test.aspx?param=';

and then you don't need to change anything inside of the OpenLayers library.

Best regards,
Bart
Post by JuKiM
Hi all,
Finally I've decided to modify the openlayers call.
Now I make the XmlHttpRequest.open against the same domain (The IIS served
application), and there I redirect the call to geoserver, and then return
the result to the client..
sUrl = "test.aspx?param=" + escape(sUrl); //Force the call to same domain
this._object.open(sMethod, sUrl, bAsync, sUser, sPassword);
And I've created a new page called test hosted in IIS, that catch the
If Request.QueryString.Count <> 0 Then
Dim wsResponse As XmlDocument = New XmlDocument()
Dim param As String
param = Request.QueryString("param") 'In the param we have the
GeoServer URL
Dim url As String = param
wsResponse.Load(url)
Dim XMLDocument As String = wsResponse.InnerXml
Response.Clear()
Response.ContentType = "text/xml"
Response.Write(XMLDocument) 'We return the result from GeoServer
End If
And doing that, I can do the XMLHttpRequest and get the response from
GeoServer..
Any advice/problem with doing in that way?
Thanks!
Post by JuKiM
Post by JuKiM
Hi,
I've been testing in IE.. If I create a 'test.html' file in a folder
under
Post by JuKiM
IIS, I get an error of denied access/resource not available.. But if
I
copy
Post by JuKiM
that file in the www folder of geoserver, then everything works ok..
This is
Post by JuKiM
quite logical, because IIS is running on port 80, and geoserver in
8080
Post by JuKiM
(They are different hosts)...
Then when I declare the proxy, the IIS's test.html, the response i
get
is
Post by JuKiM
empty..
Your *IIS* needs the proxy. GeoServer has one built in, but it won't help
you in the slightest if your HTML page isn't hosted on GeoServer. So
either host your page on geoserver's webserver, or get a proxy into
whatever webserver you do need.
-- Chris
_______________________________________________
Users mailing list
http://openlayers.org/mailman/listinfo/users
JuKiM
2009-11-24 12:14:32 UTC
Permalink
wow!

This is what I was looking for...!! I found that I need to define the
proxyhost like "OpenLayers.ProxyHost = "/geoserver/rest/proxy?url=";" but
the 'rest/proxy' confused me, and I looked for an alternative way..

Thanks a lot!
Post by b***@osgis.nl
Hi,
OpenLayers.ProxyHost = 'test.aspx?param=';
and then you don't need to change anything inside of the OpenLayers library.
Best regards,
Bart
Continue reading on narkive:
Loading...