locked
CRM 3.0 and SSIS RRS feed

  • Question

  • Hello everyone,

    I'm trying to do some SSIS and CRM 3.0 integration (I need to pull data from CRM using it's web service).
    The problem is that when I add CRM 3.0's WSDL to a SSIS Web Service Task and choose the Service I want to connect to, the following error pops up:

    TITLE: Web Service Task
    ------------------------------

    Item has already been added. Key in dictionary: 'ArrayOfString'  Key being added: 'ArrayOfString'

    ------------------------------
    BUTTONS:

    OK
    ------------------------------

    So, after trying multiple ways to do this I finally tried to code a Custom SSIS task to get the information, however i'm getting an error that the server cannot complete the request.

    If anyone can help me either pointing what's wrong in the code or if there is a better way to get the information from the web service, please let me know.

    Here is the code i'm using:

    Code Snippet





    crm.CrmService myService = new crm.CrmService();
    myService.Url = serveraddr + "/MSCRMServices/2006/CrmService.asmx";
    myService.Credentials = System.Net.CredentialCache.DefaultCredentials;

    // Use a generic request to retrieve multiple records.
    crm.RetrieveMultipleRequest request = new
    crm.RetrieveMultipleRequest();

    // Create the ColumnSet object that indicates the fields to be retrieved.
    crm.ColumnSet cols = new crm.ColumnSet();

    // Set the ColumnSet object's properties.
    cols.Attributes = new string[] { "fullname", "contactid" };

    // Create the ConditionExpression object.
    crm.ConditionExpression condition = new crm.ConditionExpression();

    // Set the condition to be the city equals Sammamish.
    condition.AttributeName = "fullname";
    condition.Operator = crm.ConditionOperator.NotNull;
    //condition.Values = new string[] { "" };

    // Create the FilterExpression object.
    crm.FilterExpression filter = new crm.FilterExpression();

    // Set the filter's properties.
    filter.FilterOperator = crm.LogicalOperator.And;
    filter.Conditions = new crm.ConditionExpression[] { condition };

    // Create the QueryExpression object.
    crm.QueryExpression query = new crm.QueryExpression();

    // Set the QueryExpression object's properties.
    query.EntityName = "contact";

    query.ColumnSet = cols;
    query.Criteria = filter;

    // Set the Request object's properties.
    request.Query = query;

    // Execute the request.
    crm.RetrieveMultipleResponse response = (crm.RetrieveMultipleResponse)myService.Execute(request);

    // Get the results from the response.
    crm.BusinessEntityCollection entities = response.BusinessEntityCollection;


    Friday, August 29, 2008 6:04 PM

Answers

All replies