Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Error evaluating Distinguished Fields?
- This topic has 1 reply, 1 voice, and was last updated 9 years, 6 months ago by
community-content.
-
AuthorPosts
-
-
November 4, 2006 at 3:12 AM #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>");
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' 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.
-
November 4, 2006 at 11:43 AM #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.
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.