none
Biztalk 2010 with CRM online retreive multiple issues RRS feed

  • Question

  • Hi all,


    I have a scenario where we are trying to retrieve multiple records from CRM online. I followed the blog here :

    http://makdns.blogspot.in/2013/06/reterive-multiple-dynamics-crm-2011.html

    For the deployment and port configuration I did follow that part (the deployment and port configuration on BizTalk administration from this blog:

    http://www.neudesic.com/blog/biztalk-server-dynamics-crm-online-integration-premises-lines-business-systems-using-biztalk-server-2013/


    For the LiveId authentication for CRM I followed this blog (this is also referred on the previous blog) and added the extensions :

    http://blogical.se/blogs/mikael/archive/2011/12/11/i-did-it-so-you-don-t-have-to-connecting-to-dynamics-crm-online-from-biztalk-server.aspx


    I added filters on my WCF Send port :

    BTS.Operation == http://schemas.microsoft.com/xrm/2011/Contracts/Services/IOrganizationService/RetrieveMultiple 
    
      BTS.MessageType == CRMReadTask.IOrganizationService_RetrieveMultiple_InputMessage

    When I put the XML file (input) in receive folder, it throws me an error :


    The adapter failed to transmit message going to send port "WcfSendPort_OrganizationService_CustomBinding_IOrganizationService_Custom" with URL "https://TestOrgSOn.api.crm.dynamics.com/XRMServices/2011/Organization.svc". It will be retransmitted after the retry interval specified for this Send Port. Details:"System.ArgumentOutOfRangeException: The value of this argument must fall within the range 0 to 2.
    Parameter name: headerIndex
    Actual value was -1.
    
    Server stack trace: 
       at System.ServiceModel.Channels.MessageHeaders.RemoveAt(Int32 headerIndex)
       at LiveIdAuthentication.LiveIdAuthenticationMessageInspector.AfterReceiveReply(Message& reply, Object correlationState)
       at System.ServiceModel.Dispatcher.ImmutableClientRuntime.AfterReceiveReply(ProxyRpc& rpc)
       at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
       at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
       at System.ServiceModel.Channels.ServiceChannel.EndRequest(IAsyncResult result)
    
    Exception rethrown at [0]: 
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at System.ServiceModel.Channels.IRequestChannel.EndRequest(IAsyncResult result)
       at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.RequestCallback(IAsyncResult result)".


    I search for this issue but not able to get any answers. I hope someone would help me out here.

    - Girija


    Please mark responses as answered if it helped you.. This helps others... - Girija Shankar Beuria



    Wednesday, November 19, 2014 2:08 PM

Answers


  • If you suddenly start getting the error message "System.ArgumentOutOfRangeException: The value of this argument must fall within the range 0 to 2" you are probably receiving a SOAP fault response.

    Make sure that the service account is still valid, e.g. password has not expired.

    If you add request and response logging to the BehaviorExtension code, you'll see that there will be another error message received AFTER BizTalk has aborted the WCF connection. 

    This message may tell more about the underlying cause.

    //Rene

    • Marked as answer by Girija Beuria Saturday, December 19, 2015 4:47 PM
    Thursday, December 10, 2015 1:08 PM

All replies

  • Your exception is "System.ArgumentOutOfRangeException: The value of this argument must fall within the range 0 to 2"

    So as per my assumption you are firing wrong message to CRM .Can you verify the request what your are sending to Axpata

    Thanks

    Abhishek

    Wednesday, November 19, 2014 6:37 PM
  • Hi,

    Please verify that you have LiveIdAuthentication added into the GAC.

    It may be worth checking the detailed error message in the CRM trace folder.

    Rachit


    Thursday, November 20, 2014 3:33 AM
    Moderator
  • I have followed the steps in the blog and have added the dll into GAC using GacUtil.exe

    - Girija


    Please mark responses as answered if it helped you.. This helps others... - Girija Shankar Beuria

    Thursday, November 20, 2014 4:57 AM
  • Hi,

    My message (XML in receive location) looks something like this (as mentioned in the blog):

    <ns0:Audit xmlns:ns0="http://CRMReadTask.TASKXML">
       <Fetch>
         <Query>
             &lt;fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false"&gt;
               &lt;entity name="task"&gt;
                  &lt;attribute name="subject" /&gt;
                  &lt;attribute name="activityid" /&gt;
                 &lt;order attribute="activityid" descending="false" /&gt;
                 &lt;filter type="and"&gt;
                   &lt;condition attribute="statecode" operator="eq" value="0" /&gt;
                 &lt;/filter&gt;
               &lt;/entity&gt;
             &lt;/fetch&gt;
         </Query>
       </Fetch>
     </ns0:Audit>

    - Girija


    Please mark responses as answered if it helped you.. This helps others... - Girija Shankar Beuria

    Thursday, November 20, 2014 5:01 AM
  • Any suggestions please.

    - Girija


    Please mark responses as answered if it helped you.. This helps others... - Girija Shankar Beuria

    Friday, November 21, 2014 9:55 AM

  • If you suddenly start getting the error message "System.ArgumentOutOfRangeException: The value of this argument must fall within the range 0 to 2" you are probably receiving a SOAP fault response.

    Make sure that the service account is still valid, e.g. password has not expired.

    If you add request and response logging to the BehaviorExtension code, you'll see that there will be another error message received AFTER BizTalk has aborted the WCF connection. 

    This message may tell more about the underlying cause.

    //Rene

    • Marked as answer by Girija Beuria Saturday, December 19, 2015 4:47 PM
    Thursday, December 10, 2015 1:08 PM