You need to sign in to do that
Don't have an account?
CJDEVCONPRO
Problem with API
Can anybody tell me why I am getting a "405 Get not supported" error message? I have a simple form with two text boxes and a command button. When I click the command button (after entering my login creds) I simply want to open my SForce web space.
Here is my code:
Private Function login() As Boolean
Dim un As String = txtLogin.Text
If un.Length = 0 Then
Return False
End If
Dim pw As String = txtPassword.Text
If pw.Length = 0 Then
Return False
End If
'//Provide feed back while we create the web service binding
lstStatus.Items.Insert(0, Now() & " " & "Creating the binding to the web service...")
'/*
'* Create the binding to the sforce servics
'*/
binding = New sforce.SforceService
'// Time out after a minute
binding.Timeout = 60000
'//Attempt the login giving the user feedback
lstStatus.Items.Insert(0, Now() & " " & "LOGGING IN NOW....")
Try
loginRes = binding.login(un, pw)
Catch e As System.Web.Services.Protocols.SoapException
'// This is likley to be caused by bad username or password
lstStatus.Items.Insert(0, Now() & " " & e.Message & ", please try again.")
Return False
Catch ex As Exception
'// This is something else, probably comminication
lstStatus.Items.Insert(0, Now() & " " & ex.Message & ", please try again.")
Return False
End Try
lstStatus.Items.Insert(0, Now() & " " & "The session id is: " & loginRes.sessionId)
lstStatus.Items.Insert(0, Now() & " " & "The new server url is: " & loginRes.serverUrl)
'//Change the binding to the new endpoint
binding.Url = loginRes.serverUrl
'//Create a new session header object and set the session id to that returned by the login
binding.SessionHeaderValue = New sforce.SessionHeader
binding.SessionHeaderValue.sessionId = loginRes.sessionId
lstStatus.Items.Insert(0, Now() & " " & loginRes.sessionId)
loggedIn = True
Return True
End Function
Here is my code:
Private Function login() As Boolean
Dim un As String = txtLogin.Text
If un.Length = 0 Then
Return False
End If
Dim pw As String = txtPassword.Text
If pw.Length = 0 Then
Return False
End If
'//Provide feed back while we create the web service binding
lstStatus.Items.Insert(0, Now() & " " & "Creating the binding to the web service...")
'/*
'* Create the binding to the sforce servics
'*/
binding = New sforce.SforceService
'// Time out after a minute
binding.Timeout = 60000
'//Attempt the login giving the user feedback
lstStatus.Items.Insert(0, Now() & " " & "LOGGING IN NOW....")
Try
loginRes = binding.login(un, pw)
Catch e As System.Web.Services.Protocols.SoapException
'// This is likley to be caused by bad username or password
lstStatus.Items.Insert(0, Now() & " " & e.Message & ", please try again.")
Return False
Catch ex As Exception
'// This is something else, probably comminication
lstStatus.Items.Insert(0, Now() & " " & ex.Message & ", please try again.")
Return False
End Try
lstStatus.Items.Insert(0, Now() & " " & "The session id is: " & loginRes.sessionId)
lstStatus.Items.Insert(0, Now() & " " & "The new server url is: " & loginRes.serverUrl)
'//Change the binding to the new endpoint
binding.Url = loginRes.serverUrl
'//Create a new session header object and set the session id to that returned by the login
binding.SessionHeaderValue = New sforce.SessionHeader
binding.SessionHeaderValue.sessionId = loginRes.sessionId
lstStatus.Items.Insert(0, Now() & " " & loginRes.sessionId)
loggedIn = True
Return True
End Function
Private SFLink = "https://na4-api.salesforce.com/services/Soap/u/7.0?sid="
I am simply trying to just open my web browser already logged in so it does not prompt me to do so.
I have looked through the docs and nothing is providing the information on the proper way to call the frontdoor.
It used to be this:
https://na1.salesforce.com/secur/frontdoor.jsp?sid=
It told me the new link was this:
https://na4-api.salesforce.com/services/Soap/u/7.0
Any help would be greatly appreciated.
note that frontdoor is an unsupport hack that may go away at any time.