problems on method "POST"

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

problems on method "POST"

Alberto Kunze

Hi
I am using Geoserver 1.3 RC4 and Tomcat 5. I created a project with a html file and place a getMap instruction like this:

<html>
  <head>
    <title>test.html</title>
  </head>
  <body>
   <FORM method="POST" action= " http://127.0.0.1:8080/geoserver/wms/GetMap">
     <INPUT type='text' name='bbox' value='-130,24,-66,50'>
     <INPUT type='text' name='styles' value='population'>
     <INPUT type='text' name='Format' value='image%2Fpng'>
     <INPUT type='text' name='request' value='GetMap'>
     <INPUT type='text' name='layers' value='states'>
     <INPUT type='text' name='width' value='550'>
     <INPUT type='text' name='height' value='250'>
     <INPUT type='text' name='srs' value='EPSG%3A4326'>
     <INPUT type='submit' value='Load Map'>
   </FORM>
  </body>
</html>

Than, I receive this message from TOMCAT/GEOSERVER:

[Fatal Error] :1:1: Content is not allowed in prolog.
org.vfny.geoserver.wms.WmsException: line 1 column 1 -- Content is not allowed in prolog.
 at org.vfny.geoserver.wms.requests.GetMapXmlReader.read(GetMapXmlReader.java :117)
 at org.vfny.geoserver.wms.servlets.GetMap.doPost(GetMap.java:60)
 ......
 ......

So, if I change method="POST" to method="GET" in the FORM tag, it's works.... But i want to use HTTP-POST because using long requests with long text on html.... What I'm doing wrong ?????

thanks in advance

Reply | Threaded
Open this post in threaded view
|

Re: problems on method "POST"

alexander-petkov
I believe you need to have one input field of type text, with an
SLD-POST request as a value (see 2nd example):

http://docs.codehaus.org/display/GEOSDOC/SLD+Snippets

This document by D. Blasby will also help:
http://docs.codehaus.org/display/GEOSDOC/InLineFeature+Usage

Alex

On 1/10/06, Alberto Kunze <[hidden email]> wrote:

>
>
> Hi
> I am using Geoserver 1.3 RC4 and Tomcat 5. I created a project with a html
> file and place a getMap instruction like this:
>
> <html>
>   <head>
>     <title>test.html</title>
>   </head>
>   <body>
>    <FORM method="POST" action= "
> http://127.0.0.1:8080/geoserver/wms/GetMap">
>      <INPUT type='text' name='bbox' value='-130,24,-66,50'>
>      <INPUT type='text' name='styles' value='population'>
>      <INPUT type='text' name='Format' value='image%2Fpng'>
>      <INPUT type='text' name='request' value='GetMap'>
>      <INPUT type='text' name='layers' value='states'>
>      <INPUT type='text' name='width' value='550'>
>      <INPUT type='text' name='height' value='250'>
>      <INPUT type='text' name='srs' value='EPSG%3A4326'>
>      <INPUT type='submit' value='Load Map'>
>    </FORM>
>   </body>
> </html>
>
> Than, I receive this message from TOMCAT/GEOSERVER:
>
> [Fatal Error] :1:1: Content is not allowed in prolog.
> org.vfny.geoserver.wms.WmsException: line 1 column 1 --
> Content is not allowed in prolog.
>  at
> org.vfny.geoserver.wms.requests.GetMapXmlReader.read(GetMapXmlReader.java
> :117)
>  at
> org.vfny.geoserver.wms.servlets.GetMap.doPost(GetMap.java:60)
>  ......
>  ......
>
> So, if I change method="POST" to method="GET" in the FORM tag, it's
> works.... But i want to use HTTP-POST because using long requests with long
> text on html.... What I'm doing wrong ?????
>
> thanks in advance
>
N�HY޵隊X���'���u���[�������
ަ�k��!���W�~�鮆�zk��C� 塧m����@^ǚ��^��z�Z�f�z�j�!�x2�������ɫ,��� a{� �,�H��4�m���i�(��ܢo�v'��jYhr'ׯ:�rX��g����z��z�&j)b� b�ў�ǫ�����+-��.�ǟ����a��l��b��,���y�+��޷�b��?�+-�w������z��z�
Reply | Threaded
Open this post in threaded view
|

Re: problems on method "POST"

Brent Owens
In reply to this post by Alberto Kunze
I don't think Geoserver can disect a a POST request like that. For
example, a proper POST getMap request to Geoserver would look like this:
URL: http://localhost:8080/geoserver/wfs
request body:
<wfs:GetFeature service="WFS" version="1.0.0"
  outputFormat="GML2"
  xmlns:topp="http://www.openplans.org/topp"
  xmlns:wfs="http://www.opengis.net/wfs"
  xmlns:ogc="http://www.opengis.net/ogc"
  xmlns:gml="http://www.opengis.net/gml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.opengis.net/wfs
                      http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd">
  <wfs:Query typeName="topp:states">
    <wfs:PropertyName>topp:STATE_NAME</wfs:PropertyName>
    <wfs:PropertyName>topp:PERSONS</wfs:PropertyName>
    <ogc:Filter>
      <ogc:BBOX>
        <ogc:PropertyName>the_geom</ogc:PropertyName>
        <gml:Box srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
           <gml:coordinates>-75.102613,40.212597
-72.361859,41.512517</gml:coordinates>
        </gml:Box>
      </ogc:BBOX>
   </ogc:Filter>
  </wfs:Query>
</wfs:GetFeature>

You will have to build the query yourself using the input from the form.
The request demos page that comes with GeoServer demonstrates several
post methods. Just navigate from the GeoServer start page to Demo ->
Demo Request

Brent Owens
(The Open Planning Project)



Alberto Kunze wrote:

> Hi
> I am using Geoserver 1.3 RC4 and Tomcat 5. I created a project with a
> html file and place a getMap instruction like this:
>
> <html>
>   <head>
>     <title>test.html</title>
>   </head>
>   <body>
>    <FORM method="POST" action= "
> http://127.0.0.1:8080/geoserver/wms/GetMap">
>      <INPUT type='text' name='bbox' value='-130,24,-66,50'>
>      <INPUT type='text' name='styles' value='population'>
>      <INPUT type='text' name='Format' value='image%2Fpng'>
>      <INPUT type='text' name='request' value='GetMap'>
>      <INPUT type='text' name='layers' value='states'>
>      <INPUT type='text' name='width' value='550'>
>      <INPUT type='text' name='height' value='250'>
>      <INPUT type='text' name='srs' value='EPSG%3A4326'>
>      <INPUT type='submit' value='Load Map'>
>    </FORM>
>   </body>
> </html>
>
> Than, I receive this message from TOMCAT/GEOSERVER:
>
> [Fatal Error] :1:1: Content is not allowed in prolog.
> org.vfny.geoserver.wms.WmsException: line 1 column 1 -- Content is not
> allowed in prolog.
>  at
> org.vfny.geoserver.wms.requests.GetMapXmlReader.read(GetMapXmlReader.java
> :117)
>  at org.vfny.geoserver.wms.servlets.GetMap.doPost(GetMap.java:60)
>  ......
>  ......
>
> So, if I change method="POST" to method="GET" in the FORM tag, it's
> works.... But i want to use HTTP-POST because using long requests with
> long text on html.... What I'm doing wrong ?????
>
> thanks in advance
>


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: problems on method "POST"

Justin Deoliveira-3
In reply to this post by alexander-petkov
Hi Alberto,

Magne fixed form based post for GetMap requests post RC4. You may want
to download the lastest and greatest geoserver and try it again.

-Justin

Alexander Petkov wrote:

> I believe you need to have one input field of type text, with an
> SLD-POST request as a value (see 2nd example):
>
> http://docs.codehaus.org/display/GEOSDOC/SLD+Snippets
>
> This document by D. Blasby will also help:
> http://docs.codehaus.org/display/GEOSDOC/InLineFeature+Usage
>
> Alex
>
> On 1/10/06, Alberto Kunze <[hidden email]> wrote:
>
>>
>>Hi
>>I am using Geoserver 1.3 RC4 and Tomcat 5. I created a project with a html
>>file and place a getMap instruction like this:
>>
>><html>
>>  <head>
>>    <title>test.html</title>
>>  </head>
>>  <body>
>>   <FORM method="POST" action= "
>>http://127.0.0.1:8080/geoserver/wms/GetMap">
>>     <INPUT type='text' name='bbox' value='-130,24,-66,50'>
>>     <INPUT type='text' name='styles' value='population'>
>>     <INPUT type='text' name='Format' value='image%2Fpng'>
>>     <INPUT type='text' name='request' value='GetMap'>
>>     <INPUT type='text' name='layers' value='states'>
>>     <INPUT type='text' name='width' value='550'>
>>     <INPUT type='text' name='height' value='250'>
>>     <INPUT type='text' name='srs' value='EPSG%3A4326'>
>>     <INPUT type='submit' value='Load Map'>
>>   </FORM>
>>  </body>
>></html>
>>
>>Than, I receive this message from TOMCAT/GEOSERVER:
>>
>>[Fatal Error] :1:1: Content is not allowed in prolog.
>>org.vfny.geoserver.wms.WmsException: line 1 column 1 --
>>Content is not allowed in prolog.
>> at
>>org.vfny.geoserver.wms.requests.GetMapXmlReader.read(GetMapXmlReader.java
>>:117)
>> at
>>org.vfny.geoserver.wms.servlets.GetMap.doPost(GetMap.java:60)
>> ......
>> ......
>>
>>So, if I change method="POST" to method="GET" in the FORM tag, it's
>>works.... But i want to use HTTP-POST because using long requests with long
>>text on html.... What I'm doing wrong ?????
>>
>>thanks in advance
>>
>
> N�HY޵隊X���'���u���[�������
> ަ�k��!���W�~�鮆�zk��C� 塧m����@^ǚ��^��z�Z�f�z�j�!�x2�������ɫ,��� a{� �,�H��4�m���i�(��ܢo�v'��jYhr'ׯ:�rX��g����z��z�&j)b� b�ў�ǫ�����+-��.�ǟ����a��l��b��,���y�+��޷�b��?�+-�w������z��ers=


--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users