WebService 错误:无法加载协定为xxx的终结点配置部分,因为找到了该协定的多个终结点配置
2015-07-10 15:42
507 查看
当在vs 2010中添加服务引用后,如果“更新”服务引用,或“删除”该服务引用后再次加入后,在运行时会出现此错误。这是因为在“更新/
删除”服务引用时,app.config文件并不会自动修改,在“更新”或再次“加入”后,会生成两个同样的“endpoint”,需要手工删除掉原有
的才能正常运行。
第一次加入后的app.config
<client>
<endpoint address="http://localhost/WSTest/TestDalWS.asmx" binding="basicHttpBinding"
bindingConfiguration="TestDalWSSoap6" contract="WSServer.TestDalWSSoap"
name="TestDalWSSoap6" />
</client>
对应的 <bing> 也只有一个。
<bindings>
<basicHttpBinding>
<binding name="TestDalWSSoap6" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="">
<extendedProtectionPolicy policyEnforcement="Never" />
</transport>
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
在“更新”或再次“加入”后,会生成两个同样的“endpoint”,需要手工删除掉原有的才能正常运行。
删除”服务引用时,app.config文件并不会自动修改,在“更新”或再次“加入”后,会生成两个同样的“endpoint”,需要手工删除掉原有
的才能正常运行。
第一次加入后的app.config
<client>
<endpoint address="http://localhost/WSTest/TestDalWS.asmx" binding="basicHttpBinding"
bindingConfiguration="TestDalWSSoap6" contract="WSServer.TestDalWSSoap"
name="TestDalWSSoap6" />
</client>
对应的 <bing> 也只有一个。
<bindings>
<basicHttpBinding>
<binding name="TestDalWSSoap6" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="">
<extendedProtectionPolicy policyEnforcement="Never" />
</transport>
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
在“更新”或再次“加入”后,会生成两个同样的“endpoint”,需要手工删除掉原有的才能正常运行。
相关文章推荐
- 云创网贷系统为互联网金融平台:保驾护航
- IOS - 购买信息请求
- 经过代码设置color 类型的selector
- 关于spring的roo shell不能正常使用的解决办法
- nodejs 操作mongodb插查删改
- Vim 配置(整合网上大神的内容)
- 【暑假训练 7.10】 codevs 2492 上帝造题的七分钟2
- 阶乘的递归实现和非递归实现
- oracle参数与启停
- 堆排序详解
- Floyd最短路径算法
- GRE写作必备句型
- iOS核心动画-5
- [Exercise 1] Linear Regression
- 分享一个PHP中文分词,一定要看(13亿人看完都感动了^_^!!!)
- Ubuntu14.04搭建安装svn服务器
- jsp页面使用 jstl,出现 Unknown tag (c:foreach)
- 车行贷款要把身份证原件给车行吗?
- C# const, readonly, static readonly
- 联网查看图片的Demo