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,并用它提供的方法了。

【版权所有@ithuo】 【博客地址 http://www.cnblogs.com/ithuo】 可以转载,但请注明出处并保持博客超链接,有不正确的地方请不吝赐教,谢谢大家的帮助与支持!
原文地址:https://www.cnblogs.com/ithuo/p/4657829.html