gpt4 book ai didi

c# - https 不适用于虚拟目录

转载 作者:太空宇宙 更新时间:2023-11-03 15:00:26 26 4
gpt4 key购买 nike

我为我的网站配置 SSL https://www.test.com .我在其中有一个虚拟目录 testwcf。当我使用 https://www.test.com/testwcf/Common.svc 访问它时.显示的消息 You have created a service. 但是当我访问服务中的任何方法时,例如 https://www.test.com/testwcf/Common.svc/select?id=1我收到错误 找不到资源。。但它适用于 http,即 http://www.test.com/testwcf/Common.svc/select?id=1。谁能帮我解决这个问题。我在网上搜索了很多,但对我没有任何帮助

下面是我的websconfg

<services>

<service name="testwcf.Service1">
<endpoint address=""
binding="basicHttpBinding"
bindingConfiguration="secureHttpBinding"
contract="testwcf.IService1"/>

<endpoint address="mex"
binding="mexHttpsBinding"
contract="IMetadataExchange" />
</service>
</services>
<bindings>
<basicHttpBinding>
<binding name="secureHttpBinding">
<security mode="Transport">
<transport clientCredentialType="None"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
</system.serviceModel>

最佳答案

您需要为您的服务更新绑定(bind)以使用传输安全性。添加安全绑定(bind),例如:

<bindings>
<basicHttpBinding>
<binding name="secureHttpBinding">
<security mode="Transport">
<transport clientCredentialType="None"/>
</security>
</binding>
</basicHttpBinding>
</bindings>

然后更改您的服务配置以使用该绑定(bind)。

<services>
<service name="MySecureWCFService.Service1">
<endpoint address=""
binding="basicHttpBinding"
bindingConfiguration="secureHttpBinding"
contract="MySecureWCFService.IService1"/>

<endpoint address="mex"
binding="mexHttpsBinding"
contract="IMetadataExchange" />
</service>
</services>

更多信息请访问 http://msdn.microsoft.com/en-us/library/hh556232(v=vs.110).aspx

关于c# - https 不适用于虚拟目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22982280/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com