- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我已获得 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>
最佳答案
您发布的最后一个 soap 看起来像 WSE 生成的那个。 wcf 是什么样子的?我建议将 wcf 与 authenticatioMode 为“mutualCertificate”的自定义绑定(bind)一起使用,而不是像您使用的那样。参见 here有关您可能会看到的消息的更多详细信息。
关于c# - 尝试通过 WSE 或 WCF 访问 Web 服务时出现 "The signature or decryption was invalid",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15302343/
WSE (Web Services Enhancements) 上有一个旧代码。现在,在适用于 HTTPS 的服务的“沙盒”中,开始使用自签名证书。现在在沙箱中出现错误——无法创建 SSL/TLS 安
我一直在尝试使用 WCF 或 WSE 更改 SOAP 安全元素。 WCF:实现消息检查器并在 Beforerequestsent 中添加自定义代码。在后面的代码中设置以下自定义绑定(bind)后,我在
我一直在尝试使用 WCF 或 WSE 更改 soap 安全元素。 WCF:实现消息检查器并在 Beforerequestsent 中添加您的自定义代码。在后面的代码中设置了以下自定义绑定(bind)后
我对 WSE 和 WCF 都很陌生,我正在尝试使用 WCF 使用 Web 服务,但所有示例文档均适用于 VS2005 + WSE。此 Web 服务使用 WS-Security 1.0。我已经通过 Vi
我尝试为 WSE 3.0 服务创建 WCF 客户端。我已经将 WSE3.0 客户端用于相同的服务。这是它的配置: 服
如何使用 WCF 与老式 WSE 2.0 Web 服务进行通信? 最佳答案 首先,在我看来,WSE 2.0 和 WSE 3.0 都已过时,而不是“老派”。 其次,你“就去做吧”。添加服务引用并通过代理
.NET WSE 线程安全地从 WSDL 生成客户端 stub 吗? 当然,“线程安全”不一定是一个严格定义的术语,所以我至少对以下内容感兴趣: 同一个 stub 类的不同实例是否可由不同线程同时访问
是否可以使用 http.sys 将我自己开发的异常通过 Soap 发送到客户端?? 最佳答案 不幸的是,据我所知,答案是否定的。您不能在服务器端构建自己的自定义异常并期望通过 WSE 在客户端使用它们
尽管在 Visual Studio 2005 中的客户端项目上启用了 WSE 3.0,但我所做的 Web 引用总是以从 SoapHttpClientProtocol 派生的服务代理结束。我必须手动将继
我需要与使用 WSE 2.0 实现 WS-Security 和 DIME 的旧版 .NET Web 服务集成。问题是我需要从 Java 应用程序执行此操作。 我期望 Axis2 能够与 WS-Secu
我已经创建了一个 Web 服务,它有几个使用 .net 3.5 开发的方法。将访问 Web 服务的客户端将使用 .net 3.0。我被要求使此 Web 服务“安全”,并且在网上查看了很多选项。 第一个
我们有一个 Web 服务,其中包含 WSE 3.0 端点和 .NET Framework 4.5 上较新的 WCF 端点。 WCF 使用 basicHttpBinding。 问题是新的 WCF 绑定(
我正在尝试从 C++ 应用程序访问 .net Web 服务(内置于 vs 2008)。我正在使用 IXMLHttpRequest 访问该服务。以下是相关代码: MSXML::IXMLHttpRequ
我需要调用仅支持 DIME 的遗留 SOAP API , 但 DIME 在 WSE 3.0 中不受支持。 遗憾的是,支持 DIME 的 WSE 2.0 不支持与 Visual Studio 2005
我在发送安全 wse header 以使用 Web 服务时遇到问题,并且已经尝试了数十种使用 TargetProcess.com 中的此 Web 服务的方法,但我不确定我做错了什么。 (http://
我在从 WCF 客户端连接到第三方 WSE 3.0 Web 服务时遇到困难。我已经实现了此知识库文章中所示的自定义绑定(bind)类: http://msdn.microsoft.com/en-us/
为此,我在网上找遍了。我一直在做这件事,但我尝试使用其 Web 服务的供应商拒绝正式支持 WCF 作为一种使用方法。 我不是 Web 服务专家,所以我会尽我所能在最初的帖子中记录和解释,但无论如何,如
我已经成功创建了一个在不使用身份验证时可以正常工作的 WS 客户端。 但是,服务器 (WebSphere) 现在需要添加一个 ws-security 用户名 token ,我很难做到这一点。生成的 S
我正在使用 wsdl,它会自动将额外的元素添加到 xml 中。为了使其符合不使用这些元素的外部 Web 服务。请参见下图: http://img406.imageshack.us/img406/130
关于这个区域,我还有几个其他问题,但现在它们有点多余了。任何对他们的回答也将不胜感激,但这个问题是我目前主要关心的问题。 我遵循了很多关于 MTOM/XOP 如何在 WSE 3.0 中工作的示例,并且
我是一名优秀的程序员,十分优秀!