向geoserver服务器发送请求

我们知道,向服务器发送请求有两种,一种是get,一种是Post
我这里总结的是,如何向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协议
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值