SAP Knowledge Base Article - Public

2528664 - SOAP Server returns error : SESS_INVAL during put / upsert of data System.Exception: Put: Invalid session.

Symptom

  • Success Factors is periodically returning an error when customer call soap service, even when isValidSession() method returns 'true';
  • SOAP Web service call returns error : SESS_INVAL during put / upsert of data ; System.Exception: Put: Invalid session.
  • SuccessFactor URL : https://soap4.successfactors.com/axis/services/PartnerService Error Code : SESS_INVAL

Environment

  • Successfactors
  • Third Party Web Service

Cause

Customer third party web service trace log

XXXX-XX-XX 21:08:50,160 SFOperations Login - SFOperations.Login() Results: URL = https://soap4.successfactors.com/axis/services/PartnerService;jsessionid=<SESSIONID>

Resolution

Q. How to Manage the Session ID?

A. The LoginResult will contain the SessionId for the login. Rather than manage the sessionId, enable cookies in the HTTP session, and let the HTTP protocol manage the session attribute for you. Then the login request (SOAP over HTTP) will set the session Id attribute as a cookie.

Note : Below structure is an example for reference.

Example SOAP Request for Login

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:partnerservice="http://partnerService.successfactors.com">
<soapenv:Header/>
<soapenv:Body>
<partnerservice:login>
<credential>
<companyId xsi:type="xsd:string">CompanyID</companyId>
<username xsi:type="xsd:string">UserID</username>
<password xsi:type="xsd:string">password-string</password>
</credential>
</partnerservice:login>
</soapenv:Body>
</soapenv:Envelope>

Example SOAP Response for Login

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchemainstance">
<soapenv:Body>
<ns1:loginResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="http://server.partnerService.axis.sfv4.sf.com">
<loginReturn href="#id0"/>
</ns1:loginResponse>
<multiRef id="id0" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:LoginResult"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="urn:PartnerService">
<lastModified xsi:type="soapenc:string" xsi:nil="true"/>
<locale xsi:type="soapenc:string" xsi:nil="true"/>
<objectId xsi:type="soapenc:string" xsi:nil="true"/>
<sessionId xsi:type="soapenc:string">3389XXXXXXXX7112DC80DD7D7FF0A60E </sessionId>
<sfAttributes xsi:type="soapenc:Array" xsi:nil="true"/>
<url xsi:type="soapenc:string"/>
</multiRef>
</soapenv:Body>
</soapenv:Envelope>

Keywords

  • SOAP Server Error
  • Web Service
  • Put: Invalid session.
  • SESS_INVAL
  • Cookie on request URI
, KBA , LOD-SF-INT-API , API & Adhoc API Framework , LOD-SF-INT , Integrations , How To

Product

SAP SuccessFactors HCM Core all versions

Attachments

PartnerService_UserImport.pdf