Welcome to MSDN Blogs Sign in | Join | Help

WSS Adapter handling of InfoPath forms with attachments

InfoPath supports forms with file attachments by encoding the attachement as base64 and including the following PI

<?mso-infoPath-file-attachment-present ?>

at the top of the XML document to indicate that a file has been attached to the document.

WSS adapter works with InfoPath forms with attachements by making sure that it does not add/remove/update any of the PIs that are related to file attachment. If the files are attached to the form in InfoPath then the PI should be there because InfoPath adds it. If the files are attached by your orchestration or some component other than InfoPath, then the orchestration/component needs to add the PI explicitly. The adapter cannot know if a file attachment is included in the form (unless the PI is present in which case there's nothing to be done) so it will never add the PI. You can add the PI explicitly in your orchestration using a construct like this:

msg(XMLNORM.ProcessingInstructionOption) = 1;
msg(XMLNORM.ProcessingInstruction) = "<?mso-infoPath-file-attachment-present ?>";

So, whatever component attaches the files to the form needs to also add the PI. WSS adapter will preserve the PI if it's in the document, but it will never add such a PI to the XML document.

Published Tuesday, June 20, 2006 4:15 PM by Adrian Hamza

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

Wednesday, October 03, 2007 4:59 AM by Mike Kolling

# re: WSS Adapter handling of InfoPath forms with attachments

Hi

Is it possible for Biztalk to open an infopath message and place the file attachments to the infopath message into a folder?

Is there any sample code of how to do this?

Mike

Wednesday, October 03, 2007 3:08 PM by Adrian Hamza

# re: WSS Adapter handling of InfoPath forms with attachments

Yes, it should be possible, but I don't know of any existing samples. You need to get the base64 encoded string from the XML document (using an xpath, or a distinguished property) and then decode it using C# code and the Convert.FromBase64String method. You need to create a BizTalk message from the resulting byte[] and then send that through a port to a file.

Leave a Comment

(required) 
required 
(required) 
 
Page view tracker