none
Uncaught exception (see the 'inner exception' below) has suspended an instance of service - Data at the root level is invalid. Line 1, position 1. RRS feed

  • Question

  • Hi All,

    I am getting one exception when i am trying to create one record in CRM through Biztalk. Record is created in the CRM but the orchestation got suspended with the following message.

            

    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

    When i checked in the message tab
    Message status shows the following message in Message Parts - Body 

    <CreateResponse xmlns="http://schemas.microsoft.com/xrm/2011/Contracts/Services"><CreateResult>85rt4588-f43df-e611-80c4-005056b26447</CreateResult></CreateResponse>

    Can anyone please guide me whats the issue.Is the issue related with the response i am getting??

    Thanxs

    Monday, December 5, 2016 10:51 AM

Answers

  • Hello,

    You must be having 2-way Physical SendPort in your admin console where you are sending the request to CRM and you are receiving the response back from CRM. During design time in Visual Studio you must have bounded the logical receive port of your Request-Response port type to receive certain type of message similarly you must have bounded the the logical send port of your Request-Response port type to send certain type of message to CRM. 

    Request Schema will have Root Node: Create and Namespace: http://schemas.microsoft.com/xrm/2011/Contracts/Services

    Response schema will have RootNode: CreateResponse and Namespace:http://schemas.microsoft.com/xrm/2011/Contracts/Services

    You need to check that at design time you have selected the right schemas against both Request and Response operation of your logical request-response port in orchestration in Visual Studio. You need to validate the response which you got above with response schema. 

    Please refer for better understanding: http://kentweare.blogspot.in/2011/03/biztalk-2010-calling-dynamics-crm-40.html

    I repeat you should use the BizTalk WCF Service Consuming Wizard to generate the service schemas that is the only recommended way to generate schemas in BizTalk.


    Rachit Sikroria (Microsoft Azure MVP)

    Monday, December 5, 2016 1:29 PM
    Moderator

All replies

  • Hi,

    This is because that response you getting from CRM does not comply to the response schema you have applied on the two way port. Compare the reponse message from the response schema you have.

    You should use the BizTalk WCF Service Consuming Wizard to generate the service schemas and the binding file instead of creating it manually. 

    Refer: 

    http://kentweare.blogspot.in/2011/03/biztalk-2010-calling-dynamics-crm-40.html

    https://jamescorbould.wordpress.com/2013/09/27/biztalk-and-wcf-consuming-a-wcf-service-part-2-the-biztalk-wcf-service-consuming-wizard-and-a-look-at-the-artefacts-created/

    https://msdn.microsoft.com/en-us/library/bb226552.aspx


    Rachit Sikroria (Microsoft Azure MVP)


    Monday, December 5, 2016 11:04 AM
    Moderator
  • Hi Rachit

    Can you please clarify what is this response schema and where i can look for this in my project. I am sorry i am asking such basic questions but i am new to this and want to understand this thing clearly. One more thing in my project there is some condition because that we have to create ports manually.Please suggest solutions related to that .

    Thanks a lot for your help.
    Monday, December 5, 2016 11:57 AM
  • Hello,

    You must be having 2-way Physical SendPort in your admin console where you are sending the request to CRM and you are receiving the response back from CRM. During design time in Visual Studio you must have bounded the logical receive port of your Request-Response port type to receive certain type of message similarly you must have bounded the the logical send port of your Request-Response port type to send certain type of message to CRM. 

    Request Schema will have Root Node: Create and Namespace: http://schemas.microsoft.com/xrm/2011/Contracts/Services

    Response schema will have RootNode: CreateResponse and Namespace:http://schemas.microsoft.com/xrm/2011/Contracts/Services

    You need to check that at design time you have selected the right schemas against both Request and Response operation of your logical request-response port in orchestration in Visual Studio. You need to validate the response which you got above with response schema. 

    Please refer for better understanding: http://kentweare.blogspot.in/2011/03/biztalk-2010-calling-dynamics-crm-40.html

    I repeat you should use the BizTalk WCF Service Consuming Wizard to generate the service schemas that is the only recommended way to generate schemas in BizTalk.


    Rachit Sikroria (Microsoft Azure MVP)

    Monday, December 5, 2016 1:29 PM
    Moderator
  • Hi Rachit

    Thank you so much for your help...the issue is resolved
    Tuesday, December 6, 2016 11:53 AM