2017-11-06 8 views
-1

私はGeoServer WFSエンドポイントに対して、最も単純なWFS HTTP_POSTリクエストを動作させようとしています。WFSのタイプ名が無効です:GetFeatures POST?

http://mygeoserver.com/geoserver/ows 

このリクエストのボディを持つ:

http://mygeoserver.com/geoserver/ows? 
    service=wfs& 
    version=2.0.0& 
    request=getfeature& 
    count=3& 
    typenames=mynamespace:myfeaturetype& 
    cql_filter=dccode=%27XYZ%27 

私はこのHTTP_POST要求を期待する:

このHTTP_GET要求は動作しますが、私は(わかりやすくするために挿入された改行を)期待するものを返し

<GetFeature 
    version="2.0.0" 
    service="WFS" 
    count="3" 
    xmlns="http://www.opengis.net/wfs/2.0" 
    xmlns:fes="http://www.opengis.net/fes/2.0" 
    xmlns:gsml="http://xmlns.geosciml.org/GeoSciML-Core/3.2" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://www.opengis.net/wfs/2.0 
    http://schemas.opengis.net/wfs/2.0/wfs.xsd" 
    > 

    <Query 
     typeNames="mynamespace:myfeaturetype" 
     > 
     <Filter 
      xmlns="http://www.opengis.net/fes/2.0" 
      xmlns:xlink="http://www.w3.org/1999/xlink" 
      xmlns:gsml="http://xmlns.geosciml.org/GeoSciML-Core/3.2" > 
      <PropertyIsEqualTo> 
       <ValueReference>dccode</ValueReference> 
       <Literal>XYZ</Literal> 
      </PropertyIsEqualTo> 
     </Filter> 
    </Query> 
</GetFeature> 

同じものを返す。

代わりに、私はエラーを取得する:

cvc-datatype-valid.1.2.3: 'mynamespace:myfeaturetype' is not a valid value of union type 'TypeNamesType'. 

    cvc-attribute.3: The value 'mynamespace:myfeaturetype' of attribute 'typeNames' on element 'Query' is not valid with respect to its type, 'TypeNamesListType'. 

ループのために私を投げて何がHTTP_GETに型名パラメータのために働くの非常に同じ値がHTTP_POSTでエラーがスローされますということです。

問題は、 "mynamespace"のXMLに名前空間定義を指定する必要があるようです。

<Query 
    typeNames="mynamespace:myfeaturetype" 
    xmlns:mynamespace="http://????" 
    > 

私は、GeoServerインストールのどこかでこれが利用可能であると仮定しています。しかしここで?

答えて

1

これは、ワークスペースmynamespaceのURIとして設定した内容になります。あなたはdescribeFeatureリクエストを使ってそれを見ることができます。だから、例えば:

curl http://localhost:8080/geoserver/wfs\?service=wfs\&version=1.1.0\&request=DescribeFeatureType\&typeName=topp:states 

ができます:

<?xml version="1.0" encoding="UTF-8"?> 
<xsd:schema xmlns:gml="http://www.opengis.net/gml" 
    xmlns:topp="http://www.openplans.org/topp" 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
    elementFormDefault="qualified" 
    targetNamespace="http://www.openplans.org/topp"> 
    <xsd:import namespace="http://www.opengis.net/gml" schemaLocation="http://localhost:8080/geoserver/schemas/gml/3.1.1/base/gml.xsd"/> 
    <xsd:complexType name="statesType"> 
    <xsd:complexContent> 
    [....] 
関連する問題