Error evaluating Distinguished Fields?

Home Page Forums BizTalk 2004 – BizTalk 2010 Error evaluating Distinguished Fields?

Viewing 1 reply thread
  • Author
    Posts
    • #16318

      Hi All!

      I am constructing a message in a construction shape of the orchestration like this:

      xmlDocVar = new System.Xml.XmlDocument();

      xmlDocVar.LoadXml(@"<ns0:NewDataSet xmlns:ns0=""http://BizCompTest2.BizCompTest3OutSchema""><Table><CustomerCode>CustomerCode_0</CustomerCode><CustomerName>CustomerName_0</CustomerName><CustomerDescription>CustomerDescription_0</CustomerDescription><LogOID>10</LogOID><LocationID>10</LocationID><RelationshipID>10</RelationshipID></Table></ns0:NewDataSet>&quot;);

      BizCompTest4OutMsg = xmlDocVar;

      BizCompTest4OutMsg.Table.CustomerDescription = "Hello";

      BizCompTest4OutMsg.Table.CustomerName = "Customer 1";

      BizCompTest4OutMsg.Table.LocationID = 232;

      BizCompTest4OutMsg.Table.LogOID = 234324;

      BizCompTest4OutMsg.Table.RelationshipID = 234234;

      BizCompTest4OutMsg.Table.CustomerCode = "23498";

      BizCompTest4OutMsg(MSMQ.CorrelationId) = BizCompTest4InMsg(MSMQ.Id);

      Exception thrown from: segment 1, progress 14

      Inner exception: A failure occurred while evaluating the distinguished field Table.CustomerDescription against the message part data. The message part data does not contain at least one of the nodes specified by the XPath expression (listed below) that corresponds to the distinguished field. The cause for this error may be that the message part data has not been initialized or that the message part data does not conform to the message part schema. Ensure that the message part data is initialized correctly. XPath expression: /*[local-name()='NewDataSet' and namespace-uri()='http://BizCompTest4.BizCompTest4OutSchema'%5D/*%5Blocal-name()='Table&#039; and namespace-uri()='']/*[local-name()='CustomerDescription' and namespace-uri()='']

       

      Exception type: XPathUpdateException

       

      Now all the fields are distinguished in the schema and are available in the orchestration, I just cant seem to figure out why this is happening, I've searched the net but no solid reason has been given for this, please help as this is very important for us.

       

       

      Regards,

      Sajid.

       

       

    • #16319

      The problem is the namespace:

      Your message has a namespace of:  http://BizCompTest2.BizCompTest3OutSchema

      While the xpath has a namespace of http://BizCompTest4.BizCompTest4OutSchema

      The xpath namespace is set when you promote the distinguished field in your schema and will match the schema target namespace.  

      You need to change the namespace in the second line of your code above
      Also, if you set the "Use Default Constructor" property on xmlDocVar you do not need the first line. 

       

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.