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