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.


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.


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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.