原因是在web.config 文件中多次引用了“添加外部引用”

 <system.serviceModel>
  <bindings>
   <basicHttpBinding>
    <binding name="WebServiceSoap" />
    <binding name="WebServiceSoap1" />
   </basicHttpBinding>
  </bindings>
  <client>
   <endpoint address="http://10.29.68.32/WebService.asmx" binding="basicHttpBinding"
    bindingConfiguration="WebServiceSoap" contract="ServiceReference.WebServiceSoap"
    name="WebServiceSoap" />
   <endpoint address="http://10.29.68.32/WebService.asmx" binding="basicHttpBinding"
    bindingConfiguration="WebServiceSoap1" contract="ServiceReference.WebServiceSoap"
    name="WebServiceSoap1" />
  </client>
 </system.serviceModel> 

 

所以删掉一个节点既可(如查引用的是WebServiceSoap,删掉WebServiceSoap1的有关节点,反之~)

也可以在页面引用的时候指定bindingConfiguration名字:

如:ServiceReference.WebServiceSoap web = new WebServiceSoapClient("WebServiceSoap");

 

posted on 2013-07-17 14:06  bin790302901  阅读(3709)  评论(0编辑  收藏  举报