SAP Knowledge Base Article - Public

3113212 - SFAPI login error with HTTP 500 error and "Failed to execute the ExtractVariables: ExtractCompanyId"

Symptom

You are trying to use SFAPI calls, and you get errors like HTTP 500 or the error below:

{"Envelope":{"encodingStyle":"http:\/\/schemas.xmlsoap.org\/soap\/encoding\/","Body":{"Fault":{"faultcode":"soap:Server","faultstring":"Failed to execute the ExtractVariables: ExtractCompanyId","faultactor":{},"detail":{"source":{"errorcode":"steps.extractvariables.ExecutionFailed"}}}}}}

Environment

  • SAP SuccessFactors HCM Suite
    • SFAPI - CompoundEmployee

Reproducing the Issue

You are running your API POST call with SF endpoint:

https://apiXXXX.sapsf.com/sfapi/v1/soap?wsdl    (this endpoint depends of the data center)

 And you are trying to do POST > Login operations

<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
    <Body>
        <login xmlns="urn:sfobject.sfapi.successfactors.com">
            <credential>
                <companyId>YOUR_COMPANY_ID</companyId>
                <username>YOUR_USER</username>
                <password>has_special_chars_like_$_&_@_#_>_"_and_others/password>
            </credential>
        </login>
    </Body>
</Envelope>

Cause

There are 2 possible causes related to this error:

  1. Password with special characters in the Login Operation. 
  2. You are trying to perform the query in CompoundEmployee directly, without performing the Login first.

Resolution

  1. Please change the password:
    Ensure that your password doesn’t contain the XML special character &, <,  >, "
  2. As for the second cause, please perform the login Operation in order to get the session BEFORE performing the actual CE API call.
    You can use the example in the 'Reproducing the Issue' Section if you are using Basic Authentication and want an Login example.

Keywords

SFAPI, SOAP, Login, error, HTTP 500, ECP, ping, CompoundEmployee, {"Envelope":{"encodingStyle":"http:\/\/schemas.xmlsoap.org\/soap\/encoding\/","Body":{"Fault":{"faultcode":"soap:Server","faultstring":"Failed to execute the ExtractVariables: ExtractCompanyId","faultactor":{},"detail":{"source":{"errorcode":"steps.extractvariables.ExecutionFailed"}}}}}}, SAP SuccessFactors API. , KBA , LOD-SF-INT-API , API & Adhoc API Framework , LOD-SF-INT , Integrations , LOD-SF-INT-CE , Compound Employee API , LOD-SF-INT-ECP , SF EC to ECP API's & Connectivity Issues Only , Problem

Product

SAP SuccessFactors HCM Suite all versions