小编gth*_*85f的帖子

具有证书以及客户端和服务签名的WCF消息安全性

我们正在尝试使用x509证书在客户端和WCF服务之间实现消息安全性.客户端发送soap安全标头,服务按预期验证标头.问题是该服务没有使用我们需要的安全头来签署它的响应消息.我相信下面包含了所需的所有信息,但如果您还需要其他信息,请告诉我.谢谢!

该服务的web.config:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.web>
    <customErrors mode="Off" />
  </system.web>
  <system.serviceModel>
    <services>
      <service name="RealIdCardService.AetnaNavigator" behaviorConfiguration="serviceCredentialBehavior">
        <endpoint address="" contract="RealIdCardService.IAetnaNav" binding="wsHttpBinding" bindingConfiguration="InteropCertificateBinding"></endpoint>
        <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="serviceCredentialBehavior">
          <serviceDebug includeExceptionDetailInFaults="true" />
          <serviceMetadata httpsGetEnabled="true" />
          <serviceCredentials>
            <!--certificate storage path in the server-->
            <serviceCertificate findValue="WcfClient" x509FindType="FindBySubjectName" storeLocation="LocalMachine" storeName="TrustedPeople" />
            <issuedTokenAuthentication allowUntrustedRsaIssuers="true" />
            <!--certificate storage path in the client-->
            <clientCertificate>
              <certificate findValue="WcfServer" x509FindType="FindBySubjectName" storeLocation="LocalMachine" storeName="TrustedPeople" />
              <authentication certificateValidationMode="PeerTrust" revocationMode="NoCheck" />
            </clientCertificate>
          </serviceCredentials>
        </behavior>
          </serviceBehaviors>
    </behaviors>
    <bindings>
      <wsHttpBinding>
        <binding name="InteropCertificateBinding"> …
Run Code Online (Sandbox Code Playgroud)

wcf ws-security soap certificate wcf-security

3
推荐指数
1
解决办法
6222
查看次数

Knockout js复选框检查绑定

在淘汰赛中,我试图对一组数据执行foreach以显示复选框.我遇到的问题是,在我与其中一个框交互之前,检查的数据绑定似乎没有运行.例如,下面我生成5个文本框,其中没有一个显示为已选中.但是,当我点击"一个"时,"两个"和"四个"也会被检查,因为它们应该从一开始就是.

使用Javascript:

var viewModel = {};

viewModel.choices = ["one", "two", "three", "four", "five"];
viewModel.selectedChoices = ko.observableArray(["two", "four"]);

viewModel.selectedChoicesDelimited = ko.dependentObservable(function () {
        return viewModel.selectedChoices().join(",");
    });

ko.applyBindings(viewModel);
Run Code Online (Sandbox Code Playgroud)

HTML:

<ul class="options" data-bind="foreach: choices">
    <li><label><input type="checkbox" name="NotifyMembers" data-bind="checked: $parent.selectedChoices, attr: { value: $data }" /><span data-bind="text: $data"></span></label></li>
</ul>
<hr />
<div data-bind="text: selectedChoicesDelimited"></div>
Run Code Online (Sandbox Code Playgroud)

小提琴在:http://jsfiddle.net/bvGG3/1/

谢谢你的帮助.

javascript knockout.js

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