Skip to main content
 using (var auth = new Enterprise.SoapClient())

            {

                var userId = "XXX";

                var password = "XXX";

                 

                Enterprise.LoginResult result = auth.login(null, new Enterprise.CallOptions(), userId , password);

   

                var client = new SendSMSContactControllerPortTypeClient();

                client.SendSMSContact(new SessionHeader() { sessionId = result.sessionId }, new CallOptions(), null, null,

                   model.PhoneNumber, model.Message); 

            }

My question is for some reason the "SendSMSContact" returns following error, any sugessions or ideas are greatly appreciated.

Exception Details:

Invalid Session ID found in SessionHeader: Illegal Session. Session not found, missing session hash: This error usually occurs after a session expires or a user logs out.
3 answers
  1. Jan 16, 2018, 3:12 AM

    These are the below reasons that I can think of which could cause this issue.

    • This error occurs when a subsequent SOAP Service Request is trying to perform any operation however, the session connection may have timed out due to elasped time between 2 subsequent requests. Hence, the Session Id which is included in the SOAP Header of your service request is not valid anymore. You can try setting the Session Timeout value to its maximum which is 120 seconds.
    • Additionally, the Session Id value included in the header is incorrect and hence you could do the following.

      • If you get this error, use appropriate retry mechanism to login again with the given credetnials which will create a new connection and permit you to perform the transaction.
0/9000