Web服务在SSL端点与404找到 [英] Webservice over SSL endpoint not found with 404

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

问题描述

我有一个web服务启动和运行,并通过浏览器我能达到它,看到它的启动和运行。还没有HTTPS我可以对web服务的调用。

I've got a webservice up and running and through the browser I can reach it and see it's up and running. Also without https I can make calls to the webservice.

为使目前我使用的小型控制台应用程序来测试并查看结果的电话。

To make calls at the moment I'm using a small console application to test and see the results.

服务器端我的web.config是如下:

Server side my web.config is as following:

服务栏目

<services>
    <service name="Website.mynamespace.Service1">
        <endpoint address="/service.svc" behaviorConfiguration=""  binding="wsHttpBinding" contract="SomeDLLFile.Anothernamespace.Services.Proxy.Interface1" ></endpoint>
        <endpoint address="/service.svc" behaviorConfiguration="" binding="wsHttpBinding" contract="SomeDLLFile.Anothernamespace.Services.Proxy.Interface1" bindingConfiguration="myBinding" />
        <endpoint address="mex" binding="wsHttpBinding" contract="IMetadataExchange"/>
      </service>
      <service name="Website.mynamespace.Service2">
        <endpoint address="/service.svc" behaviorConfiguration=""  binding="wsHttpBinding" contract="SomeDLLFile.Anothernamespace.Services.Proxy.Interface2" ></endpoint>
        <endpoint address="/service.svc" behaviorConfiguration="" binding="wsHttpBinding" contract="SomeDLLFile.Anothernamespace.Services.Proxy.Interface2" bindingConfiguration="myBinding" />
        <endpoint address="mex" binding="wsHttpBinding" contract="IMetadataExchange"/>
      </service>
</services>

所使用的结合

  <wsHttpBinding>
    <binding name="myBinding">
      <security mode="Transport">
        <transport clientCredentialType="None"/>
        </security>
    </binding>
  </wsHttpBinding>

在客户端(我的控制台应用程序),我增加了一个服务引用我的web服务。通过这种方式,我能够使通过HTTP调用。然而,当使用HTTPS我得到一个错误说以下

On the client side (my console application) i've added an service reference to my webservice. This way I'm able to make calls over HTTP. However when using HTTPS i'm getting an error saying the following

没有终点的https://test.mywebsite.nl/service.svc听,可以接受的消息。这通常是由不正确的地址或SOAP行动造成的。见的InnerException,如果present,为更多的细节。

从我的控制台应用程序在app.config看起来像这样;

The app.config from my console application looks like this;

<client>
      <endpoint address="https://test.mywebsite.nl/service.svc" 
                binding="basicHttpBinding"
                bindingConfiguration="BasicHttpBinding_IProxyInterface1"
                contract="Service.IProxyInterface1" 
                name="BasicHttpBinding_IProxyClientInterface" />
      <endpoint address="https://test.mywebsite.nl/service.svc" 
                binding="basicHttpBinding"
                bindingConfiguration="BasicHttpBinding_IProxyInterface2"
                contract="Service.IProxyInterface2" 
                name="BasicHttpBinding_IProxyInterface2" />
</client>

<behaviors>
  <serviceBehaviors>
    <!-- 
      Step 2. Inside a <serviceBehaviors> section, add 
      a name attribute in the <behaviors> element that 
      matches the behaviorConfiguration attribute in the
      <service> element above.
    -->
    <behavior name="">
      <serviceMetadata httpGetEnabled="true" httpGetUrl=""/>
      <serviceDebug httpHelpPageEnabled="true" includeExceptionDetailInFaults="true" />
    </behavior>
  </serviceBehaviors>
</behaviors>

当我在看的内部异常,我看到的是一个404错误。我试着上MS SO,也是文章从其它主题的各种建议,但我一定是失去了一些东西,因为我现在还在重新具有相同的错误psented $ P $。任何人任何想法,我在做什么错在这里?

When i'm looking at the inner exception I'm looking at an 404-error. I've tried various suggestion from other topics on SO and also articles at MS, but I must be missing something since i'm still represented with the same error. Anybody any idea what I'm doing wrong here?

推荐答案

得到了解决问题由于<一个href=\"http://stackoverflow.com/questions/3876955/wcf-service-returns-404-over-https-but-not-http\">this话题在这里左右。

Got the issue solved thanks to this topic here on SO.

问题是在服务的名字,所以我结合端点在一个服务定义两个合同。我也改变了的wsHttpBinding到basicHttpBinding的。

The problem was in the service name, so I combined the endpoints to both contracts in one service definition. I also changed the wsHttpBinding to an basicHttpBinding.

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

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