1

I use an application which call an extern web service from Salesforce and I get an error during the call.

I get this message :

Could not find client cert with dev name: '***' specified in clientCertName_x

This is my Apex class generated by WSDL2Apex :

//Generated by wsdl2apex

public class tempuriOrgAcnt {
    public class Add_element {
        public schemasDatacontractOrg200407MagellaAcnt.Account account;
        private String[] account_type_info = new String[]{'account','http://tempuri.org/',null,'0','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','true','false'};
        private String[] field_order_type_info = new String[]{'account'};
    }
    public class UpdateResponse_element {
        public String UpdateResult;
        private String[] UpdateResult_type_info = new String[]{'UpdateResult','http://tempuri.org/',null,'0','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','true','false'};
        private String[] field_order_type_info = new String[]{'UpdateResult'};
    }
    public class Delete_element {
        public Integer id;
        public String recordType;
        private String[] id_type_info = new String[]{'id','http://tempuri.org/',null,'0','1','false'};
        private String[] recordType_type_info = new String[]{'recordType','http://tempuri.org/',null,'0','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','true','false'};
        private String[] field_order_type_info = new String[]{'id','recordType'};
    }
    public class Update_element {
        public schemasDatacontractOrg200407MagellaAcnt.Account account;
        private String[] account_type_info = new String[]{'account','http://tempuri.org/',null,'0','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','true','false'};
        private String[] field_order_type_info = new String[]{'account'};
    }
    public class AddResponse_element {
        public String AddResult;
        private String[] AddResult_type_info = new String[]{'AddResult','http://tempuri.org/',null,'0','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','true','false'};
        private String[] field_order_type_info = new String[]{'AddResult'};
    }
    public class DeleteResponse_element {
        public String DeleteResult;
        private String[] DeleteResult_type_info = new String[]{'DeleteResult','http://tempuri.org/',null,'0','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','true','false'};
        private String[] field_order_type_info = new String[]{'DeleteResult'};
    }
    public class ClearUsernameBinding_IAccountService {
        public String endpoint_x = 'http://**.**.***.***:8080/SalesforceGateway/AccountService.svc';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCertName_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public Integer timeout_x;
        private String[] ns_map_type_info = new String[]{'http://schemas.datacontract.org/2004/07/Magellan.Extranet.SalesforceGateway.DataContracts', 'schemasDatacontractOrg200407MagellaAcnt', 'http://tempuri.org/', 'tempuriOrgAcnt', 'http://schemas.microsoft.com/2003/10/Serialization/', '// Account AsyncTempuriOrgAcnt schemasDa'};
        public String Add(schemasDatacontractOrg200407MagellaAcnt.Account account) {
            tempuriOrgAcnt.Add_element request_x = new tempuriOrgAcnt.Add_element();
            request_x.account = account;
            tempuriOrgAcnt.AddResponse_element response_x;
            Map<String, tempuriOrgAcnt.AddResponse_element> response_map_x = new Map<String, tempuriOrgAcnt.AddResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://tempuri.org/IAccountService/Add',
              'http://tempuri.org/',
              'Add',
              'http://tempuri.org/',
              'AddResponse',
              'tempuriOrgAcnt.AddResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.AddResult;
        }
        public String Delete_x(Integer id,String recordType) {
            tempuriOrgAcnt.Delete_element request_x = new tempuriOrgAcnt.Delete_element();
            request_x.id = id;
            request_x.recordType = recordType;
            tempuriOrgAcnt.DeleteResponse_element response_x;
            Map<String, tempuriOrgAcnt.DeleteResponse_element> response_map_x = new Map<String, tempuriOrgAcnt.DeleteResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://tempuri.org/IAccountService/Delete',
              'http://tempuri.org/',
              'Delete',
              'http://tempuri.org/',
              'DeleteResponse',
              'tempuriOrgAcnt.DeleteResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.DeleteResult;
        }
        public String Update_x(schemasDatacontractOrg200407MagellaAcnt.Account account) {
            tempuriOrgAcnt.Update_element request_x = new tempuriOrgAcnt.Update_element();
            request_x.account = account;
            tempuriOrgAcnt.UpdateResponse_element response_x;
            Map<String, tempuriOrgAcnt.UpdateResponse_element> response_map_x = new Map<String, tempuriOrgAcnt.UpdateResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://tempuri.org/IAccountService/Update',
              'http://tempuri.org/',
              'Update',
              'http://tempuri.org/',
              'UpdateResponse',
              'tempuriOrgAcnt.UpdateResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.UpdateResult;
        }
    }
}

I use the attributes "clientCertName_x" and "clientCertPasswd_x" (available in the Apex class) but they doesn't work and I don't understand why bacause the informatic system called from Salesforce doesn't require SSL certificate (what I read on internet), just an username and a password.

Anyone can help me please?

Regards Aurélien

1

Please check if the end-point set in Apex Class is correct and is listed in Remote Site Settings under Security Controls Also, you can generate a Self Signed Certificate from Certificate and Key Management under Security Controls, ask informatica to upload this at their server.

public class HTTPS_Class {

    public String clientCertName_x;
    public String clientCert_x;             // not required with the new process
    public String clientCertPasswd_x; // not required with the new process

etc }

I am calling this class in another Apex class

XYZ.HTTPS_Class p= new XYZ.HTTPS_Class();

     p.clientCertName_x = 'TestCERT'; // TestCERT is the certificate I generated in Salesforce and the same was installed on endpoint server
  • In fact, to call the webservice, I need an username and a password. These parameters (clientCertName_x and clientCertPasswd_x) are for SSL certificates. In the WSDL, there is no place to use username and password. So, it's not my solution, I spoke with an other developer to use a SSL certificate. I am waiting for him.. Regards Aurélien – Aurélien Laval Oct 20 '15 at 12:01

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.