I have used Partner WSDL and created an apex class. I am trying to connect to force.com to get the records. I just started this as an example to get familiar with the SOAP API.
I actually want to use the SOAP API to create and delete the UserTerritory records. I need SOAP API for this because DML on UserTerritory are not supported in apex.
As a start I have created the snippet to get some records using the API, but I am getting an error
Web service callout failed: Unable to parse callout response. Apex type not found for element Name
partnerSoapSforceCom.Soap partner = new partnerSoapSforceCom.Soap(); partner.endpoint_x = 'https://login.salesforce.com/services/Soap/u/39.0'; partnerSoapSforceCom.LoginResult lr = partner.login('UserName', 'Password' + 'SecurityToken'); partnerSoapSforceCom.SessionHeader_element header = new partnerSoapSforceCom.SessionHeader_element(); header.sessionId = UserInfo.getSessionId(); partner.SessionHeader=header; partnerSoapSforceCom.QueryResult qr = partner.query('Select Id, Name from Account limit 1');