加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

WebService 错误:无法加载协定为xxx的终结点配置部分,因为找到

发布时间:2020-12-17 00:28:04 所属栏目:安全 来源:网络整理
导读:? ? 原因是在webconfig中包含多个 endpoint,绑定对应的节点或者删除不用的即能解决这个问题 WeatherWSSoapClient?wwc?=? new ?WeatherWSSoapClient( "WeatherWSSoap" )? configuration ? ???? system.web ? ???????? compilation ? debug = "true" ? targetF

?

?

原因是在webconfig中包含多个endpoint,绑定对应的节点或者删除不用的即能解决这个问题

 
 
  1. WeatherWSSoapClient?wwc?=?new?WeatherWSSoapClient("WeatherWSSoap")?
 
 
  1. <configuration>?
  2. ????<system.web>?
  3. ????????<compilation?debug="true"?targetFramework="4.0"?/>?
  4. ????</system.web>?
  5. ?
  6. ????<system.serviceModel>?
  7. ????????<bindings>?
  8. ????????????<basicHttpBinding>?
  9. ????????????????<binding?name="WeatherWSSoap"?closeTimeout="00:01:00"?openTimeout="00:01:00"?
  10. ????????????????????receiveTimeout="00:10:00"?sendTimeout="00:01:00"?allowCookies="false"?
  11. ????????????????????bypassProxyOnLocal="false"?hostNameComparisonMode="StrongWildcard"?
  12. ????????????????????maxBufferSize="65536"?maxBufferPoolSize="524288"?maxReceivedMessageSize="65536"?
  13. ????????????????????messageEncoding="Text"?textEncoding="utf-8"?transferMode="Buffered"?
  14. ????????????????????useDefaultWebProxy="true">?
  15. ????????????????????<readerQuotas?maxDepth="32"?maxStringContentLength="8192"?maxArrayLength="16384"?
  16. ????????????????????????maxBytesPerRead="4096"?maxNameTableCharCount="16384"?/>?
  17. ????????????????????<security?mode="None">?
  18. ????????????????????????<transport?clientCredentialType="None"?proxyCredentialType="None"?
  19. ????????????????????????????realm=""?/>?
  20. ????????????????????????<message?clientCredentialType="UserName"?algorithmSuite="Default"?/>?
  21. ????????????????????</security>?
  22. ????????????????</binding>?
  23. ????????????</basicHttpBinding>?
  24. ????????????<customBinding>?
  25. ????????????????<binding?name="WeatherWSSoap12">?
  26. ????????????????????<textMessageEncoding?maxReadPoolSize="64"?maxWritePoolSize="16"?
  27. ????????????????????????messageVersion="Soap12"?writeEncoding="utf-8">?
  28. ????????????????????????<readerQuotas?maxDepth="32"?maxStringContentLength="8192"?maxArrayLength="16384"?
  29. ????????????????????????????maxBytesPerRead="4096"?maxNameTableCharCount="16384"?/>?
  30. ????????????????????</textMessageEncoding>?
  31. ????????????????????<httpTransport?manualAddressing="false"?maxBufferPoolSize="524288"?
  32. ????????????????????????maxReceivedMessageSize="65536"?allowCookies="false"?authenticationScheme="Anonymous"?
  33. ????????????????????????bypassProxyOnLocal="false"?decompressionEnabled="true"?hostNameComparisonMode="StrongWildcard"?
  34. ????????????????????????keepAliveEnabled="true"?maxBufferSize="65536"?proxyAuthenticationScheme="Anonymous"?
  35. ????????????????????????realm=""?transferMode="Buffered"?unsafeConnectionNtlmAuthentication="false"?
  36. ????????????????????????useDefaultWebProxy="true"?/>?
  37. ????????????????</binding>?
  38. ????????????</customBinding>?
  39. ????????</bindings>?
  40. ????????<client>?
  41. ????????????<endpoint?address="http://webservice.webxml.com.cn/WebServices/WeatherWS.asmx"?
  42. ????????????????binding="basicHttpBinding"?bindingConfiguration="WeatherWSSoap"?
  43. ????????????????contract="ServiceReference1.WeatherWSSoap"?name="WeatherWSSoap"?/>?
  44. ????????????<endpoint?address="http://webservice.webxml.com.cn/WebServices/WeatherWS.asmx"?
  45. ????????????????binding="customBinding"?bindingConfiguration="WeatherWSSoap12"?
  46. ????????????????contract="ServiceReference1.WeatherWSSoap"?name="WeatherWSSoap12"?/>?
  47. ????????</client>?
  48. ????</system.serviceModel>?
  49. </configuration>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读