gpt4 book ai didi

asp.net - 无法正确添加服务引用

转载 作者:行者123 更新时间:2023-12-02 08:10:49 24 4
gpt4 key购买 nike

我在 443 端口下有一个 notificationService,但是当我尝试将其添加到 Windows Phone 7 服务引用时,我不能,那么它是否可以链接到我的服务部署在 443 端口下的事实。

http://localhost:443/NotificationService.svc 发出 HTTP 请求时发生错误。这可能是由于在 HTTPS 情况下未使用 HTTP.SYS 正确配置服务器证书。这也可能是由于客户端和服务器之间的安全绑定(bind)不匹配造成的。底层连接已关闭:发送时发生意外错误。由于数据包格式意外,握手失败。如果当前解决方案中定义了该服务,请尝试构建该解决方案并再次添加服务引用。

<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="True" multipleSiteBindingsEnabled="false"/>
<services>
<service name="Project.Services.NotificationService"
behaviorConfiguration="notificationservicebehavior">
<endpoint name="basicHttpBinding"
contract="Project.Services.INotificationService"
address="http://127.0.0.1:443/NotificationService.svc"
binding="basicHttpBinding"
/>
</service>
</services>

<behaviors>
<serviceBehaviors>
<behavior name="notificationservicebehavior">
<serviceMetadata httpGetEnabled="true" httpGetUrl="" />
</behavior>
<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>

最佳答案

如果您使用的是自签名证书或不是来自 these authorities 的证书您需要在设备上安装它。

只有两种方法可以在设备上安装第三方证书,目前都无法通过代码完成:

Installing certificates via Windows®Internet Explorer®
A certificate canbe posted on a website and madeavailable to users through adevice-accessible URL that they canuse to download the certificate. Whena user accesses the page and taps thecertificate, it opens on the device.The user can inspect the certificate,and if they choose to continue thecertificate is installed on thedevice.

Installing certificates via email
The certificate installer onWindows Phone 7 supports .cer, .p7b,and .pfx files. When installingcertificates via email, make sure yourmail filters do not block .cer files.Certificates that are sent via emailappear as message attachments. When acertificate is received, a user cantap to review the contents and thentap to install the certificate.Typically, when an identitycertificate is installed the user isprompted for the passphrase thatprotects it.

您必须让用户执行其中一项操作,应用程序才能使用证书。

来自Windows Phone 7 and Certificates_FINAL_121610.pdf

关于asp.net - 无法正确添加服务引用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6073322/

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