I am consuming a Java Web Service as a WCF service from .NET.
The service has an HTTPS endpoint and requires the message to be signed with a client certificate.
I have set up WCF tracing and with the Service Trace Viewer I can confirm that the request is signed and sent off as expected and a valid response is returned from the servi开发者_运维技巧ce. But the response is not accepted by my console application. Instead the following exception is thrown:
Cannot find a token authenticator for the 'System.IdentityModel.Tokens.X509SecurityToken' token type. Tokens of that type cannot be accepted according to current security settings.
What am I doing wrong?
Apparently there is a small but significant variation in the way WCF and this Java Web Service implements this type of security (might be specific to this service or might be a general Java issue).
The correct response is received but WCF is unable to interpret a token element.
My solution, or rather workaround, was to utilize the WCF predecessor WSE (Web Service Enhancements 3.0).
A reference to the Microsoft.Web.Services3 assembly, a lot of head scratching (WTFs) and a lengthy work of code including a MutualCertificate10Assertion
later I got my response.
精彩评论