Custom disassembler without schema. Is it possible?
-
Wednesday, September 05, 2012 7:36 AM
Hi
Due to the difficulties we had receiving EDI messages, our team decided to develop custom parser and biztalk pipeline.
Here's a little snippet from the code:
[ComponentCategory(CategoryTypes.CATID_PipelineComponent)] [ComponentCategory(CategoryTypes.CATID_DisassemblingParser)] [System.Runtime.InteropServices.Guid("BAEC7357-C749-4273-9119-C9450E34B3C6")] public class EdiDisassembler : IDisassemblerComponent, IBaseComponent, IComponentUI { private IBaseMessage message; public void Disassemble(IPipelineContext pContext, IBaseMessage pInMsg) { message = pContext.GetMessageFactory().CreateMessage(); message.AddPart("Body", pContext.GetMessageFactory().CreateMessagePart(), true); var parser = new CUSCAR_D95B(); var errors = new List<ApplicationException>(); var doc = parser.Parse(pInMsg.BodyPart.GetOriginalDataStream(), errors); var serializer = new XmlSerializer(typeof(EdiDocument)); serializer.Serialize(message.BodyPart.Data, doc); } public IBaseMessage GetNext(IPipelineContext pContext) { var result = message; message = null; return result; }
My problem is that I don't want to use a schema, nor validate the message somehow yet. I read somewhere that I had to promote MessageType property in order biztalk to be able to successfully route the message. However, as I said, I don't have a schema for the document. Is there anyway I can avoid promoting MessageType property? When I try to process a document using my disassembler, I get an error saying:
The Messaging engine failed to process a message submitted by adapter:FILE Source URL:C:\Temp\*.edi. Details:The published message could not be routed because no subscribers were found. This error occurs if the subscribing orchestration or send port has not been enlisted, or if some of the message properties necessary for subscription evaluation have not been promoted. Please use the Biztalk Administration console to troubleshoot this failure.
However, it works with other pipeline.
Any help would be appreciated.- Edited by Dato0011 Wednesday, September 05, 2012 7:37 AM
All Replies
-
Monday, September 24, 2012 6:51 PM
I haven't done it but you can have "Untyped Messages" but what is the actual requirement. For instance once it comes out of pipeline then what is the next step in processing.
I guess you can use a send port with filter "Receive Port Name" and simple send the data to the location.
-
Monday, October 01, 2012 1:34 AM
If you simply want to parse the EDI file and route it to a send port do the followning:
- Deploy your custom pipeline (containing your custom disassembler).
- Create your receive port and receive location.
- Set the receive location pipeline to your custom receive pipeline.
- Create your send port.
- Add a send port filter using BTS.ReceivePortName == <Receive Port from Step 2 above>
- Enlist the Send Port and Start the Receive Location.
- Run your test.
If you want to operate on the message (promotion, demotion, orchestration, ...), the output must be XML and must match a deployed schema.
David Downing... If this answers your question, please Mark as the Answer. If this post is helpful, please vote as helpful.
- Edited by David K. Downing Monday, October 01, 2012 1:37 AM
- Edited by David K. Downing Monday, October 01, 2012 3:23 PM
- Proposed As Answer by mitchke Tuesday, October 02, 2012 8:53 AM
- Marked As Answer by LeoTangModerator Friday, October 05, 2012 6:32 AM

