Skip to main content
Hello
we configures K2 with biztalk component in order to call a biztalk orchestration.

I added the schema of biztalk to the k2 process but when i try to execute the process it throw the following error:

System.Xml.XmlException: Root element is missing.
at K2Code74.SendK2WorkList(ClientEventContext& K2)
at K2Code74.Main(ClientEventContext K2)

i am not understanding what it is?
Please help
I'm not how applicable to your BizTalk issue this may be, but it may help lead to a fix.

It was in regards to multiple XML schemas within one process - one is called "SchemaA" and the other "SchemaB".

On a client page, they were populating controls (on load) on the form using the SchemaA. When clicking on the submit button, trying to save new values to the "SchemaB" file resulted in the same error ("System.Xml.XmlException: Root element is missing.").

In such a case, the following steps fixed the issue:
1. In K2.net Studio make sure to set the metadata for the "SchemaA" field as follows:
-Navigate to and open the "SchemaB" Process xml field.
-From the XML Metadata tab, click the 'Create XML Instance' button to set the metadata if it has not already been set.

2. Change your code to load the MetaData, rather than the Value:
xdoc.LoadXml(myPI.XmlFields("SchemaB").MetaData)

I hope this hits the mark for you too. 😉
thanks for the reply but i foung the problem.
The biztlak server was not mapping data to K2 so the message was always empty.

Reply