我有一个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) 我有一个在LAN上正常工作的WCF服务,但是当尝试从外部访问它时,服务引用失败.
我的WCF服务托管在使用静态IP无域的win2k3盒子上.