Jukka,

Thabks for your response. That didn't help, but don't worry I finally found the 
solution. The problem was that my PHP proxy didn't set any header, so I added 
the following line 

curl_setopt($ch, CURLOPT_HTTPHEADER,array('Content-Type: text/xml; 
charset=utf-8', 'Content-Type: application/xml; charset=utf-8')); 

And it worked perfectly.

Thanks.
 
 
Un saludo,
 
··················································································

David Alda Fernández de Lezea
Lurralde eta Biodibertsitate Saila / Dpto. de Territorio y Biodiversidad
 
IKT
Granja Modelo s/n · 01192 · Arkaute (Araba)

··················································································
Tlfnos.: 945-00-32-95                         Fax: 945-00.32.90
··················································································
email: [email protected]                                web: www.ikt.es
··················································································

-----Mensaje original-----
De: Rahkonen Jukka [mailto:[email protected]] 
Enviado el: miércoles, 13 de octubre de 2010 16:57
Para: David Alda Fernandez de Lezea; [email protected]
Asunto: Re: [Geoserver-users] Perform getfeature request through GeoServerusing 
POST method

Hi,
 
WFS 1.0.0 is using GML2.  I would change either the version or the outputformat 
first and see it that helps.
 
-Jukka Rahkonen-

________________________________

Lähettäjä: David Alda Fernandez de Lezea [mailto:[email protected]]
Lähetetty: ke 13.10.2010 16:43
Vastaanottaja: [email protected]
Aihe: [Geoserver-users] Perform getfeature request through GeoServerusing POST 
method




Hi list,

I'm a bit newbie in GeoServer, so forgive me if this is something stupid. I 
want from an OpenLayers based web application to ask for some features of a 
layer served via GeoServer. I'm using a filter and I need to do it using POST 
method. I've got my porxy script made in PHP that works fine, but when I make 
the request I get the following message from GeoServer:

<?xml version="1.0" encoding="UTF-8"?>
<ows:ExceptionReport version="1.0.0"
  xsi:schemaLocation="http://www.opengis.net/ows 
http://192.168.1.38:8080/geoserver/schemas/ows/1.0.0/owsExceptionReport.xsd";
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:ows="http://www.opengis.net/ows";>
  <ows:Exception exceptionCode="MissingParameterValue" locator="request">
    <ows:ExceptionText>Could not determine geoserver request from http request 
POST /geoserver/wfs? HTTP/1.1
Host: 192.168.1.38:8080&#xd;
Accept: */*&#xd;
Content-Length: 837&#xd;
Content-Type: application/x-www-form-urlencoded&#xd;
&#xd;
</ows:ExceptionText>
  </ows:Exception>
</ows:ExceptionReport>

My POST data is:

<wfs:GetFeature service="WFS" version="1.0.0" outputFormat="GML3" 
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="Municipios"> 
<Filter><Or><And><PropertyIsEqualTo><PropertyName>PROVINCIA</PropertyName><Literal>1</Literal></PropertyIsEqualTo><PropertyIsEqualTo><PropertyName>MUNICIPIO</PropertyName><Literal>1</Literal></PropertyIsEqualTo></And><And><PropertyIsEqualTo><PropertyName>PROVINCIA</PropertyName><Literal>1</Literal></PropertyIsEqualTo><PropertyIsEqualTo><PropertyName>MUNICIPIO</PropertyName><Literal>2</Literal></PropertyIsEqualTo></And></Or></Filter>
  </wfs:Query></wfs:GetFeature>

It seems that GeoServer is waiting from another parameter in the URL which 
would be request to execute, but it's defined in the XML parameter.

My JavaScript code:

var theUrl = networkSettings.proxyURL + "method=POST&url=" + 
this.onlineResource + "&data=" + filtro;
        //06-10-2010
        var myAjax = new OpenLayers.Ajax.Request(
        theUrl,
        {
                        method: 'post',
                        contentType:  'application/xml',
                        postBody: filtro,
                        onComplete: callbackFunction,
                        onFailure: function(){alert("Error petición AJAX.");}
        });

I can see the data in the proxy.

Am I doing something wrong??

Thanks in advance.

Un saludo,

··················································································

David Alda Fernández de Lezea
Lurralde eta Biodibertsitate Saila / Dpto. de Territorio y Biodiversidad

IKT
Granja Modelo s/n · 01192 · Arkaute (Araba)

··················································································
Tlfnos.: 945-00-32-95                         Fax: 945-00.32.90
··················································································
email: [email protected]                                web: www.ikt.es
··················································································

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports standards for 
HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great 
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users



------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to