我们知道,向服务器发送请求有两种,一种是get,一种是Post
我这里总结的是,如何向geoserver服务器发送xml内容的请求
其他类型的请求,比如getfeature,transaction之类的请求格式,请参考ogc的wfs协议
我这里总结的是,如何向geoserver服务器发送xml内容的请求
<mx:HTTPService id="testpost" result="wfsResultHandler(event)" fault="wfsFaultHandler(event)">
private function OnPost(event:MouseEvent):void
{
testpost.url="http://localhost:9090/geoserver/wfs";
testpost.contentType="application/xml";
testpost.method="post";
var kkkk:XML=<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="states">
<ogc:Filter>
<ogc:BBOX>
<ogc:PropertyName>the_geom</ogc:PropertyName>
<gml:Box srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
<gml:coordinates>
-73.99312376470733,40.76203427979042 -73.9239210030026,40.80129519821393
</gml:coordinates>
</gml:Box>
</ogc:BBOX>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>;
testpost.send(kkkk);
}
其他类型的请求,比如getfeature,transaction之类的请求格式,请参考ogc的wfs协议