geoserverサーバに要求を送信します。

1791 ワード

私達は知っています。サーバーに要求を送るには2つの種類があります。一つは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);
   }
他のタイプの要求、例えばget feat ture、transactionなどの要求フォーマットは、ogcのwfsプロトコルを参照してください。