2017-11-06 30 views
-1

GeoServer WFS 엔드 포인트에 대해 가장 단순한 WFS HTTP_POST 요청을 처리하려고합니다.WFS의 잘못된 typenames : 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에 typeNames 매개 변수에 작동하는 바로 그 값이 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> 
    [....]