Inclusión de la función de conexión
private CrmService GetCrmService(string organizationName) {
// Setup the Authentication Token
CrmAuthenticationToken token = new CrmAuthenticationToken();
token.OrganizationName = organizationName;
CrmService crmService = new CrmService();
crmService.Credentials = System.Net.CredentialCache.DefaultCredentials;
crmService.CrmAuthenticationTokenValue = token;
return crmService;
}
En el programa principal se conecta
#region Proceso de conexión
crmService = GetCrmService("organizacion");
crmService.Credentials = new System.Net.NetworkCredential("usuario", "pass", "domain");
crmService.Url = "http://127.0.0.1/MSCrmServices/2007/CrmService.asmx";
#endregion
No hay comentarios:
Publicar un comentario