Mapguide的Http登录

  客户端访问Mapguide,有两种方式:

      第一种方式:   每次请求都发送用户名密码:例如 请求瓦片尺寸:

GET /mapguide/mapagent/mapagent.fcgi?OPERATION=GETDEFAULTTILESIZEY&VERSION=1.0.0&CLIENTAGENT=MapGuide&LOCALE=en 

Accept: text/html, application/xhtml+xml, */*
Accept-Language: zh-CN
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)
Accept-Encoding: gzip, deflate
Host: 192.168.205.145
Connection: Keep-Alive
Authorization: Basic QWRtaW5pc3RyYXRvcjphZG1pbg==   //base64加密的用户名和密码

第二种方式:分两步。

 1.用用户名和密码获得一个Session。发送如下信息后,会返回一个字符串Session.

GET /mapguide/mapagent/mapagent.fcgi?OPERATION=CREATESESSION&VERSION=1.0.0&FORMAT=text%2fxml&CLIENTAGENT=MapGuide&LOCALE=en 
Accept: text/html, application/xhtml+xml, */*
Accept-Language: zh-CN
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)
Accept-Encoding: gzip, deflate
Host: 192.168.205.145
Connection: Keep-Alive
Authorization: Basic QWRtaW5pc3RyYXRvcjphZG1pbg==

 2.以后每次请求用该Session做参数:

 GET /mapguide/mapagent/mapagent.fcgi?OPERATION=GETFEATUREPROVIDERS&SESSION=上一步返回的字符串&VERSION=1.0.0&LOCALE=en&CLIENTAGENT=MapGuide   

 

使用http,将数据get,就可以和Mapguide 实现通信。

    

posted @ 2012-12-04 17:16  烟影  阅读(260)  评论(0编辑  收藏  举报