I am getting an incorrect host address in my GetCapabilities response.
I have Geoserver 1.3.1 running in the Jetty container at
http://localhost:8888. When I submit a GetCapabilities request directly
from a web browser I get a correct response, where the onlineResource values
all look like this:
<Get onlineResource="http://localhost:8888/geoserver/wfs?"/>
However, when I make the same request from a Perl script containing:
#!/usr/bin/perl -wT
use XML::LibXML;
...
my $parser = XML::LibXML->new();
my $getcaps_url =
"http://localhost:8888/geoserver/wfs?request=GetCapabilities&service=WFS&ver
sion=1.0.0";
my $getcaps_doc = $parser->parse_file($getcaps_url);
...
the onlineResource values have the wrong host address:
<Get onlineResource="http://localhost:80/geoserver/wfs?"/>
If I save the correct response from my web browser to a file, then read the
file with my Perl script, the address are still correct, so I believe that
Geoserver is returning the wrong addresses, and they are not being corrupted
by the Perl XML parser.
Why is this host address conversion happening, and can I prevent it?
Thanks,
-ellery-
Hmmm... GeoServer tends to fill out the capabilities document with how the request was made, so I think geoserver somehow thinks it's getting the request from localhost:80. There's been a request to make it so one can customize that: http://jira.codehaus.org/browse/GEOS-598 You can vote on the issue to bump it up our queue a bit.
You also can hack it, see: http://www.nabble.com/Fix+URL+of+OnlineRessource+elements+in+Capabilities-t1599189.html#a4419368
But it's a bit weird that it's returning the :80 when your request is to 8888. Is it possible that perl is ignoring the port? If you turn off port forwarding/apache, so geoserver doesn't respond at :80 then I guess that this script won't work, as GeoServer is generally good at returning the url where it gets the request. So yeah, figure out if there's another way to set the port requested in perl.
Chris
Ellery Chan wrote:
I am getting an incorrect host address in my GetCapabilities response.
I have Geoserver 1.3.1 running in the Jetty container at
http://localhost:8888. When I submit a GetCapabilities request directly
from a web browser I get a correct response, where the onlineResource values
all look like this:
<Get onlineResource="http://localhost:8888/geoserver/wfs?"/>
However, when I make the same request from a Perl script containing:
#!/usr/bin/perl -wT
use XML::LibXML;
...
my $parser = XML::LibXML->new();
my $getcaps_url =
"http://localhost:8888/geoserver/wfs?request=GetCapabilities&service=WFS&ver
sion=1.0.0";
my $getcaps_doc = $parser->parse_file($getcaps_url);
...
the onlineResource values have the wrong host address:
<Get onlineResource="http://localhost:80/geoserver/wfs?"/>
If I save the correct response from my web browser to a file, then read the
file with my Perl script, the address are still correct, so I believe that
Geoserver is returning the wrong addresses, and they are not being corrupted
by the Perl XML parser.
Why is this host address conversion happening, and can I prevent it?
Thanks,
-ellery-
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
--
Chris Holmes
The Open Planning Project
http://topp.openplans.org