5

In my sandbox I consume a webservice which needs a self signed certificate

WS_SGDil.ServiceSoap ws = new WS_SGDil.ServiceSoap();
ws.clientCertName_x = 'API_Client_Certificate';
return ws;

In the same sandbox I have this certificate picture of certificate

Now when I callout the webservice I receive this exception

System.CalloutException: Web service callout failed: Could not find client cert with dev name: 'API_Client_Certificate' specified in clientCertName_x

Any idea ? Thanks in advance

Edit : Forgot to add, I have the same call and certificate in another sandbox (for the testers). There it works. It's when I'm trying it on my dev sandbox (!= sandbox of the testers) that it fails.

2 Answers 2

5

So the certificate I was trying to reach was definitely in my sandbox. Although it came from a refresh of my sandbox. Apparently .. Salesforce doesn't have a thing for created-from-refresh certs. Because I deleted the certificate, created a new one with the same name, and there it was found by my callout.

Voilà, I don't have a technical explanation, sorry... just my experience.

0

This sounds like you have not added the certificate in the sandbox where the fallout fails. You can check this under the certificate management section in setup.

2
  • It's definitely there. It might sound unrealistic but it's there. I'm looking for a way to query for the certifcate. Commented Oct 3, 2017 at 8:06
  • Hmm. Ok - to be honest your code snippet looks good to me... sorry that I can’t help Commented Oct 3, 2017 at 8:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .