简体   繁体   中英

CRUD processes using SSIS and C# into CRM 2011

I am trying to insert/update contact records in to CRM 2011 (On premise RO15) using CRM web services. I am using SSIS package to get data from my source and using C# (script component) inserting them in to CRM.

Originally I was using one row at a time using ContactInput_ProcessInputRow(ContactInputBuffer Row) method. This would insert one row at a time and after reading this post I changed in to bulk import using ContactInput_ProcessInput(ContactInputBuffer Buffer) method.

This appears to fix the problem at first when it starts inserting rows. But after about 1500 rows, I get timeout error. Normally, I would change the client side timeout settings in config file but because this is done through script component, I don't see config file. I have also increased timeout limit on server side to 24 hours.

The C# code I am using is same as the bulk insert code from the post (linked) above. I have changed the buffer size to 10 as that is what Scribe use and works well with CRM 2011 setup we have.

How do I fix this timeout issue? I am expecting to have around 5K records per integration.

Thank you for the replies. I think I have fix this issue by adding following block of code in app.config file (in script component).

    <system.web>
    <httpRuntime executionTimeout="12000"/>
</system.web>

<system.serviceModel>
    <bindings>
        <netTcpBinding>
            <binding name="longTimeoutBinding"
              receiveTimeout="02:00:00" sendTimeout="02:00:00" closeTimeout="02:00:00" openTimeout="02:00:00">
                <security mode="None"/>
            </binding>
        </netTcpBinding>
    </bindings>

    <services>
        <service name="longTimeoutService"
          behaviorConfiguration="longTimeoutBehavior">
            <endpoint address="net.tcp://localhost/longtimeout/"
              binding="netTcpBinding" bindingConfiguration="longTimeoutBinding" />
        </service>
        </services>
        </system.serviceModel>

I did few follow up tests and I managed to insert/update around 7K records with no error. I hope this help any lost soul like me!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM