通过SSL使用.NET WCF的Java客户端(不支持WS-Policy)
我在Windows Server 2008的IIS中托管了一个.NET 4.0 WCF服务,该服务在HTTP上运行良好。WCF服务正被第三方使用,该第三方正在使用Appian Process Modeler配置WCF客户端(这并不重要,但我想我应该提到它) EDIT:因此他们使用Appian Process Modeler的事实实际上可能是相关的。它是一个基于Java的客户端,因此这意味着我们试图让Java客户端通过SSL使用WS-Policy来使用.NET WCF服务。 编辑#2:既然我现在知道Java正在使用.NET服务,那么这是我可以在我的终端上做的一个修复程序,允许Java通过SSL使用我的服务,还是我的客户端可以做一个修复程序,允许他们的Java代码使用WS-Policy使用.NET服务? 从测试转移到生产环境后,当客户机更新其服务引用以指向新的生产URL时,会出现以下错误: 端点BasicHttpBinding_IInterface包含对WS-Policy主题的引用,该主题尚不受支持。该端点不可供选择。(APNX-2-4041-003) 在比较两个WSDL文档(非SSL/测试、SSL/生产)时,我发现了以下两个差异,都与WS-Policy有关(这是WSDL文档中仅有的两个差异,URL除外):通过SSL使用.NET WCF的Java客户端(不支持WS-Policy),java,c#,wcf,ssl,appian,Java,C#,Wcf,Ssl,Appian,我在Windows Server 2008的IIS中托管了一个.NET 4.0 WCF服务,该服务在HTTP上运行良好。WCF服务正被第三方使用,该第三方正在使用Appian Process Modeler配置WCF客户端(这并不重要,但我想我应该提到它) EDIT:因此他们使用Appian Process Modeler的事实实际上可能是相关的。它是一个基于Java的客户端,因此这意味着我们试图让Java客户端通过SSL使用WS-Policy来使用.NET WCF服务。 编辑#2:既然我现在知
及
我试图在生产环境中创建一个静态WSDL文档,并删除这两个部分,但如果这样做,我将无法生成到WCF服务的安全连接
所以我的问题是,在没有WS-Policy要求的情况下,如何配置WCF通过SSL进行响应?
以下是我们在服务器上使用的配置:
<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>
根据微软的说法,这似乎是不可能的 见和
中讨论了身份验证模式以及相应的前缀和名称空间。这可能会给你一些额外的想法。谢谢你的回复和链接。我认为我的问题更多的是“如何让Java客户端通过SSL使用我的.NET WCF服务”,而不是“如何关闭WS-Policy”。不过,我对你的答案投了更高的票,因为这些链接确实为我的原始问题提供了一些见解。@Scott:这是一篇关于这个主题的非常好的文章:谢谢,这很有帮助。我认为这是需要在Java端发生的事情,才能让它正常工作。不过,本文确实有所帮助。我将把这个问题留待讨论,看看是否还有其他人有具体的建议。再次感谢。上面的URL不再有效。另一方面,它被移动到:hoonzis.blogspot.com/2011/07/aspnet-forms-authentication-and-java.html——我不得不说,您的问题似乎很特殊,您将无法在那里找到解决方案。您可以实现这一点。。没那么难。。你只需要知道你要发送什么:)
<wsp:PolicyReference URI="#BasicHttpBinding_IInterface_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>