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
CJDEVCONPROCJDEVCONPRO 

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
CJDEVCONPROCJDEVCONPRO
Here is the SFLink Dim:

Private SFLink = "https://na4-api.salesforce.com/services/Soap/u/7.0?sid="
SuperfellSuperfell
Why are you trying to do a GET on the soap api endpoint ? what do you mean by open the "web space" ?
CJDEVCONPROCJDEVCONPRO
That is the message I get in my web browser.

I am simply trying to just open my web browser already logged in so it does not prompt me to do so.
SuperfellSuperfell
Search the boards for frontdoor
CJDEVCONPROCJDEVCONPRO
I did and nothing is giving me a definitive answer.

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.
SuperfellSuperfell
https://na4.salesforce.com/secur/frontdoor.jsp?sid=

note that frontdoor is an unsupport hack that may go away at any time.
CJDEVCONPROCJDEVCONPRO
Ummm.... Is there an official link?
SuperfellSuperfell
To open the UI with an existing API generated session? no.