Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private CrmService GetCrmService()
- {
- // Setup the Authentication Token
- CrmSdk.CrmAuthenticationToken token = new CrmSdk.CrmAuthenticationToken();
- token.OrganizationName = ConfigurationManager.AppSettings["CrmOrg"];
- string crmServerHost = ConfigurationManager.AppSettings["CrmHostName"];
- string crmServerPort = ConfigurationManager.AppSettings["CrmPort"];
- //token.AuthenticationType = 0;
- CrmService service = new CrmService();
- if (crmServerHost != null &&
- crmServerHost.Length > 0)
- {
- service.Url = "http://" + crmServerHost + ":" + crmServerPort + "/MSCRMServices/2007/CrmService.asmx";
- }
- service.Credentials = System.Net.CredentialCache.DefaultCredentials;
- service.CrmAuthenticationTokenValue = token;
- return service;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement