gpt4 book ai didi

wcf - 没有端点监听 WCF AuthenticationService

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

我正在尝试验证我从 windows phone 7 登录的用户使用AuthenticationService WCF 托管在 IIS 7 中。

我在没有 SSL 的情况下尝试过并且工作正常。但我想将其转换为https。

我遇到的错误是当我从我的 WP7 模拟器中调用这个 WCF 时是:

"EndpointNotFoundException"

但是我的 web.config 具有以下详细信息:

<system.serviceModel>
<services>
<service name="System.Web.ApplicationServices.AuthenticationService"
behaviorConfiguration="AuthenticationServiceTypeBehaviors">
<endpoint contract="System.Web.ApplicationServices.AuthenticationService"
binding="basicHttpBinding"
bindingConfiguration="userHttps" address="https://localhost:700/AuthenticationService.svc"
bindingNamespace="http://asp.net/ApplicationServices/v200"/>
<endpoint address="mex"
binding="mexHttpsBinding"
contract="IMetadataExchange" />
</service>

</services>
<bindings>
<basicHttpBinding>
<binding name="userHttps">
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="AuthenticationServiceTypeBehaviors" >
<serviceMetadata httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>

</serviceBehaviors>

</behaviors>
<serviceHostingEnvironment
aspNetCompatibilityEnabled="true"/>
</system.serviceModel>

使用:AspNetSqlMembershipProvider,我正在避免这些细节来说明这一点。

在我的 IIS 7 中,我创建了一个应用程序池并关联了一个自签名托管 WCF 的证书,并在 SSL 设置选项中选择“需要 SSL- 选中”和“忽略客户端证书-选中”

我可以浏览到 https://localhost:700/AuthenticationService.svc.

我能够将其作为服务引用添加到我的手机中,但是当我调用登录方法显示错误。

我已经指定了端点地址,但它仍然显示错误。

任何人都可以向我解释如何调试它以获得更多详细信息或指向的任何指针解决“通过 SSL 使用身份验证服务 WCF”

EDIT 1 我在尝试访问时尝试使用 IP 地址和 svc URL通过浏览器服务

svcutil.exe https://mcname.domain.local:700/AuthenticationService.svc?wsdl 

编辑 2 尝试禁用防病毒和防火墙,但仍然没有成功。

最佳答案

根据@Rajesh 的评论,我在手机中安装了证书,它开始工作了。

我尝试了导出 .CER、.PFX 和 .P7B 格式的所有选项,但只有 P7B 格式适合我将其安装到手机中。

使用 SSL 启用 AuthenticationService WCF 的 web.config 文件部分是

        <services>
<service behaviorConfiguration="AppServiceBehaviors" name="System.Web.ApplicationServices.AuthenticationService">
<endpoint binding="basicHttpBinding" bindingConfiguration="defaultBasicHttpBinding"
bindingNamespace="http://asp.net/ApplicationServices/v200" contract="System.Web.ApplicationServices.AuthenticationService" />
</service>

</services>
<behaviors>
<serviceBehaviors>
<behavior name="AppServiceBehaviors">
<serviceMetadata httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
<behavior name="">
<serviceMetadata httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"
multipleSiteBindingsEnabled="true" />
</system.serviceModel>

<system.web.extensions>
<scripting>
<webServices>
<authenticationService enabled="true" requireSSL="true"/>

遵循以下步骤使其工作:http://blogs.msdn.com/b/davidhardin/archive/2010/12/30/wp7-and-self-signed-ssl-certificates.aspx

  • 主机名必须可由 http 代理通过 DNS、WINS、hosts文件等
  • SSL 证书的名称必须与主机匹配姓名。
  • 受信任的根证书必须与 http
    代理人,即在电话中。

将证书安装到 WP7 模拟器手机上是最棘手的部分。如前所述,P7B 文件托管在 IIS 上,URL 是通过模拟器浏览器访问的,这帮助我在手机上安装了证书(抱歉!我忘记了引用链接)。

安装后,端点问题消失,开始工作。因为这不是一个永久的解决方案(因为每次模拟器关闭时都需要重新安装 CERT),我正在研究 http://wp7certinstaller.codeplex.com/为测试目的在 IIS 中托管时使其工作的代码。

感谢@Rajesh 的帮助。

关于wcf - 没有端点监听 WCF AuthenticationService,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13069711/

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