wcf - WCF Ws-安全服务配置
问题描述
我对围绕我的 WCF 服务和 WS-Seciurity 的配置有问题。我无权访问客户端,到目前为止,我正在尝试使用 SoapUI 作为具有 WS-A 寻址、用户名、密码和 WSS 密码类型“PasswordDigest”选项的客户端。
我使用带有简单证书 .NET 4.7 的 IIS 和 https。
我尝试了很多版本,但都没有成功。我只想找到最简单、有效的解决方案,在启用 WS-Seciurity PasswordDigest 选项的情况下从 SoapUI/客户端请求中读取“安全”标头。
当前配置文件的当前错误“InvalidSecurity”“验证消息的安全性时发生错误”
<system.serviceModel>
<protocolMapping>
<add scheme="https" binding="wsHttpBinding"/>
</protocolMapping>
<services>
<service name="SoapService" behaviorConfiguration="SoapServiceConf">
<!--<endpoint address="SoapService" binding="wsHttpBinding" contract="MPA.SoapService.References.ServiceReference.SentSOAP" /> -->
<endpoint address="" binding="wsHttpBinding" contract="Interfaces.ISoap" bindingConfiguration="wsHttpBind"/>
<endpoint contract="IMetadataExchange" binding="mexHttpsBinding" address="mex" />
</service>
</services>
<bindings>
<wsHttpBinding>
<binding maxReceivedMessageSize="10485760" name="wsHttpBind">
<security mode="TransportWithMessageCredential">
<transport clientCredentialType="Basic"/>
<message clientCredentialType="UserName" algorithmSuite="Default" establishSecurityContext="false" />
</security>
<reliableSession enabled="false" />
<readerQuotas maxArrayLength="10485760" maxDepth="1024" maxStringContentLength="10485760" />
</binding>
</wsHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="SoapServiceConf">
<serviceCredentials>
<serviceCertificate findValue="soapservice"
storeName="My"
x509FindType="FindByIssuerName" />
</serviceCredentials>
<serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="False" />
</behavior>
<behavior name="MyServiceTypeBehaviors" >
<!-- Add the following element to your service behavior configuration. -->
<serviceMetadata httpGetEnabled="false" httpsGetEnabled="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
谢谢。
解决方案
推荐阅读
- android - Android - 图层列表中的相对位图大小
- json - 使用 scala 将 Spark DF[string] 转换为 Json
- reactjs - Saga 被多次调用
- javascript - Array 中没有重复的颜色
- string - 通过后缀数组的最长公共子串:我们真的需要唯一的哨兵吗?
- r - 通过函数将 URL 传递给 dplyr:mutate 时如何修复“json 文本中的无效字符”
- python - 我的 python 应用程序中的所有线程都显示为“python3”
- powerapps - 灵活高度画廊行下的空间
- firebase - console.debug 未显示在 firebase 函数日志中
- xamarin - 自定义条目 null xamarin