asp.net下使用get方式调用webservice

webservice(web服务)能够让各个独立的web服务站点共享资源,使各个独立的应用程序集成起来,好处就不用多说了。asp.net中调用webservice有三种方式,既使用代理类,post和get方式。默认的是使用post方式。但有时候我们也需要web服务支持get方式。只需要在web.config文件中webservice节中这样配置:

<webServices>
      <protocols>
        <add   name= "HttpSoap"/>
        <add   name= "HttpPost"/>
        <add   name= "HttpGet"/>
        <add   name= "HttpPostLocalhost"/>
        <add   name= "Documentation"/>
      </protocols>
    </webServices>

这样就可以直接在浏览器地址栏中输入地址方法名参数的方式来调用了。

posted @ 2012-03-14 23:48  Dylan.Du  阅读(334)  评论(0)    收藏  举报