[OpenLayers-Users] WFS request as a Post erros

Myeong Hun Jeong mhjeong74 at gmail.com
Wed Apr 29 03:33:57 EDT 2009


Dear list.

I am using openlayers2.7 and geoserver.

After loading WMS layer, I request WFS as a Post.



function wfsQuery()

    {

        data = "<?xml version='1.0' encoding='UTF-8' ?>" +

                "<wfs:GetFeature service='WFS' version='1.0.0' " +

                    "xmlns:topp='http://www.openplans.org/topp' " +

                    "xmlns:wfs='http://www.opengis.net/wfs' " +

                    "xmlns:ogc='http://www.opengis.net/ogc' " +

                    "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.xsd'> " +

                    "<wfs:Query typeName='topp:states'> " +

                        "<ogc:Filter> " +

                            "<ogc:PropertyIsEqualTo>" +


"<ogc:PropertyName>STATE_FIPS</ogc:PropertyName>"
+

                                "<ogc:Literal>48</ogc:Literal>" +

                            "</ogc:PropertyIsEqualTo>" +

                        "</ogc:Filter> " +

                        "</wfs:Query> " +

                "</wfs:GetFeature>";







        var responseObj = new OpenLayers.Ajax.Request("
http://localhost:8888/geoserver/wfs",

                {   method: 'post',

                     postBody: data,

                     onComplete: wfsResponse

                }

            );

    }

function wfsResponse(transport) {

gmlParser = new OpenLayers.Format.GML();

        features = gmlParser.read(transport.responseText);

         var styleMapSimple = new OpenLayers.StyleMap({

                strokeColor: "black",

                strokeWidth:1,

                fillColor: "orange",

                fillOpacity: 0.7,

            });



       var layerStyled = new OpenLayers.Layer.Vector("result", {styleMap:
styleMapSimple});

        layerStyled.addFeatures(features);

        map.addLayer(layerStyled);

    }



But, I encounter an error message.

The error message is that

<?xml version="1.0" encoding="UTF-8"?>

<ows:ExceptionReport version="1.0.0"

  xsi:schemaLocation="http://www.opengis.net/ows
http://localhost:8888/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 GET /geoserver/wfs HTTP/1.1

Cache-Control: no-cache&#xd;

Pragma: no-cache&#xd;

User-Agent: Java/1.5.0_12&#xd;

Host: localhost:8888&#xd;

Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2&#xd;

Connection: keep-alive&#xd;

&#xd;

</ows:ExceptionText>

  </ows:Exception>

</ows:ExceptionReport>



How to solve this error?



Best regards,

Myeonghun Jeong.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090429/4575ce88/attachment.html


More information about the Users mailing list