首页 > 其他 > 详细

System.InvalidOperationException: 无法加载协定为“ServiceReference1.XXXXXXXXXXXXXXXX”的终结点配置部分,因为找到了该协定的多个终结点配置。请按名称指示首选的终结点配置部分。

时间:2015-11-13 10:04:00      阅读:2126      评论:0      收藏:0      [点我收藏+]
 1   <system.serviceModel>
 2     <bindings>
 3       <basicHttpBinding>
 4         <binding name="testWebServiceSoap" />
 5       </basicHttpBinding>
 6       <customBinding>
 7         <binding name="testWebServiceSoap12">
 8           <textMessageEncoding messageVersion="Soap12" />
 9           <httpTransport />
10         </binding>
11       </customBinding>
12     </bindings>
13     <client>
14       <endpoint address="http://localhost:3360/WebServices/testWebService.asmx"
15           binding="basicHttpBinding" bindingConfiguration="testWebServiceSoap"
16           contract="ServiceReference1.testWebServiceSoap" name="testWebServiceSoap" />
17       <endpoint address="http://localhost:3360/WebServices/testWebService.asmx"
18           binding="customBinding" bindingConfiguration="testWebServiceSoap12"
19           contract="ServiceReference1.testWebServiceSoap" name="testWebServiceSoap12" />
20     </client>
21   </system.serviceModel>

导致的原因是多了一段,删除这里即可:
1       <endpoint address="http://localhost:3360/WebServices/testWebService.asmx"
2           binding="customBinding" bindingConfiguration="testWebServiceSoap12"
3           contract="ServiceReference1.testWebServiceSoap" name="testWebServiceSoap12" />

 



 

System.InvalidOperationException: 无法加载协定为“ServiceReference1.XXXXXXXXXXXXXXXX”的终结点配置部分,因为找到了该协定的多个终结点配置。请按名称指示首选的终结点配置部分。

原文:http://www.cnblogs.com/chao2014/p/4961240.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!