首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >WCF + SSL没有找到端点

WCF + SSL没有找到端点
EN

Stack Overflow用户
提问于 2009-04-28 13:22:02
回答 2查看 16.8K关注 0票数 12

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

我有一个托管在II7上的wcf服务,当我使用普通的http协议时,所有服务都可以正常工作。

我添加了SSL能力,从那时起我就无法从代码中访问它。我可以创建一个客户机,但不能运行它的任何方法。

这是我有的东西

代码语言:javascript
代码运行次数:0
运行
复制
 <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>

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

我就这样用它

代码语言:javascript
代码运行次数:0
运行
复制
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 (如果存在)。

有人能帮我吗?我真的不明白发生了什么..。

注意:我可以使用Internet正确地访问can服务(所以我想我的证书是可以的)

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2009-04-28 14:59:54

你说得对,

服务器端Sg出错。

这就是我是如何让它工作的

代码语言:javascript
代码运行次数:0
运行
复制
<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>
票数 3
EN

Stack Overflow用户

发布于 2009-04-28 14:49:41

我认为服务器web.config可能是这里的错误之一。我已经在客户端使用下面的app.config处理work。

代码语言:javascript
代码运行次数:0
运行
复制
<configuration>
  <system.serviceModel>
    <bindings>
      <wsHttpBinding>
        <binding name="WSHttpBinding_IService" >
          <security mode="Transport">
            <transport realm ="" clientCredentialType="Windows" />
          </security>
        </binding>

      </wsHttpBinding>
    </bindings>
    <client>
      <endpoint address="https://mycomputer/Service/Service.svc"
          binding="wsHttpBinding"
          bindingConfiguration="WSHttpBinding_IService"
          contract="ServiceProxy.IService" name="WSHttpBinding_IService">
        <identity>
          <dns value="mycomputer" />
        </identity>
      </endpoint>
    </client>
  </system.serviceModel>
</configuration>

唯一明显的区别是ClientCredentialType,我将其设置为Windows,因为我希望使用集成的windows身份验证。服务器web.config包括以下行来设置客户端可以使用的服务。

代码语言:javascript
代码运行次数:0
运行
复制
  <system.serviceModel>
    <bindings>
      <wsHttpBinding>
        <binding name="WindowsBinding">
          <security mode="Transport">
            <transport proxyCredentialType="Windows" />
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>
    <services>
      <service behaviorConfiguration="Service.Service1Behavior"
               name="Service.Service">
        <endpoint address="" binding="wsHttpBinding"
                  bindingConfiguration="WindowsBinding"
                  contract="ServiceInterface.IService">
          <identity>
            <dns value="mycomputer" />
          </identity>
        </endpoint>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="Service.Service1Behavior">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

您能否将其与服务器端的web.config进行比较,看看有什么不同?或者将您的web.config添加到问题中。

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/797903

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档