0 Replies Latest reply on Apr 22, 2013 10:19 PM by 1003430

    How to Query Contact in C#

      I am attempting to query a contact. Below are the steps and hopefully i am doing something wrong.

      1) Download Contact Custom WSDL for Web Services v2.0
      2) Add the WSDL as a service reference to the Visual Studio project
      3) Login using the Establish() from sample code
      4) See code below - CRMOD.ContactClient does not have a URL like the examples I have seen with account, so I cannot not set the sessionID using the url().
      - when this is called I get a "Server" exception.

      private void TestContactButton_Click(object sender, RoutedEventArgs e)
      Session s = new Session();
      s.username = "username here";
      s.password = "password here";


      CRMOD.ContactClient client = new CRMOD.ContactClient();

      CRMOD.ContactQueryPage_Input input = new CRMOD.ContactQueryPage_Input();

      input.ListOfContact = new CRMOD.ListOfContactQuery();

      CRMOD.queryType queryType = new CRMOD.queryType();
      queryType.Value = "000655898";
      input.ListOfContact.Contact = new CRMOD.ContactQuery();
      input.ListOfContact.Contact.AccountId = queryType;


      CRMOD.ContactQueryPage_Input test = input;

      catch (Exception ex)
      int test = 1;

      Also, I am confused in why my instance of web services does not have an account WSDL.