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
SunsterSunster 

Using Version 15 of the API to login properly

I am new to Salesforce and writing my first Integration Application using the Salesforce API. Here is a little background for my issue.

  1. I have downloaded the Partner wsdl for my organization.
  2. I am using VS 2008 and VB for my development platform. 
  3. I have added the Partner.wsdl as a Service Reference

I am currently attempting to login using version 15 of the api. Here is the code that I am using:

Private Function Login() As Boolean 'Create service object Dim bResult As Boolean = False Dim sforcePartnerClient As New SForceTestingPartnerService.SoapClient Dim sforcePartnerLoginResult As SForceTestingPartnerService.LoginResult Dim sforcePartnerGlobalResult As SForceTestingPartnerService.DescribeGlobalResult Try Console.WriteLine("----Login Response----") 'Invoke the login call and save results in LoginResult sforcePartnerClient.Open() sforcePartnerLoginResult = sforcePartnerClient.login(New SForceTestingPartnerService.LoginScopeHeader(), New SForceTestingPartnerService.CallOptions, Me.SalesforceUsername, Me.SalesforcePasswordToken) 'Supposed to set SessionID 'Supposed to set URL If (Not sforcePartnerLoginResult.passwordExpired) Then bResult = True Else Throw New Exception("Salesforce Username Password is expired.") End If If (bResult) Then 'Begin to setup all of the appropriate objects sforcePartnerGlobalResult = sforcePartnerClient.describeGlobal(sforcePartnerSessionHeader, New SForceTestingPartnerService.CallOptions()) End If Catch ex As Exception Me.LogError(ex) Finally sforcePartnerClient.Close() Console.WriteLine("----Login Response----") End Try Return bResult End Function

 

As I am going over the Developer guide for the login call. I noticed that a couple of properties are missing from the Client that seem to be available in the Web Service Reference.

 

  1. Url
  2. SessionHeaderValue

 How are these Property values handled in the Service Reference vs. the Web Service Reference? Or, can you point me to an appropriate example? 

 

Your help would be very much appreciated.