Home Page › Forums › BizTalk 2004 – BizTalk 2010 › how to get contents of an invalid xmldocument
- This topic has 3 replies, 1 voice, and was last updated 9 years ago by
community-content.
-
AuthorPosts
-
-
August 11, 2006 at 6:21 AM #15241
Do you have schema validation turned on for your Orchestration by any changes? It’s a config file setting. If you haven’t changed it, then you don’t.
I haven’t really tried to accomplish this but the Xml Document should work. If the error actually on the Send Port? Maybe if you use type String for the output message? Or maybe XLangMessasge.
Let me know if you figure it out.
-
August 17, 2006 at 2:53 AM #15242
Ok, how about this.
You get your return message from the pipeline and pass it to a helper .net component. Inside the component, you access the message as an XLang Message of type Stream and load it into something stringbuilder maybe.
In any case, you should have a Stream that you can convert into a String.
The overall return result from the method would be a String (your message). Or you could just return the exact data you are looking for.
I’ll try to build a sample of this and see if I can get it to work but I’ll not have any time in the next few days.
Oh, if you need a starting point for the .net helper you can look at and modify the helper .net class I have in this sample: http://www.biztalkgurus.com/Samples/Debatch-Smaller-Batch-Orchestration.html
If you give it a try, let me know the results.
-
August 9, 2006 at 11:14 AM #15243
Dear all,
My scenario is i calling a send pipeline in orchestration. I pass a message of xmldocument type to this pipeline. pipeline processes incoming message and return result in xmldocument object.
Result is basically a flat file data now whenever i try to extract contents from message that is of xmldocument type it throws exception as it is invalid xml document.
how can i extract contents of an invalid xmldocument??????Regards,
Farukh.-
August 17, 2006 at 2:15 AM #15244
Farukh, Stephen..
I faced this same issue at one point trying to build my notification application.
Basically, whether or not the XML message is valid, you can always access the context properties etc. Basically, you can do whatever you want EXCEPT accessing the payload to read/write etc. The simple fact is that the pipeline didnt return a file as a well formed XML document.
using System.string or XMLdocument as the message type would accomplish the exact same result, but as you probably know, you cant transorm, promote etc.
I solved this by wrapping my \”payload access\” areas in a scope with an exception handler. If the message is not a wellformed doc, then it would be passed to a C# helper class that would read the contents of the message as a stream and conduct a few string methods etc to try to figure out the reason that this file is invalid. you could accomplish the same by calling the ffdasm with one node that is delimited on the eof and then run your logic in that same orchestration or in another one even another orchestration dedicated to this.
All in all, in my use of messages in biztalk, i couldnt find any way to access data in a partially correct message and biztalk will throw an error every time.
if anyone figures out some other way, pass it on. I would love an easier way to solve some of these problems
-
-
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.