我正在尝试使用 https 设置 SightMax 实时聊天,但是当请求下面的 url 时
https://livechat.domain.com/Live-Chat/agentinterfacejson.svc/ssl/chat/RequestSurvey
它返回这个错误
Could not find a base address that matches scheme https for the endpoint with binding WebHttpBinding. Registered base address schemes are [http].
尝试过研究,但仍然无法解决问题,下面是我的 web.configIIS 已设置为绑定(bind)到 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>
您似乎缺少 BaseAddress,而您的端点地址是相对的。
<baseAddresses>
<add baseAddress="https://livechat.domain.com/Livechat/agentinterfacejson.svc" />
</baseAddresses>
WCF Service Host settings
我是一名优秀的程序员,十分优秀!