{"id":24,"date":"2026-08-13T13:36:19","date_gmt":"2026-08-13T13:36:19","guid":{"rendered":"https:\/\/72.18.83.234\/?p=24"},"modified":"2026-08-13T14:09:14","modified_gmt":"2026-08-13T14:09:14","slug":"the-encompass-sdk-trap-when-moving-it-to-a-web-api-broke-our-loan-triggers","status":"publish","type":"post","link":"https:\/\/barrymind.com\/?p=24","title":{"rendered":"The Encompass SDK Trap: When Moving It to a Web API Broke Our Loan Triggers"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\"><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Sometimes the hardest production bugs are the ones that make absolutely no sense.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Nothing in the business logic has changed.<br>The same Encompass SDK is being used.<br>The same loan is being updated.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And yet, somehow, the result is different.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This was one of those bugs.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">A 10-Year-Old Mortgage System<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The system I work on is a long-running mortgage platform built on <strong>.NET Framework 4.8<\/strong>. It integrates heavily with <strong>ICE Mortgage Technology Encompass<\/strong>, using the Encompass SDK to read and update loan data.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When the project was first built, our architecture was fairly straightforward. We had a portal application, and the portal itself directly called the Encompass SDK whenever it needed to interact with a loan.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It worked well enough for a while.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Then we discovered a problem: the Encompass SDK was extremely resource-intensive.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">As the system grew, putting all those SDK calls inside the main portal application started to feel less and less comfortable. So we decided to separate the Encompass integration layer from the portal.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The new architecture looked roughly like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Before:\n\nPortal\n   |\n   +---- Encompass SDK\n             |\n             +---- Encompass\n\n\nAfter:\n\nPortal\n   |\n   +---- Web API\n             |\n             +---- Encompass SDK\n                       |\n                       +---- Encompass\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The idea was simple: move the Encompass-related work into a dedicated Web API application, and run it on a separate server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It seemed like a straightforward architectural improvement.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And it was.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Until it wasn&#8217;t.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">&#8220;Some Loans Aren&#8217;t Saving Correctly&#8221;<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A few days after the new Web API went into production, our Sales team started reporting something strange.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Some loans were not saving correctly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">More specifically, certain <strong>dependent fields in Encompass were not being updated as expected<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">At first, this sounded like a normal application bug.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Maybe we were not setting a field correctly.<br>Maybe the API request was missing something.<br>Maybe the loan data was stale.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We checked the obvious things first.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The values being sent to Encompass looked correct.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The SDK calls were succeeding.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There were no obvious exceptions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And yet the final loan state was wrong.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That was the first clue that something deeper was happening.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The Part That Didn&#8217;t Make Sense<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">After digging into the issue, we discovered something even stranger.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Encompass supports custom triggers that can react to loan field changes and perform additional business logic. Our system relied on some of these triggers to populate or update related fields.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Those triggers had worked perfectly when the portal application was calling the Encompass SDK directly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">But now, after moving the SDK calls into the new Web API&#8230;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">some of them simply weren&#8217;t firing.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The exact same loan update that previously caused a trigger to execute was no longer producing the same behavior.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Nothing about the Encompass business logic had intentionally changed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We had only moved the SDK call from one application to another.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">At this point, we knew we weren&#8217;t looking at a simple &#8220;wrong field value&#8221; problem.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We had to figure out what was different about the new application.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The Investigation<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This was before AI-assisted development became part of our daily workflow, so there was no ChatGPT to throw the problem at.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We had documentation, source code, logs, Encompass behavior, and a lot of debugging.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We compared the old portal application and the new Web API application.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We checked the SDK version.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We checked the requests.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We checked the loan fields.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We checked application configuration.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And eventually, we noticed something we had completely overlooked.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The new Web API project had a section in its <code>web.config<\/code> that looked like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;system.codedom&gt;\n    &lt;compilers&gt;\n        &lt;compiler\n            language=\"c#;cs;csharp\"\n            extension=\".cs\"\n            type=\"Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35\"\n            warningLevel=\"4\"\n            compilerOptions=\"\/langversion:default \/nowarn:1659;1699;1701\"\/&gt;\n\n        &lt;compiler\n            language=\"vb;vbs;visualbasic;vbscript\"\n            extension=\".vb\"\n            type=\"Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35\"\n            warningLevel=\"4\"\n            compilerOptions=\"\/langversion:default \/nowarn:41008 \/define:_MYTYPE=\\&amp;quot;Web\\&amp;quot; \/optionInfer+\"\/&gt;\n\n    &lt;\/compilers&gt;\n&lt;\/system.codedom&gt;\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">At the time, I had barely paid attention to it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It was just part of the <code>web.config<\/code> generated by Visual Studio when creating the ASP.NET Web API project.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It looked like boilerplate.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And honestly, I had no idea why it was there.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">So, What Does <code>system.codedom<\/code> Actually Do?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This is one of those pieces of .NET Framework configuration that is easy to ignore because most applications don&#8217;t need you to think about it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>system.codedom<\/code> configures <strong>Code Document Object Model (CodeDOM) compiler providers<\/strong> used by the ASP.NET runtime for compiling code dynamically.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In our case, the configuration registers two compiler providers:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>a C# compiler<\/li>\n\n\n\n<li>a Visual Basic compiler<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>Microsoft.CodeDom.Providers.DotNetCompilerPlatform<\/code> package provides these compiler providers and allows ASP.NET applications to use the newer Roslyn-based compilers for runtime compilation. This is commonly added to classic ASP.NET projects through Visual Studio\/NuGet templates and configuration.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The interesting part for us was the second entry:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>language=\"vb;vbs;visualbasic;vbscript\"\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">That is the Visual Basic compiler provider.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And that suddenly became very relevant.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Because Encompass custom triggers in our environment were written in <strong>VB<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So our new application wasn&#8217;t simply another .NET application.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It was also introducing a specific Visual Basic runtime compilation environment.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That was the difference we had been looking for.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The Unexpected Interaction<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The important lesson here is not that <code>system.codedom<\/code> is &#8220;bad.&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It isn&#8217;t.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The configuration is perfectly normal for an ASP.NET application, and the <code>Microsoft.CodeDom.Providers.DotNetCompilerPlatform<\/code> package is widely used for runtime compilation in classic ASP.NET applications.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The problem was the interaction between several moving parts:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ASP.NET Web API\n        |\n        +---- CodeDOM \/ Roslyn configuration\n        |\n        +---- Encompass SDK\n                |\n                +---- Encompass runtime\n                        |\n                        +---- Custom VB triggers\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Our original portal application and the new Web API application did not have exactly the same runtime environment.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The Encompass SDK call itself was successful.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The loan field update itself was successful.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">But the surrounding runtime environment had changed enough that some of the Encompass custom trigger behavior was no longer the same.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That was the real bug.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And once we identified the CodeDOM configuration as the key difference, the problem finally made sense.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why This Bug Was So Difficult to Find<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Looking back, the most interesting part of this bug is that almost nothing appeared to be broken.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There was no obvious exception.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There was no failed API request.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There was no authentication problem.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The SDK was returning successfully.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">From the application&#8217;s point of view, everything looked fine.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The failure happened one layer deeper:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Application\n    \u2193\nEncompass SDK\n    \u2193\nLoan update\n    \u2193\nCustom Trigger\n    X\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The application completed the operation, but part of Encompass&#8217;s expected downstream behavior didn&#8217;t happen.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That makes these bugs especially painful in enterprise systems.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can spend hours looking at the code that writes the loan field, when the real problem is the runtime environment surrounding the code.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The Lesson I Took Away<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This incident changed the way I look at framework-generated configuration.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When Visual Studio adds 50 lines to a <code>web.config<\/code>, it is very tempting to think:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">&#8220;That&#8217;s probably just boilerplate.&#8221;<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">Sometimes it is.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Sometimes it is the bug.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The other lesson is even more important for systems like Encompass:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>When you move an SDK integration from one application to another, you are not necessarily moving just the code. You are moving the runtime environment around that code.<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That environment can include:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>framework version<\/li>\n\n\n\n<li>loaded assemblies<\/li>\n\n\n\n<li>compiler providers<\/li>\n\n\n\n<li>configuration<\/li>\n\n\n\n<li>application pool settings<\/li>\n\n\n\n<li>authentication context<\/li>\n\n\n\n<li>process architecture<\/li>\n\n\n\n<li>deployment structure<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">And with an enterprise platform like Encompass, any of those differences can potentially affect behavior outside the code you are directly controlling.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Today, I would probably start the investigation much faster.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Back then, we didn&#8217;t have AI assistants that could scan configuration, understand the relationship between CodeDOM, VB compilation, and a mortgage platform, and suggest dozens of possible interactions in seconds.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We had logs, documentation, source code&#8230;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">and a lot of coffee.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Sometimes that&#8217;s how enterprise software teaches you things.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes the hardest production bugs are the ones that make absolutely no sense. Nothing in the business logic has changed.The same Encompass SDK is being used.The same loan is being updated. And yet, somehow, the result is different. This was one of those bugs. A 10-Year-Old Mortgage System The system I work on is a &#8230; <a title=\"The Encompass SDK Trap: When Moving It to a Web API Broke Our Loan Triggers\" class=\"read-more\" href=\"https:\/\/barrymind.com\/?p=24\" aria-label=\"Read more about The Encompass SDK Trap: When Moving It to a Web API Broke Our Loan Triggers\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-24","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/barrymind.com\/index.php?rest_route=\/wp\/v2\/posts\/24","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/barrymind.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/barrymind.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/barrymind.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/barrymind.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=24"}],"version-history":[{"count":5,"href":"https:\/\/barrymind.com\/index.php?rest_route=\/wp\/v2\/posts\/24\/revisions"}],"predecessor-version":[{"id":39,"href":"https:\/\/barrymind.com\/index.php?rest_route=\/wp\/v2\/posts\/24\/revisions\/39"}],"wp:attachment":[{"href":"https:\/\/barrymind.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=24"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/barrymind.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=24"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/barrymind.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=24"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}