• mriera@peretarres.org
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies

Hi,

since yesterday we can't connect from our web service to Salesforce.

 

These are the steps that we have followed:

 

1th Step,- We login against  Salesforce to get a new session Id. We use the next funtion:

 

Public Function LoginSession() As String

        Dim lr As sforce.LoginResult

        Dim ss As sforce.SforceService = New sforce.SforceService

        Dim Id As String

        Try

            lr = ss.login(_userId, _password)

            Id = lr.sessionId

        Catch ex As Exception

            Id = ""

        End Try

        Return Id

    End Function


2th Step.- we try to insert a new record using the session id. We use the next funtion:

 

 

  Public Function InsertarRegistres(ByVal NewCuenta As ws_Salesforce.Account, ByVal SessionId As String) As TRetorn

        Dim I As Integer = 0

        Dim Entitats As ws_Salesforce.ws_SalesforceService = New ws_Salesforce.ws_SalesforceService

        Try

            InicialStatus()

            If SessionId & "" = "" Then

                Retorn.BolError = True

                Retorn.Missatge = "No session"

            Else

                InicialStatus()

                Entitats.SessionHeaderValue = New ws_Salesforce.SessionHeader

                Entitats.SessionHeaderValue.sessionId = SessionId

                Dim NewCuentaOK() As ws_Salesforce.Account

                NewCuentaOK = Entitats.Inserir_Cuenta(NewCuenta)

                If Not NewCuentaOK Is Nothing Then

                    For Each C As ws_Salesforce.Account In NewCuentaOK

                        Retorn.ObjValor = C.Id & ""

                    Next

                Else

                    Retorn.BolError = True

                    Retorn.Missatge = "NOTHING"

                    Retorn.ObjValor = ""

                End If

                'ss.logout()

            End If

        Catch GetError As Exception

            Retorn.BolError = True

            Retorn.Missatge = GetError.Message & ""

            Retorn.ObjValor = ""

        End Try

        Return Retorn

    End Function

 

The function returns the message :

"

INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session. Session not found, missing session key: 00D200000006ZXT!AQ8AQJ_K.7R.VvaC5Bg4BmnFt9EllAGok9hHDVxWwTBqjKnhe7_Ma17zUK4QcWeT_lTgq2EDZ.PSXOBMyMFWjgmoqeNRQrkp

 

Can you help me?

 

Thanks

 

 

 

"