2011-12-15 49 views
0

我有一个.NET 4.0 WCF服务托管在Windows Server 2008上的IIS中,该服务通过HTTP运行得很好。第三方正在使用WCF服务,第三方正在使用Appian Process Modeler来配置WCF客户端(不是相关的,但我想我会提到它)。Java客户端使用基于SSL的.NET WCF(不支持WS-Policy)

编辑:所以他们使用Appian Process Modeler的事实可能实际上是相关的。它是一个基于Java的客户端,这意味着我们试图让Java客户端使用基于SSL的WS-Policy来使用.NET WCF服务。编辑#2:因为我现在知道Java正在使用.NET服务,这是一个修复程序,我可以在我的一端执行以允许Java通过SSL使用我的服务,或者是否有修复我的客户端可以放置到允许他们的Java代码使用WS-Policy使用.NET服务吗?

从移动检测,对我们的生产环境中,当我们的客户更新其服务引用指向新的生产URL后,他们得到了以下错误:

端点BasicHttpBinding_IInterface包含对WS-引用政策主题,尚未得到支持。该端点不可用于选择。 (APNX-2-4041-003)

在比较两个WSDL文档(非SSL /测试,SSL /生产)时,我发现了两个与WS-Policy相关的差异(这两个差异都是只有两个差异,除了网址,WSDL文档中):

<wsp:Policy wsu:Id="BasicHttpBinding_IInterface_policy"> 
    <wsp:ExactlyOne> 
     <wsp:All> 
     <sp:TransportBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"> 
      <wsp:Policy> 
      <sp:TransportToken> 
       <wsp:Policy> 
       <sp:HttpsToken RequireClientCertificate="false"/> 
       </wsp:Policy> 
      </sp:TransportToken> 
      <sp:AlgorithmSuite> 
       <wsp:Policy> 
       <sp:Basic256/> 
       </wsp:Policy> 
      </sp:AlgorithmSuite> 
      <sp:Layout> 
       <wsp:Policy> 
       <sp:Strict/> 
       </wsp:Policy> 
      </sp:Layout> 
      </wsp:Policy> 
     </sp:TransportBinding> 
     </wsp:All> 
    </wsp:ExactlyOne> 
    </wsp:Policy> 

而且

<wsp:PolicyReference URI="#BasicHttpBinding_IInterface_policy"/> 

我试图在生产中创造一个静态的WSDL文档与这两个部分删除,但我不能生成如果我这样做,则可以安全连接到WCF服务。

所以我的问题是,如何配置WCF通过SSL响应没有WS-Policy要求?

这是我们正在使用的服务器上的配置:

<system.serviceModel> 
    <bindings> 
     <basicHttpBinding> 
      <binding name="basicHttps"> 
       <security mode="Transport"> 
        <transport clientCredentialType="None" /> 
        <message /> 
       </security> 
      </binding> 
     </basicHttpBinding> 
    </bindings> 
    <client /> 
    <services> 
     <service name="Namespace.API.IInterface_Implementation"> 
     <endpoint address="" 
        binding="basicHttpBinding" 
        bindingConfiguration="basicHttps" 
        contract="Namespace.API.Interfaces.IInterface"/> 
     <endpoint address="mex" 
        binding="mexHttpsBinding" 
        contract="IMetadataExchange"/> 

     </service> 
    </services> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior> 
      <serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" /> 
      <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --> 
      <serviceDebug includeExceptionDetailInFaults="false"/> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> 
    </system.serviceModel> 

回答

1

据微软称,这似乎并不可能。

请参阅herehere

认证模式和相应的前缀和命名空间在MSDN讨论。这可能会给你一些额外的想法。

+0

感谢您的回复和链接。我想我的问题已经变得更多的是“如何让Java客户端通过SSL使用我的.NET WCF服务”,而不是“如何关闭WS-Policy”。我赞成你的回答,尽管这些链接确实为我的原始问题提供了一些见解。 – Scott 2011-12-15 17:42:22