WFS using xml

Eijnden, B. van den (Bart) b.vdeijnden at AGI.RWS.MINVENW.NL
Mon Feb 6 08:18:41 EST 2006


Hi Fabio,

Please always reply to the list.

You can send it eg with Python, or PHP, whatever. You cannot use a pure HTML
form without server-side processing, since it sends using a param=value
approach (i.e. you need to remove the part before the = of the posted string
if I remember correctly).

What do you mean with: "How can I give to the server the XML path?" ?

Example for Python:

import httplib, urllib, string, base64, time

# 1) set variable for request to be posted

request="""
<GetFeature service="WFS" version="1.0.0" xmlns="http://www.opengis.net/wfs"
xmlns:gml="http://www.opengis.net/gml"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://schemas.opengis.net/wfs/1.0.0
WFS-basic.xsd"><Query
typeName="postcode"><ogc:Filter><ogc:And><ogc:PropertyIsLike wildCard='*'
singleChar='.' escape='!'
matchCase='false'><ogc:PropertyName>PC6</ogc:PropertyName><ogc:Literal>8044P
C*</ogc:Literal></ogc:PropertyIsLike><ogc:PropertyIsLike wildCard='*'
singleChar='.' escape='!'
matchCase='false'><ogc:PropertyName>HUISNR</ogc:PropertyName><ogc:Literal>*<
/ogc:Literal></ogc:PropertyIsLike></ogc:And></ogc:Filter></Query></GetFeatur
e>
"""
# 2) set WFS servername and hostname

# productie
server="/stragisweb/cgi-bin/mapserv.exe?map=/ms4w/apps/stragisweb/htdocs/sit
es/zwolle/map/stragisweb.map&"
hostname="localhost:8080"

# 3) execute the request

h = httplib.HTTP(hostname)
h.putrequest("POST", server)
h.putheader("Content-type", "text/xml")
h.putheader("Content-length", "%d" % len(request))
h.putheader("Accept", "text/xml")
h.putheader('Host', hostname)
h.endheaders()
h.send(request)
reply, msg, hdrs = h.getreply()

# 4) print the response
print h.getfile().read()

Best regards,
Bart

-----Oorspronkelijk bericht-----
Van: fabio.dovidio at planetek.it [mailto:fabio.dovidio at planetek.it]
Verzonden: maandag 6 februari 2006 14:17
Aan: Eijnden, B. van den (Bart)
Onderwerp: Re: [UMN_MAPSERVER-USERS] WFS using xml


How can i send the XML file? Wich is the html form ? How can I give to the
server the XML 
path?

Thank u much,
Fabio.

On 6 Feb 2006 at 4:44, Eijnden, B. van den (Bart) wrote:

> Yes this is possible.
> 
> If it does not work posting to the URL you provided, try posting to a URL
> like:
> 
> http://localhost:8089/cgi-bin/mapserv?service=WFS&version=1.0.0
> 
> Best regards,
> Bart
> 
> -----Oorspronkelijk bericht-----
> Van: UMN MapServer Users List
> [mailto:MAPSERVER-USERS at LISTS.UMN.EDU]Namens Ricaille Tanguy
> Verzonden: maandag 6 februari 2006 13:31
> Aan: MAPSERVER-USERS at LISTS.UMN.EDU
> Onderwerp: [UMN_MAPSERVER-USERS] WFS using xml
> 
> 
> Hello,
> is it possible to get a feature description using POST with a xml file
like
> this:
> <wfs:GetFeature service="WFS" version="1.0.0" outputFormat="GML2"...
> xmlns=...
>     <wfs:Query typeName="featurename">
>         <ogc:Filter>
>             <ogc:BBOX>
>                 <ogc:PropertyName>....
>                 ...
> </wfs:GetFeature>
> Can i post it to http://localhost:8089/cgi-bin/mapserv, and get back
> description file in gml ?
> 
> I have a like application using geoserver, and i will try to use
> mapserver... I hope it is possible.
> Thank you.
> 
> 
> Disclaimer
> ************************************************************************
> Aan dit bericht kunnen geen rechten worden ontleend. Dit bericht is
> uitsluitend bestemd voor de geadresseerde. Als u dit bericht per abuis
> hebt ontvangen, wordt u verzocht het te vernietigen en de afzender te 
> informeren. Wij adviseren u om bij twijfel over de juistheid of de 
> volledigheid van de mail contact met afzender op te nemen.
> 
> This message shall not constitute any rights or obligations.
> This message is intended solely for the addressee.
> If you have received this message in error, please delete it and
> notify the sender immediately. When in doubt whether this message
> is correct or complete, please contact the sender.
> ************************************************************************



Disclaimer
************************************************************************
Aan dit bericht kunnen geen rechten worden ontleend. Dit bericht is
uitsluitend bestemd voor de geadresseerde. Als u dit bericht per abuis
hebt ontvangen, wordt u verzocht het te vernietigen en de afzender te 
informeren. Wij adviseren u om bij twijfel over de juistheid of de 
volledigheid van de mail contact met afzender op te nemen.

This message shall not constitute any rights or obligations.
This message is intended solely for the addressee.
If you have received this message in error, please delete it and
notify the sender immediately. When in doubt whether this message
is correct or complete, please contact the sender.
************************************************************************



More information about the mapserver-users mailing list