WCF服务在方法请求上返回404 [英] WCF service returning 404 on method requests

查看:73
本文介绍了WCF服务在方法请求上返回404的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个WCF服务页面,该页面仅通过SSL运行WebGets / WebInvokes-在我的本地计算机(自签名证书)上运行良好。但是,在生产环境中,我可以访问service.svc(它向我提供有关如何使用的消息),但是service.svc / AnyRequest返回404。这两种环境都托管在IIS 7.5中。

I have a WCF service page running only WebGets/WebInvokes over SSL - it works fine on my local machine (self signed cert). On production, however, I can reach service.svc (and it gives me the message about how to consume) but service.svc/AnyRequest returns a 404. Both environments are hosted in IIS 7.5.

我已启用跟踪,该服务甚至没有处理任何方法请求(例如service.svc / SomeRequest),但是它正在处理 service.svc 很好。它也在 https://computername.domain.net/path/service.svc 听-这正常吗?通常应该指向 https://publicaging.com/path/service.svc 吗?

I've enabled tracing and the service isn't even picking up any of the method requests (e.g. service.svc/SomeRequest), however it is processing service.svc just fine. It's also listening at https://computername.domain.net/path/service.svc - is this normal? Should it normally be pointing to https://publicfacing.com/path/service.svc?

也请注意生产服务器正在IIS中托管多个站点。

Also note that the production server is hosting multiple sites within IIS.

下面是我的web.config的system.serviceModel部分。建议从此处使用SSLBehave。

Below is the system.serviceModel section of my web.config. The SSLBehave was suggested from here.

  <system.serviceModel>
    <bindings>
      <webHttpBinding>
        <binding name="TransportSecurity">
          <security mode="Transport">
            <transport clientCredentialType="None"></transport>
          </security>
        </binding>
      </webHttpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="SSLBehave">
          <useRequestHeadersForMetadataAddress>
            <defaultPorts>
              <add scheme="https" port="443"/>
            </defaultPorts>
          </useRequestHeadersForMetadataAddress>
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="UserManagement.ajaxAspNetAjaxBehavior">
          <webHttp defaultOutgoingResponseFormat="Json" defaultBodyStyle="Wrapped" />
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true"
      multipleSiteBindingsEnabled="true" />
    <services>
      <service name="UserManagement.ajax" behaviorConfiguration="SSLBehave">
        <endpoint address="" behaviorConfiguration="UserManagement.ajaxAspNetAjaxBehavior"
          binding="webHttpBinding" bindingConfiguration="TransportSecurity" contract="UserManagement.ajax" />
      </service>
    </services>
  </system.serviceModel>


推荐答案

我将首先检查一些东西;

I would start by checking a number of things;


  • 托管目录上的权限?

  • .Net版本正确吗?

  • 您是否已将证书添加到站点?

  • 尝试将图像放置在同一路径中,是否可以导航到该路径(排除偶数路径映射)
  • Permissions on the hosted directory?
  • .Net version is correct?
  • Have you added the certificate to the site?
  • Try putting an image in the same path, can you navigate to that (rule out the odd occasional path mappings)

祝你好运!

这篇关于WCF服务在方法请求上返回404的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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