There is indeed an issue with not finding the proper constructor for BinarySecurityToken. Could you show us the code?
some issue with init not finding the proper constructor
The error may be a bit misleading. That constructor is marked as protected (similar to package level access in ColdFusion). Meaning you are not allowed to instantiate it from outside the package (in this case from CF). It is also an abstract class. You need to use one of the concrete classes that extends BinarySecurityToken instead. Those will have public constructors.
I've tried using the X509SecurityToken with the same results. Code sample below.
webService = CreateObject(".NET","System.Web.Services.WebService","C:\Windows\Microsoft.NET\Framework\ v2.0.50727\System.Web.dll,C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Web.Service s.dll");
x509Store = CreateObject(".NET","System.Security.Cryptography.X509Certificates.X509Store");
x509Cert2 = CreateObject(".NET","System.Security.Cryptography.X509Certificates.X509Certificate2");
binaryToken = CreateObject(".NET","Microsoft.Web.Services3.Security.Tokens.X509SecurityToken","C:\Progr am Files\Microsoft WSE\v3.0\Microsoft.Web.Services3.dll");
MessageSigX509 = CreateObject(".NET","Microsoft.Web.Services3.Security.MessageSignature","C:\Program Files\Microsoft WSE\v3.0\Microsoft.Web.Services3.dll");
MessageSigUname = CreateObject(".NET","Microsoft.Web.Services3.Security.MessageSignature","C:\Program Files\Microsoft WSE\v3.0\Microsoft.Web.Services3.dll");
storeLoc = CreateObject(".NET","System.Security.Cryptography.X509Certificates.StoreLocation");
storeName = CreateObject(".NET","System.Security.Cryptography.X509Certificates.StoreName");
openFlags = CreateObject(".NET","System.Security.Cryptography.X509Certificates.OpenFlags");
findType = CreateObject(".NET","System.Security.Cryptography.X509Certificates.X509FindType");
str = CreateObject(".NET","System.String");
certs = x509Store.Get_Certificates();
webCerts = certs.Find(findType.FindBySubjectKeyIdentifier,"*******************************",false);
webCert = x509Cert2.init(webCerts.Get_Item(0));
First, can you post the line number where the error occurs and the latest error message?
Second, if the error is occuring on the call to binaryToken.init(webCert); dump webCert . Are you sure you are passing in the correct object?
Message was edited by: -==cfSearching==-
Yes it's binaryToken.init(webCert); that is throwing the error about not finding a constructor.
I've done dumps of all the objects. The webCert object looks good to me. The code seems to be finding the cert in the x509Store. The actual error I get in this instance is:
Unable to find a constructor for class Microsoft.Web.Services3.Security.Tokens.X509SecurityToken that accepts parameters of type ( System.Security.Cryptography.X509Certificates.X509Certificate2 ).
Nothing is jumping out as blatantly wrong so far. But the two typical causes I have run into are wrong class or dll/library mix up.
Does the code work when you run it in .net?
I haven't attempted to run it in .NET. It may come to that though.
Honestly, unless it is a really big hassle to do so, I would try that first. A small test class that duplicates your CF code should tell you very quickly if the problem is with the CF layer or just your syntax or library references.