title: How do I connect to a CRM IFD web service?
body: <p>I have taken the code from the SDK and made just one modification to set the authentication type but when I try to connect I get an "Unauthorized" error.</p>
  
  <p>My code is:</p>
  
  <pre><code>// Set up the CRM Service.
  CrmAuthenticationToken token = new CrmAuthenticationToken();
  token.AuthenticationType = 2;
  token.OrganizationName = "TESTCRM";
  
  
  CrmService service = new CrmService();
  service.Url = "https://testcrm.ifdtestsystem.com/MSCrmServices/2007/CrmService.asmx";
  service.CrmAuthenticationTokenValue = token;
  //service.Credentials = System.Net.CredentialCache.DefaultCredentials;
  service.Credentials = new NetworkCredential("Bill", "Password");
  
  
  // Create an account entity and assign data to some attributes.
  account newAccount = new account();
  newAccount.name = "Greg Bike Store";
  newAccount.accountnumber = "123456";
  newAccount.address1_postalcode = "98052";
  newAccount.address1_city = "Redmond";
  
  
  // Call the Create method to create an account.
  Guid accountId = service.Create(newAccount);
  </code></pre>