locked
Uncaught exception (see the 'inner exception' below) has suspended an instance of service RRS feed

  • Question

  • Hello Guys

            

    The service instance will remain suspended until administratively resumed or terminated. 
    If resumed the instance will continue from its last persisted state and may re-throw the same unexpected exception.
    InstanceId: 
    Shape name: 
    ShapeId: 
    Exception thrown from: segment 1, progress 13
    Inner exception: Data at the root level is invalid. Line 1, position 1.

    Exception type: XmlException
    Source: System.Xml
    Target Site: Void Throw(System.Exception)
    The following is a stack trace that identifies the location where the exception occured

       at System.Xml.XmlTextReaderImpl.Throw(Exception e)
       at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
       at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()
       at System.Xml.Xm

    Orchestration Details - 
    1) One receive port (get xml from folder)
    2) One Enter message
    3)Call Orchestration
    4)Leave Message

    Details of Call Orchestration
    Call orchestration call another orchestration to Create record in CRM.

    Any kind of suggestions are welcome

    Thanxs in Advance

    Wednesday, November 30, 2016 5:43 AM

Answers

  • Hi

    Is the above message the one that gets suspended, when you go to your Suspended orchestration instance in Admin Console?

    Note, that if you are passing this message directly to the orchestration, it will not work as it contains the SOAP header and envelope.

    The XML should just contain the message content inside SOAP body, that is -

    <Create xmlns="http://schemas.microsoft.com/xrm/2011/Contracts/Services" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
          <entity xmlns:a="http://schemas.microsoft.com/xrm/2011/Contracts">
            <a:Attributes xmlns:b="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
              <a:KeyValuePairOfstringanyType>
                <b:key>name</b:key>
                <b:value i:type="c:string" xmlns:c="http://www.w3.org/2001/XMLSchema">SOAPAccountTest</b:value>
              </a:KeyValuePairOfstringanyType>

    ...

    ...


    Thanks Arindam

    Wednesday, November 30, 2016 7:17 AM
    Moderator

All replies

  • Hello,

    In CRM message types are quiet different error indicates that xml message which you are generating is not having correct information.

    hope you are generating CRM schemas properly if not then concentrate their and to be more sure send us more details please post what message you generated.

    Regards,

    Sharad Verma

    Wednesday, November 30, 2016 6:55 AM
  • Hi Sharad

    POST http://xxx:0000/ABCDev/XRMServices/2011/Org.svc
    Content-Type: text/xml; charset=utf-8
    SOAPAction: http://schemas.microsoft.com/xrm/2011/Contracts/Services/IOrg/Create

    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
      <s:Body>
        <Create xmlns="http://schemas.microsoft.com/xrm/2011/Contracts/Services" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
          <entity xmlns:a="http://schemas.microsoft.com/xrm/2011/Contracts">
            <a:Attributes xmlns:b="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
              <a:KeyValuePairOfstringanyType>
                <b:key>name</b:key>
                <b:value i:type="c:string" xmlns:c="http://www.w3.org/2001/XMLSchema">SOAPAccountTest</b:value>
              </a:KeyValuePairOfstringanyType>
              <a:KeyValuePairOfstringanyType>
                <b:key>cb_countrycode</b:key>
                <b:value i:type="a:OptionSetValue">
                  <a:Value>169810077</a:Value>
                </b:value>
              </a:KeyValuePairOfstringanyType>
              <a:KeyValuePairOfstringanyType>
                <b:key>cb_enterpriseid</b:key>
                <b:value i:type="a:EntityReference">
                  <a:Id>82c5b7a8-dc7a-e411-91fd-0050569b3222</a:Id>
                  <a:KeyAttributes xmlns:c="http://schemas.microsoft.com/xrm/7.1/Contracts" />
                  <a:LogicalName>cb_enterprise</a:LogicalName>
                  <a:Name i:nil="true" />
                  <a:RowVersion i:nil="true" />
                </b:value>
              </a:KeyValuePairOfstringanyType>
              <a:KeyValuePairOfstringanyType>
                <b:key>cb_importedon</b:key>
                <b:value i:type="c:dateTime" xmlns:c="http://www.w3.org/2001/XMLSchema">2016-11-28T13:11:36.5805514+01:00</b:value>
              </a:KeyValuePairOfstringanyType>
              <a:KeyValuePairOfstringanyType>
                <b:key>cb_iscustomer</b:key>
                <b:value i:type="c:boolean" xmlns:c="http://www.w3.org/2001/XMLSchema">true</b:value>
              </a:KeyValuePairOfstringanyType>
              <a:KeyValuePairOfstringanyType>
                <b:key>revenue</b:key>
                <b:value i:type="a:Money">
                  <a:Value>250</a:Value>
                </b:value>
              </a:KeyValuePairOfstringanyType>
              <a:KeyValuePairOfstringanyType>
                <b:key>numberofemployees</b:key>
                <b:value i:type="c:int" xmlns:c="http://www.w3.org/2001/XMLSchema">25</b:value>
              </a:KeyValuePairOfstringanyType>
            </a:Attributes>
            <a:EntityState i:nil="true" />
            <a:FormattedValues xmlns:b="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
            <a:Id>00000000-0000-0000-0000-000000000000</a:Id>
            <a:KeyAttributes xmlns:b="http://schemas.microsoft.com/xrm/7.1/Contracts" xmlns:c="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
            <a:LogicalName>account</a:LogicalName>
            <a:RelatedEntities xmlns:b="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
            <a:RowVersion i:nil="true" />
          </entity>
        </Create>
      </s:Body>
    </s:Envelope>

     this is the xml which we are passing to the Orchestration...I hope may help you in giving some better suggestions
    Thanxs


    Wednesday, November 30, 2016 7:02 AM
  • Hi

    Is the above message the one that gets suspended, when you go to your Suspended orchestration instance in Admin Console?

    Note, that if you are passing this message directly to the orchestration, it will not work as it contains the SOAP header and envelope.

    The XML should just contain the message content inside SOAP body, that is -

    <Create xmlns="http://schemas.microsoft.com/xrm/2011/Contracts/Services" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
          <entity xmlns:a="http://schemas.microsoft.com/xrm/2011/Contracts">
            <a:Attributes xmlns:b="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
              <a:KeyValuePairOfstringanyType>
                <b:key>name</b:key>
                <b:value i:type="c:string" xmlns:c="http://www.w3.org/2001/XMLSchema">SOAPAccountTest</b:value>
              </a:KeyValuePairOfstringanyType>

    ...

    ...


    Thanks Arindam

    Wednesday, November 30, 2016 7:17 AM
    Moderator
  • Hello,

    I understand you want to call the create entity of CRM, You need to download CRM SDK from the below link that will give you below schemas

    CRM SDK :- https://www.microsoft.com/en-in/download/details.aspx?id=44567

    from one of the schemas your request message will be look like this;

    This is format of the message required from BizTalk and i think your port configuration will need to call proper CRM instance URL;

    please follow this will help you lot to understand CRM Integration with BizTalk.

    Integration with BizTalk :- http://social.technet.microsoft.com/wiki/contents/articles/32258.biztalk-server-2013-r2-integration-with-ms-dynamics-crm-2015.aspx

    CRM Behaviour Extension :- 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

    Regards,

    Sharad Verma

    Wednesday, November 30, 2016 7:31 AM
  • Hello,

    The first thing I would expect is that *somewhere* the orchestration is trying to parse an xml message which contains contains invalid xml data (like an empty message).

    The message you posted looks correct. Have you verified whether this message has actually been sent out to CRM? If so, has CRM responded and do you know what the response is?

    Wednesday, November 30, 2016 7:52 AM
  • Hi Arindam

    Your solution works partially for me.I tried the way you had mentioned.I was able to proceed but now the issue is that orchestration is in Dehydration state.Can you please guide me further how can i proceed from here??

    Thanxs

    Wednesday, November 30, 2016 11:14 AM
  • Hi

    It means that the orchestration has moved past the error.

    An orchestration normally goes to dehydrated state if it is waiting for a response message after it has sent a request - basically a response from a 2-way SendPort is probably being awaited by your orchestration instance.

    I see that you also have a call orchestration - is that being called? Possibly the called orchestration is not getting completed, and the parent is going to dehydrated state.

    You need to inspect which shape in your orchestration is stuck. Use the Orchestration Debugger for this. Right-click the dehydrated orchestration instance in Admin Console -> Orchestration debugger. You can see in timestamp which shape executed last.


    Thanks Arindam



    Wednesday, November 30, 2016 12:16 PM
    Moderator
  • Hi Arindam

    From Dehydrated state it moves to Suspended state and it is throwing exception

    System.Net.WebException: Content Type application/xml; charset=utf-8 was not supported by service http://abcmachine:81/ABCHTTP.svc.  The client and service bindings may be mismatched.

    Can you please guide me how to move further

    Thanxs
     
    Wednesday, November 30, 2016 12:20 PM
  • Hi

    I notice that you have created a new thread for this different error.

    Request you to continue the troubleshooting there.


    Thanks Arindam

    Wednesday, November 30, 2016 12:24 PM
    Moderator