<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-34356418</id><updated>2011-04-21T18:44:12.051-07:00</updated><title type='text'>Effective Software</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://effectivesoftware.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34356418/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://effectivesoftware.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Piers Coleman</name><uri>http://www.blogger.com/profile/08102083136950249115</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>2</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-34356418.post-115860418316516662</id><published>2006-09-18T11:23:00.000-07:00</published><updated>2006-09-19T09:19:12.463-07:00</updated><title type='text'>Limitations with the BizTalk SMTP Adapter</title><content type='html'>This post discusses a recent project I worked on where we used the BizTalk 2004 SMTP adapter to send emails from within our orchestration. Here is an outline of the orchestration:&lt;br /&gt;&lt;br /&gt;1) Orchestration was triggered twice a day by use of the &lt;a href="http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=E473FC93-5081-44C7-A9C9-84BF4E783728"&gt;Scheduled Task Adapter&lt;/a&gt;&lt;br /&gt;2) Sends a message to a custom Web service requesting a list of reports from the SharePoint repository. This Web service uses the SharePoint API to do the retrieval&lt;br /&gt;3) Sends a message to a custom Web service requesting a list of email recipients from the SharePoint repository. Again, this Web service uses the SharePoint API to do the retrieval&lt;br /&gt;4) Sends the list of reports embedded inside the email body as HTML to the email recipients.&lt;br /&gt;&lt;br /&gt;We found the following exception in the Event Viewer when running this orchestration with an email recipient list with greater than 256 characters:&lt;br /&gt;&lt;br /&gt;Event Type: Error&lt;br /&gt;Event Source: XLANG/s&lt;br /&gt;Description: Uncaught exception terminated service&lt;br /&gt;Failed while attempting to send message 'SummaryEmail'.&lt;br /&gt;Exception type: SendFailedException&lt;br /&gt;Source: Microsoft.XLANGs.BizTalk.Engine&lt;br /&gt;Target Site: Void WriteMessageState(Microsoft.BizTalk.Interop.IBTPEPInfoLookup, System.Guid, Microsoft.XLANGs.BaseTypes.XLANGMessage, Microsoft.XLANGs.Core.Segment, System.String, System.String, System.Collections.IList, Boolean, System.Collections.IList)&lt;br /&gt;&lt;br /&gt;Additional error information: The property 'OutboundTransportLocation' has a value with length greater than 256 characters.&lt;br /&gt;&lt;br /&gt;Exception type: COMException&lt;br /&gt;Source: Target Site: Void PostToSendPort(System.Guid ByRef, Microsoft.BizTalk.Agent.Interop.IBTMessageBatch, Microsoft.BizTalk.Agent.Interop.IBTMessage, System.String, System.String, Microsoft.BizTalk.Interop.IBTMMessageList ByRef)&lt;br /&gt;&lt;br /&gt;Here are the basic steps I took to resolve this issue:&lt;br /&gt;&lt;br /&gt;1) The email distribution list returned from the Web service was a simple comma separated string. This string was converted to a collection of strings.&lt;br /&gt;2) A Loop shape was used to loop over each string (email address) and send the email.&lt;br /&gt;&lt;br /&gt;The relative section of the orchestration is shown here:&lt;br /&gt;&lt;a href="http://photos1.blogger.com/blogger/713/2664/1600/Teekay%20Summary%20Orchestration.1.jpg"&gt;&lt;img style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" height="310" alt="" src="http://photos1.blogger.com/blogger/713/2664/320/Teekay%20Summary%20Orchestration.1.jpg" width="370" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I borrowed ideas from &lt;a href="http://blogs.msdn.com/richardbpi/archive/2005/08/15/451760.aspx"&gt;Richard Seroter&lt;/a&gt; for the code inside the Assign Summary and Set Port Properties Expression shapes:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;tempDoc = (System.Xml.XmlDocument)OutgoingEmailVesselReport;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;HtmlSummaryReports = XmlToHtmlStringConverter.Convert(tempDoc, EmailStylesheetLocation);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;SummaryEmail.EmailBody = new RawString(HtmlSummaryReports);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;SummaryEmail(SMTP.Subject) = Part.SetContentType(SummaryEmail.EmailBody, "text/html");&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;EmailAddress = StringUtils.GetString(EmailDistributionCollection, LoopCounter); &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;AppendedEmailAddress = "mailto:" + EmailAddress;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;ReportPort(Microsoft.XLANGs.BaseTypes.Address) = AppendedEmailAddress;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;LoopCounter = LoopCounter + 1;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I didn't use the accessor operator to access the email strings inside the EmailDistributionCollection string collection object because this operator wasn't recognized by the BizTalk editor. I tried to use an enumerator, but the enumerator is not a serialized type, so I put a number of the shapes inside an atomic scope, but you cannot put a Send shape inside an atomic scope...&lt;br /&gt;&lt;br /&gt;The Send Port's type uses a Send Pipeline that uses a MIME/SMIME encoder at the Encode stage. You need to reference this Send Pipeline in the "Send Pipeline" property of your Send Port.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34356418-115860418316516662?l=effectivesoftware.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effectivesoftware.blogspot.com/feeds/115860418316516662/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34356418&amp;postID=115860418316516662' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34356418/posts/default/115860418316516662'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34356418/posts/default/115860418316516662'/><link rel='alternate' type='text/html' href='http://effectivesoftware.blogspot.com/2006/09/limitations-with-biztalk-smtp-adapter.html' title='Limitations with the BizTalk SMTP Adapter'/><author><name>Piers Coleman</name><uri>http://www.blogger.com/profile/08102083136950249115</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34356418.post-115817834209991610</id><published>2006-09-13T13:11:00.000-07:00</published><updated>2006-09-13T13:12:22.116-07:00</updated><title type='text'></title><content type='html'>I'll be posting my regular thoughts on the state of the software industry. I'm currently working with C#, .NET and BizTalk so expect a few posts on these subjects as well.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34356418-115817834209991610?l=effectivesoftware.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effectivesoftware.blogspot.com/feeds/115817834209991610/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34356418&amp;postID=115817834209991610' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34356418/posts/default/115817834209991610'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34356418/posts/default/115817834209991610'/><link rel='alternate' type='text/html' href='http://effectivesoftware.blogspot.com/2006/09/ill-be-posting-my-regular-thoughts-on.html' title=''/><author><name>Piers Coleman</name><uri>http://www.blogger.com/profile/08102083136950249115</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
