title: BizTalk Server and SalesForce - INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session
body: <p>I'm working on an integration scenario between SalesForce and BizTalk Server 2010. I have read the following blogs</p>
  
  <p><a href="http://seroter.wordpress.com/2009/10/11/orchestrating-the-cloud-part-ii-creating-and-consuming-a-salesforce-com-service-from-biztalk-server/" rel="nofollow">http://seroter.wordpress.com/2009/10/11/orchestrating-the-cloud-part-ii-creating-and-consuming-a-salesforce-com-service-from-biztalk-server/</a></p>
  
  <p><a href="http://soa-thoughts.blogspot.com.au/2010/08/biztalk-salesforce-and-msmq-part-i.html" rel="nofollow">http://soa-thoughts.blogspot.com.au/2010/08/biztalk-salesforce-and-msmq-part-i.html</a></p>
  
  <p><a href="http://soa-thoughts.blogspot.com.au/2010/08/biztalk-salesforce-and-msmq-part-ii.html" rel="nofollow">http://soa-thoughts.blogspot.com.au/2010/08/biztalk-salesforce-and-msmq-part-ii.html</a></p>
  
  <p>I set the sessionId in a message assignment shape as described in the posts:</p>
  
  <pre><code>SfdcMessage(WCF.Headers) = "&lt;headers&gt;&lt;SessionHeader&gt;&lt;sessionId&gt;00DK0000005Du2o!AREAQLnrXpVFRAAgwT_Z7iaK0do1IltgHqDLyDfLhbkUGqvFMvzNURdgRtKdPc47cO9sZpOPJ0x8q496vQJsXKGrXt4BcdLW&lt;/sessionId&gt;&lt;/SessionHeader&gt;&lt;/headers&gt;";
  </code></pre>
  
  <p>However when my send port calls the SalesForce custom web service I receive the following error</p>
  
  <p>A message sent to adapter "WCF-BasicHttp" on send port "WcfSendPort_SP" with URI <a href="https://abc.xyz" rel="nofollow">https://abc.xyz</a> is suspended.</p>
  
  <p>Error details: System.ServiceModel.FaultException: sf:INVALID_SESSION_IDINVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session</p>
  
  <p>at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.RequestCallback(IAsyncResult result)</p>
  
  <p>I did some more research and came across these posts: </p>
  
  <p><a href="http://boards.developerforce.com/t5/General-Development/INVALID-SESSION-ID-Invalid-Session-ID-found-in-SessionHeader/td-p/74031" rel="nofollow">http://boards.developerforce.com/t5/General-Development/INVALID-SESSION-ID-Invalid-Session-ID-found-in-SessionHeader/td-p/74031</a></p>
  
  <p><a href="http://boards.developerforce.com/t5/Perl-PHP-Python-Ruby-Development/INVALID-SESSION-ID-Invalid-Session-ID-found-in-SessionHeader/td-p/66846" rel="nofollow">http://boards.developerforce.com/t5/Perl-PHP-Python-Ruby-Development/INVALID-SESSION-ID-Invalid-Session-ID-found-in-SessionHeader/td-p/66846</a></p>
  
  <p><a href="http://boards.developerforce.com/t5/General-Development/INVALID-SESSION-ID-Invalid-Session-ID-found-in-SessionHeader/td-p/200705" rel="nofollow">http://boards.developerforce.com/t5/General-Development/INVALID-SESSION-ID-Invalid-Session-ID-found-in-SessionHeader/td-p/200705</a></p>
  
  <p>Has anyone encountered this issue? </p>
  
  <p>Any help is appreciated.</p>
  
  <p>Cheers,</p>