【发布时间】:2012-10-25 13:29:13
【问题描述】:
我正在尝试使用 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
EDIT 2尝试禁用防病毒和防火墙,但仍然没有成功。
【问题讨论】:
-
如果您在 IIS 上托管,则端点地址由 IIS 管理,因此删除端点地址值。我还看到您在端口 700 上使用 Https 而不是默认的 443。如果这是您想要的,那么您是否将 SSL 证书映射到 IIS 中的端口 700。证书是自签名的吗?如果是,那么您可能会得到一个可以被 ServicePointManager.ServerCertificateValidationCallback 属性覆盖的异常 (msdn.microsoft.com/en-us/library/…)
-
是的,它的自签名以及在哪里使用这个 ServicePointManager.ServerCertificateValidationCallback??在 Wp7 中,它都是异步 Web 服务调用,我不知道该放在哪里。我也用默认的 443 试过了
-
ServicePointManager.ServerCertificateValidationCallback 需要在客户端调用代码。
-
@Rajesh 我将其更改为默认端口 443,但仍然显示相同的错误
-
你能在remotehost机器上用IE或其他浏览器在本地浏览吗?
标签: wcf windows-phone-7 ssl wcf-ria-services wcf-security