緣由是在web.config 文件中屢次引用了「添加外部引用」web
<system.serviceModel> <bindings> <basicHttpBinding> <binding name="WebServiceSoap" /> <binding name="WebServiceSoap1" /> </basicHttpBinding> </bindings> <client> <endpoint address="http://localhost:8054/WebService.asmx" binding="basicHttpBinding" bindingConfiguration="WebServiceSoap" contract="ServiceReference.WebServiceSoap" name="WebServiceSoap" /> <endpoint address="http://localhost:8054/WebService.asmx" binding="basicHttpBinding" bindingConfiguration="WebServiceSoap1" contract="ServiceReference.WebServiceSoap" name="WebServiceSoap1" /> </client> </system.serviceModel>
因此刪掉一個節點既可(如查引用的是WebServiceSoap,刪掉WebServiceSoap1的有關節點,反之~)spa
也能夠在頁面引用的時候指定bindingConfiguration名字:code
如:ServiceReference.WebServiceSoap web = new WebServiceSoapClient("WebServiceSoap");blog