<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Bruno Câmara</title>
        <link>http://agilior.pt/blogs/bruno.camara/Default.aspx</link>
        <description>True merit, like a river, the deeper it is, the less noise it makes</description>
        <language>en-US</language>
        <copyright>BFC</copyright>
        <managingEditor>bruno.camara@agilior.pt</managingEditor>
        <generator>Subtext Version 1.9.0.27</generator>
        <image>
            <title>Bruno Câmara</title>
            <url>http://agilior.pt/blogs/images/RSS2Image.gif</url>
            <link>http://agilior.pt/blogs/bruno.camara/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <item>
            <title>What are the skills and responsibilities of a web designer?</title>
            <link>http://agilior.pt/blogs/bruno.camara/archive/2009/04/29/7743.aspx</link>
            <description>&lt;p&gt; &lt;/p&gt; &lt;p&gt;Recently I decided to deepen my knowledge about CSS, reading the book &lt;a href="http://www.amazon.co.uk/CSS-Mastery-Advanced-Standards-Solutions/dp/1590596145/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1241029868&amp;amp;sr=8-1"&gt;CSS Mastery&lt;/a&gt;. This decision was based on the need to create web sites with clean markup, focusing the work of structuring and the look &amp;amp; feel at CSS. &lt;/p&gt; &lt;p&gt;First, I must say that I really enjoyed reading the book. I always saw CSS as being part of the toolbox of a web designer. Let me clarify: I am far away of being a web designer, and to be honest, I was not cut off for the job. But a Web Designer is a must have if you want to succeed doing web sites or web applications. &lt;/p&gt; &lt;p&gt;Let's say that I want to hire a Web Designer to my team: &lt;strong&gt;what skills do I have to look for, which distinguish a good web designer? (Comments from web designers are welcome)&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;One thing I am sure: &lt;strong&gt;being just a Designer (not a Web Designer) is not enough for my team&lt;/strong&gt;. For me, a Designer is someone who knows for example how to work with &lt;a href="http://www.adobe.com/products/freehand/"&gt;FreeHand MX&lt;/a&gt;, &lt;a href="http://www.adobe.com/br/products/photoshop/photoshop/"&gt;Photoshop&lt;/a&gt;, image processing, but has no idea what HTML is, or CSS is, or any other subject related to web. The site that is being produced can even be good looking, &lt;strong&gt;but I think the web designer must go further: he has to give me the web template, images, CSSs, etc. More, the Web Designer must understand subjects as Accessibility, or Cross-Browser, Usability, etc&lt;/strong&gt;. I believe also that there are design types that can be awesome, but they are not for the web. Am I asking too much for a web designer? Don't get me wrong: I am really really out of my comfort zone, since I consider myself as a backend developer (which typically does not work too much with the end user). My question is totally honest!&lt;/p&gt; &lt;p&gt;Why I am posting about this subject? In the moment, my team is configured with a Designer (not a Web Designer), and it was not my decision. Who is trying to fill the gap about web design (html, css, etc,)? We, Web Developers. What is our feeling? That every decision we make (putting a div, a background image, transparencies, etc) is surrounded with the question: are we doing it right? Of course that at the end of the day the job it will be done, with more or less difficulty and errors.&lt;/p&gt; &lt;p&gt;In my opinion, Web Designers are really important to Web Projects and can make the difference about the success or failure of the project. &lt;strong&gt;In Web Projects, Web Designers are maybe not sufficient to success, but they are necessary to achieve it.&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Again, comments and different visions about the subject are welcome.&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt; BFC&lt;/p&gt;&lt;img src="http://agilior.pt/blogs/bruno.camara/aggbug/7743.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>BFC</dc:creator>
            <guid>http://agilior.pt/blogs/bruno.camara/archive/2009/04/29/7743.aspx</guid>
            <pubDate>Wed, 29 Apr 2009 17:43:03 GMT</pubDate>
            <wfw:comment>http://agilior.pt/blogs/bruno.camara/comments/7743.aspx</wfw:comment>
            <comments>http://agilior.pt/blogs/bruno.camara/archive/2009/04/29/7743.aspx#feedback</comments>
            <slash:comments>6</slash:comments>
            <wfw:commentRss>http://agilior.pt/blogs/bruno.camara/comments/commentRss/7743.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Building a Culture in a Small Professional Services Firm</title>
            <link>http://agilior.pt/blogs/bruno.camara/archive/2009/04/15/7551.aspx</link>
            <description>&lt;p&gt;One of the most difficulties that exists when managing a small professional services firm is to guarantee that exists a common culture which identifies all the developers in the firm. It is not uncommon to have one developer exclusively dedicated to a customer during a while, or for example, have a team of two developers mixed with customer developers to develop some project. We have some projects that can be developed in-house, and other that cannot. Of course we prefer to develop projects in-house. The daily living is one of the major contributions to build a culture. We can know better each other, and we can see the team as a family. When this kind of dally living is impossible, we must have alternatives to promote our culture.&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;&lt;strong&gt;Recruitment&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;The culture of a firm starts at the recruitment. When managing a small company, &lt;strong&gt;making a mistake when hiring can be the END&lt;/strong&gt;. I will not detail our recruitment process here, but at interviews we always mention some characteristics that must be present to work at Agilior. Basically we tell our motto: "&lt;strong&gt;Learn or Out&lt;/strong&gt;". We tell to the candidate that at Agilior we are always in &lt;strong&gt;continuous learning&lt;/strong&gt;, and that we have &lt;strong&gt;passion&lt;/strong&gt; about technology. We are always trying to evolve all the time. We tell to the candidate if he does not identify with this kind of behavior he is free to finish the interview.&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;&lt;strong&gt;Conventions&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;We have conventions defined to our projects at many levels&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Source control organization&lt;/li&gt; &lt;li&gt;Visual studio (project structure)&lt;/li&gt; &lt;li&gt;C#&lt;/li&gt; &lt;li&gt;Database &lt;/li&gt; &lt;li&gt;BizTalk&lt;/li&gt; &lt;li&gt;Unit Tests&lt;/li&gt;&lt;/ul&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;The main goal of conventions is to define some practices that must be used in all projects. The use of conventions guarantee some consistency between projects, and switching between projects is easy for a developer. The definition of conventions is a "work in progress", since there are always changes to be included. Some time ago we did a task force to draft the initial version. Of course we discussed a lot, since we all have different tastes. &lt;strong&gt;But the important is to have our people being committed in the process&lt;/strong&gt;. We have also to be careful when defining conventions, since the developer creativity can be compromised when defining excessive conventions.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/p&gt; &lt;p&gt;&lt;strong&gt;Sharing Knowledge&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Having mechanisms to sharing knowledge is extremely important. We have an&lt;strong&gt; internal blog,&lt;/strong&gt; which is much more active that our public blog. Many posts in the internal blog are links: interesting posts, tools, applications, etc. Right now we have 288 posts since January 2008. &lt;/p&gt; &lt;p&gt;We also have a Wiki and Forums in our intranet, however not so active.&lt;/p&gt; &lt;p&gt;One of our fringe benefits is to give to every developer an &lt;strong&gt;annual budget to buy books&lt;/strong&gt; (remember: Learn or Out). The budget can only be used in books (technology, management, entrepreneurship). There is a list in our intranet where we register the books, so everyone knows what is being read at Agilior. &lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;&lt;strong&gt;Agilior Meetings&lt;/strong&gt;&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;And finally I have to mention that we have our &lt;strong&gt;monthly meetings&lt;/strong&gt;. At the last Friday of each month we schedule a meeting with everyone. This is a technical meeting, where one or two of us are invited to give a presentation about a technical subject. This month, the subject is "Developing in Mono".  After the presentation (and discussion) we make some kind of a &lt;a href="http://www.mountaingoatsoftware.com/daily-scrum"&gt;daily scrum&lt;/a&gt;,  and each one answer to:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;What did you do last month?&lt;/li&gt; &lt;li&gt;What you will do in the next month?&lt;/li&gt;&lt;/ul&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;After the meeting, we dine together at our preferred restaurant, with some beers, and "healthy" conversations .&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;I would like to have all the projects developed in-house, having the team all together, and investing in a good office space, with big monitors, great chairs, etc.. Maybe this is impossible in a consulting firm, and only possible when developing products. For now, we have to deal with the distance, and promote new ways to enrich our culture.&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;BFC&lt;/p&gt;&lt;img src="http://agilior.pt/blogs/bruno.camara/aggbug/7551.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>BFC</dc:creator>
            <guid>http://agilior.pt/blogs/bruno.camara/archive/2009/04/15/7551.aspx</guid>
            <pubDate>Wed, 15 Apr 2009 07:47:41 GMT</pubDate>
            <wfw:comment>http://agilior.pt/blogs/bruno.camara/comments/7551.aspx</wfw:comment>
            <comments>http://agilior.pt/blogs/bruno.camara/archive/2009/04/15/7551.aspx#feedback</comments>
            <slash:comments>5</slash:comments>
            <wfw:commentRss>http://agilior.pt/blogs/bruno.camara/comments/commentRss/7551.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Microsoft Dynamics CRM - A RAD Platform!</title>
            <link>http://agilior.pt/blogs/bruno.camara/archive/2009/03/30/7439.aspx</link>
            <description>&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Since the end of 2008 that we, at Agilior, decided to extend our offer in terms of professional services. We decided to include in our portfolio CRM implementations, using Microsoft Dynamics CRM 4.0. As usual, we started our internal research, buying some books, experimenting the product, and tried some scenarios and customizations.&lt;/p&gt;
&lt;p&gt;As we were going forward in our research, it was obvious to us that the product was extremely well featured with respect to customizations. In fact, when you install the product, you can consider that you have a CRM installation, where you can register all the interactions with your customer, help you sales team to be more productive, etc., etc. However, after knowing the product features in terms of customization, you can use the same platform to build any line of business application (LOB)! But the most powerful think about this, is that you can build the LOB application without writing almost any code.  It seems that we are not alone in this reflection. In fact there is already a book named &lt;a href="http://www.thecrmbook.com"&gt;CRM as a Rapid Development Platform&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;Jason Hunt and Aaron Helder, now from &lt;a href="http://www.ascentium.com"&gt;Ascentium&lt;/a&gt;, wrote an &lt;a href="http://www.ascentium.com/blog/crm/Gallery/Ascentium%20-%20Microsoft%20Dynamics%20CRM%20as%20a%20Business%20Application%20Platform.pdf"&gt;excellent article&lt;/a&gt; explaining why MSCRM is a business application platform. Jason and Aaron were part of the Microsoft CRM development team, and the platform was originally designed to be a development platform, and the CRM happens as sample application to manage customer relationships. &lt;/p&gt;
&lt;p&gt;  &lt;/p&gt;
&lt;p&gt;Regarding the development of any LOB application, in the article it is said that, &lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;We‘ve found that using Microsoft CRM as your platform generally saves 50% to 70% of the development time. Effort you would have spent on the platform can be put towards the harder problem of identifying the right functionality and providing it in the right way.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;  &lt;/p&gt;
&lt;p&gt;I am confused, and maybe I am missing something. So, knowing that Microsoft  it is extremely  efficient in terms of marketing and sales, why Microsoft does not push to the masses the Dynamics CRM as a development platform? Of course that Microsoft has its internal reasons to not to do that. Sincerely, I would like to hear from Microsoft the public reason, and, let's say, the real reason. &lt;/p&gt;
&lt;p&gt;The ecosystem has many companies which sells RAD Platforms (I will not mention names). But imagine that Microsoft starts to push Dynamics CRM as the new RAD/Agile Development Platform, maybe re-branded with a new product name. How the market will respond to this new product? What will be the future of the most of the companies that are in this market space? Do you really need a team with too many great developers? &lt;/p&gt;
&lt;p&gt;  &lt;/p&gt;
&lt;p&gt;Putting my developer hat, I must to say that what I really love to do is to craft software, and this kind of RAD development is not my first choice. However, I recognize the business benefits when adopting this kind of platform, in terms of costs, maintenance, etc.. And I must say that I am really impressed with Dynamics CRM capabilities as a development platform. I hope to see the re-brand of the platform inside Microsoft, a good marketing campaign set, a good licence scheme, and maybe, we have the tipping point of the Dynamics CRM, not as a CRM solution, but as a Business Application Development Platform. &lt;/p&gt;&lt;img src="http://agilior.pt/blogs/bruno.camara/aggbug/7439.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>BFC</dc:creator>
            <guid>http://agilior.pt/blogs/bruno.camara/archive/2009/03/30/7439.aspx</guid>
            <pubDate>Mon, 30 Mar 2009 16:40:10 GMT</pubDate>
            <wfw:comment>http://agilior.pt/blogs/bruno.camara/comments/7439.aspx</wfw:comment>
            <comments>http://agilior.pt/blogs/bruno.camara/archive/2009/03/30/7439.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://agilior.pt/blogs/bruno.camara/comments/commentRss/7439.aspx</wfw:commentRss>
        </item>
        <item>
            <title>BizTalk: Delivery Notification in Direct Send Ports</title>
            <link>http://agilior.pt/blogs/bruno.camara/archive/2008/04/17/4344.aspx</link>
            <description>&lt;p align="center"&gt; &lt;/p&gt; &lt;p&gt;When sending a message in BizTalk to a Send Port, we can use the Delivery Notification property to test whether the message was sent with success. However, this feature is not available if we are using Direct Binding. Recently, in one of our projects, we needed to have the acknowledge in a direct send port. Fortunately, there is &lt;a href="http://blogs.microsoft.co.il/blogs/rel/archive/2007/10/20/delivery-notification-with-direct-send-port.aspx"&gt;someone who wrote the solution&lt;/a&gt;. So here is the step by step how to in a visual way.&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;ul&gt; &lt;li&gt;First of all, imagine that the there is an orchestration named ProcessMessage, which receives as parameters the message to send, the SendPort to use, and a boolean telling if the send port has delivery notification support.&lt;/li&gt;&lt;/ul&gt; &lt;blockquote&gt; &lt;p align="center"&gt;&lt;a href="http://agilior.pt/blogs/images/agilior_pt/blogs/bruno.camara/WindowsLiveWriter/BizTalkDeliveryNotificationinDirectSendP_EFDA/image_4.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="145" alt="image" src="http://agilior.pt/blogs/images/agilior_pt/blogs/bruno.camara/WindowsLiveWriter/BizTalkDeliveryNotificationinDirectSendP_EFDA/image_thumb_1.png" width="261" border="0" /&gt;&lt;/a&gt;       &lt;/p&gt;&lt;/blockquote&gt; &lt;ul&gt; &lt;li&gt; &lt;div align="left"&gt;Next you have to decide if the send port passed as an argument supports delivery notification or not&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p align="left"&gt; &lt;/p&gt; &lt;p align="center"&gt;&lt;a href="http://agilior.pt/blogs/images/agilior_pt/blogs/bruno.camara/WindowsLiveWriter/BizTalkDeliveryNotificationinDirectSendP_EFDA/image_8.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="208" alt="image" src="http://agilior.pt/blogs/images/agilior_pt/blogs/bruno.camara/WindowsLiveWriter/BizTalkDeliveryNotificationinDirectSendP_EFDA/image_thumb_3.png" width="655" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p align="left"&gt; &lt;/p&gt; &lt;p align="center"&gt; &lt;/p&gt; &lt;p&gt;where the rule is&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p align="center"&gt;&lt;a href="http://agilior.pt/blogs/images/agilior_pt/blogs/bruno.camara/WindowsLiveWriter/BizTalkDeliveryNotificationinDirectSendP_EFDA/image_10.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="211" alt="image" src="http://agilior.pt/blogs/images/agilior_pt/blogs/bruno.camara/WindowsLiveWriter/BizTalkDeliveryNotificationinDirectSendP_EFDA/image_thumb_4.png" width="446" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;ul&gt; &lt;li&gt;If the send port supports delivery notification, we will proceed as usual, catching the DeliveryNotificationException, and Suspending the Orchestration manually&lt;/li&gt;&lt;/ul&gt; &lt;p align="center"&gt;&lt;a href="http://agilior.pt/blogs/images/agilior_pt/blogs/bruno.camara/WindowsLiveWriter/BizTalkDeliveryNotificationinDirectSendP_EFDA/image_14.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="833" alt="image" src="http://agilior.pt/blogs/images/agilior_pt/blogs/bruno.camara/WindowsLiveWriter/BizTalkDeliveryNotificationinDirectSendP_EFDA/image_thumb_6.png" width="817" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;ul&gt; &lt;li&gt;Now, let's do the hard part, when the send port does not support delivery notification out of the box. In this case, this first thing we must do, is to construct a new XmlDocument message, setting the promoted property of BTS.AckRequired to true, and initializing the BTS.CoorelationToken to new guid.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt; &lt;/p&gt; &lt;p align="center"&gt;&lt;a href="http://agilior.pt/blogs/images/agilior_pt/blogs/bruno.camara/WindowsLiveWriter/BizTalkDeliveryNotificationinDirectSendP_EFDA/image_18.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="324" alt="image" src="http://agilior.pt/blogs/images/agilior_pt/blogs/bruno.camara/WindowsLiveWriter/BizTalkDeliveryNotificationinDirectSendP_EFDA/image_thumb_8.png" width="476" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p align="center"&gt;&lt;a href="http://agilior.pt/blogs/images/agilior_pt/blogs/bruno.camara/WindowsLiveWriter/BizTalkDeliveryNotificationinDirectSendP_EFDA/image_20.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="311" alt="image" src="http://agilior.pt/blogs/images/agilior_pt/blogs/bruno.camara/WindowsLiveWriter/BizTalkDeliveryNotificationinDirectSendP_EFDA/image_thumb_9.png" width="571" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;ul&gt; &lt;li&gt;Next, we will need to define three correlation types.  &lt;ul&gt; &lt;li&gt;The AckRequiredCorrelationType, which must use the property BTS.AckRequired  &lt;/li&gt;&lt;li&gt;The CorrelationTokenCorrelationType, which must use the property BTS.CorrelationToken  &lt;/li&gt;&lt;li&gt;The MessageCorrelationType, which must use the promoted properties that we will use to filter when the message arrives at the message box. In our case we defined two properties, the Channel and the Direction.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p align="center"&gt; &lt;/p&gt; &lt;p align="center"&gt;&lt;a href="http://agilior.pt/blogs/images/agilior_pt/blogs/bruno.camara/WindowsLiveWriter/BizTalkDeliveryNotificationinDirectSendP_EFDA/image_22.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="104" alt="image" src="http://agilior.pt/blogs/images/agilior_pt/blogs/bruno.camara/WindowsLiveWriter/BizTalkDeliveryNotificationinDirectSendP_EFDA/image_thumb_10.png" width="346" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p align="center"&gt; &lt;/p&gt; &lt;ul&gt; &lt;li&gt;Then, we define three correlation sets respectively&lt;/li&gt;&lt;/ul&gt; &lt;p align="center"&gt;&lt;a href="http://agilior.pt/blogs/images/agilior_pt/blogs/bruno.camara/WindowsLiveWriter/BizTalkDeliveryNotificationinDirectSendP_EFDA/image_24.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="122" alt="image" src="http://agilior.pt/blogs/images/agilior_pt/blogs/bruno.camara/WindowsLiveWriter/BizTalkDeliveryNotificationinDirectSendP_EFDA/image_thumb_11.png" width="337" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;ul&gt; &lt;li&gt;Now, we can send the message to the direct send port, initializing the three correlation sets&lt;/li&gt;&lt;/ul&gt; &lt;p&gt; &lt;/p&gt; &lt;p align="center"&gt;&lt;a href="http://agilior.pt/blogs/images/agilior_pt/blogs/bruno.camara/WindowsLiveWriter/BizTalkDeliveryNotificationinDirectSendP_EFDA/image_26.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="188" alt="image" src="http://agilior.pt/blogs/images/agilior_pt/blogs/bruno.camara/WindowsLiveWriter/BizTalkDeliveryNotificationinDirectSendP_EFDA/image_thumb_12.png" width="1070" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;ul&gt; &lt;li&gt; &lt;div align="left"&gt; Now we have to add two receive shapes, which must receive from a Receive Por Direct, and both have to follow de correlation set  . Why two receive shapes? The first receive has a subscription to receive a copy of the original message. In the second receive shape we receive the message that we are searching, which must be a NACK or an ACK. &lt;/div&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p align="left"&gt; &lt;/p&gt; &lt;p align="center"&gt;&lt;a href="http://agilior.pt/blogs/images/agilior_pt/blogs/bruno.camara/WindowsLiveWriter/BizTalkDeliveryNotificationinDirectSendP_EFDA/image_5.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="344" alt="image" src="http://agilior.pt/blogs/images/agilior_pt/blogs/bruno.camara/WindowsLiveWriter/BizTalkDeliveryNotificationinDirectSendP_EFDA/image_thumb.png" width="862" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p align="center"&gt; &lt;/p&gt; &lt;ul&gt; &lt;li&gt; &lt;div align="left"&gt;To decide if we have a NACK, we can inspect the property BTS.AckType&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p align="center"&gt;&lt;a href="http://agilior.pt/blogs/images/agilior_pt/blogs/bruno.camara/WindowsLiveWriter/BizTalkDeliveryNotificationinDirectSendP_EFDA/image_32.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="679" alt="image" src="http://agilior.pt/blogs/images/agilior_pt/blogs/bruno.camara/WindowsLiveWriter/BizTalkDeliveryNotificationinDirectSendP_EFDA/image_thumb_13.png" width="519" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p align="left"&gt; &lt;/p&gt; &lt;p align="center"&gt;&lt;a href="http://agilior.pt/blogs/images/agilior_pt/blogs/bruno.camara/WindowsLiveWriter/BizTalkDeliveryNotificationinDirectSendP_EFDA/image_30.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="251" alt="image" src="http://agilior.pt/blogs/images/agilior_pt/blogs/bruno.camara/WindowsLiveWriter/BizTalkDeliveryNotificationinDirectSendP_EFDA/image_thumb_7.png" width="483" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p align="left"&gt; &lt;/p&gt; &lt;p align="left"&gt; &lt;/p&gt; &lt;p align="left"&gt;And that's it. When there is a NACK, the message we will receive is something like this.&lt;/p&gt; &lt;p align="left"&gt; &lt;/p&gt; &lt;p&gt; &lt;/p&gt;&lt;div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:81233e77-17cc-49e7-b9e2-3030cc8754a2" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre style="background-color:White;"&gt;&lt;div&gt;&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000; "&gt;SOAP:Envelope &lt;/span&gt;&lt;span style="color: #FF0000; "&gt;xmlns:SOAP&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="http://schemas.xmlsoap.org/soap/envelope/"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt;
SOAP:encodingStyle&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="http://schemas.xmlsoap.org/soap/encoding/"&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
  &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000; "&gt;SOAP:Body&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
    &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000; "&gt;SOAP:Fault&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
      &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000; "&gt;faultcode&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;Microsoft BizTalk Server Negative Acknowledgment &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000; "&gt;faultcode&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
      &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000; "&gt;faultstring&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;An error occurred while processing the message, refer to the details section for more information &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000; "&gt;faultstring&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
      &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000; "&gt;faultactor&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;SFTP://127.0.0.1:22/in/%SourceFileName%&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000; "&gt;faultactor&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
      &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000; "&gt;detail&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
        &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000; "&gt;ns0:NACK &lt;/span&gt;&lt;span style="color: #FF0000; "&gt;Type&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="NACK"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt; xmlns:ns0&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="http://schema.microsoft.com/BizTalk/2003/NACKMessage.xsd"&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
          &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000; "&gt;NAckID&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;{2EE4D577-313F-4840-8FB2-3DC60CF3B68B}&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000; "&gt;NAckID&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
          &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000; "&gt;ErrorCode&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;0xc0c0167a&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000; "&gt;ErrorCode&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
          &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000; "&gt;ErrorCategory&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;0&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000; "&gt;ErrorCategory&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
          &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000; "&gt;ErrorDescription&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;Server error (2): No such file&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000; "&gt;ErrorDescription&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
        &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000; "&gt;ns0:NACK&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
      &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000; "&gt;detail&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
    &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000; "&gt;SOAP:Fault&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
  &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000; "&gt;SOAP:Body&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000; "&gt;SOAP:Envelope&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;We built an helper class to extract the ErrorCode the FaultActor to log the exception, send and email, and suspend the orchestration with a reason which can be understood by the BizTalk operator. &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Now we have delivery notification in direct send ports.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Until next time.&lt;/p&gt;&lt;img src="http://agilior.pt/blogs/bruno.camara/aggbug/4344.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>BFC</dc:creator>
            <guid>http://agilior.pt/blogs/bruno.camara/archive/2008/04/17/4344.aspx</guid>
            <pubDate>Thu, 17 Apr 2008 15:33:16 GMT</pubDate>
            <wfw:comment>http://agilior.pt/blogs/bruno.camara/comments/4344.aspx</wfw:comment>
            <comments>http://agilior.pt/blogs/bruno.camara/archive/2008/04/17/4344.aspx#feedback</comments>
            <slash:comments>1513</slash:comments>
            <wfw:commentRss>http://agilior.pt/blogs/bruno.camara/comments/commentRss/4344.aspx</wfw:commentRss>
        </item>
        <item>
            <title>BizTalk: SFTP Adapter and SSH Daemon Configuration Troubleshooting</title>
            <category>BizTalk</category>
            <link>http://agilior.pt/blogs/bruno.camara/archive/2008/03/05/3825.aspx</link>
            <description>&lt;p&gt;In one of our BizTalk implementations we are using &lt;a href="http://en.wikipedia.org/wiki/SFTP"&gt;SFTP&lt;/a&gt; to transfer files. We are using the SFTP adapter from &lt;a href="http://www.nsoftware.com/"&gt;/n software&lt;/a&gt;. Recently we had a situation where we had too many timeouts written in the event log, and too many messages were retried using the out-of-box retry mechanism of BizTalk. We started to research where the bottleneck was. Our first bet was to think that the limitation was in the destination  server. We talked to the system administrator and he told us that there is no limitation in the simultaneous SSH connections. Then we started to watch to BizTalk  and we increased the &lt;a href="http://msdn2.microsoft.com/en-us/library/fb6y0fyc.aspx"&gt;maxConnection&lt;/a&gt;  in the config file, however nothing changed in terms of the number of timeouts. &lt;/p&gt; &lt;p&gt;We continued to research and we began to watch to unix man pages to see if there is some parameter you could change in the &lt;a href="http://unixhelp.ed.ac.uk/CGI/man-cgi?sshd_config+5"&gt;SSH daemon&lt;/a&gt;. We took special attention to one parameter named MaxStartups. In the documentation it is said&lt;/p&gt; &lt;p&gt; &lt;/p&gt;&lt;pre&gt;             Specifies the maximum number of concurrent unauthenticated con-
	     nections to the sshd daemon.  Additional connections will be
	     dropped until authentication succeeds or the LoginGraceTime
	     expires for a connection.	The default is 10.

	     Alternatively, random early drop can be enabled by specifying the
	     three colon separated values ``start:rate:full'' (e.g.,
	     "10:30:60").  sshd will refuse connection attempts with a proba-
	     bility of ``rate/100'' (30%) if there are currently ``start''
	     (10) unauthenticated connections.	The probability increases lin-
	     early and all connection attempts are refused if the number of
	     unauthenticated connections reaches ``full'' (60).&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;It seems there is a limitation in the number of simultaneous unauthenticated connections. Of course we are using authentication, but there is a delay between the connection is opened and the authentication process. To confirm our feelings we made a simple test: we opened 10 connections without authenticate. When opening the 11th connection we got "Connection Refused".  So the problem is, under peak load, BizTalk starts to open SSH connections and begins the authentication process. It it not hard to imagine that there is a probability to have connections refused, while others are in the authentication process. We expalined the situation to our system administrator and asked him to increase the parameters MaxStartups. He increased to 30 and guess what: the timeouts disappeared (well, in fact we have one or another occasionally). Always learning.&lt;/p&gt;&lt;img src="http://agilior.pt/blogs/bruno.camara/aggbug/3825.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>BFC</dc:creator>
            <guid>http://agilior.pt/blogs/bruno.camara/archive/2008/03/05/3825.aspx</guid>
            <pubDate>Wed, 05 Mar 2008 08:18:19 GMT</pubDate>
            <wfw:comment>http://agilior.pt/blogs/bruno.camara/comments/3825.aspx</wfw:comment>
            <comments>http://agilior.pt/blogs/bruno.camara/archive/2008/03/05/3825.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://agilior.pt/blogs/bruno.camara/comments/commentRss/3825.aspx</wfw:commentRss>
        </item>
        <item>
            <title>WCF Service Hosted in IIS with Integrated Authentication</title>
            <category>WCF</category>
            <link>http://agilior.pt/blogs/bruno.camara/archive/2008/02/19/3721.aspx</link>
            <description>&lt;p&gt; &lt;/p&gt; &lt;p&gt;Recently we developed a WCF service, which had to be hosted in IIS. This service must run under the credentials of the user calling the service, so we used Integrated Authentication with Impersonation. Even the service was hosted in IIS, we were not using ASP.Net compatibility mode, so the WCF was responsible to do all the work related to authentication and impersonation. &lt;/p&gt; &lt;p&gt;At the client, we generated the proxy using Add Service Reference (to use WCF at client side), and we started our tests. Here is the configuration used at the client&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;&lt;/p&gt; &lt;div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:e444b482-5932-44c3-a7df-34263105c526" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre style="background-color:White;"&gt;&lt;div&gt;&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color: #FF00FF; "&gt;xml version="1.0" encoding="utf-8" &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;?&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000; "&gt;configuration&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
    &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000; "&gt;system&lt;/span&gt;&lt;span style="color: #FF0000; "&gt;.serviceModel&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
        &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000; "&gt;bindings&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
            &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000; "&gt;basicHttpBinding&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
                &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000; "&gt;binding &lt;/span&gt;&lt;span style="color: #FF0000; "&gt;name&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="BasicHttpBinding_IMyService"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt; closeTimeout&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="00:01:00"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt;
                    openTimeout&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="00:01:00"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt; receiveTimeout&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="00:10:00"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt; sendTimeout&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="00:01:00"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt;
                    allowCookies&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="false"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt; bypassProxyOnLocal&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="false"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt; hostNameComparisonMode&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="StrongWildcard"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt;
                    maxBufferSize&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="65536"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt; maxBufferPoolSize&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="524288"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt; maxReceivedMessageSize&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="65536"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt;
                    messageEncoding&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="Text"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt; textEncoding&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="utf-8"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt; transferMode&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="Buffered"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt;
                    useDefaultWebProxy&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="true"&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
                    &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000; "&gt;readerQuotas &lt;/span&gt;&lt;span style="color: #FF0000; "&gt;maxDepth&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="32"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt; maxStringContentLength&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="8192"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt; maxArrayLength&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="16384"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt;
                        maxBytesPerRead&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="4096"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt; maxNameTableCharCount&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="16384"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt; &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
                    &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000; "&gt;security &lt;/span&gt;&lt;span style="color: #FF0000; "&gt;mode&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="TransportCredentialOnly"&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
                        &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000; "&gt;transport &lt;/span&gt;&lt;span style="color: #FF0000; "&gt;clientCredentialType&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="Ntlm"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt; proxyCredentialType&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="None"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt;
                            realm&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;=""&lt;/span&gt;&lt;span style="color: #FF0000; "&gt; &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
                        &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000; "&gt;message &lt;/span&gt;&lt;span style="color: #FF0000; "&gt;clientCredentialType&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="UserName"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt; algorithmSuite&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="Default"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt; &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
                    &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000; "&gt;security&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
                &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000; "&gt;binding&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
            &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000; "&gt;basicHttpBinding&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
        &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000; "&gt;bindings&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
        &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000; "&gt;client&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
            &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000; "&gt;endpoint &lt;/span&gt;&lt;span style="color: #FF0000; "&gt;address&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="http://myserver/webServices/MyService.svc"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt;
                binding&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="basicHttpBinding"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt; bindingConfiguration&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="BasicHttpBinding_IMyService"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt;
                contract&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="TestConsole.mySvc.IMyService"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt; name&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="BasicHttpBinding_IMyService"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt; &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
        &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000; "&gt;client&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
    &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000; "&gt;system.serviceModel&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000; "&gt;configuration&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Our first test passed with success. However, after some resets in IIS we got un exception when calling the service from the client&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Could not load file or assembly 'MyAssembly, Version=&lt;/strong&gt;&lt;a href="http://1.0.0.0"&gt;&lt;strong&gt;1.0.0.0&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;, Culture=neutral, PublicKeyToken=fa47a5aeac7aa410' or one of its dependencies. Access is denied.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Without understanding the source and the cause of this random error, we began our research. We tried to change ACLs, we tried to change settings on the Application Pool, we tried everything you can imagine, and after a few days of trial and error, we discovered the pattern of the error. So, we got success on the service call after cleaning all the Temporary ASP.Net File and resetting the IIS. In this condition the service ran ok, until the next compilation, maybe caused by a modification in the web.config file. After the new compilation we got the exception again. I almost quit hosting my service in IIS, and change to a self-hosted service, using a windows service. However, before quit, I decided to ask for help to one of the Portuguese WCF Gurus, &lt;a href="http://www.arquitecturadesoftware.org/blogs/antoniocruz/"&gt;António Cruz&lt;/a&gt;. A few hours later, António call me, and told me that the problem was in the client side, because we were not specifying the &lt;a href="http://msdn2.microsoft.com/en-us/library/system.servicemodel.security.windowsclientcredential.allowedimpersonationlevel.aspx"&gt;allowed impersonation level&lt;/a&gt;, and the default is &lt;a href="http://msdn2.microsoft.com/en-us/library/system.security.principal.tokenimpersonationlevel.aspx"&gt;Identification&lt;/a&gt;,which means (pasting from documentation)&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;em&gt;The server process can obtain information about the client, such as security identifiers and privileges, but it cannot impersonate the client. This is useful for servers that export their own objects, for example, database products that export tables and views. Using the retrieved client-security information, the server can make access-validation decisions without being able to use other services that are using the client's security context.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;António told me to use the level &lt;a href="http://msdn2.microsoft.com/en-us/library/system.security.principal.tokenimpersonationlevel.aspx"&gt;Impersonation&lt;/a&gt; instead, which means (pasting again)&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;em&gt;The server process can impersonate the client's security context on its local system. The server cannot impersonate the client on remote systems.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;/em&gt; &lt;/p&gt;
&lt;p&gt;To do this we had to specify a behavior. Here is the new configuration file&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:9fd6b532-d8c4-43b0-878c-a599a11deda6" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; width: 834px; padding-top: 0px"&gt;&lt;pre style="background-color:White;"&gt;&lt;div&gt;&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color: #FF00FF; "&gt;xml version="1.0" encoding="utf-8" &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;?&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000; "&gt;configuration&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
    &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000; "&gt;system&lt;/span&gt;&lt;span style="color: #FF0000; "&gt;.serviceModel&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
        &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000; "&gt;bindings&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
            &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000; "&gt;basicHttpBinding&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
                &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000; "&gt;binding &lt;/span&gt;&lt;span style="color: #FF0000; "&gt;name&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="BasicHttpBinding_IMyService"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt; closeTimeout&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="00:01:00"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt;
                    openTimeout&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="00:01:00"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt; receiveTimeout&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="00:10:00"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt; sendTimeout&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="00:01:00"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt;
                    allowCookies&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="false"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt; bypassProxyOnLocal&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="false"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt; hostNameComparisonMode&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="StrongWildcard"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt;
                    maxBufferSize&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="65536"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt; maxBufferPoolSize&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="524288"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt; maxReceivedMessageSize&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="65536"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt;
                    messageEncoding&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="Text"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt; textEncoding&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="utf-8"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt; transferMode&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="Buffered"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt;
                    useDefaultWebProxy&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="true"&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
                    &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000; "&gt;readerQuotas &lt;/span&gt;&lt;span style="color: #FF0000; "&gt;maxDepth&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="32"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt; maxStringContentLength&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="8192"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt; maxArrayLength&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="16384"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt;
                        maxBytesPerRead&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="4096"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt; maxNameTableCharCount&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="16384"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt; &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
                    &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000; "&gt;security &lt;/span&gt;&lt;span style="color: #FF0000; "&gt;mode&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="TransportCredentialOnly"&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
                        &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000; "&gt;transport &lt;/span&gt;&lt;span style="color: #FF0000; "&gt;clientCredentialType&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="Ntlm"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt; proxyCredentialType&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="None"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt;
                            realm&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;=""&lt;/span&gt;&lt;span style="color: #FF0000; "&gt; &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
                        &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000; "&gt;message &lt;/span&gt;&lt;span style="color: #FF0000; "&gt;clientCredentialType&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="UserName"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt; algorithmSuite&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="Default"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt; &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
                    &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000; "&gt;security&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
                &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000; "&gt;binding&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
            &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000; "&gt;basicHttpBinding&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
        &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000; "&gt;bindings&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
        &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000; "&gt;client&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
            &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000; "&gt;endpoint &lt;/span&gt;&lt;span style="color: #FF0000; "&gt;address&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="http://ag-bfcamara/webServices/MyService.svc"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt;
                binding&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="basicHttpBinding"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt;     bindingConfiguration&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="BasicHttpBinding_IMyService"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt;
                contract&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="TestConsole.mySvc.IMyService"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt; name&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="BasicHttpBinding_IMyService"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt;
               behaviorConfiguration&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="ImpersonationBehavior"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt; &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
        &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000; "&gt;client&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
        &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000; "&gt;behaviors&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
           &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000; "&gt;endpointBehaviors&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
              &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000; "&gt;behavior &lt;/span&gt;&lt;span style="color: #FF0000; "&gt;name&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="ImpersonationBehavior"&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
                 &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000; "&gt;clientCredentials&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
                      &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000; "&gt;windows &lt;/span&gt;&lt;span style="color: #FF0000; "&gt;allowedImpersonationLevel&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="Impersonation"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt; &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
                 &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000; "&gt;clientCredentials&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
              &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000; "&gt;behavior&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
           &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000; "&gt;endpointBehaviors&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
        &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000; "&gt;behaviors&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
    &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000; "&gt;system.serviceModel&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000; "&gt;configuration&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;With this configuration we eliminate the strange behaviour we had before and everything is now ok. And this security feature makes sense, since the client has the right to specify what kind of impersonation the service can do. However, when using Identification level (which is the default), why the service runs ok if we delete the temporary ASP.Net files and reset IIS? It seems there is a special condition which makes the service run without problem, at least until the next compilation. Very strange!&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;From all Agilior Team, a special thanks to António Cruz.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;BFC&lt;/p&gt;&lt;img src="http://agilior.pt/blogs/bruno.camara/aggbug/3721.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>BFC</dc:creator>
            <guid>http://agilior.pt/blogs/bruno.camara/archive/2008/02/19/3721.aspx</guid>
            <pubDate>Tue, 19 Feb 2008 11:26:25 GMT</pubDate>
            <wfw:comment>http://agilior.pt/blogs/bruno.camara/comments/3721.aspx</wfw:comment>
            <comments>http://agilior.pt/blogs/bruno.camara/archive/2008/02/19/3721.aspx#feedback</comments>
            <slash:comments>13</slash:comments>
            <wfw:commentRss>http://agilior.pt/blogs/bruno.camara/comments/commentRss/3721.aspx</wfw:commentRss>
        </item>
        <item>
            <title>BizTalk: How to change the BAM Portal to Portuguese</title>
            <link>http://agilior.pt/blogs/bruno.camara/archive/2008/01/18/3544.aspx</link>
            <description>&lt;p&gt; &lt;/p&gt; &lt;p&gt;Recently, we're asked from one of our customers if it was possible to customize the BAM Portal to Portuguese. Well, knowing in advance that the BAM &lt;a href="http://msdn2.microsoft.com/en-us/library/aa560122.aspx"&gt;has very limited customization&lt;/a&gt;, our answer was "We will have to investigate".&lt;/p&gt; &lt;p&gt;We started our investigation, hoping that BAM Portal had support to satellite assemblies. In our installation the satellite assemblies with resources weren't under the bin directory. We checked also at MSDN if there was a Portuguese installation, however it seems there isn't. &lt;/p&gt; &lt;p&gt;&lt;br /&gt;Using Reflector, We started to explore the code in BAM portal assemblies. There is an assembly dedicated to have almost all the resources displayed in BAM Portal.  The assembly that have the resources is Microsoft.BizTalk.Bam.Portal.UI.dll. Using Reflector we exported this assembly to a VS Project and started to edit the resources (using Resourcer).&lt;br /&gt;&lt;/p&gt; &lt;p&gt;Our first approach was trying to generate a satellite assembly for culture PT. We generated the assembly, deployed under bin\pt-PT, changed the culture in the web.config, but nothing happened (the BAM Portal remained in English). Using the tool fuslogvw.exe we checked what assemblies were being loaded. In fact, the .Net Assembly Loader was trying to load the assembly &lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;Microsoft.BizTalk.Bam.Portal.UI.resources, Version=3.0.1.0, Culture=pt, PublicKeyToken=31bf3856ad364e35&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;however, our satellite assembly will never work, since we will never get the key to sign our assembly with the same key as the primary assembly.&lt;/p&gt; &lt;p&gt;We continued to look the code in Reflector, and when the ResourceManager is created, the assembly argument that is passed to constructor was loaded using the partial name Microsoft.BizTalk.Bam.Portal.UI. We knew that if we replaced this assembly with the one with the Portuguese resources, maintaining the partial name, we would get the BAM Portal in Portuguese (it worked). The problem with this approach is that "it's not clean": Microsoft could argue that our installation would not be supported since we replaced physically an original assembly. No way. &lt;/p&gt; &lt;p&gt;The solution was to use the web.config to do the replacement we want, using the .net framework mechanisms to redirect assemblies. We compiled again our assembly, now with a strong name, and signed with our private key. We added our assembly to the GAC and add this snippet to the web.config&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:348ed47e-b748-4c6b-b669-f8417d1bb2dc" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre style="background-color:White;"&gt;&lt;div&gt;&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="color: #000000; "&gt;  &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000; "&gt;runtime&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
    &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000; "&gt;assemblyBinding &lt;/span&gt;&lt;span style="color: #FF0000; "&gt;xmlns&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="urn:schemas-microsoft-com:asm.v1"&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
         &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000; "&gt;qualifyAssembly &lt;/span&gt;&lt;span style="color: #FF0000; "&gt;partialName&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="Microsoft.BizTalk.Bam.Portal.UI"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt; 
fullName&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;="Microsoft.BizTalk.Bam.Portal.UI ,version=1.0.0.0, publicKeyToken=edf781631e804c6e,culture=neutral"&lt;/span&gt;&lt;span style="color: #FF0000; "&gt; &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
    &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000; "&gt;assemblyBinding&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;
  &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000; "&gt;runtime&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt; &lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This snippet tells to the framework that if someone asks for the partial name Microsoft.Biztalk.Bam.Portal.UI it will get the assembly with the fullname specified in the attribute "fullName". Bingo!. It works. Now we have the BAM Portal in Portuguese. Changing the web.config, we think we are  not compromising our installation in terms of support ;-).&lt;/p&gt;
&lt;p&gt;Of course we have to be careful when upgrading to other versions of BizTalk. Maybe new versions can include more resources, or Microsoft can change the way display resources in the Portal. Who knows.&lt;/p&gt;
&lt;p&gt;We finished our job customizing and translating all the Bam Portal to Portuguese. Our customer gave us a smile. &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;BFC&lt;/p&gt;&lt;img src="http://agilior.pt/blogs/bruno.camara/aggbug/3544.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>BFC</dc:creator>
            <guid>http://agilior.pt/blogs/bruno.camara/archive/2008/01/18/3544.aspx</guid>
            <pubDate>Fri, 18 Jan 2008 16:23:22 GMT</pubDate>
            <wfw:comment>http://agilior.pt/blogs/bruno.camara/comments/3544.aspx</wfw:comment>
            <comments>http://agilior.pt/blogs/bruno.camara/archive/2008/01/18/3544.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://agilior.pt/blogs/bruno.camara/comments/commentRss/3544.aspx</wfw:commentRss>
        </item>
        <item>
            <title>BizTalk: Suddenly the BTS slows down the processing rate...</title>
            <link>http://agilior.pt/blogs/bruno.camara/archive/2008/01/02/3470.aspx</link>
            <description>&lt;p&gt; &lt;/p&gt; &lt;p&gt;Recently, we had a situation with the BizTalk installed in one of our customers, where the message processing time started to increase. We started our investigation, analyzing threads, disabling anti-virus, etc.  This BizTalk installation consists of a cluster in Active/Active mode at the application tier. At the database tier we have also a cluster in active/passive mode. &lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;The behaviour was very strange, since the processing time was increasing linearly. The system wasn't under load. We checked the MessageBox size, counting the rows at the Spool table, but everything was ok. &lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;We started to investigate all the performance counters related to BizTalk, checking the SDK documentation. Meanwhile, our attention went to a performance counter named &lt;b&gt;Message publishing delay (ms)&lt;/b&gt; under the category BizTalk:MessageAgent. With PerfMon we started to check this counter. This counter was increasing, which explains why we had a bad processing time. We had to understand the cause for this increasing delay. There is a chapter in BTS SDK dedicated to Throttling, which is a mechanism to  moderate the workload associated a host instance. Apparently we are under Throttling without knowing. &lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;To confirm our suspicions, we checked the performance counter &lt;strong&gt;Message Publishing Throttling State&lt;/strong&gt; under category BizTalk:Message Agent. This counter tell us what caused the throttling, and we had a value of 6. Our first reaction was "what a hell is 6?". Checking again the documentation, the value of 6 means&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;&lt;em&gt;"Host message queue size, the spool table size or the tracking table size exceed the specified threshold. &lt;/em&gt;&lt;/p&gt; &lt;p&gt;&lt;em&gt;Possible reasons for this condition include: &lt;/em&gt; &lt;/p&gt;&lt;ul&gt; &lt;li&gt;&lt;em&gt;The SQL Agent jobs used by BizTalk Server to maintain the BizTalk Server databases not running or are running slowly. &lt;/em&gt;&lt;/li&gt; &lt;li&gt;&lt;em&gt;Down-stream components are not processing messages from the in-memory queue in a timely manner. &lt;/em&gt;&lt;/li&gt; &lt;li&gt;&lt;em&gt;Number of suspended messages is high. &lt;/em&gt;&lt;/li&gt; &lt;li&gt;&lt;em&gt;Maximum sustainable load for the system has been reached."&lt;/em&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;There was a relief knowing what was the problem: we are under &lt;strong&gt;Throttling&lt;/strong&gt;. Well, but we had to understand what was the condition that triggered Throttling. In terms of mitigation strategy, the documentation says&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;&lt;em&gt;"Ensure that the SQL Agent jobs used by BizTalk Server to maintain the BizTalk Server databases are running and are not failing.&lt;/em&gt;&lt;/p&gt; &lt;p&gt;&lt;em&gt;Terminate and resume suspended instances as needed.&lt;/em&gt; &lt;/p&gt;&lt;p&gt;&lt;em&gt;Increase the default value for the &lt;b&gt;Message count in database&lt;/b&gt; threshold taking into consideration the space requirements of the SQL server that houses the BizTalk databases.&lt;/em&gt; &lt;/p&gt;&lt;p&gt;&lt;em&gt;If your database is sized appropriately to handle additional message backlog, consider increasing the &lt;b&gt;ThrottlingSpoolMultiplier&lt;/b&gt; and &lt;b&gt;ThrottlingTrackingDataMultiplier&lt;/b&gt; registry values to allow additional backlog in the Spool and Tracking tables. For more information about changing the values see"&lt;/em&gt;  &lt;/p&gt;&lt;p&gt; &lt;/p&gt; &lt;p&gt;As I told before, we had already checked the Spool table, and it was almost empty. However we hadn't checked yet the Tracking Tables. The name of the tracking table in the MessageBox database is &lt;strong&gt;TrackingData. &lt;/strong&gt;We checked the number of records in this view and we found ~ 800k records. Reading the documentation again&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;&lt;em&gt;"The &lt;b&gt;Message count in database&lt;/b&gt; setting also indirectly defines the threshold for a throttling condition based on the number of messages in the spool table or tracking table. If the number of messages in the spool table or tracking table exceeds 10 times this value then a throttling condition will be triggered. By default the &lt;b&gt;Message count in database&lt;/b&gt; value is set to 50,000, which will cause a throttling condition if the spool table or the tracking table exceeds 500,000 messages."&lt;/em&gt;&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;&lt;strong&gt;The cause of Throttling was in the Tracking Tables&lt;/strong&gt;. &lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;For now, we decided to disable throttling based on the message count in database parameter, specifying a value of 0 in the treshhold "Message count in database". Meanwhile we are investigating why our TrackingData has so many records.&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;I recommend for all BizTalk developers and administrators to read the chapters in SDK documentation about Throttling. It has great information, and never know if suddenly your BizTalk slows down the processing.&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;BFC&lt;/p&gt;&lt;img src="http://agilior.pt/blogs/bruno.camara/aggbug/3470.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>BFC</dc:creator>
            <guid>http://agilior.pt/blogs/bruno.camara/archive/2008/01/02/3470.aspx</guid>
            <pubDate>Wed, 02 Jan 2008 15:42:06 GMT</pubDate>
            <wfw:comment>http://agilior.pt/blogs/bruno.camara/comments/3470.aspx</wfw:comment>
            <comments>http://agilior.pt/blogs/bruno.camara/archive/2008/01/02/3470.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://agilior.pt/blogs/bruno.camara/comments/commentRss/3470.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Personal: Changed priorities in my life</title>
            <link>http://agilior.pt/blogs/bruno.camara/archive/2007/12/02/3300.aspx</link>
            <description>&lt;p&gt;Sometimes all of us change priorities in our lives.  I have recently changed mine. Those that know me may be thinking that the reason for changing my priorities was the birth of my second son Filipe, who is three months old now. Allow me to say that you are wrong. Before diving in my reasons, let me say that my life has been marked by cycles, and typically there are changes in the way I see the world at the end of each cycle. &lt;/p&gt;&lt;p&gt;A little bit of the history of my life. I played soccer since 10 until I was 15 years old. When I was 15, in 1991, I was playing soccer at a great club, Benfica,  but I've started my career at a small club named Olivais e Moscavide.  I think my father had a dream: that someday, me and my older brother would be great soccer players. Well, at that time my friends at school went to the cinema while I was training, I had no summer vacations because I had tournaments in July, and in August we started to train again to prepare the next season. I trained two times per day in plain August, while my friends were at the beach enjoying vacations. Of course, at Benfica I was being payed to be a football player. It was good money, however I had no time to spent it. - I kept all the money in the bank account. At that time, everyone was saying that Bruno Câmara had great chances to be a great player, but I decided to quit at the end of August of 1992. Why? Simple: I was 15 and I wanted to live a "normal" life: go to the cinema, have vacations, go to disco at Friday and Saturday nights, etc. When I played football, I couldn't sleep the night before the game: all night thinking about the game, mentally visualizing possible game situations and how to do the best. NO WAY. I don't want this to my life, I thought. Of course my father was very sad. I remember telling to my father that the victories that I had in soccer I would continue to have as a student. My father cried at that time but fully supported my decision. It was the end of a cycle in my life, with a change in priorities. &lt;/p&gt;&lt;p&gt;I think my journey as a student left my father and mother proud again. When I was 22 I ended my graduation in Computer Science Engineering. Well, during this time, I couldn't sleep also at the night before the exam, but now idealizing the math exercises and reviewing mentally my appointments. It is a question of attitude. At the end of my graduation I was invited to pursue a PhD and continue an investigation career in the academic world, teaching as an assistant professor. However, my priorities changed again: I wanted to earn money to be financially independent, have a car and begin thinking on a house. I was tired of the academic world. I needed to see the outside world. It was the end of another cycle. &lt;/p&gt;&lt;p&gt;I started working at 22 and married at 25. I had a rapid ascending in my professional career, however at 27 I needed to change again. Well, I thought I needed to change but I overreacted it. I quit my job to start my own company, my wife got pregnant, and I decided to take a master degree at computer science. What a stupid idea! Too immature. I quit the master degree two years later, because the starting of the company was very hard. During the first times my big priority was Agilior, my own company. It needed me to give the first steps. Agilior has been growing slowly, but is a wealthy company. In another post, who knows, I will talk about why I decided to have my own company.  &lt;/p&gt;&lt;p&gt;But as I said at the beginning of this post, I changed priorities recently. Why? Simple: my old son André has now 3.5 years old and he needs me a lot. But the curious thing is that I need him a lot also. Parenthood has been the best experience in my life. Most of the books that I've read were about computer science, entrepreneurship and personal development, but now I'm starting to read about parenting. Since early I want to be one of the best guys in some field of computer science and to be recognized by the community. Now I want also to be the best father and to be recognized by my sons. And that's my first priority now. And the time is too small. I will continue to be committed to both fields, professional and personal, but it is hard to excel in both. To be honest, now I prefer to adopt a low profile in front of the community - in fact, I want to be away of the lights.  &lt;/p&gt;&lt;p&gt;A few days ago I asked to my son "who are your best friends?". I expected to hear David, Rui, etc, who are friends at school. However, the answer was "my father and mother". My first reaction was to question mom if it was her that had taught him. She said no. In the following day I questioned at school if the teacher taught him something like this. They said no. Well, I have no words to explain what I felt. My fears are now to fail as a father. Am I doing the right thing when I do this or give that to my son? Am I doing the right thing when I punish them? How to prepare them to life? As I said, that's my priority now. I hope to be a great father for my sons, as my father was to me and my brother. &lt;/p&gt;&lt;img src="http://agilior.pt/blogs/bruno.camara/aggbug/3300.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>BFC</dc:creator>
            <guid>http://agilior.pt/blogs/bruno.camara/archive/2007/12/02/3300.aspx</guid>
            <pubDate>Sun, 02 Dec 2007 20:11:16 GMT</pubDate>
            <wfw:comment>http://agilior.pt/blogs/bruno.camara/comments/3300.aspx</wfw:comment>
            <comments>http://agilior.pt/blogs/bruno.camara/archive/2007/12/02/3300.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://agilior.pt/blogs/bruno.camara/comments/commentRss/3300.aspx</wfw:commentRss>
        </item>
        <item>
            <title>WF: Who did what in this Workflow Instance? An Auditing Service...</title>
            <link>http://agilior.pt/blogs/bruno.camara/archive/2007/09/12/2094.aspx</link>
            <description>&lt;p&gt;Windows Workflow Foundation has an out-of-the-box set of runtime services. One of the most popular is the Tracking Service, which is defined in the class &lt;b&gt;SqlTrackingService&lt;/b&gt;. The &lt;b&gt;SqlTrackingService&lt;/b&gt; class represents a fully functional tracking service. You can use this service to collect and store tracking information and tracking profiles, and provide them when requested by the workflow runtime engine. The SQL tracking service writes tracking data sent to it by the runtime tracking infrastructure to a SQL database. Well, I just copied the definition of SqlTrackingService from Windows SDK Documentation. In fact, there are a lot of information about SqlTrackingService. &lt;/p&gt;&lt;p&gt;However, it is not the first time that our customers question us about the user Identity who made some interaction on some workflow instance. Well, I think that SqlTrackingService is a good starting point for reflection about this requirement. Let's see: the best solution is to have an extensibility point in the SqlTrackingService that allows me to associate with the tracking event being saved more information. Unfortunately, this is not possible, but you can always write your own tracking service. Deep Dive in Tracking Services reading this &lt;a href="http://msdn2.microsoft.com/en-us/library/bb264458(vs.80).aspx"&gt;article&lt;/a&gt;. &lt;/p&gt;&lt;p&gt;&lt;/p&gt; &lt;p&gt;So, I decided to write my own tracking service. Since I decided to implement it as an extension of SqlTrackingService, my tracking service requires that  SqlTrackingService is registered in the WorkflowRuntime. What I want is that my tracking service writes in a Sql Server table the identity information for each event written by SqlTrackingService. So let's start for the database and define the table&lt;/p&gt; &lt;p&gt;  &lt;/p&gt;&lt;div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:fbbd5b05-2d23-4d46-9a42-ce0537506d3b" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre style="background-color:White;"&gt;&lt;div&gt;&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="color: #000000; "&gt;CREATE TABLE [dbo].[AuditingTrackingEvent]
(
    [WorkflowID] [uniqueidentifier] NOT NULL,
    [EventOrder] [&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;int&lt;/span&gt;&lt;span style="color: #000000; "&gt;] NOT NULL,
    [Username] [varchar](&lt;/span&gt;&lt;span style="color: #000000; "&gt;100&lt;/span&gt;&lt;span style="color: #000000; "&gt;) NOT NULL,
    [EventDate] [datetime] NOT NULL,
)
GO

CREATE CLUSTERED INDEX IX_AuditingTrackingEvent_WorkflowID_EventOrder
ON AuditingTrackingEvent(WorkflowID, EventOrder)
GO&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;The column EventDate is not necessary, since the tables associated with the SqlTrackingService already record this information.
&lt;/p&gt;&lt;p&gt;Now I have to implement my service, which I will call SqlAuditingService, extending the abstract class TrackingService
&lt;/p&gt;&lt;p&gt; &lt;/p&gt;
&lt;div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:64b1ce67-d833-46ef-946b-1820daa9ac34" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre style="background-color:White;"&gt;&lt;div&gt;&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="color: #000000; "&gt;    &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;public&lt;/span&gt;&lt;span style="color: #000000; "&gt; &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;class&lt;/span&gt;&lt;span style="color: #000000; "&gt; SqlAuditingService : TrackingService
    {
        &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;protected&lt;/span&gt;&lt;span style="color: #000000; "&gt; &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;override&lt;/span&gt;&lt;span style="color: #000000; "&gt; TrackingProfile GetProfile(Guid workflowInstanceId)
        {
            &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;throw&lt;/span&gt;&lt;span style="color: #000000; "&gt; &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;new&lt;/span&gt;&lt;span style="color: #000000; "&gt; Exception(&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;The method or operation is not implemented.&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;);
        }

        &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;protected&lt;/span&gt;&lt;span style="color: #000000; "&gt; &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;override&lt;/span&gt;&lt;span style="color: #000000; "&gt; TrackingProfile GetProfile(Type workflowType, Version profileVersionId)
        {
            &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;throw&lt;/span&gt;&lt;span style="color: #000000; "&gt; &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;new&lt;/span&gt;&lt;span style="color: #000000; "&gt; Exception(&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;The method or operation is not implemented.&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;);
        }

        &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;protected&lt;/span&gt;&lt;span style="color: #000000; "&gt; &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;override&lt;/span&gt;&lt;span style="color: #000000; "&gt; TrackingChannel GetTrackingChannel(TrackingParameters parameters)
        {
            &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;throw&lt;/span&gt;&lt;span style="color: #000000; "&gt; &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;new&lt;/span&gt;&lt;span style="color: #000000; "&gt; Exception(&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;The method or operation is not implemented.&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;);
        }

        &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;protected&lt;/span&gt;&lt;span style="color: #000000; "&gt; &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;override&lt;/span&gt;&lt;span style="color: #000000; "&gt; &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;bool&lt;/span&gt;&lt;span style="color: #000000; "&gt; TryGetProfile(Type workflowType, &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;out&lt;/span&gt;&lt;span style="color: #000000; "&gt; TrackingProfile profile)
        {
            &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;throw&lt;/span&gt;&lt;span style="color: #000000; "&gt; &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;new&lt;/span&gt;&lt;span style="color: #000000; "&gt; Exception(&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;The method or operation is not implemented.&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;);
        }

        &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;protected&lt;/span&gt;&lt;span style="color: #000000; "&gt; &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;override&lt;/span&gt;&lt;span style="color: #000000; "&gt; &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;bool&lt;/span&gt;&lt;span style="color: #000000; "&gt; TryReloadProfile(Type workflowType, Guid workflowInstanceId, &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;out&lt;/span&gt;&lt;span style="color: #000000; "&gt; TrackingProfile profile)
        {
            &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;throw&lt;/span&gt;&lt;span style="color: #000000; "&gt; &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;new&lt;/span&gt;&lt;span style="color: #000000; "&gt; Exception(&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;The method or operation is not implemented.&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;);
        }
    }&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;and my channel, SqlAuditingChannel, extending the abstract class TrackingChannel
&lt;/p&gt;&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:e2038a74-9e11-4994-9798-c10158ea13bc" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre style="background-color:White;"&gt;&lt;div&gt;&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="color: #000000; "&gt;    &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;public&lt;/span&gt;&lt;span style="color: #000000; "&gt; &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;class&lt;/span&gt;&lt;span style="color: #000000; "&gt; SqlAuditingChannel : TrackingChannel
    {
        &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;protected&lt;/span&gt;&lt;span style="color: #000000; "&gt; &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;override&lt;/span&gt;&lt;span style="color: #000000; "&gt; &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;void&lt;/span&gt;&lt;span style="color: #000000; "&gt; InstanceCompletedOrTerminated()
        {
            &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;throw&lt;/span&gt;&lt;span style="color: #000000; "&gt; &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;new&lt;/span&gt;&lt;span style="color: #000000; "&gt; Exception(&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;The method or operation is not implemented.&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;);
        }

        &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;protected&lt;/span&gt;&lt;span style="color: #000000; "&gt; &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;override&lt;/span&gt;&lt;span style="color: #000000; "&gt; &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;void&lt;/span&gt;&lt;span style="color: #000000; "&gt; Send(TrackingRecord record)
        {
            &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;throw&lt;/span&gt;&lt;span style="color: #000000; "&gt; &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;new&lt;/span&gt;&lt;span style="color: #000000; "&gt; Exception(&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;The method or operation is not implemented.&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;);
        }
    }&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;The SqlAuditingService must have the same implementation as SqlTrackingService in respect to profile management. In fact, I want my SqlAuditingService to behave as a wrapper to SqlTrackingService. We have two approaches here: 
&lt;/p&gt;&lt;p&gt;1) inspect the code (via Reflector) in SqlTrackingService and duplicate it in our implementation; 
&lt;/p&gt;&lt;p&gt;2) Use reflection to invoke the equivalent methods on SqlTrackingService (you have to use reflection because of the visibility of the methods in the class SqlTrackingService). 
&lt;/p&gt;&lt;p&gt;It's up to you. (BTW: in our implementation we choose approach 1).
&lt;/p&gt;&lt;p&gt;The main method is the GetTrackingChannel, which must return an instance of SqlAuditingChannel
&lt;/p&gt;&lt;p&gt; &lt;/p&gt;
&lt;div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:3a8c8603-00b0-4d3c-a362-c9053390c372" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre style="background-color:White;"&gt;&lt;div&gt;&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="color: #000000; "&gt;        &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;protected&lt;/span&gt;&lt;span style="color: #000000; "&gt; &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;override&lt;/span&gt;&lt;span style="color: #000000; "&gt; TrackingChannel GetTrackingChannel(TrackingParameters parameters)
        {
            &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;return&lt;/span&gt;&lt;span style="color: #000000; "&gt; &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;new&lt;/span&gt;&lt;span style="color: #000000; "&gt; SqlAuditingChannel(&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;this&lt;/span&gt;&lt;span style="color: #000000; "&gt;);
        }&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;In the SqlAuditingChannel, in the implementation of the Send methos, we must write to the database the identity information 
&lt;/p&gt;&lt;p&gt; &lt;/p&gt;
&lt;div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:b1642585-5036-4313-bc58-f79ea4094413" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre style="background-color:White;"&gt;&lt;div&gt;&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="color: #000000; "&gt;        &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;protected&lt;/span&gt;&lt;span style="color: #000000; "&gt; &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;override&lt;/span&gt;&lt;span style="color: #000000; "&gt; &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;void&lt;/span&gt;&lt;span style="color: #000000; "&gt; Send(TrackingRecord record)
        {
            &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;string&lt;/span&gt;&lt;span style="color: #000000; "&gt; userName &lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt; GetCurrentUsername();
            WriteInDatabase(record, userName);
            
        }&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;One possible implementation for the method GetCurrentUsername is&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:8bd9285f-e15e-4330-bce1-d97056b6936c" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre style="background-color:White;"&gt;&lt;div&gt;&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="color: #000000; "&gt;        &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;private&lt;/span&gt;&lt;span style="color: #000000; "&gt; &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;string&lt;/span&gt;&lt;span style="color: #000000; "&gt; GetCurrentUsername()
        {
            &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;string&lt;/span&gt;&lt;span style="color: #000000; "&gt; login &lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt; &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;string&lt;/span&gt;&lt;span style="color: #000000; "&gt;.Empty;
            &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;if&lt;/span&gt;&lt;span style="color: #000000; "&gt; (HttpContext.Current &lt;/span&gt;&lt;span style="color: #000000; "&gt;!=&lt;/span&gt;&lt;span style="color: #000000; "&gt; &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;null&lt;/span&gt;&lt;span style="color: #000000; "&gt;)
            {
                login &lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt; HttpContext.Current.User.Identity.Name;
            }
            &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;else&lt;/span&gt;&lt;span style="color: #000000; "&gt;
            {
                login &lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt; Thread.CurrentPrincipal.Identity.Name;
            }
            &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;return&lt;/span&gt;&lt;span style="color: #000000; "&gt; login;
        }&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;The implementation depends on your scenario, but for example if you are hosting the WF Runtime in IIS, and using the ManualWorkflowScheduler and using the Membership Provider, this implementation works fine.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;The implementation depends on your scenario, but for example if you are hosting the WF Runtime in IIS, and using the ManualWorkflowScheduler and the Membership Provider, this implementation works fine.
&lt;/p&gt;&lt;p&gt;This is a simplified version of the auditing service. Of course in the real world you must deal with some aspects
&lt;/p&gt;&lt;ul&gt;
&lt;li&gt;Transactionality: if the SqlTrackingService was configured with IsTransactional = true, then your SqlAuditingChannel must be transactional either. For this you must implement the IPendingWork interface 
&lt;/li&gt;&lt;li&gt;SharedConnection: if the SqlTrackingService and the SqlPersistenceService shares the same connection, avoiding to use distributed transaction, using the service SharedConnectionWorkflowCommitWorkBatchService, then you must use the same connection. This is a big deal, since this service was not designed to be open and allow other runtime services to use the connection and the transaction in use. In the real implementation we had to use reflection to get access to the connection and transaction. As an humble suggestion to the WF Team, please design the SharedConnectionWorkflowCommitWorkBatchService to be used by other services. 
&lt;/li&gt;&lt;li&gt;At last, you must provide some kind of helper to explore and merge the native information of the Tracking service and our Auditing service. Remember that the column EventOrder (combined with WorkflowID)  is the column that allows you to correlate events between the two services.&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;You can email me if you want to know more about the complete implementation.&lt;/p&gt;&lt;img src="http://agilior.pt/blogs/bruno.camara/aggbug/2094.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>BFC</dc:creator>
            <guid>http://agilior.pt/blogs/bruno.camara/archive/2007/09/12/2094.aspx</guid>
            <pubDate>Wed, 12 Sep 2007 21:13:30 GMT</pubDate>
            <wfw:comment>http://agilior.pt/blogs/bruno.camara/comments/2094.aspx</wfw:comment>
            <comments>http://agilior.pt/blogs/bruno.camara/archive/2007/09/12/2094.aspx#feedback</comments>
            <slash:comments>15</slash:comments>
            <wfw:commentRss>http://agilior.pt/blogs/bruno.camara/comments/commentRss/2094.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>