Asp.Net中WebServices的调用方式

  在web.config中这样配置要引用的WebServices

  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="VoteSoap" />
      </basicHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://localhost:1234/Vote.asmx" binding="basicHttpBinding"
        bindingConfiguration="VoteSoap" contract="Vote.VoteSoap" name="VoteSoap" />
    </client>
  </system.serviceModel>

     中间还有一些操作。。。

  然后在需要应用的类中引入命名空间,然后就可以调用这个webservices,并用它提供的方法了。

posted @ 2015-07-18 22:31  IT火  阅读(322)  评论(0编辑  收藏  举报