tags:

views:

579

answers:

2

I need to correlate a PDF and a XML file in BizTalk using the PDF filename and value in the XML. How can I read a PDF-file into an orchestration? I somehow have to handle it as XML ...

The reason for the correlation is that I have to have both the PDF and the XML from the sending system before I can write them in a specific order to the receiving system (the PDF file has to be delivered before the XML meta file is sent.).

+5  A: 

Is your requirement to process a PDF file as a binary within BizTalk - process it through BizTalk without ever actually reading anything from the file?

If that is the case then you don't need to parse it to XML at all, you simply read the message into a document of type System.Xml.XmlDocument on your receive location, using a passthrough pipeline.

This document will have all the standard context properties such as received filename that you can use any way you want, including for your correlation.

Richard Seroter has a blog post here that goes into this in some detail.

If you need to parse the PDF to XML than I'm not sure if such an adapter/pipeline even exists. (There are adapters for serializing to a PDF but not the other way around)

David Hall
Excellent! I always thought that was possible but hadn't tried it myself and I've missed Richard S. post. Thanks!
Riri
A: 

I had a situation where we received an XML doc and several PDFs associated with that doc to be processed. The receive location receives the XML and sends it to anorchestration. The orchestration uses the file names from the XML doc to read in the PDF file from a custom componenent. The code moved the PDF but you could also use it to MIME encode it and put it in the XML document.

You mentioned having to wait for the PDF to appear. You can hav the orchestraion do some waits while looking for the PDF to appear.

ChrisLoris