[Geoserver-devel] Can I write WFS requests from a HTML form?

I've been trying to test a geoserver WFS using a HTML form. I can get GET
requests to work, but I can't work out how to do POST requests.
I keep getting error messages like:

<ServiceExceptionReport version="1.2.0"
    xsi:schemaLocation="http://www.opengis.net/ogc
http://www.gisontheweb.com:8080/geoserver/data/capabilities/wfs/1.0.0/OGC-exception.xsd&quot;&gt;
  <ServiceException locator="org.vfny.geoserver.requests.XmlRequestReader">
      XML capabilities request parsing error:
      com.caucho.xml.XmlParseException: stream:1: XML file has no top-element.
      All well-formed XML files have a single top-level element.
  </ServiceException>
</ServiceExceptionReport>

<html>
  <body>
    <h2>Post GetCapabilities</h2>
    <form action="http://www.gisontheweb.com:8080/geoserver/GetCapabilities&quot;
method="post">
      <textarea cols="40" rows="5">
        &lt;?xml version="1.0" encoding="UTF-8"?&gt;
        &lt;GetCapabilities service="WFS"/&gt;
      </textarea>
      <input type="submit">
    </form>
  </body>
</html>

======

If I change the form action URL to
http://www.gisontheweb.com:8080/geoserver/wfs I get the error:
"No wfs kvp request recognized. The REQUEST parameter must be one of
GetFeature, GetFeatureWIthLock, DescribeFeatureType, LockFeature, or
Transaction."

Any ideas on what I'm doing wrong?

--
Cameron Shorter http://cameron.shorter.net
Open Source Developer http://generguide.sourceforge.net
                             http://mapbuilder.sourceforge.net
                             http://geotools.org
Senior Software Engineer http://www.adi-limited.com

Hi Cameron,

this is a common problem with HTML forms, not specific to Geoserver. HTML forms always put something in front of the XML that gets posted, something like XML= (I can't remember the exact string that is being put in front).

In my opinion it is better to test with e.g. Python test scripts.

Best regards.
Bart

On Mon, 24 Nov 2003 07:01:46 +1100, Cameron Shorter <cameron@anonymised.com> wrote:

I've been trying to test a geoserver WFS using a HTML form. I can get GET
requests to work, but I can't work out how to do POST requests.
I keep getting error messages like:

<ServiceExceptionReport version="1.2.0"
    xsi:schemaLocation="http://www.opengis.net/ogc
http://www.gisontheweb.com:8080/geoserver/data/capabilities/wfs/1.0.0/OGC-exception.xsd&quot;&gt;
  <ServiceException locator="org.vfny.geoserver.requests.XmlRequestReader">
      XML capabilities request parsing error:
      com.caucho.xml.XmlParseException: stream:1: XML file has no top-element.
      All well-formed XML files have a single top-level element.
  </ServiceException>
</ServiceExceptionReport>

<html>
  <body>
    <h2>Post GetCapabilities</h2>
    <form action="http://www.gisontheweb.com:8080/geoserver/GetCapabilities&quot;
method="post">
      <textarea cols="40" rows="5">
        &lt;?xml version="1.0" encoding="UTF-8"?&gt;
        &lt;GetCapabilities service="WFS"/&gt;
      </textarea>
      <input type="submit">
    </form>
  </body>
</html>

======

If I change the form action URL to
http://www.gisontheweb.com:8080/geoserver/wfs I get the error:
"No wfs kvp request recognized. The REQUEST parameter must be one of
GetFeature, GetFeatureWIthLock, DescribeFeatureType, LockFeature, or
Transaction."

Any ideas on what I'm doing wrong?

--
  

Cameron,

I've had a similar problem, but I think it is caused by the HTML-form.
When submitting the form, something is put in front of the values you
submit (e.g. the name of the form-element). I've build a simple jsp-page
to post XML-requests directly, using some taglib for HTTP-requests I
found on the internet. If you would like to, I can send you that page
tomorrow. (Monday).

Thijs Brentjens

-----Original Message-----
From: geoserver-devel-admin@lists.sourceforge.net
[mailto:geoserver-devel-admin@lists.sourceforge.net] On Behalf Of
Cameron Shorter
Sent: zondag 23 november 2003 21:02
To: geoserver-devel@lists.sourceforge.net
Subject: [Geoserver-devel] Can I write WFS requests from a HTML form?

I've been trying to test a geoserver WFS using a HTML form. I can get
GET
requests to work, but I can't work out how to do POST requests. I keep
getting error messages like:

<ServiceExceptionReport version="1.2.0"
    xsi:schemaLocation="http://www.opengis.net/ogc
http://www.gisontheweb.com:8080/geoserver/data/capabilities/wfs/1.0.0/OG
C-exception.xsd">
  <ServiceException
locator="org.vfny.geoserver.requests.XmlRequestReader">
      XML capabilities request parsing error:
      com.caucho.xml.XmlParseException: stream:1: XML file has no
top-element.
      All well-formed XML files have a single top-level element.
  </ServiceException>
</ServiceExceptionReport>

<html>
  <body>
    <h2>Post GetCapabilities</h2>
    <form
action="http://www.gisontheweb.com:8080/geoserver/GetCapabilities&quot;
method="post">
      <textarea cols="40" rows="5">
        &lt;?xml version="1.0" encoding="UTF-8"?&gt;
        &lt;GetCapabilities service="WFS"/&gt;
      </textarea>
      <input type="submit">
    </form>
  </body>
</html>

======

If I change the form action URL to
http://www.gisontheweb.com:8080/geoserver/wfs I get the error: "No wfs
kvp request recognized. The REQUEST parameter must be one of
GetFeature, GetFeatureWIthLock, DescribeFeatureType, LockFeature, or
Transaction."

Any ideas on what I'm doing wrong?

--
Cameron Shorter http://cameron.shorter.net
Open Source Developer http://generguide.sourceforge.net
                             http://mapbuilder.sourceforge.net
                             http://geotools.org
Senior Software Engineer http://www.adi-limited.com

-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program. Does
SourceForge.net help you be more productive? Does it help you create
better code? SHARE THE LOVE, and help us help YOU! Click Here:
http://sourceforge.net/donate/
_______________________________________________
Geoserver-devel mailing list Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Thanks Thijs,
Doug Cates has written a similar script which he has offered to send me.

Chris, if you like I can merge the best out of these 2 scripts and put them
into the Geoserver CVS repository.
It would be good there were a permanent WFS Tester form on the web that we
could all use as a resource. Has someone got a web server that they are
prepared to allow others use as a testing resource?

On Monday 24 Nov 2003 7:35 am, Thijs Brentjens wrote:

Cameron,

I've had a similar problem, but I think it is caused by the HTML-form.
When submitting the form, something is put in front of the values you
submit (e.g. the name of the form-element). I've build a simple jsp-page
to post XML-requests directly, using some taglib for HTTP-requests I
found on the internet. If you would like to, I can send you that page
tomorrow. (Monday).

Thijs Brentjens

-----Original Message-----
From: geoserver-devel-admin@lists.sourceforge.net
[mailto:geoserver-devel-admin@lists.sourceforge.net] On Behalf Of
Cameron Shorter
Sent: zondag 23 november 2003 21:02
To: geoserver-devel@lists.sourceforge.net
Subject: [Geoserver-devel] Can I write WFS requests from a HTML form?

I've been trying to test a geoserver WFS using a HTML form. I can get
GET
requests to work, but I can't work out how to do POST requests. I keep
getting error messages like:

<ServiceExceptionReport version="1.2.0"
    xsi:schemaLocation="http://www.opengis.net/ogc
http://www.gisontheweb.com:8080/geoserver/data/capabilities/wfs/1.0.0/OG
C-exception.xsd">
  <ServiceException
locator="org.vfny.geoserver.requests.XmlRequestReader">
      XML capabilities request parsing error:
      com.caucho.xml.XmlParseException: stream:1: XML file has no
top-element.
      All well-formed XML files have a single top-level element.
  </ServiceException>
</ServiceExceptionReport>

<html>
  <body>
    <h2>Post GetCapabilities</h2>
    <form
action="http://www.gisontheweb.com:8080/geoserver/GetCapabilities&quot;
method="post">
      <textarea cols="40" rows="5">
        &lt;?xml version="1.0" encoding="UTF-8"?&gt;
        &lt;GetCapabilities service="WFS"/&gt;
      </textarea>
      <input type="submit">
    </form>
  </body>
</html>

======

If I change the form action URL to
http://www.gisontheweb.com:8080/geoserver/wfs I get the error: "No wfs
kvp request recognized. The REQUEST parameter must be one of
GetFeature, GetFeatureWIthLock, DescribeFeatureType, LockFeature, or
Transaction."

Any ideas on what I'm doing wrong?

--
Cameron Shorter http://cameron.shorter.net
Open Source Developer http://generguide.sourceforge.net
                             http://mapbuilder.sourceforge.net
                             http://geotools.org
Senior Software Engineer http://www.adi-limited.com

Cameron Shorter wrote:

Thanks Thijs,
Doug Cates has written a similar script which he has offered to send me.

Chris, if you like I can merge the best out of these 2 scripts and put them into the Geoserver CVS repository.
It would be good there were a permanent WFS Tester form on the web that we could all use as a resource. Has someone got a web server that they are prepared to allow others use as a testing resource?

I think the latest GeoServer on the wms branch as just such a test Servlette, chris had me using it last week.

When we escape the wms-merge process it should be available to all.

Cameron: If you wanted to merge just the test servlette on to head you should be able to. May even be worth a dot release :slight_smile:

On my GeoServer this test servlette shows up as:

http://localhost:8080/geoserver/wfs/TestWfsPost

Hopefully that will help you track down what class to merge.

Jody

Cameron,

The servlet in the wms-merge is the same one that I sent you.

Doug

On Sun, 2003-11-23 at 13:38, Jody Garnett wrote:

Cameron Shorter wrote:

>Thanks Thijs,
>Doug Cates has written a similar script which he has offered to send me.
>
>Chris, if you like I can merge the best out of these 2 scripts and put them
>into the Geoserver CVS repository.
>It would be good there were a permanent WFS Tester form on the web that we
>could all use as a resource. Has someone got a web server that they are
>prepared to allow others use as a testing resource?
>
>
I think the latest GeoServer on the wms branch as just such a test
Servlette, chris had me using it last week.

When we escape the wms-merge process it should be available to all.

Cameron: If you wanted to merge just the test servlette on to head you
should be able to. May even be worth a dot release :slight_smile:

On my GeoServer this test servlette shows up as:

http://localhost:8080/geoserver/wfs/TestWfsPost

Hopefully that will help you track down what class to merge.

Jody

-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Cameron Shorter wrote:

>Thanks Thijs,
>Doug Cates has written a similar script which he has offered to send me.
>
>Chris, if you like I can merge the best out of these 2 scripts and put them
>into the Geoserver CVS repository.
>It would be good there were a permanent WFS Tester form on the web that we
>could all use as a resource. Has someone got a web server that they are
>prepared to allow others use as a testing resource?
>
>
I think the latest GeoServer on the wms branch as just such a test
Servlette, chris had me using it last week.

When we escape the wms-merge process it should be available to all.

Cameron: If you wanted to merge just the test servlette on to head you
should be able to. May even be worth a dot release :slight_smile:

I'd be happy to do a 1.0.2 on monday or tuesday, with the only change
being the addition of Doug's TestWfsPost servlet. As Jody said it's
already in wms-merge, so it'll be in the next big geoserver release. Or I
could just put it on the head branch, so it's in cvs to be checked out
without having to mess with wms-merge. It's definitely a useful little
piece of code.

  Chris

Would it be appropriate to create a WFS Test Form package which is seperate to
the Geoserver package?

The WFS Test Form package should be kept in the Geoserver CVS repository, and
stored on Sourceforge. However you should be able to download it seperately
to geoserver. Ie, you download wfsform-1.0.tar.gz

On Monday 24 Nov 2003 12:29 pm, Chris Holmes wrote:

> Cameron Shorter wrote:
> >Thanks Thijs,
> >Doug Cates has written a similar script which he has offered to send me.
> >
> >Chris, if you like I can merge the best out of these 2 scripts and put
> > them into the Geoserver CVS repository.
> >It would be good there were a permanent WFS Tester form on the web that
> > we could all use as a resource. Has someone got a web server that they
> > are prepared to allow others use as a testing resource?
>
> I think the latest GeoServer on the wms branch as just such a test
> Servlette, chris had me using it last week.
>
> When we escape the wms-merge process it should be available to all.
>
> Cameron: If you wanted to merge just the test servlette on to head you
> should be able to. May even be worth a dot release :slight_smile:

I'd be happy to do a 1.0.2 on monday or tuesday, with the only change
being the addition of Doug's TestWfsPost servlet. As Jody said it's
already in wms-merge, so it'll be in the next big geoserver release. Or I
could just put it on the head branch, so it's in cvs to be checked out
without having to mess with wms-merge. It's definitely a useful little
piece of code.

  Chris

--
Cameron Shorter http://cameron.shorter.net
Open Source Developer http://generguide.sourceforge.net
                             http://mapbuilder.sourceforge.net
                             http://geotools.org
Senior Software Engineer http://www.adi-limited.com