cancel
Showing results for 
Search instead for 
Did you mean: 

CPI-SF - Logout of SuccessFactors HCM Suite fails because of empty header Cookie JSESSIONID

tomvanrooijen
Participant
0 Kudos

Hi all,

I'm setting up employee replication from ECC to SAP using package :

SuccessFactors HCM Suite Talent Management integration with SAP ERP HCM

The first CPI interface called by ECC is the logout from SF using this soap path:

/cxf/hcm2bizx/SFSFSessionHandlingLogoutQueryResult

This integration fails with the following error:

Outbound processing in endpoint at /hcm2bizx/SFSFSessionHandlingLogoutQueryResult failed with message "Fault:Could not generate the XML stream caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'w' (code 119) in prolog; expected '<'
at [row,col {unknown-source}]: [1,1].", caused by "WstxUnexpectedCharException:Unexpected character 'w' (code 119) in prolog; expected '<'
at [row,col {unknown-source}]: [1,1]"

In debug I can see this error which is generated by the soap call to SF::

org.apache.cxf.binding.soap.SoapFault: while trying to load from index 1 of an object array with length 1, returned from java.lang.String.split(java.lang.String)

A working request (from postman directly to SF) looks like this

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:sap-com:document:sap:soap:functions:mc-style">
   <soapenv:Header/>
   <soapenv:Body>
		<ns1:logout xmlns:ns1="urn:sfobject.sfapi.successfactors.com"></ns1:logout>
   </soapenv:Body>
</soapenv:Envelope>

The body content before the soap call to SF is this:

<?xml version="1.0" encoding="UTF-8"?>
<ns1:logout xmlns:ns1="urn:sfobject.sfapi.successfactors.com"></ns1:logout>

I have no idea where this unexpected character is coming from. I can see no more information in CPI or ECC.

Where is this error coming from?

Thanks,

Tom

tomvanrooijen
Participant
0 Kudos

So indeed the real error returned by successfactors is this:

while trying to load from index 1 of an object array with length 1, returned from java.lang.String.split(java.lang.String)

That also explain the unexpected character "w" in error monitoring.

No solution yet though.

tomvanrooijen
Participant
0 Kudos

So I tracked it down to an empty JSESSIONID in the Cookie Header.

The Content modifier called Enricher adds a header called Cookie. The value comes from this xpath statement:

concat('JSESSIONID=',/urn:logoutRequest/sessionId)

The sending message from ECC however does not contain this xpath so the header contains the value "JSESSIONID=" so no value for the session. This is what crashes Successfactors.

So why does SAP not provide the JSESSIONID in the message? A dummy value would suffice for a correct interface

Accepted Solutions (1)

Accepted Solutions (1)

tomvanrooijen
Participant

Well, I finally found the reason.

As it turns out the abap report RH_SFI_SYNCHRONIZE_EMPL_DATA errored out all the employees to be synchronized and at the end triggered the logout process without that a login ever happened.

As long as some employees are sent the login is sent normally and subsequently the logout succeeds as well since ECC now sends a sessionId in the logoutRequest

Sriprasadsbhat
Active Contributor
0 Kudos

Thanks for sharing detailed analysis.

Answers (0)