Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>David's answer is the correct answer.</p> <p>Even in cases where you don't know absolutely nothing about the contents of the expected attachments, surely you know their names and locations. Therefore you can use the <em>Flexible Correlation</em> linked to in david's answer like this:</p> <p>The key to the solution is to correlate on the builtin BTS.ReceivedFileName property.</p> <p>First, create a custom receive pipeline, with a custom pipeline component that promotes the BTS.ReceivedFileName context property of the received messages. This simple custom component is fairly easy to write but you can make it straightforward by using third-party frameworks such as, (<em>shameless plug, here</em>) my <a href="http://maximelabelle.wordpress.com/2010/01/28/a-base-class-for-building-custom-pipeline-components/" rel="nofollow">PipelineComponentBase</a> class or the excellent <a href="http://btsplcw.codeplex.com/" rel="nofollow">BizTalk Server Pipeline Component Wizard</a>.</p> <p>Now for the easy part:</p> <ul> <li>Attachments are received in a specific location, designated by its path on the filesystem.</li> <li>Create a receive location that listens to <em>an alternate location</em>, used only to control when files are actually swallowed by BizTalk.</li> <li>In your orchestration, create a correlation type with the BTS.ReceivedFileName property and a correlation set base on this correlation type.</li> <li>When you want to receive binary attachments, send a dummy message with the BTS.ReceivedFileName context property set to the filename of the binary attachment but with the path matching the <em>alternate location</em> ; the one used by the receive location. Initialize the correlation on the send shape.</li> <li>Use an expression shape to copy the binary file from its original location to the one used by the receive location.</li> <li>Finally, use a receive shape bound to the receive port that contains the receive location whose custom receive pipeline will promote the BTS.ReceivedFileName property.</li> </ul> <p>Notice that you actually need to send a message in order to initialize the correlation. It does not matter what message you send actually. What I'd do is send the message through a send pipeline that contains an <em>empty</em> pipeline component. That is a pipeline component that reads the message but return null (so that the message vanishes into thin air before it reaches the adapter). A more elaborate solution would be to use a <em>null</em> adapter. That is an adapter that reads the message but does not do anything about it.</p> <p>These two solutions avoid having many files accumulate in a temporary location somewhere, just for the sake of initializing a correlation!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload