private CrmSdk.CrmService GetCrmService(string organizationName) {
// Setup the Authentication Token
CrmSdk.CrmAuthenticationToken token = new CrmAuthenticationToken();
token.OrganizationName = organizationName;
CrmSdk.CrmService crmService = new CrmSdk.CrmService();
crmService.Credentials = System.Net.CredentialCache.DefaultCredentials;
crmService.CrmAuthenticationTokenValue = token;
return crmService;
}
...
CrmService crmService = GetCrmService("organiacion");
crmService.Credentials = new System.Net.NetworkCredential("usuario", "pass", "domain");
No hay comentarios:
Publicar un comentario