WCF + SSL 未找到端点 [英] WCF + SSL no endpoint found

查看:50
本文介绍了WCF + SSL 未找到端点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想了好几个小时来解决这个问题.

I'm figthing for hours now to figure out this problem.

我在 II7 上托管了一个 wcf 服务,当我使用普通的 http 协议时一切正常.

I have a wcf service that I host on II7, all works fine when I use the normal http protocol.

我添加了 SSL 功能,从那以后我无法从代码访问它.我可以创建一个客户端,但不能运行它的任何方法.

I added SSL capabilites and since then I cannot access it from code. I can create a client but cannot run any of its methods.

这是我所拥有的

 <system.serviceModel>
    <bindings>
        <wsHttpBinding>
            <binding name="WSHttp0">
                <security mode="Transport">
                    <transport realm ="" clientCredentialType="None" />
                </security>
            </binding>
        </wsHttpBinding>
    </bindings>
    <client>
        <endpoint address="https://serverName.domname.local/WCFTest/MyWebServicec.svc"
            binding="wsHttpBinding" bindingConfiguration="WSHttp0" contract="SSLWebService.IMyWebService"
            name="WSEP">
            <identity>
                <dns value="serverName.domname.local" />
            </identity>
        </endpoint>
    </client>
</system.serviceModel>

我为我的项目添加了一个服务引用

I added a service reference to my project

我就是这么用的

Dim client As MyWebServiceClient = New MyWebServiceClient()
Try
    client.GetDocumentByDocID(5)
Catch ex As Exception
    MessageBox.Show(ex.Message)
End Try

这是我得到的

没有端点侦听 https://serverName.domname.local/WCFTest/MyWebService.svc 可以接受消息.这通常是由不正确的地址或 SOAP 操作引起的.有关详细信息,请参阅 InnerException(如果存在).

There was no endpoint listening at https://serverName.domname.local/WCFTest/MyWebService.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.

有人可以帮我解决这个问题吗?我真的不明白这是怎么回事...

Can anyone help me on this? I really do not understand what is going on...

注意:我可以使用 Internet Explorer 正确访问网络服务(所以我猜我的证书没问题)

note: I can access the webservice correctly using Internet Explorer (so I guess my certificate is ok)

推荐答案

你说得对,

服务器端sg错误.

这是我如何让它工作

<system.serviceModel>
    <bindings>
        <wsHttpBinding>
            <binding name="wsHttpEndpointBinding">
                <security mode="Transport">
                    <transport clientCredentialType ="None"/>
                </security>
            </binding>
        </wsHttpBinding>
    </bindings>
    <services>
        <service behaviorConfiguration="App_WcfWebService.AppWebServiceBehavior" name="App_WcfWebService.AppWebService">
            <endpoint address="" binding="wsHttpBinding" bindingConfiguration ="wsHttpEndpointBinding" contract="App_WcfWebService.IAppWebService">

            </endpoint>
            <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>
        </service>
    </services>
    <behaviors>
        <serviceBehaviors>
            <behavior name="App_WcfWebService.AppWebServiceBehavior">
                <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
                <serviceMetadata httpsGetEnabled="true"/>
                <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
                <serviceDebug includeExceptionDetailInFaults="true"/>
                <serviceThrottling maxConcurrentSessions="90" />                    
            </behavior>
        </serviceBehaviors>
    </behaviors>
</system.serviceModel>

这篇关于WCF + SSL 未找到端点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆