• 在 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>
  • 相关阅读:
    轻、快、好、免费的开发工具
    通过改进算法来优化程序性能的真实案例(Ransac)
    图像变形算法:实现Photoshop液化工具箱中向前变形工具
    用Helper对类的行为进行修饰以便复用(附:外三篇)
    桌边书
    高音+海豚音收藏
    Silverlight Framework没有得Enum.GetValues方法
    mysql安装出现error Nr.1045
    只有mdf文件而没有ldf文件修复方法
    js鼠标样式
  • 原文地址:https://www.cnblogs.com/byvar/p/4717207.html
Copyright © 2020-2023  润新知