Geekswithblogs.net
HOME
ARCHIVES
CONTACT
LOGIN
El Grego
BizTalk blog
News
My Stats
Posts - 28
Comments - 32
Trackbacks - 55
Twitter
gvdwiele
Damn You Auto Correct Reveals 9 Funniest Texts of the Year
http://t.co/NKIzQnP3
about 68 days ago
gvdwiele
Researcher's Video Shows Secret Software on Millions of Phones Logging Everything
http://t.co/YAmDNYqw
about 73 days ago
gvdwiele
http://t.co/uySVzfgi
This will change everything, fingers crossed...
about 104 days ago
gvdwiele
http://t.co/PWrjFatX
about 105 days ago
gvdwiele
RT
@cultofmac
: New post: What’s So Great About Siri?
http://t.co/1KZkfom5
about 126 days ago
gvdwiele
@hhariri
1 time only so far. Unrelated but very important if you are on Lion:
http://t.co/4vObneV
Helped a lot performance wise...
about 186 days ago
gvdwiele
Emergency exit
http://t.co/ttofCza
about 289 days ago
gvdwiele
Listen
#SoundCloud
:
http://snd.sc/fSI3rL.
now!
about 345 days ago
gvdwiele
@tomasrestrepo
again :)
about 360 days ago
gvdwiele
My custom XLANG parser in action: belanbiz2009
http://skit.ch/brnw
real automated unittesting for orchestrations a step closer :)
about 389 days ago
Tag Cloud
WCF
WPF
more tags...
Recent Comments
Ok, but you did not answer how to solve the proble...
by Zsanett
Hi,Could you please share the code for the custom ...
by harry
is there an updated version of your adapter for BT...
by Anthony
Had a static WCF (basic) sendport and used a pipel...
by Frank Driesens
The GetReference method shows the related document...
by Dipesh A.
Recent Posts
WCF send port behavior
RESTful Enterprise Development
CharacterTranscoder pipeline component on github.com
Question marks in your flatfile output CONTINUED
Question marks in your flatfile output?
Archives
February, 2010 (1)
December, 2009 (1)
September, 2009 (1)
August, 2009 (2)
July, 2009 (1)
June, 2009 (2)
May, 2009 (2)
February, 2009 (1)
December, 2008 (1)
September, 2005 (2)
April, 2005 (1)
March, 2005 (2)
February, 2005 (1)
November, 2004 (4)
October, 2004 (2)
September, 2004 (4)
Post Categories
BizTalk - EAI - B2B
Monday, July 13, 2009
BizTalk Arbitrary Binary Email Attachments (or how to fix unreadable attachments)
Recently we have been receiving another series of complaints from clients that had trouble reading the pdf attachment of a BizTalk dynamic generated email. For some years we have been using the MIME encoder pipeline component and dynamically buildup our emails as multi-part message from inside orchestration. We got the mustard from
here
.
As said, it wasn't the first time we had these complaints. But it was always for a small minority of users only. Hence it sounded more like a user-specific issue. Since the smoke kept coming back I decided to start looking for a small fire at our side. Which I think I found:
By default the MIME encoder pipeline component puts 'text/plain' as the MIME content-type.
This will always work if your content is in fact of type 'text', but for all the other types such as a pdf it is not correct in the strict sense.
Success will depend on the mail-client: apparently GMAIL doesn't care that much about it, same story for the majority of our Exchange/Outlook clients. If you want 100% coverage, the only good solution is to specify the correct MIME type for every attachment. For a pdf attachment it should be 'application/pdf':
Please note that the BizTalk 2006/2009 SMTP adapter can take care of the correct MIME encoding (but if the content is already MIME encoded inside the pipeline it is kept intact). According to various blog entries the new SMTP adapter's MIME encoder will take care of setting the correct content-type.
I preferred a small update to my existing code instead of a global rewrite to leverage these new options.
Luckily you can override the MIME encoder's default by specifying the content type of the XLANGPart like this:
part.SetPartProperty(typeof(Microsoft.XLANGs.BaseTypes.ContentType), contentType);
The only thing left to-do is to find out the correct MIME-type per attachment.
I have wrote a small function that does exactly that by using the file extension:
etc...
The default content-type for unknown extensions is "application/octet-stream".
This alone could have been enough to fix the issue but I've tried to put in as much detail and content-types as are documented
here
.
Here is a
sample class
(original sample credits go to
Tomas Restrepo
with content-type update).
Share This Post:
Posted On
Monday, July 13, 2009 6:35 AM
|
Feedback (4)
Filed Under [
BizTalk - EAI - B2B
]