2

WSDL と、C# を使用してヒットする必要がある Web サービスの URL が与えられました。Web サービスは HTTPS 経由でアクセスされ、提供された証明書を使用して SOAP ペイロードに署名する必要があると指示されました。サンプルの SOAP メッセージも提供されており、それを soapUI にプラグインすると、有効な応答が返されます。そのメッセージは次のようになります。

<soapenv:Envelope xmlns:oas="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xis="http://paymetric/2007-07/XiSecureWS.xsd">
   <soapenv:Header><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><wsse:BinarySecurityToken EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" wsu:Id="CertId-94D3D696D2D0F9176413124110633037" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">MIICYDCCAcmgAwIBAgIFLtK9XLEwDQYJKoZIhvcNAQEFBQAwgZQxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJUWDEQMA4GA1UEBxMHSG91c3RvbjEYMBYGA1UEChMPUGF5bWV0cmljLCBJbmMuMQ0wCwYDVQQLEwRTYWFTMRswGQYDVQQDExJQTUNBLnBheW1ldHJpYy5jb20xIDAeBgkqhkiG9w0BCQEWEW1pc0BwYXltZXRyaWMuY29tMB4XDTExMDQxMjE1MDk1M1oXDTEzMDQwMTE1MDk1M1owgYUxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJHQTERMA8GA1UEBxMIQ29sb21idXMxDjAMBgNVBAoTBUFmbGFjMQ4wDAYDVQQLEwVBZmxhYzEWMBQGA1UEAxMNQ2VjaWxsaW8gR2lsbDEeMBwGCSqGSIb3DQEJARYPY2dpbGxAYWZsYWMuY29tMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAMN5LPHPVzhTWkB/R7qJVNMe/Z9dLsCZ5qlo/m1BRS0nGS+EWSTrjeGj12pGIO7xKg+OMOZMOylvNTzsgrh6U+sCAwEAAaMPMA0wCwYDVR0PBAQDAgP4MA0GCSqGSIb3DQEBBQUAA4GBACwh0KaS6RqMRXY4IDTGfWq2KQ+lLpkjtReAXlnpYr350axV9EoPoDkW3MPwdsKPWeFPll4vZQbOw4+kw07rGXrKLydxp2FpCRRNzoGlMTDyA1HpOtL2zMpokXz7HB7E13Y6SwJjK03KTJSw4wJLw/2AzYmZiYbp6L6OvD1lx0fJ</wsse:BinarySecurityToken><ds:Signature Id="Signature-3" xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
<ds:Reference URI="#id-2">
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<ds:DigestValue>0YnXlBdLNSbCMUP0Tuiu3c2ye+g=</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue>
LBpI+U/3Q9utuaNR/8j4smX1VGoOCeexbDmL6xM4nrHpHyNys1J6kOJIwGLOW0XEKRzTbdil5JjO
iKR/jzg5hw==
</ds:SignatureValue>
<ds:KeyInfo Id="KeyId-94D3D696D2D0F9176413124110633038">
<wsse:SecurityTokenReference wsu:Id="STRId-94D3D696D2D0F9176413124110633039" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><wsse:Reference URI="#CertId-94D3D696D2D0F9176413124110633037" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"/></wsse:SecurityTokenReference>
</ds:KeyInfo>
</ds:Signature></wsse:Security></soapenv:Header>
   <soapenv:Body wsu:Id="id-2" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
      <xis:sEncrypt_Input>
         <xis:MaxUnmaskedDigits>4</xis:MaxUnmaskedDigits>
         <xis:isUnmaskedFromLeft>1</xis:isUnmaskedFromLeft>
         <xis:strRawValue>1234123412341234</xis:strRawValue>
      </xis:sEncrypt_Input>
   </soapenv:Body>
</soapenv:Envelope>

WSE 3.0 と WCF を使用してこのサービスにアクセスしようとしました。WSE が時代遅れであり、使用すべきではないことはわかっていますが、この時点で機能するものを切望しており、WCF についてはうまくいきません。

私のWSE実装は次のとおりです。

XiSecureWSService svcXi = new XiSecureWSService();
            SoapContext context = svcXi.RequestSoapContext;

            X509Store store = new X509Store(StoreName.TrustedPeople, StoreLocation.LocalMachine);
            store.Open(OpenFlags.ReadOnly);

            X509Certificate2Collection certs = store.Certificates.Find(X509FindType.FindBySubjectDistinguishedName,
                "certificatelookupinfo", false);

            X509Certificate2 cert;
            X509SecurityToken signatureToken;
            if (certs.Count == 1)
            {
                cert = certs[0];
                signatureToken = new X509SecurityToken(cert);
            }
            else
            {
                signatureToken = null;
            }

            MessageSignature sig = new MessageSignature(signatureToken);

            context.Security.Tokens.Add(signatureToken);
            context.Security.Elements.Add(sig);
            context.Security.MustUnderstand = false;
            context.Security.Timestamp.TtlInSeconds = 60;

            sEncrypt_InputType xiInput = new sEncrypt_InputType();
            xiInput.MaxUnmaskedDigits = 4;
            xiInput.isUnmaskedFromLeft = false;
            xiInput.strRawValue = "1234123412341234";

            sEncrypt_OutputType xiOutput = svcXi.pm_SingleEncrypt(xiInput);

ここに私のWCF実装があります:

XiSecureWSPortTypeClient client = new XiSecureWSPortTypeClient("XiSecureWSServicePort",
                                                                           "https://endpointaddress");

            X509Store store = new X509Store(StoreName.TrustedPeople, StoreLocation.LocalMachine);
            store.Open(OpenFlags.ReadOnly);

            X509Certificate2Collection certs = store.Certificates.Find(X509FindType.FindBySubjectDistinguishedName,
                                                                       "certificatelookupinfo",
                                                                       false);

            X509Certificate2 cert;
            X509SecurityToken signatureToken;
            if (certs.Count == 1)
            {
                cert = certs[0];
                signatureToken = new X509SecurityToken(cert);
            }
            else
            {
                cert = null;
                signatureToken = null;
            }

            SecurityHeaderType security = new SecurityHeaderType();
            client.ClientCredentials.ClientCertificate.Certificate = cert;

            sEncrypt_InputType xiInput = new sEncrypt_InputType();
            xiInput.MaxUnmaskedDigits = 4;
            xiInput.isUnmaskedFromLeft = false;
            xiInput.strRawValue = "1234123412341234";

            sEncrypt_OutputType xiOutput = client.pm_SingleEncrypt(security, xiInput);

私の .config ファイルは次のようになります。

<?xml version="1.0"?>
<configuration>
  <startup>
  <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup>
  <system.serviceModel>
    <protocolMapping>
      <add scheme="https" binding="customBinding"/>
    </protocolMapping>
    <bindings>
      <customBinding>
        <binding name="MyCustomBinding">
          <textMessageEncoding messageVersion="Soap11" />
          <security authenticationMode="CertificateOverTransport" includeTimestamp="true" />
          <httpsTransport keepAliveEnabled="false" />
        </binding>
      </customBinding>
    </bindings>
    <client>
      <endpoint address="https://endpointaddress" binding="customBinding"
        bindingConfiguration="MyCustomBinding" contract="XiSecureWSPortType"
        name="XiSecureWSServicePort" />
    </client>
  </system.serviceModel>
</configuration>

WSE によって生成される SOAP 呼び出しは、次のようになります。

    <?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    <soap:Header>
        <wsa:Action wsu:Id="Id-c93385e7-4e68-4e65-b73f-e0d6040b407a">http://endpoint.wsdl/pm_SingleEncrypt</wsa:Action>
        <wsa:MessageID wsu:Id="Id-dbdda6fd-6d3f-4b1d-8b30-34b87567d865">urn:uuid:054e3fdd-c1ab-4ef8-9e45-d6edbf462272</wsa:MessageID>
        <wsa:ReplyTo wsu:Id="Id-5704430b-7323-468d-9073-ce6f4adb03c6">
            <wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address>
        </wsa:ReplyTo>
        <wsa:To wsu:Id="Id-795dab74-1cab-44ed-8c1e-6cf5db6d89c5">https://endpointaddress</wsa:To>
        <wsse:Security>
            <wsu:Timestamp wsu:Id="Timestamp-5c742cc5-9653-45f3-81cf-691d5e76861c">
                <wsu:Created>2013-03-08T19:53:18Z</wsu:Created>
                <wsu:Expires>2013-03-08T19:54:18Z</wsu:Expires>
            </wsu:Timestamp>
            <wsse:BinarySecurityToken ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" wsu:Id="SecurityToken-d1c1eee1-4eaa-4418-8d80-4416b05b4745">MIICrDCCAhWgAwIBAgIFLtjzLRAwDQYJKoZIhvcNAQEFBQAwgZQxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJUWDEQMA4GA1UEBxMHSG91c3RvbjEYMBYGA1UEChMPUGF5bWV0cmljLCBJbmMuMQ0wCwYDVQQLEwRTYWFTMRswGQYDVQQDExJQTUNBLnBheW1ldHJpYy5jb20xIDAeBgkqhkiG9w0BCQEWEW1pc0BwYXltZXRyaWMuY29tMB4XDTEyMDgzMTE1NTYyOFoXDTE0MDgyMTE1NTYyOFowgY0xCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJTQzETMBEGA1UEBwwKQ2hhcmxlc3RvbjESMBAGA1UECgwJQmxhY2tiYXVkMQwwCgYDVQQLDANVQVQxFjAUBgNVBAMMDUxpbmRhIENvbGxpbnMxIjAgBgkqhkiG9w0BCQEWE25vb25lQGJsYWNrYmF1ZC5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKvvNxFm5pXQepTeBkonadC9AHAlZrwyJheNewJ7gaS+jGNAFPHOabiUHS99TIo5Qp9+iwkKBeHuCiiJCeBzhBUVjTJ+CQFbJc12IhVRvOeW5xnyawbe+025BkK+xfjDFvTU2LIZjAV+3y+TADVWUV4VSALlwARKHH2EOu0JaZqfAgMBAAGjDzANMAsGA1UdDwQEAwID+DANBgkqhkiG9w0BAQUFAAOBgQCGQfBXqMe/Qmr3LIItBzHFyP+qu8+/IA7x+//xOFFm/GpJg8FWd8uHiuWOVNHjxLKzN/o+oKRPs1rBamCjB4CDI9BhKDDi6ZmA2uvSJV2pdEeKL63mgPBb0o8QrFrUWSqoDEGqa8d6vlgXrQSzojIK3rxjd71xfoPcdrcBwHqJCw==</wsse:BinarySecurityToken>
            <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
                <SignedInfo>
                    <ds:CanonicalizationMethod xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
                    <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
                    <Reference URI="#Id-c93385e7-4e68-4e65-b73f-e0d6040b407a">
                        <Transforms>
                            <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
                        </Transforms>
                        <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
                        <DigestValue>kOQUVB/DeBZJiM5sOBtjdtuxXlg=</DigestValue>
                    </Reference>
                    <Reference URI="#Id-dbdda6fd-6d3f-4b1d-8b30-34b87567d865">
                        <Transforms>
                            <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
                        </Transforms>
                        <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
                        <DigestValue>pJRl5c7txgnw4rXEWzrFrmOBVPE=</DigestValue>
                    </Reference>
                    <Reference URI="#Id-5704430b-7323-468d-9073-ce6f4adb03c6">
                        <Transforms>
                            <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
                        </Transforms>
                        <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
                        <DigestValue>YBG6XGu50bEz+yGcUl6LSflpegM=</DigestValue>
                    </Reference>
                    <Reference URI="#Id-795dab74-1cab-44ed-8c1e-6cf5db6d89c5">
                        <Transforms>
                            <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
                        </Transforms>
                        <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
                        <DigestValue>LOUX6dBXgV0UI+2Xz2SbvXCjLZg=</DigestValue>
                    </Reference>
                    <Reference URI="#Timestamp-5c742cc5-9653-45f3-81cf-691d5e76861c">
                        <Transforms>
                            <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
                        </Transforms>
                        <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
                        <DigestValue>tUlKm/sCne9jjjlg/oOtycdFUhI=</DigestValue>
                    </Reference>
                    <Reference URI="#Id-44ed0eaf-f408-45ac-b703-fff9b3fdd638">
                        <Transforms>
                            <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
                        </Transforms>
                        <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
                        <DigestValue>ekZF3fuslJcNRjuXNekGZ49Hdq8=</DigestValue>
                    </Reference>
                </SignedInfo>
                <SignatureValue>K1MfLOS6sHmPxVsaLgTHoS9/Kisy/T07Um0/qlpV+246F+jPy1HbU+K0/pnAGESgLnzzA8bbGp7fZxmoIOx6oAONtI7sqM6E6OxY9g0aw+b+XAL65JT+9cXIKLNOUs9O9f301PGmlJ0ldocz0TkAX9NQTxdv8e8zqhsBLsH9kKo=</SignatureValue>
                <KeyInfo>
                    <wsse:SecurityTokenReference>
                        <wsse:Reference URI="#SecurityToken-d1c1eee1-4eaa-4418-8d80-4416b05b4745" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" />
                    </wsse:SecurityTokenReference>
                </KeyInfo>
            </Signature>
        </wsse:Security>
    </soap:Header>
    <soap:Body wsu:Id="Id-44ed0eaf-f408-45ac-b703-fff9b3fdd638">
        <sEncrypt_Input xmlns="http://endpoint/xsdname.xsd">
            <MaxUnmaskedDigits>4</MaxUnmaskedDigits>
            <isUnmaskedFromLeft>false</isUnmaskedFromLeft>
            <strRawValue>1234123412341234</strRawValue>
        </sEncrypt_Input>
    </soap:Body>
</soap:Envelope>

WCF SOAP 要求は次のようになります。

<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    <s:Header>
        <h:Security xmlns:h="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" />
        <VsDebuggerCausalityData xmlns="http://schemas.microsoft.com/vstudio/diagnostics/servicemodelsink">uIDPo8nVLrfiqatEmo8IboHWGp0AAAAA1E1NtzXJZEGIoAvEM9FGvDB0fAYl39xBpJzQdMwSA8IACQAA</VsDebuggerCausalityData>
        <o:Security xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" s:mustUnderstand="1">
            <u:Timestamp u:Id="_0">
                <u:Created>2013-03-08T21:13:18.546Z</u:Created>
                <u:Expires>2013-03-08T21:18:18.546Z</u:Expires>
            </u:Timestamp>
            <o:BinarySecurityToken u:Id="uuid-ecc8d8b8-ede9-46f6-b589-5d3b606a051a-1" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3">MIICrDCCAhWgAwIBAgIFLtjzLRAwDQYJKoZIhvcNAQEFBQAwgZQxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJUWDEQMA4GA1UEBxMHSG91c3RvbjEYMBYGA1UEChMPUGF5bWV0cmljLCBJbmMuMQ0wCwYDVQQLEwRTYWFTMRswGQYDVQQDExJQTUNBLnBheW1ldHJpYy5jb20xIDAeBgkqhkiG9w0BCQEWEW1pc0BwYXltZXRyaWMuY29tMB4XDTEyMDgzMTE1NTYyOFoXDTE0MDgyMTE1NTYyOFowgY0xCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJTQzETMBEGA1UEBwwKQ2hhcmxlc3RvbjESMBAGA1UECgwJQmxhY2tiYXVkMQwwCgYDVQQLDANVQVQxFjAUBgNVBAMMDUxpbmRhIENvbGxpbnMxIjAgBgkqhkiG9w0BCQEWE25vb25lQGJsYWNrYmF1ZC5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKvvNxFm5pXQepTeBkonadC9AHAlZrwyJheNewJ7gaS+jGNAFPHOabiUHS99TIo5Qp9+iwkKBeHuCiiJCeBzhBUVjTJ+CQFbJc12IhVRvOeW5xnyawbe+025BkK+xfjDFvTU2LIZjAV+3y+TADVWUV4VSALlwARKHH2EOu0JaZqfAgMBAAGjDzANMAsGA1UdDwQEAwID+DANBgkqhkiG9w0BAQUFAAOBgQCGQfBXqMe/Qmr3LIItBzHFyP+qu8+/IA7x+//xOFFm/GpJg8FWd8uHiuWOVNHjxLKzN/o+oKRPs1rBamCjB4CDI9BhKDDi6ZmA2uvSJV2pdEeKL63mgPBb0o8QrFrUWSqoDEGqa8d6vlgXrQSzojIK3rxjd71xfoPcdrcBwHqJCw==</o:BinarySecurityToken>
            <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
                <SignedInfo>
                    <CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
                    <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
                    <Reference URI="#_0">
                        <Transforms>
                            <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
                        </Transforms>
                        <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
                        <DigestValue>8Jq254k3Mqm2AZ58M/7SZ0Oj9hY=</DigestValue>
                    </Reference>
                </SignedInfo>
                <SignatureValue>oUQgQmYxq+RvetZYGBzHMg953V+w0hxoT5BAICFs1xDuNoJi2SYIO2nvyHrywVGpvqMLeY+K89FI9SdfMyPJx6iReZm/QB8gTP5ZwkY9YQxyEEn6hlVnU+CUYaQmBtnAXMJJkQxS+OAzz3SfGBcXZSulGMwRS1fJtbC3tNtBfF4=</SignatureValue>
                <KeyInfo>
                    <o:SecurityTokenReference>
                        <o:Reference URI="#uuid-ecc8d8b8-ede9-46f6-b589-5d3b606a051a-1" />
                    </o:SecurityTokenReference>
                </KeyInfo>
            </Signature>
        </o:Security>
    </s:Header>
    <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <sEncrypt_Input xmlns="http://vendor/xsdfile.xsd">
            <MaxUnmaskedDigits>4</MaxUnmaskedDigits>
            <isUnmaskedFromLeft>false</isUnmaskedFromLeft>
            <strRawValue>4100123412341234</strRawValue>
        </sEncrypt_Input>
    </s:Body>
</s:Envelope>

WSE を使用して何を試しても、「署名または復号化が無効でした」というエラーが表示されます。WCF の実装を試してみると、「要素 'o:Security' のデータを理解する必要がありますが、処理できない」ということがわかります。私はこれについて頭を悩ませてきました - 誰かアイデアを持っていますか?

編集: 現在の SOAP リクエスト:

<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    <s:Header>
        <h:Security xmlns:h="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" u:Id="_2" />
        <VsDebuggerCausalityData xmlns="http://schemas.microsoft.com/vstudio/diagnostics/servicemodelsink">uIDPo9KISySaFjJMiAw5zk9o3qYAAAAAxhoAIROo00iQikvZBzGIH8wpfBfX1e1Kg29TMjN6keYACQAA</VsDebuggerCausalityData>
        <o:Security xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" s:mustUnderstand="1">
            <o:BinarySecurityToken u:Id="uuid-bf6b0577-5466-4726-ac5e-2ba07665475f-2" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">MIICrDCCAhWgAwIBAgIFLtjzLRAwDQYJKoZIhvcNAQEFBQAwgZQxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJUWDEQMA4GA1UEBxMHSG91c3RvbjEYMBYGA1UEChMPUGF5bWV0cmljLCBJbmMuMQ0wCwYDVQQLEwRTYWFTMRswGQYDVQQDExJQTUNBLnBheW1ldHJpYy5jb20xIDAeBgkqhkiG9w0BCQEWEW1pc0BwYXltZXRyaWMuY29tMB4XDTEyMDgzMTE1NTYyOFoXDTE0MDgyMTE1NTYyOFowgY0xCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJTQzETMBEGA1UEBwwKQ2hhcmxlc3RvbjESMBAGA1UECgwJQmxhY2tiYXVkMQwwCgYDVQQLDANVQVQxFjAUBgNVBAMMDUxpbmRhIENvbGxpbnMxIjAgBgkqhkiG9w0BCQEWE25vb25lQGJsYWNrYmF1ZC5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKvvNxFm5pXQepTeBkonadC9AHAlZrwyJheNewJ7gaS+jGNAFPHOabiUHS99TIo5Qp9+iwkKBeHuCiiJCeBzhBUVjTJ+CQFbJc12IhVRvOeW5xnyawbe+025BkK+xfjDFvTU2LIZjAV+3y+TADVWUV4VSALlwARKHH2EOu0JaZqfAgMBAAGjDzANMAsGA1UdDwQEAwID+DANBgkqhkiG9w0BAQUFAAOBgQCGQfBXqMe/Qmr3LIItBzHFyP+qu8+/IA7x+//xOFFm/GpJg8FWd8uHiuWOVNHjxLKzN/o+oKRPs1rBamCjB4CDI9BhKDDi6ZmA2uvSJV2pdEeKL63mgPBb0o8QrFrUWSqoDEGqa8d6vlgXrQSzojIK3rxjd71xfoPcdrcBwHqJCw==</o:BinarySecurityToken>
            <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
                <SignedInfo>
                    <CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
                    <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
                    <Reference URI="#_1">
                        <Transforms>
                            <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
                        </Transforms>
                        <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
                        <DigestValue>zFBRC19YqaNfiONdpUCbcr4DQxs=</DigestValue>
                    </Reference>
                    <Reference URI="#_2">
                        <Transforms>
                            <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
                        </Transforms>
                        <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
                        <DigestValue>IkDHDcU8EXvtVZTidHKQd1q1g3s=</DigestValue>
                    </Reference>
                </SignedInfo>
                <SignatureValue>a377DsYAjfklKE14NT1NjGWKNQaW2CCBXRpb08tzNcJKHPF07226AxqoA589y+IscFxwzlsQ+S5g4a5DkcXG25HYyNnXktHlQWzn9B1mvElQwY1pgq02hJ5g+Z3/ctyruqu4m1gKexYAtKthor06Zf800L4QNQlfYLDVawawwnc=</SignatureValue>
                <KeyInfo>
                    <o:SecurityTokenReference>
                        <o:Reference ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" URI="#uuid-bf6b0577-5466-4726-ac5e-2ba07665475f-2" />
                    </o:SecurityTokenReference>
                </KeyInfo>
            </Signature>
        </o:Security>
    </s:Header>
    <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" u:Id="_1">
        <sEncrypt_Input xmlns="http://vendor/xsdfile.xsd">
            <MaxUnmaskedDigits>4</MaxUnmaskedDigits>
            <isUnmaskedFromLeft>false</isUnmaskedFromLeft>
            <strRawValue>1234123412341234</strRawValue>
        </sEncrypt_Input>
    </s:Body>
</s:Envelope>
4

1 に答える 1

2

パブリッシュした最後の SOAP は、WSE が生成したものと似ています。wcf はどのように見えますか? あなたが使用したものとは異なり、「mutualCertificate」のauthenticationModeを使用したカスタムバインディングでwcfを使用することをお勧めします。表示されるメッセージの詳細については、こちらをご覧ください

于 2013-03-08T20:31:04.837 に答える