The scenario where we encountered this issue was during Salesforce integration. Salesforce expects custom header to be passed in the soap envolope.
Issue: INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session. Session not found, missing session hash: wbecQmJucxUexYVBpM7E2jqTFaqEPZRWpOdXMu2wJC8= This error usually occurs after a session expires or a user logs out.
Current :-
msgQueryAllReq(WCF.Headers) = “<headers><SessionHeader xmlns=’urn:partner.soap.sforce.com’><sessionId>” + SessionId + “</sessionId></SessionHeader></headers>”;
New/Solution:-
msgQueryAllReq(WCF.OutboundCustomHeaders) = “<headers><SessionHeader xmlns=’urn:partner.soap.sforce.com’><sessionId>” + SessionId + “</sessionId></SessionHeader></headers>”;
Keep Takeaways:
- WCF.Headers is cached by BizTalk engine.
- SessionHeader should have namespace urn:partner.soap.sforce.com
- Session Inactivity time under profile/user level overrides organisation level timeout settings.
- Session Management setting in Salesforce gives created and valid until time for every session.
- Session ID in login response, session ID in session management and session hash code are linked 1-1.
- Session hash code is unique for any given session ID in Salesforce
References:
https://docs.microsoft.com/en-us/biztalk/core/using-soap-headers-in-wcf-messages-with-orchestrations