WCF服务的方法reqests返回404 [英] WCF service returning 404 on method reqests

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

问题描述

我有一个WCF服务页面只运行WebGets / WebInvokes通过SSL - 它的工作原理我的本地机器(自签名证书)的罚款。在生产,但是,我可以达到service.svc(和它给了我关于如何使用该消息),但service.svc / AnyRequest返回404两种环境在IIS 7.5主办。



我已经启用跟踪,服务甚至没有拿起任何方法请求(如service.svc / SomeRequest),然而它处理 service.svc 就好了。它还在听 https://computername.domain.net/path/service.svc - 这正常吗?如果它通常是指向 https://publicfacing.com/path/service.svc



另外请注意生产服务器承载IIS中的多个站点。



下面是我的web.config的system.serviceModel部分。该SSLBehave从这里 建议。

 < system.serviceModel> 
<&绑定GT;
<&的WebHttpBinding GT;
<绑定名称=TransportSecurity>
<安全模式=运输>
<运输clientCredentialType =无>< /运输及GT;
< /安全>
< /&结合GT;
< /&的WebHttpBinding GT;
< /绑定>
<&行为GT;
< serviceBehaviors>
<行为NAME =SSLBehave>
< useRequestHeadersForMetadataAddress>
< defaultPorts>
<加入计划=htt​​ps开头端口=443/>
< / defaultPorts>
< / useRequestHeadersForMetadataAddress>
< /行为>
< / serviceBehaviors>
< endpointBehaviors>
<行为NAME =UserManagement.ajaxAspNetAjaxBehavior>
< webHttp defaultOutgoingResponseFormat =Json的defaultBodyStyle =包装/>
< /行为>
< / endpointBehaviors>
< /行为>
< serviceHostingEnvironment aspNetCompatibilityEnabled =真正的
multipleSiteBindingsEnabled =真/>
<服务和GT;
<服务名称=UserManagement.ajaxbehaviorConfiguration =SSLBehave>
<端点地址=behaviorConfiguration =UserManagement.ajaxAspNetAjaxBehavior
结合=的WebHttpBindingbindingConfiguration =TransportSecurity合同=UserManagement.ajax/>
< /服务>
< /服务>
< /system.serviceModel>


我要检查一些事情开始;




  • 在托管目录权限?

  • .NET版本是正确的?

  • 你有没有添加的证书的网站?

  • 尝试把图像在同一路径下,就可以导航到(排除奇偶尔路径映射)



祝你好运!


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.

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?

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

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;

  • 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)

Good luck!

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

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