Answered by:
Error: root element missing

Question
-
Hi All,
I am splitting the message in orchestration using Xpath.
Once child document is created I am trying to map it to target message schema.But the Output of the map is null.
and when I try to send it folder or target system.
Error: Root element missing.
I have created child schema based on the complextype (where child is one of the complex typeused by parent) and when I try to assign the same target name space of parent it giving following error.
Namespaces attribute of an import must not match the real value of the enclosing targetNamepace of the schemaPlease let me know what I am missing.
Thanks
MurariThursday, February 25, 2010 4:08 PM
Answers
-
Hi,
You can review this thread: http://www.biztalkgurus.com/forums/p/10869/21704.aspx.
Regards,Steef-Jan Wiggers
MCTS BizTalk Server
http://soa-thoughts.blogspot.com/
If this answers your question please mark it accordingly
BizTalk Server- Proposed as answer by Leonid GanelineModerator Friday, February 26, 2010 6:01 PM
- Marked as answer by Andrew_ZhuModerator Friday, March 5, 2010 7:06 AM
Thursday, February 25, 2010 5:54 PMModerator -
Hi Murali,Have you already tested your map from Visual Studio IDE first? If yes, the XML returned by your xpath expression is not completely matching with the required XML Source Schema of your map. If not, please test your map first, so that you can ensure that your XSLT works properly.Also try removing namespace to your child schema because your original XML might not have namespace..The problem "root element is missing" comes frequently due to any mismatch between your schema and XML and even deserialization as well.. I would suggest to check the instance of your schema,source XML, Destination XML, Map thoroughly.. also try validating your input XML with the schema you are using..You would find many similar threads in this forum and other Web Service & XML Serialization forum as well. try searching "root element is missing" in forum...
Thanks. Mo- Proposed as answer by Leonid GanelineModerator Friday, February 26, 2010 6:01 PM
- Marked as answer by Andrew_ZhuModerator Friday, March 5, 2010 7:06 AM
Thursday, February 25, 2010 6:02 PM -
Hi All,
I am splitting the message in orchestration using Xpath.
Once child document is created I am trying to map it to target message schema.But the Output of the map is null.
and when I try to send it folder or target system.
Error: Root element missing.
I have created child schema based on the complextype (where child is one of the complex typeused by parent) and when I try to assign the same target name space of parent it giving following error.
Namespaces attribute of an import must not match the real value of the enclosing targetNamepace of the schemaPlease let me know what I am missing.
Thanks
Murari
Just wondering, How did you create your new child schema? Are the complex type enclosed in a root node which have a proper target namespace? The issue here is not with the map but with the message that you are debatching from the original message. Try to set the proper root element and the target namespace in the message you are debatching.
Abdul Rafay - MVP & MCTS BizTalk Server
blog: http://abdulrafaysbiztalk.wordpress.com/
Please mark this as answer if it helps.- Proposed as answer by Leonid GanelineModerator Friday, February 26, 2010 6:01 PM
- Marked as answer by Andrew_ZhuModerator Friday, March 5, 2010 7:06 AM
Thursday, February 25, 2010 6:29 PM
All replies
-
Hi,
You can review this thread: http://www.biztalkgurus.com/forums/p/10869/21704.aspx.
Regards,Steef-Jan Wiggers
MCTS BizTalk Server
http://soa-thoughts.blogspot.com/
If this answers your question please mark it accordingly
BizTalk Server- Proposed as answer by Leonid GanelineModerator Friday, February 26, 2010 6:01 PM
- Marked as answer by Andrew_ZhuModerator Friday, March 5, 2010 7:06 AM
Thursday, February 25, 2010 5:54 PMModerator -
Hi Murali,Have you already tested your map from Visual Studio IDE first? If yes, the XML returned by your xpath expression is not completely matching with the required XML Source Schema of your map. If not, please test your map first, so that you can ensure that your XSLT works properly.Also try removing namespace to your child schema because your original XML might not have namespace..The problem "root element is missing" comes frequently due to any mismatch between your schema and XML and even deserialization as well.. I would suggest to check the instance of your schema,source XML, Destination XML, Map thoroughly.. also try validating your input XML with the schema you are using..You would find many similar threads in this forum and other Web Service & XML Serialization forum as well. try searching "root element is missing" in forum...
Thanks. Mo- Proposed as answer by Leonid GanelineModerator Friday, February 26, 2010 6:01 PM
- Marked as answer by Andrew_ZhuModerator Friday, March 5, 2010 7:06 AM
Thursday, February 25, 2010 6:02 PM -
Also I have found similar error posted by you in the same forum.. http://social.msdn.microsoft.com/Forums/en-US/biztalkgeneral/thread/fae4e5d4-d7ea-4a58-86c9-0e250b325b3a/By any chance you have resolved this?
Thanks. MoThursday, February 25, 2010 6:05 PM -
Hi All,
I am splitting the message in orchestration using Xpath.
Once child document is created I am trying to map it to target message schema.But the Output of the map is null.
and when I try to send it folder or target system.
Error: Root element missing.
I have created child schema based on the complextype (where child is one of the complex typeused by parent) and when I try to assign the same target name space of parent it giving following error.
Namespaces attribute of an import must not match the real value of the enclosing targetNamepace of the schemaPlease let me know what I am missing.
Thanks
Murari
Just wondering, How did you create your new child schema? Are the complex type enclosed in a root node which have a proper target namespace? The issue here is not with the map but with the message that you are debatching from the original message. Try to set the proper root element and the target namespace in the message you are debatching.
Abdul Rafay - MVP & MCTS BizTalk Server
blog: http://abdulrafaysbiztalk.wordpress.com/
Please mark this as answer if it helps.- Proposed as answer by Leonid GanelineModerator Friday, February 26, 2010 6:01 PM
- Marked as answer by Andrew_ZhuModerator Friday, March 5, 2010 7:06 AM
Thursday, February 25, 2010 6:29 PM -
Hi Murari,After you split your message, write the child schema to event log (or whatever trace mechanism you are using). After that save this xml, validate it with your schema using Visual Studio. If it is valid, test your map using this message as input.Regards,Tariq Majeed
Please mark it as answer if it helpsFriday, February 26, 2010 12:23 AM -
Thanks for your responses,
I have tested the child instance with the child schema I have created from complex type used by parent,it failed.
one more strange thing I have observed is I have created schema from child instance and try to validate again back with child instace,and this also failed.Please let me know how should I proceed with this.
Thanks
MurariFriday, February 26, 2010 11:48 AM -
Hi,
This is very confusing .. What exactly you mean by child instance.
As for getting a message to conform to a schema keep the following in mind when you split a message using XPath.
If the schema has a namespace then, when you assign the split message to it, this will fail as when you split a message using XPath it will not bring in your namespace.
Try a debug port which will just drop the split message to a File location using pass through transmit.
Then from this as a sample split message you can create a schema to conform to it.
Cheers
-----------------------------------------
Mark as Answer if this helps.
Friday, February 26, 2010 3:17 PM -
"one more strange thing I have observed is I have created schema from child instance and try to validate again back with child instace,and this also failed."
In your above statement, can you please clarify whether you generated child instance from child schema or generated child schema based on child instance?
xml instance generated from schema in visual studio may not necessarily pass xsd validation as all data in generated xml instance may not satisfy all constraints(like patterns in restrictions) defined in schema.
I have never tried to generate schema from xml instance. I am not sure how accurated such schema would be.
HTH,
Please mark it as answer by clicking on "Propose As Answer", if it helpsFriday, February 26, 2010 3:37 PM -
Thanks for your responses,
I have tested the child instance with the child schema I have created from complex type used by parent,it failed.
one more strange thing I have observed is I have created schema from child instance and try to validate again back with child instace,and this also failed.Please let me know how should I proceed with this.
Thanks
Murari
95% it is something with namespaces and namespace prefixes. Compare the Generated Instance for the child schema with your Xml instance and you will find differences.
Leonid Ganeline [BizTalk MVP] Biztalkien blogFriday, February 26, 2010 6:04 PMModerator