function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Srikanth Challa 3Srikanth Challa 3 

INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session. Session not found, missing session key:

Hi Guys, 
We can able to login into salesforce using SOAP API but could not query and get the data as it is showing the above error.
Here is the alert we had from our software. The attachment has the information
***** Flow Input *****
<ServiceMaxEvents>
    <QueryFields></QueryFields>
    <QueryWhere></QueryWhere>
    <IncludeAttachments>YES</IncludeAttachments>
    <ExportToEpiqFlag>CURRENT</ExportToEpiqFlag>
</ServiceMaxEvents>

***** WebService Input *****
<NS1:Envelope xmlns:NS1="http://schemas.xmlsoap.org/soap/envelope/"><NS1:Header><NS2:SessionHeader xmlns:NS2="urn:partner.soap.sforce.com"><NS2:sessionId>00DG0000000Cc2w!AQkAQKVzlT36EenBNfs691CrfZNmp8m0jgE81XMOsSNixx7YIJeDJJ2pyAvUkdLE3rzVIwM_y8nAUUwdBLSGqxb6jdbHoOec</NS2:sessionId></NS2:SessionHeader></NS1:Header><NS1:Body><NS3:query xmlns:NS3="urn:partner.soap.sforce.com"><NS3:queryString>SELECT ID, CaseNumber, Owner.FirstName, Owner.LastName, Owner.Email, CreatedBy.FirstName, CreatedBy.LastName, Owner.Phone, CreatedDate, Date_of_Occurrence__c, Origin, Point_of_Procedure__c, Patient_Status__c, Reply_Requested__c, Product_Return__c, Account.Name, Account.ShippingStreet, Account.ShippingCity, Account.ShippingState, Account.ShippingPostalCode, Account.ShippingCountry, SJM_Contact__r.FirstName, SJM_Contact__r.LastName, SJM_Contact_Phone__c, SJM_Contact_Email__c, Customer_Contact__r.FirstName, Customer_Contact__r.LastName, Customer_Contact_Phone__c, Customer_Contact_Email__c, Product_Line__c, SVMXC__Top_Level__r.Name, SVMXC__Top_Level__r.SVMXC__Serial_Lot_Number__c, SVMXC__Product__r.Name, SVMXC__Component__r.Name, Component_Serial_Number__c, Model_Number__c, SVMXC__Product__r.Model__c, Reported_Serial_lot_Number__c, Description, Symptom__c, Root_Cause__c, Resolution_Summary__c, SVMXC__Top_Level__r.Software_Version__c, (SELECT Id FROM Attachments ORDER BY Id) FROM Case WHERE (Type = &apos;Break Fix&apos; OR Type = &apos;After Hours Break Fix&apos; OR Type = &apos;3rd Party Break Fix&apos;) AND Export_to_EPIQ__c = Null ORDER BY CaseNumber</NS3:queryString></NS3:query></NS1:Body></NS1:Envelope>

***** WebService Output *****
<NS1:Fault xmlns:NS1="http://schemas.xmlsoap.org/soap/envelope/"><faultcode>sf:INVALID_SESSION_ID</faultcode><faultstring>INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session. Session not found, missing session key: 00DG0000000Cc2w!AQkAQKVzlT36EenBNfs691CrfZNmp8m0jgE81XMOsSNixx7YIJeDJJ2pyAvUkdLE3rzVIwM_y8nAUUwdBLSGqxb6jdbHoOec
This is expected, it can happen if the session has expired and swept away, or if the user logs out, or if its just someone trying to hack in. </faultstring><detail><NS2:UnexpectedErrorFault xmlns:NS2="urn:fault.partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="sf:UnexpectedErrorFault"><NS2:exceptionCode>INVALID_SESSION_ID</NS2:exceptionCode><NS2:exceptionMessage>Invalid Session ID found in SessionHeader: Illegal Session. Session not found, missing session key: 00DG0000000Cc2w!AQkAQKVzlT36EenBNfs691CrfZNmp8m0jgE81XMOsSNixx7YIJeDJJ2pyAvUkdLE3rzVIwM_y8nAUUwdBLSGqxb6jdbHoOec
This is expected, it can happen if the session has expired and swept away, or if the user logs out, or if its just someone trying to hack in. </NS2:exceptionMessage></NS2:UnexpectedErrorFault></detail></NS1:Fault>

. The screen shots are from a tool called soapUI. 
User-added imageUser-added image
Best Answer chosen by Srikanth Challa 3
Balaji Chowdary GarapatiBalaji Chowdary Garapati
@Srikanth Challa 3:

 Can you try by setting the serverurl property in the second request that came back as the result of login? and see if it works!


Thanks,
Balaji

All Answers

Balaji Chowdary GarapatiBalaji Chowdary Garapati
@Srikanth Challa 3:

 Can you try by setting the serverurl property in the second request that came back as the result of login? and see if it works!


Thanks,
Balaji
This was selected as the best answer
Srikanth Challa 3Srikanth Challa 3
Balaji, it worked with serverurl property. Thank you so much for you support!