[geotk] Request WFS-Server with basic autentication

Hebler, Christoph christoph.hebler at atos.net
Mon Jul 3 23:31:38 PDT 2017


Hello,

I am trying to request one special "typename" from a given WFS-Server, but I am not able to get it.
Maybe someone of you is so kind to give me a working example?

Situation:

-          using geotoolkit version 4.0.3

-          trying to request a WFS-Server

-          WFS-Server is secured with basic authentication (I assume this is where I fail)

-          WFS request request version 2.0.0 preferred (but 1.1.0 is possible too)

-          (if possible: using HTTP POST to request)

Both of the below XML-requests work within SoapUI:

<?xml version="1.0" encoding="UTF-8"?>
<wfs:GetFeature
      xmlns="http://www.opengis.net/wfs"
      xmlns:abc="http://www.abc-online.com/namespaces/abc/"
      xmlns:ogc="http://www.opengis.net/ogc"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:gml="http://www.opengis.net/gml"
      xmlns:wfs="http://www.opengis.net/wfs"
      service="WFS" version="1.1.0"
      outputFormat="text/xml; subtype=gml/3.2.1" handle="">
      <wfs:Query typeName="abc:RequestedType">
            <ogc:Filter>
                  <ogc:PropertyIsEqualTo>
                        <ogc:PropertyName>abc:RequestedType/abc:identifier</ogc:PropertyName>
                        <ogc:Literal>1234</ogc:Literal>
                  </ogc:PropertyIsEqualTo>
            </ogc:Filter>
      </wfs:Query>
</wfs:GetFeature>



<?xml version="1.0" encoding="UTF-8"?>
<wfs:GetFeature
   service="WFS"
   version="2.0.0"
   outputFormat="text/xml; subtype=gml/3.2.1" handle=""
   xmlns:abc="http://www.abc-online.com/namespaces/abc/"
   xmlns:wfs="http://www.opengis.net/wfs/2.0"
   xmlns:fes="http://www.opengis.net/fes/2.0"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>

   <wfs:Query typeNames="abc:RequestedType">
     <fes:Filter>
       <fes:PropertyIsEqualTo>
        <fes:ValueReference>abc:RequestedType/abc:identifier</fes:ValueReference>
        <fes:Literal>1234</fes:Literal>
       </fes:PropertyIsEqualTo>
     </fes:Filter>
   </wfs:Query>
</wfs:GetFeature>

Would it be possible to post a working java code example to realize such a request, starting with the creation of the WebFeatureClient (if that´s the right class), using basic authentication, setting the Query with typeName and Filter
including the lines to send that request to the WFS-Server?
Maybe a link to the documentation where this is described would also help, but unfortunately I did not find any documentation or example code explaining this situation executing a WFS request including basic authentication and setting typename and filter.
Thanks a lot in advance!

Regards,
Chris

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geotoolkit/attachments/20170704/9c95cc52/attachment.html>


More information about the Geotoolkit mailing list