在 ServiceModel 客户端配置部分中,找不到引用协定“PmWs.PmWebServiceSoap”的默认终结点元素

摘要:
---˃System.InvalidOperationException:在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>

免责声明:文章转载自《在 ServiceModel 客户端配置部分中,找不到引用协定“PmWs.PmWebServiceSoap”的默认终结点元素》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇(转载)CSV 文件处理 PERLIDEA中Git更新合并代码后,本地修改丢失下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

随便看看

博科SAN交换机基本配置(华为SNS系列交换机为例OEM博科)

switchDomain:1             ##交换机域ID:0~31或1~23。switchWwn:10:00:88:94:88:92:c3:88    ##交换机WWN号zoning:OFF              ##当接入网关模式被禁用,激活分区的名称会显示在括号内。switchBeacon:OFF            ##交换机信标状...

mysql状态查看 QPS/TPS/缓存命中率查看

showglobalstatusslike'Com_ commit';showstatslike“无缓冲池读取%”;Thread_cache_Hits=(1-Thread_created/connections)*100%(8)锁定状态mysql&gt;showstatslike“Binlog_缓存%”;...

Java 安全之:csrf攻击总结

最近,我在维护一些旧项目。在调试期间,我发现请求被反复拒绝。我仔细查看了项目的源代码,发现存在csrftoken验证。我借此机会了解了csrf攻击,并将其总结成一篇论文。受攻击的网站无法阻止攻击。在整个过程中,攻击者无法获取受害者的登录凭据,只能“冒充”。CSRF攻击成功,因为服务器将攻击者发送的请求误认为是用户的请求。服务器通过验证请求是否携带正确的令牌来...

easyExcel自动合并单元格

importcom.alibaba.excel.write.handler.CellWriteHandler;importorg.apache.poi.ss.usermodel.Sheet;importorg.apache.poi.ss.util.CellRangeAddress;int[]mergeColumnIndex){this.mergeRowInd...

wxparse使用(富文本插件)

优点:唯一已知的可以将HTML转换为小程序识别的插件缺点:转换HTML标签可能需要大量的微信小程序标签和样式配置:步骤1,下载https://github.com/icindy/wxParse第二步:把它放到项目中。我选择页面目录。步骤3:配置wxml以添加:需要时使用:...

Docker(一)

Docker的优势:1.更高效的利用系统资源。docker-v:查看Docker版本。dockerhistory:查看镜像内的历史记录。dockerdiff:查看修改的内容。使用Dockerfile定制镜像:1.以之前定制nginx镜像为例,这次我们使用Dockerfile来定制。操作Docker容器:启动容器有两种方式:一种:是基于镜像新建一个容器并启动,...