Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Web;
- using SFDC;
- namespace SfSoapCore
- {
- class Program
- {
- static string userName = "";
- static string password = "";
- static string securityToken = "";
- static SoapClient sc;
- static loginResponse lresp;
- static LoginResult lres;
- static LoginScopeHeader lsr = null;
- static void Main(string[] args)
- {
- sc = new SoapClient();
- Run();
- }
- static async void Run()
- {
- Task<loginResponse> loginTask = new Task<loginResponse>(SfLogin);
- loginTask.Start();
- lresp = await loginTask;
- lres = lresp.result;
- string serverUrl = lres.serverUrl;
- string sessionId = lres.sessionId;
- Console.WriteLine("Break");
- }
- static async loginResponse SfLogin() //ERROR 'return type of an async method must be void, Task or Task<T>'
- {
- loginResponse lr = await sc.loginAsync(null, userName, password + securityToken);
- return lr;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement