[Users] GeoExt 2 WfsCapabilitiesStore featureType name incorrect
Tobias Kirschke
tobias.kirschke at student.afg.hs-anhalt.de
Sun Apr 21 15:02:18 CEST 2013
The "normal" POST request from OpenLayers does not work with this server.
var wfs = new OpenLayers.Layer.Vector('WFS-Layer', {
strategies : [new
OpenLayers.Strategy.Fixed()],
protocol : new OpenLayers.Protocol.WFS({
version:"1.1.0",
url : URL,
featureType : record.get('name'),
featureNS : record.get('namespace'),
srsName : "EPSG:900913"
})
});
I think it is the same problem. Now I use Geotools on server side to get
the namespace prefix and then I build a GET url. Afterwards I use the
following code to integrate the WFS.
var wfs = new OpenLayers.Layer.Vector('WFS-Layer', {
strategies : [new
OpenLayers.Strategy.Fixed()],
protocol : new
OpenLayers.Protocol.HTTP({
url : URL,
format: new
OpenLayers.Format.GML.v3()
})
});
It is not pretty, but it works.
Tobias.
Am 13.04.2013 12:08, schrieb Andreas Hocevar:
> Unfortunately this is not possible. Have you considered using POST
> requests instead of building a GET url? Then you don't need the prefix
> at all.
>
> Andreas.
>
> On Fri, Apr 12, 2013 at 12:18 PM, Tobias Kirschke
> <tobias.kirschke at student.afg.hs-anhalt.de> wrote:
>> Thanks. This works for a lot of WFS-Servers. But I have a WFS-Server that
>> throw "unknown FeatureType". So it does not work there. Is there another
>> function or a short solution to get the namespace prefix yet?
>>
>> Tobias.
>>
>>
>>
>> Am 10.04.2013 17:08, schrieb Andreas Hocevar:
>>
>>> This should work:
>>>
>>>
>>> http://my/wfs?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TYPENAME=typenameWithoutPrefix&NAMESPACE=xmlns(http://my-namespace-uri)
>>>
>>> Andreas.
>>>
>>> On Wed, Apr 10, 2013 at 4:41 PM, Tobias Kirschke
>>> <tobias.kirschke at student.afg.hs-anhalt.de> wrote:
>>>> I need the namespace prefix to build a getFeature-Url.
>>>>
>>>> For example, I need the TYPENAME (lep:lsa_mlv_lep_zo_feature) in the
>>>> following URL.
>>>>
>>>>
>>>> http://www......de/ows/ws/wfs/GDI/?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TYPENAME=lep:lsa_mlv_lep_zo_feature&SRSNAME=EPSG:31468
>>>>
>>>> How do I get the required information? Or is there another solution?
>>>>
>>>> Tobias.
>>>>
>>>>
>>>>
>>>> Am 10.04.2013 16:13, schrieb Andreas Hocevar:
>>>>
>>>> "world" is the correct name. You should not need the namespace prefix.
>>>> What you usually need is the namespace uri, which you get from the
>>>> namespace property of each record.
>>>>
>>>> Out of curiosity, why do you think you need the namespace prefix?
>>>>
>>>> Andreas.
>>>>
>>>> On Wed, Apr 10, 2013 at 1:51 PM, Tobias Kirschke
>>>> <tobias.kirschke at student.afg.hs-anhalt.de> wrote:
>>>>
>>>> Hi,
>>>>
>>>> I use WfsCapabilitiesStore like in the example
>>>>
>>>> http://geoext.github.io/geoext2/examples/wfscapabilities/wfscapabilities.html
>>>>
>>>> So I get "world" as the featureType-Name, but I need the correct name
>>>> "tows:world". What can I do? Thanks.
>>>>
>>>> Tobias
>>>> _______________________________________________
>>>> Users mailing list
>>>> Users at geoext.org
>>>> http://www.geoext.org/cgi-bin/mailman/listinfo/users
>>>>
>>>>
>>>>
>>>
>
>
More information about the Users
mailing list