zoukankan      html  css  js  c++  java
  • 在 ServiceModel 客户端配置部分中,找不到引用协定“PmWs.PmWebServiceSoap”的默认终结点元素

    System.Exception: ConfigManager.LoadConfigurationFromDb
    ServiceFactory.GetPmWebService
    在 ServiceModel 客户端配置部分中,找不到引用协定“PmWs.PmWebServiceSoap”的默认终结点元素。这可能是因为未找到应用程序的配置文件,或者是因为客户端元素中找不到与此协定匹配的终结点元素。 ---> System.Exception: ServiceFactory.GetPmWebService
    在 ServiceModel 客户端配置部分中,找不到引用协定“PmWs.PmWebServiceSoap”的默认终结点元素。这可能是因为未找到应用程序的配置文件,或者是因为客户端元素中找不到与此协定匹配的终结点元素。 ---> System.InvalidOperationException: 在 ServiceModel 客户端配置部分中,找不到引用协定“PmWs.PmWebServiceSoap”的默认终结点元素。这可能是因为未找到应用程序的配置文件,或者是因为客户端元素中找不到与此协定匹配的终结点元素。
       在 System.ServiceModel.Description.ConfigLoader.LoadChannelBehaviors(ServiceEndpoint serviceEndpoint, String configurationName)
       在 System.ServiceModel.ChannelFactory.ApplyConfiguration(String configurationName, Configuration configuration)
       在 System.ServiceModel.ChannelFactory.ApplyConfiguration(String configurationName)
       在 System.ServiceModel.ChannelFactory.InitializeEndpoint(String configurationName, EndpointAddress address)
       在 System.ServiceModel.ChannelFactory`1..ctor(String endpointConfigurationName, EndpointAddress remoteAddress)
       在 System.ServiceModel.ConfigurationEndpointTrait`1.CreateSimplexFactory()
       在 System.ServiceModel.ConfigurationEndpointTrait`1.CreateChannelFactory()
       在 System.ServiceModel.ClientBase`1.CreateChannelFactoryRef(EndpointTrait`1 endpointTrait)
       在 System.ServiceModel.ClientBase`1.InitializeChannelFactoryRef()
       在 System.ServiceModel.ClientBase`1..ctor()
       在 PmLib.PmWs.PmWebServiceSoapClient..ctor()
       在 PmLib.Business.ServiceFactory.GetPmWebService()
       --- 内部异常堆栈跟踪的结尾 ---
       在 PmLib.Business.ServiceFactory.GetPmWebService()
       在 PmLib.Business.DataManager..ctor()
       在 PmLib.Business.ConfigManager.LoadConfigurationFromDb(String MacAddress)
       --- 内部异常堆栈跟踪的结尾 ---
       在 PmLib.Business.ConfigManager.LoadConfigurationFromDb(String MacAddress)
       在 PmWebService.GetExistList(String mac) 位置 e:work\WebDevxwx_szrcbCenterWebPageseMBSApp_CodePmWebService.cs:行号 211

    错误如上,解决方式很简单。在 web.config ServiceModel 文件加入 Soap 协议  

      <system.serviceModel>
        <bindings>
          <basicHttpBinding>
            <binding name="KioskServiceSoap" />
            <binding name="TaskSoap" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
              <readerQuotas maxDepth="32" maxStringContentLength="2147483647"
                maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
            </binding>
            <binding name="Service1Soap" />
            <binding name="ImageServiceSoap" maxBufferPoolSize="2147483647"
              maxReceivedMessageSize="2147483647">
              <readerQuotas maxDepth="32" maxStringContentLength="2147483647"
                maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
            </binding>
            <binding name="PmWebServiceSoap" maxBufferPoolSize="2147483647"
              maxReceivedMessageSize="2147483647">
              <readerQuotas maxDepth="32" maxStringContentLength="2147483647"
                maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
            </binding>
          </basicHttpBinding>
        </bindings>
        <client>
          <endpoint address="http://192.168.1.231/WebKioskService/KioskService.asmx"
            binding="basicHttpBinding" bindingConfiguration="KioskServiceSoap"
            contract="refCenterKioskService.KioskServiceSoap" name="KioskServiceSoap" />
          <endpoint address="http://105.1.1.142/FDSService/Task.asmx" binding="basicHttpBinding"
            bindingConfiguration="TaskSoap" contract="ClientTask.TaskSoap"
            name="TaskSoap" />
          <endpoint address="http://105.1.1.142/advance/Service1.asmx"
            binding="basicHttpBinding" bindingConfiguration="Service1Soap"
            contract="ClientService1.Service1Soap" name="Service1Soap" />
          <endpoint address="http://105.1.1.142/FDSService/ImageService.asmx"
            binding="basicHttpBinding" bindingConfiguration="ImageServiceSoap"
            contract="CallClient_ImageService.ImageServiceSoap" name="ImageServiceSoap" />
          <endpoint address="http://192.168.1.231/PmWebService.asmx" binding="basicHttpBinding"
            bindingConfiguration="PmWebServiceSoap" contract="PmWs.PmWebServiceSoap"
            name="PmWebServiceSoap" />
        </client>
      </system.serviceModel>
  • 相关阅读:
    动态规划(DP),模拟
    递推,动态规划(DP),字符串处理,最佳加法表达式
    递归,动态规划,找最短路径,Help Jimmy
    动规,模拟,递推,最长公共子序列
    递归,递推,记忆化搜索,空间优化(数字三角形)
    递归,记忆化搜索,(棋盘分割)
    递归,搜索,回溯,最优路径(线段)
    web前端开发初学者必看的学习路线(附思维导图)
    一位资深程序员大牛给予Java初学者的学习路线建议
    假如时光倒流,我会这么学习Java
  • 原文地址:https://www.cnblogs.com/byvar/p/4717207.html
Copyright © 2011-2022 走看看