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

   <system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="testWebServiceSoap" />
</basicHttpBinding>
<customBinding>
<binding name="testWebServiceSoap12">
<textMessageEncoding messageVersion="Soap12" />
<httpTransport />
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="http://localhost:3360/WebServices/testWebService.asmx"
binding="basicHttpBinding" bindingConfiguration="testWebServiceSoap"
contract="ServiceReference1.testWebServiceSoap" name="testWebServiceSoap" />
<endpoint address="http://localhost:3360/WebServices/testWebService.asmx"
binding="customBinding" bindingConfiguration="testWebServiceSoap12"
contract="ServiceReference1.testWebServiceSoap" name="testWebServiceSoap12" />
</client>
</system.serviceModel> 导致的原因是多了一段,删除这里即可:
       <endpoint address="http://localhost:3360/WebServices/testWebService.asmx"
binding="customBinding" bindingConfiguration="testWebServiceSoap12"
contract="ServiceReference1.testWebServiceSoap" name="testWebServiceSoap12" />



上一篇:noj [1482] 嘛~付钱吧!(完全背包)


下一篇:李洪强iOS开发本人集成环信的经验总结_02_基本配置