function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Piyush DivechaPiyush Divecha 

Calling external webservice from SFDC

Hi,

I am calling external web service for updating data from SFDC to external system.
We have CA signed certificate.
I am passing endpoint, certificate name that is installed but it is not working and giving below error.Can you please help.

System.CalloutException: Web service callout failed: WebService returned a SOAP Fault: Authentication Failure:  SOAP body must be signed for signature-based authentication. No credentials were provided.  Contact IT SOASvsSupport. faultcode=soap:client faultactor=SOA

//Code
public class WaiverMgmtSfdcPointSynchSOAP {
        public String endpoint_x = 'xxxx';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCertName_x='certificate name';
        public String clientCert_x;
        public String clientCertPasswd_x;
        public Integer timeout_x;
        


        private String[] ns_map_type_info = new String[]{'http://www.example.org/WaiverMgmtSfdcPointSynch/', 'OrgWaivermgmtsfdcpointsynch'};
        public OrgWaivermgmtsfdcpointsynch.StoreAllocatedPointsResponseType StoreAllocatedPoints(OrgWaivermgmtsfdcpointsynch.StoreAllocatedPointsRequestType StoreAllocatedPointsRequest) {
            OrgWaivermgmtsfdcpointsynch.StoreAllocatedPoints_element request_x = new OrgWaivermgmtsfdcpointsynch.StoreAllocatedPoints_element();
            request_x.StoreAllocatedPointsRequest = StoreAllocatedPointsRequest;
            OrgWaivermgmtsfdcpointsynch.StoreAllocatedPointsResponse_element response_x;
            Map<String, OrgWaivermgmtsfdcpointsynch.StoreAllocatedPointsResponse_element> response_map_x = new Map<String, OrgWaivermgmtsfdcpointsynch.StoreAllocatedPointsResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://www.example.org/WaiverMgmtSfdcPointSynch/StoreAllocatedPoints',
              'http://www.example.org/WaiverMgmtSfdcPointSynch/',
              'StoreAllocatedPoints',
              'http://www.example.org/WaiverMgmtSfdcPointSynch/',
              'StoreAllocatedPointsResponse',
              'OrgWaivermgmtsfdcpointsynch.StoreAllocatedPointsResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.StoreAllocatedPointsResponse;
        }
    }
 
pconpcon
It does not look like you are setting the outgoing cert on your request.  Take a look over this article [1] and see if that helps you.

NOTE: When adding code please use the "Add a code sample" button (icon <>) to increase readability and make it easier to reference.

[1] https://developer.salesforce.com/page/Making_Authenticated_Web_Service_Callouts_Using_Two-Way_SSL