相关疑难解决方法(0)

WCF服务在方法请求上返回404

我有一个WCF服务页面只通过SSL运行WebGets/WebInvokes - 它在我的本地机器上工作正常(自签名证书).但是,在生产时,我可以访问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>
    <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>
Run Code Online (Sandbox Code Playgroud)

c# ssl wcf iis-7.5

21
推荐指数
5
解决办法
4万
查看次数

WCF使用计算机名称而不是IP地址,无法解析

我有一个在LAN上正常工作的WCF服务,但是当尝试从外部访问它时,服务引用失败.

我的WCF服务托管在使用静态IP无域的win2k3盒子上.

.net wcf hostheaders wcf-binding wcf-endpoint

8
推荐指数
3
解决办法
2万
查看次数

标签 统计

wcf ×2

.net ×1

c# ×1

hostheaders ×1

iis-7.5 ×1

ssl ×1

wcf-binding ×1

wcf-endpoint ×1