Magne,
The TestWfsPost is pretty hacky, but it is actually pretty useful. What
might be better is to have the browser send an XMLHTTPRequest (AJAX)
request to the server. But:
1. You have to have a fairly modern-ish browser that has XMLHTTPRequest
2. Browser security means that the HTML page *must* come from the same
server as the where you are sending the XML to.
This is a wee bit limiting.
The basic problem is that the standard OGC services work like a normal
AJAX or SOP request. You send a normal HTTP request and stick the XML
document inside the body.
Unfortunately, there's no easy way to do this (except using the AJAX
XMLHTTPRequest) since normal <form>s (POST) stick other stuff in the
body of the request (like parameter separators).
When the TestWfsPost was created, it was just to mediate between the
HTML <form> POST and the 'pure' SOAP-like AJAX-XMLHTTPRequest
symantics.
What makes things a little more difficult, is that there are actually
two (actually 3) ways of making a WFS request to the server.
1. AJAX-like XML-in-body POST requests
2. GET request with &FILTER=... in the URL
3. (faking it) POST request, but exactly like the GET request.
To make things more complex the TestWfsPost form was written before any
of the WMS SLD-POST stuff was even thought of. So, the only way of
sending a request to the WMS was with GET.
So, the problems with TestWfsPost are 'for historical reasons'.
What would be great would be for *all* the servlets (and there are many
of them) to be able to tell the difference between an AJAX-POST (thats
what they're currently setup to handle), a HTML <form> POST (exactly
the same as the GET) and a HTML <form> POST with a single parameter
with the XML document in it.
I hope that all makes sense.
NOTE: the TestWfsPost bascially takes the "HTML <form> POST with a
single parameter with the XML document in it" and converts it into a
AJAX-like request.
Currently, there isnt a way (except with the TestWfsPost servlet) of
(easily) using HTML to make a proper 'POST' request to the WFS. (The
WMS has some support for this)
The OGC did not define a symantic for this -- they have a GET
(parameters in the URL) and a POST (AJAX style) symantic for requests.
The other two ways of making requests are not defined:
1. POST with parameters (ie. take a <form method=get> and change it to
<form method=post>)
2. POST with a parameter that contains an XML document
also:
3. GET with a parameter that contains an XML document (not really all
that useful).
dave
----------------------------------------------------------
This mail sent through IMP: https://webmail.limegroup.com/