【问题标题】:Https wcf webservice ErrorHttps wcf webservice 错误
【发布时间】:2016-03-17 18:15:45
【问题描述】:
<?xml version="1.0"?>
<configuration>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="serviceBehavior">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
<endpointBehaviors>
<behavior name="webHttp">
  <webHttp />
 </behavior>
 <behavior name="webHttpBehavior">
 <webHttp />
 </behavior></endpointBehaviors>
     </behaviors>
  <services>
  <service name="Implementation.Service" behaviorConfiguration="serviceBehavior">
  <endpoint address="" binding="basicHttpBinding"   contract="Contract.IService" behaviorConfiguration="web"    bindingConfiguration="basicHttpBinding"></endpoint>
 <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>
  </services>
  <bindings>
  <basicHttpBinding>
   <binding name="CodeItSoap" closeTimeout="00:01:00">
   <security mode="Transport">
   <transport clientCredentialType="Basic" proxyCredentialType ="Basic"  realm =" "/>
 <message clientCredentialType= "username" algorithm ="default">
  </security>
 </binding>
 </basicHttpBinding>
 </bindings>
  <client>
 <endpoint address="https://******.****-***/*****_*****?SOAP"
  binding="basicHttpBinding" bindingConfiguration="CodeItSoap"
 contract="Service.CodeItSoap" name="CodeItSoap" />
</client>
 </system.serviceModel>
 </configuration>

这只是我的 web.config 文件的一个示例。当我在本地主机上运行该服务时,它运行良好,并且在 wcf 测试客户端的帮助下,我得到了所需的输出。 但是,当我将 dllsweb.config 放在必须托管服务的服务器中时,它会引发错误 "Could not find a base address that matches scheme HTTP for the endpoint with binding BasicHttpBinding. Registered base address schemes are [https]"

谁能告诉我上述错误的原因是什么? 我的网络服务的一般流程 应用程序 -> 服务器托管(calc.svc) -> https://******.****-*/*****_*****?SOAP(已验证) 当我添加服务参考 app.config 生成时,默认情况下 basichttpbinding 已添加到 app.config 文件中。 根据我的理解,web.config 文件用于在 iis 中托管服务,我认为我的 web.config 是错误的。 在客户端端点中,calc.svc 或 https://*?soap 的端点应该是什么? https://prd36/calc.svc url 的基本httpbinding 可以吗? 我还需要为应用程序指定一个绑定吗? 请帮助我理解我很困惑,因为我编辑的 web.config 是一个仍在运行旧服务参考的现有配置。

【问题讨论】:

    标签: c# asp.net web-services wcf rest


    【解决方案1】:

    在您的端点地址中使用 http:// 而不是 https://。 要么 在您的端点中使用 BasicHttpsBinding 而不是 BasicHttpBinding

    如果问题仍然存在,请关注this link

    【讨论】:

      【解决方案2】:
       <serviceMetadata httpsGetEnabled="true"/> 
       <endpoint address="json" binding="webHttpBinding" contract="Contract.IService" behaviorConfiguration="web"></endpoint> 
       <endpoint address="mex" binding="mexHttpsinding" contract="IMetadataExchange"/>
      

      我做了以上更改,服务 url 正在网络浏览器中运行。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-02-14
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-07-13
        • 2013-04-08
        相关资源
        最近更新 更多