tags:

views:

126

answers:

2

Hi, When I try to make a SOAP call, I get the following Error.

soap:ClientGeneral security error (WSSecurityEngine: No crypto property file supplied for decryption)

Can anyone please explain what could have triggered it? Thank you,

            UsernameForCertificateAssertion assertion = new UsernameForCertificateAssertion();


            // Set the X509 Certifcate onto the assertion.

            assertion.X509TokenProvider = new X509TokenProvider(StoreLocation.LocalMachine,
                                                                StoreName.My,
                                                                "3264763f000100000745",
                                                                X509FindType.FindBySerialNumber);



            UsernameTokenProvider token = new UsernameTokenProvider("wsibtITStest-200024932", "T3sting!+$");


            assertion.UsernameTokenProvider = token;
            Policy  policy = new Policy();
            policy.Assertions.Add(assertion);
            service.SetPolicy(policy);                                             

           X509SecurityToken secToken = new X509SecurityToken(col[0]);                
           service.RequestSoapContext.Security.Tokens.Add(secToken);

service.ping();

Where service is an instance of web service. I don't know if I am missing anything.

Thank you,

+1  A: 

It sounds like the Web Service that you're calling implements WS-Security using X.509 certs.

You'll have to contact the author of the Web Service to verify and have them provide you with the cert you need to use to encrypt your request.

Justin Niessner
Thank you for your quick reponse. I already have the certificate and I am attaching it to the request but I am still getting the same error.
nimesh
A: 

This is a generic cryption message. I've seen it before when I haven't setup my decryption handler correctly. I'd say verify that it's setup right and make sure that you're using the same decryption as the encryption (I've seen that bite some folks where I work).

If that doesn't work could you post your config and all the details you can for the error?

SOA Nerd
How do I set up decryption Handler?
nimesh