none
Web service call error RRS feed

  • Question

  • Getting error while consuming webservice
    An error was discovered processing the <wsse:Security> header.

    having working sample in soupUI which sends message :

    <soapenv:Envelope xmlns:ns="http://www.macquarie.com/esi/common/1.0" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
    	<soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
    		<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    			<wsu:Timestamp wsu:Id="Timestamp-20" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    				<wsu:Created>2014-12-15T09:37:30.933Z</wsu:Created>
    				<wsu:Expires>2014-12-15T10:27:30.933Z</wsu:Expires>
    			</wsu:Timestamp>
    			<xenc:EncryptedKey Id="EncKeyId-4A2DD5E8B6F77B4313141863625091720">
    				<xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5"/>
    				<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
    					<wsse:SecurityTokenReference>
    						<ds:X509Data>
    							<ds:X509IssuerSerial>
    								<ds:X509IssuerName>CN=Macquarie Bank Limited Issuing CA NTSYDASP106,O=Macquarie Bank Limited,L=Sydney,C=AU</ds:X509IssuerName>
    								<ds:X509SerialNumber>450024862273684526707174</ds:X509SerialNumber>
    							</ds:X509IssuerSerial>
    						</ds:X509Data>
    					</wsse:SecurityTokenReference>
    				</ds:KeyInfo>
    				<xenc:CipherData>
    					<xenc:CipherValue>dgMyAgHZ3jSSjbeLcpgcuHvcPfb+K4RVTNhLw6NUkuBAcwiZmSXDWvgNhTBgE5Cs0Q/fkB7yIN3WatTjVJmZVMzLma8Vhy32eVfdIPhLH+RPhQjAz3YSKl0i46ZNlWZFBqbCI1f2HIaonPppSuPoa+vgitNegZ0u43geo4KsGJQKIeC8Fa8kXvmR/dFna5lT7wS2PheREZOz5S5qGNWF10FPe/XQnRyjTkLhX/yDOUHBjtRhiNiQeKpriMj7AqObWUfnLH0EPkkJW/7pQigzI1sKeJmWQZninsv7PY9K79Lm2yZPVbc1iUiN6It85eq3L9efRCtwmoMfxSjM+dy4rA==</xenc:CipherValue>
    				</xenc:CipherData>
    				<xenc:ReferenceList>
    					<xenc:DataReference URI="#EncDataId-19"/>
    				</xenc:ReferenceList>
    			</xenc:EncryptedKey>
    			<ds:Signature Id="Signature-17" 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-18">
    						<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>Rn2QLj8BaiM2HBIpLBaMILA4X0c=</ds:DigestValue>
    					</ds:Reference>
    				</ds:SignedInfo>
    				<ds:SignatureValue>
    dzxiuD2xYTnz6UGm+iFvC49MvwfGu9altwIwpSKIEdSY/NRcoqKTvbvKNZ9YqQ8pOr9OyRko7/r6
    AUjc8sC9DZoikbdELhy2EFhotVy8L6WdJ/aGueERz13+8KlxGtFYjYCNYUQvrkLqEmixMbbitVXu
    nADkWGvswylix90najRNwVvhSTe/oNnGPYbiqjNO54jxg/4+4vKrFI3Jrt8asa6Ecrgnylu9oduc
    Xapk7suZvtOv5NCDjJbzsnuCAocZQwPqfhPoXgPwOvrYAzH2d9BPfKqjGRqCXi1ohKmlpTmys4UW
    VFPW5Gx62JmJTFwbfeJdYmQ1T38WE38PxhotEw==
    				</ds:SignatureValue>
    				<ds:KeyInfo Id="KeyId-4A2DD5E8B6F77B4313141863625087117">
    					<wsse:SecurityTokenReference wsu:Id="STRId-4A2DD5E8B6F77B4313141863625087118" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    						<ds:X509Data>
    							<ds:X509IssuerSerial>
    								<ds:X509IssuerName>CN=Macquarie Bank Limited Issuing CA NTSYDASP106,O=Macquarie Bank Limited,L=Sydney,C=AU</ds:X509IssuerName>
    								<ds:X509SerialNumber>84691797088927878423978</ds:X509SerialNumber>
    							</ds:X509IssuerSerial>
    						</ds:X509Data>
    					</wsse:SecurityTokenReference>
    				</ds:KeyInfo>
    			</ds:Signature>
    			<wsse:UsernameToken wsu:Id="UsernameToken-16" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    				<wsse:Username>...</wsse:Username>
    				<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">...</wsse:Password>
    			</wsse:UsernameToken>
    		</wsse:Security>
    		<wsa:Action soapenv:mustUnderstand="1">http://www.macquarie.com/esi/common/1.0/getAuthenticationExpiryRequest</wsa:Action>
    		<wsa:MessageID soapenv:mustUnderstand="1">urn:Vendor software name:Software Version:123456789</wsa:MessageID>
    		<wsa:To soapenv:mustUnderstand="1">http://www.macquarie.com/esi/common/v1</wsa:To>
    	</soapenv:Header>
    	<soapenv:Body wsu:Id="id-18" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    		<xenc:EncryptedData Id="EncDataId-19" Type="http://www.w3.org/2001/04/xmlenc#Content">
    			<xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/>
    			<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
    				<wsse:SecurityTokenReference xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    					<wsse:Reference URI="#EncKeyId-4A2DD5E8B6F77B4313141863625091720"/>
    				</wsse:SecurityTokenReference>
    			</ds:KeyInfo>
    			<xenc:CipherData>
    				<xenc:CipherValue>JY2mri8rMGoGZqS0hyRpBy00G5wOP9xwDrby3zEZh7evbDdI/UdYsgxYqBNAGqw0wOAqgPAhCC/H
    acHY8sz3HMVQdGObSJNCHfkhD9Go/94YuLRORxlbAYonQHXjk7JAR24mhiKqRgsArAHoDYR1ujLD
    CBMH/GCC7ZNkrt9gh45UitMFagTaRWN0q1bnVQfQOGtP708SOzDvZX2VUMU5S6DDc/4tyyAYICZT
    DoaAXUrHFVC0zV0qJOOi+VxRNXb66o6OH6VymcYun+5fmTZ7jywSUDrY5fHZNvY/Oeb2QTYPbvi5
    bqc1mDx0LVvxSWX5oDV/9E15TnGUw78Gs75fm5VtkPakPcFkKs+K6fCBH3mEdcZhubimwg2IDQIT
    C/Y31eMBt+tvM32bZc6okoUszOvC319oFrE06GPST5+cyZt8RV4RxHuBH+11BwkqCAUe55pd4Ohp
    W3lyFFlr/MVrwg==</xenc:CipherValue>
    			</xenc:CipherData>
    		</xenc:EncryptedData>
    	</soapenv:Body>
    </soapenv:Envelope>

    and soup message from C# (that results in error)

    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    	<s:Header>
    		<a:Action s:mustUnderstand="1" u:Id="_3">http://www.macquarie.com/esi/common/1.0/getAuthenticationExpiryRequest</a:Action>
    		<a:MessageID s:mustUnderstand="1" u:Id="_4">urn:Vendor software name:Software Version:123456789</a:MessageID>
    		<a:To s:mustUnderstand="1" u:Id="_5">https://www.macquarie.com.au/esi2/esi-gateway/common/v1</a:To>
    		<o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    			<u:Timestamp u:Id="uuid-49dd51ac-85f2-46d5-a60c-626d3bec2e1e-1">
    				<u:Created>2014-12-15T08:27:09.386Z</u:Created>
    				<u:Expires>2014-12-15T08:32:09.386Z</u:Expires>
    			</u:Timestamp>
    			<o:BinarySecurityToken u:Id="uuid-d64027d6-ad3b-4da4-a3a6-39107db990ff-3" 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">MIIIUDCCBzigAwIBAgIKEe8mygACAAMlqjANBgkqhkiG9w0BAQUFADB3MQswCQYDVQQGEwJBVTEPMA0GA1UEBxMGU3lkbmV5MR8wHQYDVQQKExZNYWNxdWFyaWUgQmFuayBMaW1pdGVkMTYwNAYDVQQDEy1NYWNxdWFyaWUgQmFuayBMaW1pdGVkIElzc3VpbmcgQ0EgTlRTWURBU1AxMDYwHhcNMTQwODI0MDYyODA5WhcNMTYwODMwMDg1MjI5WjBtMQswCQYDVQQGEwJBVTEMMAoGA1UECBMDTlNXMQ8wDQYDVQQHEwZTeWRuZXkxHDAaBgNVBAoTE05vd0luZmluaXR5IFB0eSBMdGQxCzAJBgNVBAsTAklUMRQwEgYDVQQDEwtOb3dJbmZpbml0eTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALuuIqwifPY1OhFPq5Rk9hlTxZh1JOUyu2+iG8O3ycveJyZVBejFJaWzQlmb28+1fM82DixAfLRnu31OQqn0J3/yMuXThKZlWYzeKbGtFBbuT0rtccT3BdHc10QZAw5DqYgEo+OiYfIT6g/WotvVPOOi57T7BNcKcl0bIisfgV8o7Cq2e/JApAxVI9Cagd24X+bJF8Bcvx8KdddsnAJv3HWy+wzillwebx/z/hf/6mGl18MCNup2zZEXBb8OM/6eNOK8Vs/5gGdrJxoTF09bGHElooc7kytBu9O7c0mMkc1eQm106oHIYG9oEZojz2XKplClKc7LyRs6ENxSpVVtMYkCAwEAAaOCBOYwggTiMB0GA1UdDgQWBBTcMiMcPndsnB6X5GxZD577RJw3IzAfBgNVHSMEGDAWgBTOlNxuc8KAkhPyoUfWd0LEObC49DCCAfgGA1UdHwSCAe8wggHrMIIB56CCAeOgggHfhoH6bGRhcDovLy9jbj1NYWNxdWFyaWUlMjBCYW5rJTIwTGltaXRlZCUyMElzc3VpbmclMjBDQSUyME5UU1lEQVNQMTA2KDIpLGNuPU5UU1lESU5QMTE0NSxjbj1DRFAsY249UHVibGljJTIwS2V5JTIwU2VydmljZXMsY249U2VydmljZXMsQ049Q29uZmlndXJhdGlvbixEQz1wYyxEQz1pbnRlcm5hbCxEQz1tYWNxdWFyaWUsREM9Y29tP2NlcnRpZmljYXRlUmV2b2NhdGlvbkxpc3Q/YmFzZT9vYmplY3RDbGFzcz1jUkxEaXN0cmlidXRpb25Qb2ludIZvaHR0cDovL3BraWRwMS5wYy5pbnRlcm5hbC5tYWNxdWFyaWUuY29tL0NlcnREYXRhL01hY3F1YXJpZSUyMEJhbmslMjBMaW1pdGVkJTIwSXNzdWluZyUyMENBJTIwTlRTWURBU1AxMDYoMikuY3Jshm9odHRwOi8vcGtpZHAyLnBjLmludGVybmFsLm1hY3F1YXJpZS5jb20vQ2VydERhdGEvTWFjcXVhcmllJTIwQmFuayUyMExpbWl0ZWQlMjBJc3N1aW5nJTIwQ0ElMjBOVFNZREFTUDEwNigyKS5jcmwwggIlBggrBgEFBQcBAQSCAhcwggITMIHqBggrBgEFBQcwAoaB3WxkYXA6Ly8vY249TWFjcXVhcmllJTIwQmFuayUyMExpbWl0ZWQlMjBJc3N1aW5nJTIwQ0ElMjBOVFNZREFTUDEwNixjbj1haWEsY249UHVibGljJTIwS2V5JTIwU2VydmljZXMsY249c2VydmljZXMsQ049Q29uZmlndXJhdGlvbixEQz1wYyxEQz1pbnRlcm5hbCxEQz1tYWNxdWFyaWUsREM9Y29tP2NBQ2VydGlmaWNhdGU/YmFzZT9vYmplY3RDbGFzcz1jZXJ0aWZpY2F0aW9uQXV0aG9yaXR5MHsGCCsGAQUFBzAChm9odHRwOi8vcGtpZHAxLnBjLmludGVybmFsLm1hY3F1YXJpZS5jb20vQ2VydERhdGEvTWFjcXVhcmllJTIwQmFuayUyMExpbWl0ZWQlMjBJc3N1aW5nJTIwQ0ElMjBOVFNZREFTUDEwNigyKS5jcnQwewYIKwYBBQUHMAKGb2h0dHA6Ly9wa2lkcDIucGMuaW50ZXJuYWwubWFjcXVhcmllLmNvbS9DZXJ0RGF0YS9NYWNxdWFyaWUlMjBCYW5rJTIwTGltaXRlZCUyMElzc3VpbmclMjBDQSUyME5UU1lEQVNQMTA2KDIpLmNydDAqBggrBgEFBQcwAYYeaHR0cDovL21nbG9jc3AubGIubWFjYmFuay9vY3NwMAsGA1UdDwQEAwIFoDA8BgkrBgEEAYI3FQcELzAtBiUrBgEEAYI3FQi9wU6BgY1xhJGbKYWPoGyDxp5xQIHJ+A2G8qoJAgFkAgEEMBMGA1UdJQQMMAoGCCsGAQUFBwMBMBsGCSsGAQQBgjcVCgQOMAwwCgYIKwYBBQUHAwEwDQYJKoZIhvcNAQEFBQADggEBAFMUpjggEnqv5zPuQ9rdZcm1Jyzo2Sr66Eu6KTfrI5TS8irJJf6v7TwNgxmuQEFNvKr04ZRBjYALUzC2sWkPZPQD0yl+9j3ZRq5IH0BOH2Dl/qr+UmPgig1L7mDp1tuEjWVAOoJrK3mI66r/6p7pS6hepLlRa3e0RgSMsEnolBO4f/hBmStQX9fAniYqvnxks7GTn2OxMbCLlsNcXQWLJQepeXJ7b9q401STaQMFwSx/zXF1/EJ/5EnHPr3ie9id60glzxa89gYVEnKX6gZnnwbXEMTxaJ3Xmno7DHpEtATCK1awQZxEGBsFFDvuK1EiSrmJt+9B4C+qWMw43wcwgK8=</o:BinarySecurityToken>
    			<e:EncryptedKey Id="_0" xmlns:e="http://www.w3.org/2001/04/xmlenc#">
    				<e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5"/>
    				<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
    					<o:SecurityTokenReference>
    						<X509Data>
    							<X509IssuerSerial>
    								<X509IssuerName>CN=Macquarie Bank Limited Issuing CA NTSYDASP106, O=Macquarie Bank Limited, L=Sydney, C=AU</X509IssuerName>
    								<X509SerialNumber>450024862273684526707174</X509SerialNumber>
    							</X509IssuerSerial>
    						</X509Data>
    					</o:SecurityTokenReference>
    				</KeyInfo>
    				<e:CipherData>
    					<e:CipherValue>bPaCxCEmxOzSM33RrLyhAPei31YMT353jyqa7Xb+qK31LDOmvgNgINnqo1rt7g/n3Axc+1E19D1G6C09XMrk3CDmMNFUcqYJMVJk4Oh0uHSmTdODOFrDNXzd78PlYQGlZHUT7sBpzbmXZBbTqXhW5niEhueBg2iWipFMF3a06Oan5qHW7jn0iCMM9g+NvAUQiHDalR0L062BfMhXVJ6xBahsAva3jK9dF899mEHNDlb3Fa1AK6GfGlX9r88BbTWZnzKsV9CEEcCagu/osUwTwmSKaPpTjhw5mXI9xLKWJlUYD9PKAo8cXzl66RIK9aegUrQL/T9mxJTd+iVAW4w3wg==</e:CipherValue>
    				</e:CipherData>
    			</e:EncryptedKey>
    			<o:UsernameToken u:Id="uuid-d64027d6-ad3b-4da4-a3a6-39107db990ff-1">
    				<o:Username>...</o:Username>
    				<o:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">...</o:Password>
    			</o:UsernameToken>
    			<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="#_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>KESUR3wnkYMIXb4agEq3UAqMKwg=</DigestValue>
    					</Reference>
    					<Reference URI="#_3">
    						<Transforms>
    							<Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
    						</Transforms>
    						<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
    						<DigestValue>YcOMDXFHGK80928CxBOPDXOz4rY=</DigestValue>
    					</Reference>
    					<Reference URI="#_4">
    						<Transforms>
    							<Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
    						</Transforms>
    						<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
    						<DigestValue>Hfe1yXMqyGecR06+siw3qvYn47c=</DigestValue>
    					</Reference>
    					<Reference URI="#_5">
    						<Transforms>
    							<Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
    						</Transforms>
    						<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
    						<DigestValue>rZow+QtahRAsgp8KWacy7sgaEz8=</DigestValue>
    					</Reference>
    					<Reference URI="#uuid-49dd51ac-85f2-46d5-a60c-626d3bec2e1e-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>AdQUzjjRQy1NCSTv3N5SCKO50SY=</DigestValue>
    					</Reference>
    					<Reference URI="#uuid-d64027d6-ad3b-4da4-a3a6-39107db990ff-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>LT1hPoTfWAgx6B/l0BuWem055o4=</DigestValue>
    					</Reference>
    				</SignedInfo>
    				<SignatureValue>kErFNGGMVJZdaK/QaQm7DiZnGHgMEZrKZP3HkGzAHIyiAV1PQBs1tNa/OHIOBlitSsD9KojeY3uTpstDWKExaRxZy4dQNX+tBloicN4d73LYfDR2vXHFgZDX/natHQ8cWp+NhNZeoTImUTZ95pOF2eH3DIdU515Xw7HZTx07Xt7AGz3Wwv1eo/iyE7LODqXO9Cvvhk6YA5+/cJozuEf7gim3i7LfTZJHSoQsKdo2K5L8Y8N0xsAiP8J7J8SrYFCExNEMl0GUKsiGtazGmH1nA/yv5ocIw3sg5yDRLzgQSNTDRQYT/ijyLDVW68JGIEHZNwvdwbKOZYwmuy8/xUnu5A==</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-d64027d6-ad3b-4da4-a3a6-39107db990ff-3"/>
    					</o:SecurityTokenReference>
    				</KeyInfo>
    			</Signature>
    			<e:ReferenceList xmlns:e="http://www.w3.org/2001/04/xmlenc#">
    				<e:DataReference URI="#_1"/>
    			</e:ReferenceList>
    		</o:Security>
    	</s:Header>
    	<s:Body u:Id="_2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    		<e:EncryptedData Id="_1" Type="http://www.w3.org/2001/04/xmlenc#Content" xmlns:e="http://www.w3.org/2001/04/xmlenc#">
    			<e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/>
    			<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
    				<o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    					<o:Reference URI="#_0"/>
    				</o:SecurityTokenReference>
    			</KeyInfo>
    			<e:CipherData>
    				<e:CipherValue>Wz/JQOWl34D3yFyK3NW7GT01FVb49xTE1Idq4IhNlUA=</e:CipherValue>
    			</e:CipherData>
    		</e:EncryptedData>
    	</s:Body>
    </s:Envelope>

    in response for request from c# i'm getting error(HTTP500)

    <soap:Body xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="id-48">
    <soap:Fault>
    <faultcode xmlns:ns1="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">ns1:InvalidSecurity</faultcode>
    <faultstring>Security Error (An error was discovered processing the &lt;wsse:Security> header)</faultstring>
    <detail>
    <ESIFault xmlns="http://www.macquarie.com/esi/common/1.0">
    <ErrorNumber>http://www.macquarie.com/esi/gateway:0006</ErrorNumber>
    <ErrorDetails>Security Error</ErrorDetails>
    <MoreDetails>An error was discovered processing the &lt;wsse:Security> header</MoreDetails>
    </ESIFault>
    </detail>
    </soap:Fault>
    </soap:Body>
    can anybody help with service client?

    Monday, December 15, 2014 12:32 PM

All replies

  • Post the code and config file here.
    Tuesday, December 16, 2014 4:18 AM
  • code for creating client

    public void MakeCall()
            {
                AsymmetricSecurityBindingElement sec;
                sec = (AsymmetricSecurityBindingElement)SecurityBindingElement.CreateMutualCertificateBindingElement(
                    MessageSecurityVersion.WSSecurity10WSTrust13WSSecureConversation13WSSecurityPolicy12BasicSecurityProfile10);
                sec.DefaultAlgorithmSuite = SecurityAlgorithmSuite.Basic128Rsa15;
                sec.IncludeTimestamp = true;
                sec.AllowSerializedSigningTokenOnReply = true;
                sec.MessageProtectionOrder = MessageProtectionOrder.EncryptBeforeSign;
                sec.EndpointSupportingTokenParameters.Signed.Add(new UserNameSecurityTokenParameters());
    
                X509SecurityTokenParameters istp = sec.InitiatorTokenParameters as X509SecurityTokenParameters;
                if (istp != null)
                {
                    istp.X509ReferenceStyle = X509KeyIdentifierClauseType.IssuerSerial;
                }
                X509SecurityTokenParameters rstp = sec.RecipientTokenParameters as X509SecurityTokenParameters;
                if (rstp != null)
                {
                    rstp.X509ReferenceStyle = X509KeyIdentifierClauseType.IssuerSerial;
                }
    
                CustomBinding binding = new CustomBinding();
    
                binding.Elements.Add(sec);
                binding.Elements.Add(new TextMessageEncodingBindingElement(MessageVersion.Soap11WSAddressing10, Encoding.UTF8));
                binding.Elements.Add(new HttpsTransportBindingElement());
    
                EndpointIdentity ei = new DnsEndpointIdentity("esiServer");
                EndpointAddress ea = new EndpointAddress(new Uri("https://www.macquarie.com.au/esi2/esi-gateway/common/v1"), ei,
                    new AddressHeaderCollection());
    
                ChannelFactory<Common10> factory = new ChannelFactory<Common10>(binding, ea);
                factory.Endpoint.Behaviors.Add(new TestEndpointBehavior());
    
                factory.Credentials.ServiceCertificate.DefaultCertificate =
                    new X509Certificate2("..\\..\\certificates\\esiServer_Macquarie_Bank.cer");
                factory.Credentials.ClientCertificate.Certificate =
                    new X509Certificate2("..\\..\\certificates\\nowinfinity.pfx", "PaNPpRb");
     
                factory.Credentials.UserName.UserName = "byRtbik7LWYNb11vRor83B7NMB8=";
                factory.Credentials.UserName.Password = "f4PHy7x48vgw1bmAnPFFfjM2sJ4=";
                factory.Credentials.ServiceCertificate.Authentication.CertificateValidationMode = X509CertificateValidationMode.None;
    
                Common10 cc = factory.CreateChannel();
    
                AuthenticationExpiryRequest req = new AuthenticationExpiryRequest();
                try
                {
                    getAuthenticationExpiryResponse result = cc.getAuthenticationExpiry(new getAuthenticationExpiryRequest());
                }
                catch (Exception ex)
                {
                    Console.WriteLine("-----------------------------------------------------");
                    Console.WriteLine(ex.ToString());
                }
            }

    also i modify headers in message inspector

            public object BeforeSendRequest(ref Message request, IClientChannel channel)
            {
                MessageHeaderInfo messageIdHeaderInfo = null;
                MessageHeaderInfo replyToHeaderInfo = null;
                MessageHeaderInfo debugHeaderInfo = null;
                MessageHeaderInfo toHeaderInfo = null;
                MessageHeaderInfo actionHeaderInfo = null;
                
                foreach(MessageHeaderInfo headerInfo in request.Headers)
                {
                    if (headerInfo.Name == "MessageID")
                        messageIdHeaderInfo = headerInfo;
                    if (headerInfo.Name == "ReplyTo")
                        replyToHeaderInfo = headerInfo;
                    if (headerInfo.Name == "VsDebuggerCausalityData")
                        debugHeaderInfo = headerInfo;
                    if (headerInfo.Name == "To")
                        toHeaderInfo = headerInfo;
                    if (headerInfo.Name == "Action")
                        actionHeaderInfo = headerInfo;
                }
                int messageIdIndex = request.Headers.FindHeader(messageIdHeaderInfo.Name, messageIdHeaderInfo.Namespace);
                request.Headers.RemoveAt(messageIdIndex);
                request.Headers.Add(new MsgIdHeader());
                int debugIndex = request.Headers.FindHeader(debugHeaderInfo.Name, debugHeaderInfo.Namespace);
                request.Headers.RemoveAt(debugIndex);
                
    
                Console.WriteLine("BeforeSendRequest called");
                Console.WriteLine(request.ToString());
                return null;
            }
    and MsgIdHeader is:
            public class MsgIdHeader : MessageHeader
            {
                public MsgIdHeader() { }
    
                public override string Name
                {
                    get { return "MessageID"; }
                }
    
                public override string Namespace
                {
                    get { return "http://www.w3.org/2005/08/addressing"; }
                }
    
                public override bool MustUnderstand
                {
                    get
                    {
                        return true;
                    }
                }
    
                protected override void OnWriteHeaderContents(XmlDictionaryWriter writer, MessageVersion messageVersion)
                {
                    writer.WriteString("urn:Vendor software name:Software Version:123456789");
                }
            }


    Tuesday, December 16, 2014 6:50 AM