【问题标题】:Could not find a base address that matches scheme https for the endpoint with binding WebHttpBinding找不到与具有绑定 WebHttpBinding 的端点的方案 https 匹配的基地址
【发布时间】:2011-11-10 09:39:34
【问题描述】:

我正在尝试使用 https 设置 SightMax 实时聊天,但是当请求下面的 url 时

https://livechat.domain.com/Live-Chat/agentinterfacejson.svc/ssl/chat/RequestSurvey

返回这个错误

找不到与方案 https 匹配的基地址 具有绑定 WebHttpBinding 的端点。注册的基地址方案 是 [http]。

已经尝试过研究,但仍然无法正确解决, 下面是我的 web.config IIS 已设置绑定到 https。

<bindings>
    <customBinding>
        <binding name="jsonpBinding">
            <jsonpMessageEncoding/>
            <httpTransport manualAddressing="true"/>
        </binding>
        <binding name="jsonpBindingSsl">
            <jsonpMessageEncoding/>
            <httpsTransport manualAddressing="true"/>
        </binding>
    </customBinding>
    <webHttpBinding>
        <binding name="jsonBinding" maxReceivedMessageSize="52428800">
            <readerQuotas maxDepth="52428800" maxStringContentLength="52428800" maxArrayLength="52428800"/>
        </binding>
        <binding name="sslJsonBinding">
            <security mode="Transport"/>
        </binding>
        <binding name="jsonpBindingSsl">
            <security mode="Transport"/>
        </binding>
     </webHttpBinding>
</bindings>
<services>
    <service behaviorConfiguration="SmartMax.SightMax.AgentInterfaceService.AgentInterfaceJsonBehavior" name="SmartMax.SightMax.AgentInterfaceService.AgentInterfaceJson">
        <endpoint address="chat" behaviorConfiguration="jsonEndpointBehavior" binding="webHttpBinding" bindingConfiguration="jsonBinding" name="jsonChat" contract="SmartMax.SightMax.Chat.Visitor.IRemotedVisitorChat"/>
        <endpoint address="site" behaviorConfiguration="jsonEndpointBehavior" binding="webHttpBinding" bindingConfiguration="jsonBinding" name="jsonSite" contract="SmartMax.SightMax.Website.IRemotedVisitorWebsite"/>
                <!--Uncomment in order to enable SSL-->
          <endpoint address="ssl/chat" behaviorConfiguration="jsonEndpointBehavior"
          binding="webHttpBinding" bindingConfiguration="sslJsonBinding"
          name="jsonChatSsl" contract="SmartMax.SightMax.Chat.Visitor.IRemotedVisitorChat" />
        <endpoint address="ssl/site" behaviorConfiguration="jsonEndpointBehavior"
          binding="webHttpBinding" bindingConfiguration="sslJsonBinding"
          name="jsonSiteSsl" contract="SmartMax.SightMax.Website.IRemotedVisitorWebsite" />
     </service>

    <service behaviorConfiguration="SmartMax.SightMax.AgentInterfaceService.AgentInterfaceJsonpBehavior" name="SmartMax.SightMax.AgentInterfaceService.AgentInterfaceJsonp">
        <endpoint address="chat" behaviorConfiguration="jsonpEndpointBehavior" binding="customBinding" bindingConfiguration="jsonpBinding" name="jsonpChat" contract="SmartMax.SightMax.Chat.Visitor.IRemotedVisitorChat"/>
        <endpoint address="site" behaviorConfiguration="jsonpEndpointBehavior" binding="customBinding" bindingConfiguration="jsonpBinding" name="jsonpSite" contract="SmartMax.SightMax.Website.IRemotedVisitorWebsite"/>
        <!--Uncomment in order to enable SSL-->
        <endpoint address="ssl/chat" behaviorConfiguration="jsonpEndpointBehavior"
          binding="customBinding" bindingConfiguration="jsonpBindingSsl"
          name="jsonChatSsl" contract="SmartMax.SightMax.Chat.Visitor.IRemotedVisitorChat" />
        <endpoint address="ssl/site" behaviorConfiguration="jsonpEndpointBehavior"
          binding="customBinding" bindingConfiguration="jsonpBindingSsl"
          name="jsonSiteSsl" contract="SmartMax.SightMax.Website.IRemotedVisitorWebsite" />
    </service>
</services>

对此有什么想法吗?谢谢

我尝试将基地址放在每个服务上,但仍然没有成功。

<services>
    <service behaviorConfiguration="SmartMax.SightMax.AgentInterfaceService.AgentInterfaceJsonBehavior" name="SmartMax.SightMax.AgentInterfaceService.AgentInterfaceJson">
        <host>
            <baseAddresses>
                <add baseAddress="https://livechat.domain.com/Live-Chat/agentinterfacejson.svc/"/>
            </baseAddresses>
        </host>
        <endpoint address="chat" behaviorConfiguration="jsonEndpointBehavior" binding="webHttpBinding" bindingConfiguration="jsonBinding" name="jsonChat" contract="SmartMax.SightMax.Chat.Visitor.IRemotedVisitorChat"/>
        <endpoint address="site" behaviorConfiguration="jsonEndpointBehavior" binding="webHttpBinding" bindingConfiguration="jsonBinding" name="jsonSite" contract="SmartMax.SightMax.Website.IRemotedVisitorWebsite"/>
        <!--Uncomment in order to enable SSL-->
            <endpoint address="ssl/chat" behaviorConfiguration="jsonEndpointBehavior"binding="webHttpBinding" bindingConfiguration="sslJsonBinding"name="jsonChatSsl" contract="SmartMax.SightMax.Chat.Visitor.IRemotedVisitorChat" />
            <endpoint address="ssl/site" behaviorConfiguration="jsonEndpointBehavior"binding="webHttpBinding" bindingConfiguration="sslJsonBinding"name="jsonSiteSsl" contract="SmartMax.SightMax.Website.IRemotedVisitorWebsite" />
        </service>
        <service behaviorConfiguration="SmartMax.SightMax.AgentInterfaceService.AgentInterfaceJsonpBehavior" name="SmartMax.SightMax.AgentInterfaceService.AgentInterfaceJsonp">
        <host>
            <baseAddresses>
                <add baseAddress="https://livechat.domain.com/Live-Chat/agentinterfacejson.svc/"/>
            </baseAddresses>
        </host>
        <endpoint address="chat" behaviorConfiguration="jsonpEndpointBehavior" binding="customBinding" bindingConfiguration="jsonpBinding" name="jsonpChat" contract="SmartMax.SightMax.Chat.Visitor.IRemotedVisitorChat"/>
        <endpoint address="site" behaviorConfiguration="jsonpEndpointBehavior" binding="customBinding" bindingConfiguration="jsonpBinding" name="jsonpSite" contract="SmartMax.SightMax.Website.IRemotedVisitorWebsite"/>
        <!--Uncomment in order to enable SSL-->
            <endpoint address="ssl/chat" behaviorConfiguration="jsonpEndpointBehavior"binding="customBinding" bindingConfiguration="jsonpBindingSsl"name="jsonChatSsl" contract="SmartMax.SightMax.Chat.Visitor.IRemotedVisitorChat" />
            <endpoint address="ssl/site" behaviorConfiguration="jsonpEndpointBehavior"binding="customBinding" bindingConfiguration="jsonpBindingSsl"name="jsonSiteSsl" contract="SmartMax.SightMax.Website.IRemotedVisitorWebsite" />
        </service>
    </services>

【问题讨论】:

    标签: asp.net web-services ssl https


    【解决方案1】:

    您似乎缺少 BaseAddress 并且您的端点地址是相对的。

    <baseAddresses>
        <add baseAddress="https://livechat.domain.com/Livechat/agentinterfacejson.svc" />
    </baseAddresses>
    

    WCF Service Host settings

    【讨论】:

    • 您好,感谢您的及时回复,我应该把基本地址放在哪里?我需要输入两个基地址(http 和 https)?
    • 您好,我已尝试添加基址,但还是不行。
    猜你喜欢
    • 2012-04-06
    • 2021-07-29
    • 2023-03-31
    • 1970-01-01
    • 2012-05-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多