[mapserver-users] WFS and typename issue

Pericles S. Nacionales naci0002 at umn.edu
Thu Feb 28 13:28:35 PST 2008


The WFS 1.0.0 doesn't specifically say not to use spaces in a typeName
but all the examples don't contain spaces...  The space character always
causes problem as part of a parameter in web forms, it should be
avoided.  That said, if the solution is as simple as escaping spaces in
MapServer's GML output then maybe it should be done.

It's not just spaces either...  any special character could potentially
be problematic (and maybe a potential security hole).  So, yes, you
probably should tell the WFS service author that it's bad karma to put
spaces in typeNames and featureIDs. :)  Add underscores or remove spaces
if possible.

-Perry


Fischer, Brian wrote:
> After troubleshooting this a little further here is what I found.
> 
> I get an invalid http request error if I try using an escape character
> with a & in it.  That is understandable.
> 
> If I try using + or %20 it gets a little further and this is the error I
> get.
> "msDrawMap(): Image handling error. Failed to draw layer named
> 'hydrowfs'. msOGRFileOpen(): OGR error. Open failed for OGR connection
> `C:/ms4w/tmp/ms_tmp/ccc2661b5c5cc4dbff3d2d052e2e73c7.tmp.gml'. XML
> Parsing Error: Expected equal sign "
> 
> Also when I try opening the .gml file in Gaia 3 it says there is an
> error reading the GML file. If I got through the GML file and remove all
> the spaces from the typename and save the file.  Then it opens fine.
> 
> It appears the problem is that MapServer is not escaping the space
> character in the temporary GML file when it creates it.  I don't know a
> lot about the rules for the GML file and if a spaces are allowed or what
> the escape character should be.  I guess my simpliest solution is to try
> to get the WFS service author to remove the spaces from their typenames.
> But I would be willing to report this as a bug in MapServer if this is
> really a bug.  Hopefully someone can let me know.
> 
> Thanks,
> Brian
> 
> Brian Fischer
> Houston Engineering, Inc.
> Maple Grove, MN
> (763) 493-4522
> 
> -----Original Message-----
> From: Milo van der Linden [mailto:mlinden at zeelandnet.nl] 
> Sent: Thursday, February 28, 2008 2:38 PM
> To: Fischer, Brian
> Cc: Pericles S. Nacionales; mapserver-users at lists.osgeo.org
> Subject: Re: [mapserver-users] WFS and typename issue
> 
> Have you tried using  ?
> 
> I had some sort of issue that looks like yours.
> 
> like this:
> 
> "gml_include_items" "MFIELD,KFIELD,DFIELD"
> "gml_MFIELD_alias" "A Field for M"
> 
> I can retrieve fieldnames with spaces on my installation of mapserver
> for a WMS GetFeatureInfo request. If the same doesn't work on WFS I
> would suggest filing a bug.
> 
> Fischer, Brian schreef:
>> Just tried it and no + doesn't work.  I also tried %20,   and 
>>  
>>
>>
>> Brian Fischer
>> Houston Engineering, Inc.
>> Maple Grove, MN
>> (763) 493-4522
>>
>> -----Original Message-----
>> From: Pericles S. Nacionales [mailto:naci0002 at umn.edu]
>> Sent: Thursday, February 28, 2008 2:15 PM
>> To: Fischer, Brian
>> Cc: mapserver-users at lists.osgeo.org
>> Subject: Re: [mapserver-users] WFS and typename issue
>>
>> Brian,
>>
>> I take it the "+" character doesn't work?
>>
>> -Perry
>>
>> Fischer, Brian wrote:
>>   
>>> Has anybody else experience problems when using a WFS service where 
>>> the typename has a space in it?  I'm experiencing the WFS layers that
> 
>>> don't have spaces work fine with MapServer, but ones that do have 
>>> spaces produce invalid GML files.  Is there an escape character that 
>>> can be used to represent the space in the typename?
>>>  
>>> The WFS service I am trying to get to work is 
>>> http://www.datafinder.org/wfsconnector/com.esri.wfs.Esrimap/MN_MetroG
>>> I
>>> S_
>>> DataFinder_WFS_Water_Resources?request=getcapabilities&service=WFS&ve
>>> r
>>> si
>>> on=1.0.0
>>>  
>>> The layer without the space works fine, but the rest do not.
>>>  
>>> Thanks,
>>> Brian
>>>  
>>> Brian Fischer, CFM
>>> GIS Project Manager
>>> Houston Engineering, Inc. | Leave Nothing to ChanceTM
>>> 6901 East Fish Lake Road, Suite 140
>>> Maple Grove, MN 55369
>>> Phone:  763.493.4522 / Fax:  763.493.5572
>>> Email:  bfischer at houstonengineeringinc.com
>>> <mailto:bfischer at houstonengineeringinc.com>
>>> Website: www.houstonengineeringinc.com 
>>> <http://www.houstonengineeringinc.com/>
>>>  
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> -
>>> --
>>>
>>> _______________________________________________
>>> mapserver-users mailing list
>>> mapserver-users at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>>>     
>> _______________________________________________
>> mapserver-users mailing list
>> mapserver-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>>
>>   
> 
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users




More information about the MapServer-users mailing list