Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] uDig WFS Mapserver

I found some information related to this in mapserver documentation:

http://mapserver.org/ogc/wms_server.html#more-about-the-online-resource-url

"As mentioned in the section “Setup a Mapfile / wms_onlineresource metadata” above, the following Online Resource URL is perfectly valid for a MapServer WMS according to section 6.2.2 or the WMS 1.1.1 specification:

http://my.host.com/cgi-bin/mapserv?map=mywms.map&;

However, some people will argue that the above URL contains mandatory vendor-specific parameters and that this is illegal. First we would like to point that “map=...” is not considered a vendor-specific parameter in this case since it is part of the Online Resource URL which is defined as an opaque string terminated by “?” or “&” (See WMS 1.1.1 section 6.2.2).

But anyway, even if it’s valid, the above URL is still ugly. And you might want to use a nicer URL for your WMS Online Resource URL. Here are some suggestions:
......."

So there we have some ways to create a valid URL in case someone has the same problem :)

Jody, should I copy this in the bug report?

Thanks for helping :)

Joaquín Rodríguez-Guerra Urcelay

Unidad de Sistemas de Procesamiento de Ciencia y de Observación de la Tierra / Science and Earth Observing Processing Systems Unit

GMV AEROSPACE AND DEFENCE, S.A.
Isaac Newton, 11
P.T.M. Tres Cantos
E-28760 Madrid
Tel. +34 91 807 21 00 / 7695
Fax +34 91 807 21 99
www.gmv.com

________________________________________
De: udig-devel-bounces@xxxxxxxxxxxxxxxxxxxxx [udig-devel-bounces@xxxxxxxxxxxxxxxxxxxxx] En nombre de Jody Garnett [jody.garnett@xxxxxxxxx]
Enviado el: domingo, 20 de febrero de 2011 1:47
Para: User-friendly Desktop Internet GIS
Asunto: Re: [udig-devel] uDig WFS Mapserver

So checking the font of all assumed knowledge[1] we have:


In particular, encoding the query string uses the following rules:

 *   Letters (A-Z and a-z), numbers (0-9) and the characters '.','-','~' and '_' are left as-is
 *   SPACE is encoded as '+'
 *   All other characters are encoded as %FF hex<http://en.wikipedia.org/wiki/Hexadecimal> representation with any non-ASCII characters first encoded as UTF-8 (or other specified encoding)

The octet corresponding to the tilde ("~") character is often encoded as "%7E" by older URI processing implementations; the "%7E" can be replaced by"~" without changing its interpretation.

The encoding of SPACE as '+' and the selection of "as-is" characters distinguishes this encoding from RFC 1738<http://tools.ietf.org/html/rfc1738>.

So judging from that; GeoTools is correctly encoding the request "/" is not allowed to run around naked as part of the query string. Do you want to open up a mapserver bug as well?

I will note that many examples of mapserver uses their map file as part of the path defining the service end-point; and not as a parameter. This is due to each map file being considered a seperate service (with a distinct capabilities document).

Jody

[1] http://en.wikipedia.org/wiki/Query_string

--
Jody Garnett


On Sunday, 20 February 2011 at 10:41 AM, Jody Garnett wrote:

Okay cool. Internally the code tries to make the URL correct (the standard requires VERSION, SERVICE and REQUEST). The client is supposed to respond with its preferred version (which is 1.0.0 for uDig in order to use wfs-t). If you explicitly specify 1.1.0 it will use that for read-only access.

We will need to go and fix WFSDataStoreFactory; let me open a bug report for you:
- https://jira.codehaus.org/browse/GEOT-3442

--
Jody Garnett


On Friday, 18 February 2011 at 6:29 PM, Joaquín Rodriguez-Guerra Urcelay wrote:

Hello,

I took a look at the wfs catalog to see how the URL is read and it seems like before starting the parsing, a hack is done to make sure the URL uses wfs version 1.0.0, and it is there where URL is modified from:
http://localhost:8080/cgi-bin/mapserv?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetCapabilities&MAP=/opt/fgs/www/htdocs/mariss/data/states.map
to
http://localhost:8080/cgi-bin/mapserv?VERSION=1.0.0&SERVICE=WFS&REQUEST=GetCapabilities&MAP=%2Fopt%2Ffgs%2Fwww%2Fhtdocs%2Fmariss%2Fdata%2Fstates.map

Geotools is able to parse the first URL but not the second one, and commenting line 185 fixes the problem about having "/" in the URL, but of course probably that line is there for some other reasons...

WFSServiceImpl:183

// HACK: explicitly ask for WFS 1.0
URL url = (URL) params.get(WFSDataStoreFactory.URL.key);
url = WFSDataStoreFactory.createGetCapabilitiesRequest(url); // this line makes the URL wrong if it contains "/" in the params
params = new HashMap<String, Serializable>(params);
params.put(WFSDataStoreFactory.URL.key, url);
ds = (WFSDataStore) dsf.createDataStore(params);
url = WFSDataStoreFactory.createGetCapabilitiesRequest(url);

Regards,

Joaquín Rodríguez-Guerra Urcelay

Unidad de Sistemas de Procesamiento de Ciencia y de Observación de la Tierra / Science and Earth Observing Processing Systems Unit

GMV AEROSPACE AND DEFENCE, S.A.
Isaac Newton, 11
P.T.M. Tres Cantos
E-28760 Madrid
Tel. +34 91 807 21 00 / 7695
Fax +34 91 807 21 99
www.gmv.com<http://www.gmv.com>

________________________________________
De: udig-devel-bounces@xxxxxxxxxxxxxxxxxxxxx<mailto:udig-devel-bounces@xxxxxxxxxxxxxxxxxxxxx> [udig-devel-bounces@xxxxxxxxxxxxxxxxxxxxx<mailto:udig-devel-bounces@xxxxxxxxxxxxxxxxxxxxx>] En nombre de Joaquín Rodriguez-Guerra Urcelay [jrguerra@xxxxxxx<mailto:jrguerra@xxxxxxx>]
Enviado el: jueves, 17 de febrero de 2011 16:07
Para: User-friendly Desktop Internet GIS
Asunto: Re: [udig-devel] uDig WFS Mapserver

Hello,

I have finally export my wfs mapserver successfully.
I found out that if I copy the content of the getCapabilities file to an xml file, and then put that file in the web server, I can tell uDig to import wfs server from that xml file instead the getCapabilities request and it works. So If I enter the URL:

http://localhost:8080/cgi-bin/mapserv?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetCapabilities&MAP=/opt/fgs/www/htdocs/mariss/data/states.map

The parsing error occurs:
org.geotools.data.DataSourceException: Expected {http://www.opengis.net/wfs}WFS_Capabilities but was null#HTML
at org.geotools.data.wfs.WFSDataStoreFactory.parseCapabilities(WFSDataStoreFactory.java:426)
at org.geotools.data.wfs.WFSDataStoreFactory.createDataStore(WFSDataStoreFactory.java:353)

But If I enter the following URL (which contains the same XML content):

http://localhost:8080/mariss/data/getCapabilities.xml

The parsing of the capabilities is OK, and after that features are displayed correctly in the map :)

Maybe there is a problem with writing '&' in the URL.

Joaquín Rodríguez-Guerra Urcelay

Unidad de Sistemas de Procesamiento de Ciencia y de Observación de la Tierra / Science and Earth Observing Processing Systems Unit

GMV AEROSPACE AND DEFENCE, S.A.
Isaac Newton, 11
P.T.M. Tres Cantos
E-28760 Madrid
Tel. +34 91 807 21 00 / 7695
Fax +34 91 807 21 99
www.gmv.com<http://www.gmv.com>

________________________________________
De: udig-devel-bounces@xxxxxxxxxxxxxxxxxxxxx<mailto:udig-devel-bounces@xxxxxxxxxxxxxxxxxxxxx> [udig-devel-bounces@xxxxxxxxxxxxxxxxxxxxx<mailto:udig-devel-bounces@xxxxxxxxxxxxxxxxxxxxx>] En nombre de Joaquín Rodriguez-Guerra Urcelay [jrguerra@xxxxxxx<mailto:jrguerra@xxxxxxx>]
Enviado el: miércoles, 16 de febrero de 2011 21:11
Para: Mauricio Pazos; udig-devel@xxxxxxxxxxxxxxxxxxxxx<mailto:udig-devel@xxxxxxxxxxxxxxxxxxxxx>
Asunto: Re: [udig-devel] uDig WFS Mapserver

Thank you Mauricio,

Using uDig 1.2.0, I get the same results as you, your test server working almost OK, and mines failing ( but maybe a little more detalied):

!ENTRY net.refractions.udig.catalog.ui 4 0 2011-02-16 21:03:28.122
!MESSAGE Error fetching the Title for the resource
!STACK 0
org.geotools.data.DataSourceException: Expected {http://www.opengis.net/wfs}WFS_Capabilities but was null#HTML
at org.geotools.data.wfs.WFSDataStoreFactory.parseCapabilities(WFSDataStoreFactory.java:426)
at org.geotools.data.wfs.WFFFSDataStoreFactory.createDataStore(WFSDataStoreFactory.java:353)
at net.refractions.udig.catalog.internal.wfs.WFSServiceImpl.getDS(WFSServiceImpl.java:188)
at net.refractions.udig.catalog.internal.wfs.WFFFSServiceImpl.createInfo(WFSServiceImpl.java:143)
at net.refractions.udig.catalog.IService.getInfo(IService.java:328)
at net.refractions.udig.catalog.internal.wfs.WFSServiceImpl.getInfo(WFSServiceImpl.java:137)
at net.refractions.udig.catalog.ui.ResolveTitlesDecorator$UpdateLabel.run(ResolveTitlesDecorator.java:406)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
[Fatal Error] :6:3: The element type "br" must be terminated by the matching end-tag "</br>".

It is weird because one of the getCapabilities document does not even contain the br string.

I am now downloading uDig 1.2.1 to run some tests.

Thank you for providing me with a working mapserver, now I can compare mine with that one :)

Regards,

Joaquín Rodríguez-Guerra Urcelay

Unidad de Sistemas de Procesamiento de Ciencia y de Observación de la Tierra / Science and Earth Observing Processing Systems Unit

GMV AEROSPACE AND DEFENCE, S.A.
Isaac Newton, 11
P.T.M. Tres Cantos
E-28760 Madrid
Tel. +34 91 807 21 00 / 7694
Fax +34 91 807 21 99
www.gmv.com<http://www.gmv.com>
________________________________________
De: Mauricio Pazos [mauricio.pazos@xxxxxxxx<mailto:mauricio.pazos@xxxxxxxx>]
Enviado el: miércoles, 16 de febrero de 2011 10:54
Para: udig-devel@xxxxxxxxxxxxxxxxxxxxx<mailto:udig-devel@xxxxxxxxxxxxxxxxxxxxx>; Joaquín Rodriguez-Guerra Urcelay
Asunto: Re: [udig-devel] uDig WFS Mapserver

On Wednesday 16 February 2011 10:03:45 am Mauricio Pazos wrote:
I tried with some public mapserver servers with the same result (the
exception) :( Can anyone confirm this? I am using udig 1.2.0

I have tried udig using this
http://b5m.gipuzkoa.net/ogc/wfs/gipuzkoa_wfs?service=wfs&request=getcapabil
ities

Steps:
1- import the wfs in the catalog view
1- Create a new map
2- add "REGION" layer in the map
Observation:
- The features are presented in the "table view".
- The features' geometries are not displayed correctly
- Having a look in the layer property dialog, the Feature Type show
"Geometry" but it should be "polygon".

Observation:
I repeat this test case using QGIS, it display correctly the polygons
present in the REGION layer.
This test case works OK using udig-platform (trunk)



wfs servers:

http://ide.segeplan.gob.gt/cgi-bin/mapserv.exe?map=/ot_web/ot_WFS_poblado
s. map&request=getcapabilities&service=wfs
http://map.ns.ec.gc.ca/MapServer/mapserv.exe?map=/mapserver/services/envd
at /config.map&service=WFS&version=1.0.0&request=GetCapabilities

I have tried your url, I have gotten the following message in the udig
status bar:
"Error parsing capabilities document"

Observation:
It work Ok in QGIS


Using udig-platform (trunk) the console shows the following error:


"org.geotools.data.DataSourceException: Expected {http://www.opengis.net/wfs}WFS_Capabilities but was null#HTML
at org.geotools.data.wfs.WFSDataStoreFactory.parseCapabilities(WFSDataStoreFactory.java:427)
at org.geotools.data.wfs.WFSDataStoreFactory.createDataStore(WFSDataStoreFactory.java:354)


...."


So, it looks like the capability document has problems, but ... why QGIS can read this document?


cheers
--
Mauricio Pazos
www.axios.es<http://www.axios.es>


______________________
This message including any attachments may contain confidential
information, according to our Information Security Management System,
and intended solely for a specific individual to whom they are addressed.
Any unauthorised copy, disclosure or distribution of this message
is strictly forbidden. If you have received this transmission in error,
please notify the sender immediately and delete it.

______________________
Este mensaje, y en su caso, cualquier fichero anexo al mismo,
puede contener informacion clasificada por su emisor como confidencial
en el marco de su Sistema de Gestion de Seguridad de la
Informacion siendo para uso exclusivo del destinatario, quedando
prohibida su divulgacion copia o distribucion a terceros sin la
autorizacion expresa del remitente. Si Vd. ha recibido este mensaje
erroneamente, se ruega lo notifique al remitente y proceda a su borrado.
Gracias por su colaboracion.

______________________

_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel

______________________
This message including any attachments may contain confidential
information, according to our Information Security Management System,
and intended solely for a specific individual to whom they are addressed.
Any unauthorised copy, disclosure or distribution of this message
is strictly forbidden. If you have received this transmission in error,
please notify the sender immediately and delete it.

______________________
Este mensaje, y en su caso, cualquier fichero anexo al mismo,
puede contener informacion clasificada por su emisor como confidencial
en el marco de su Sistema de Gestion de Seguridad de la
Informacion siendo para uso exclusivo del destinatario, quedando
prohibida su divulgacion copia o distribucion a terceros sin la
autorizacion expresa del remitente. Si Vd. ha recibido este mensaje
erroneamente, se ruega lo notifique al remitente y proceda a su borrado.
Gracias por su colaboracion.

______________________

_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel

______________________
This message including any attachments may contain confidential
information, according to our Information Security Management System,
and intended solely for a specific individual to whom they are addressed.
Any unauthorised copy, disclosure or distribution of this message
is strictly forbidden. If you have received this transmission in error,
please notify the sender immediately and delete it.

______________________
Este mensaje, y en su caso, cualquier fichero anexo al mismo,
puede contener informacion clasificada por su emisor como confidencial
en el marco de su Sistema de Gestion de Seguridad de la
Informacion siendo para uso exclusivo del destinatario, quedando
prohibida su divulgacion copia o distribucion a terceros sin la
autorizacion expresa del remitente. Si Vd. ha recibido este mensaje
erroneamente, se ruega lo notifique al remitente y proceda a su borrado.
Gracias por su colaboracion.

______________________

_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel



______________________
This message including any attachments may contain confidential 
information, according to our Information Security Management System,
 and intended solely for a specific individual to whom they are addressed.
 Any unauthorised copy, disclosure or distribution of this message
 is strictly forbidden. If you have received this transmission in error,
 please notify the sender immediately and delete it.

______________________
Este mensaje, y en su caso, cualquier fichero anexo al mismo,
 puede contener informacion clasificada por su emisor como confidencial
 en el marco de su Sistema de Gestion de Seguridad de la 
Informacion siendo para uso exclusivo del destinatario, quedando 
prohibida su divulgacion copia o distribucion a terceros sin la 
autorizacion expresa del remitente. Si Vd. ha recibido este mensaje 
 erroneamente, se ruega lo notifique al remitente y proceda a su borrado. 
Gracias por su colaboracion.

______________________



Back to the top