<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[Edin Mulic - DEVELOPERS.DE]]></title><description><![CDATA[Software Development Blog with focus on .NET, Windows, Microsoft Azure powered by daenet]]></description><link>https://developers.de/</link><image><url>https://developers.de/favicon.png</url><title>Edin Mulic - DEVELOPERS.DE</title><link>https://developers.de/</link></image><generator>Ghost 1.21</generator><lastBuildDate>Thu, 09 Apr 2026 11:20:12 GMT</lastBuildDate><atom:link href="https://developers.de/author/edin/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[Expose BizTalk WCF/Rest endpoint via Azure Service Bus Relays: "'transportClientEndpointBehavior' could not be loaded." error]]></title><description><![CDATA[<div class="kg-card-markdown"><p>Unfortunately the official documentation <a href="https://social.technet.microsoft.com/wiki/contents/articles/1664.expose-biztalk-applications-on-the-cloud-using-appfabric-connect-for-services.aspx#Exposing_the_BizTalk_Orchestration_as_a_Service_on_the_Cloud">https://social.technet.microsoft.com/wiki/contents/articles/1664.expose-biztalk-applications-on-the-cloud-using-appfabric-connect-for-services.aspx#Exposing_the_BizTalk_Orchestration_as_a_Service_on_the_Cloud</a><br>
is not sufficient to accomplish the exposing of a BizTalk WCF or Rest endpoint via an Azure Service Bus relay.</p>
<p>If you are trying to</p></div>]]></description><link>https://developers.de/2021/02/03/transportclientendpointbehavior-could-not-be-loaded-error-when-exposing-biztalk-endpoint-via-azure-relays/</link><guid isPermaLink="false">601ac30c75b2f43c80dea089</guid><category><![CDATA[BizTalk]]></category><category><![CDATA[Enpoint]]></category><category><![CDATA[Expose;]]></category><category><![CDATA[WCF]]></category><category><![CDATA[Rest]]></category><category><![CDATA[error]]></category><category><![CDATA[transportClientEndpointBehavior]]></category><category><![CDATA[TransportClientEndpointBehaviorElement]]></category><category><![CDATA[could not be loaded]]></category><dc:creator><![CDATA[Edin Mulic]]></dc:creator><pubDate>Wed, 03 Feb 2021 16:35:00 GMT</pubDate><content:encoded><![CDATA[<div class="kg-card-markdown"><p>Unfortunately the official documentation <a href="https://social.technet.microsoft.com/wiki/contents/articles/1664.expose-biztalk-applications-on-the-cloud-using-appfabric-connect-for-services.aspx#Exposing_the_BizTalk_Orchestration_as_a_Service_on_the_Cloud">https://social.technet.microsoft.com/wiki/contents/articles/1664.expose-biztalk-applications-on-the-cloud-using-appfabric-connect-for-services.aspx#Exposing_the_BizTalk_Orchestration_as_a_Service_on_the_Cloud</a><br>
is not sufficient to accomplish the exposing of a BizTalk WCF or Rest endpoint via an Azure Service Bus relay.</p>
<p>If you are trying to do that and struggling with error like<br>
The type <mark>'Microsoft.ServiceBus.Configuration.TransportClientEndpointBehaviorElement, Microsoft.ServiceBus, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' registered for extension 'transportClientEndpointBehavior' could not be loaded.</mark><br>
the following steps might be helpful for you:</p>
<ol>
<li>
<p>If you use Service Bus Namespace as described in the official documentation you'll need to install additional tool named &quot;Azure Service Bus Explorer&quot; to be able to see the automatically created relay. To avoid this issue, simple create a Relay service in Azure rather then creating Service Bus Namespace. Basically Service Bus Namespace and Relay services  are providing the same features for relays, but the Relay service is specialized for Relay feature only, while Service Bus Namespace is providing further features like Queues and Topics.</p>
</li>
<li>
<p>After publishing a WCF service by using &quot;BizTalk WCF Service Publishing Wizard&quot; as described in the official documentation (or similar way if you  published a Rest service) you need to correct the version of the assembly Microsoft.ServiceBus.dll delivered by wizard. Otherwise you'll get the error &quot;<em>'transportClientEndpointBehavior' could not be loaded.</em>&quot; mentioned above, when trying to call the WCF/Rest endpoint locally on the BizTalk. This error is preventing the web service to create required Relay items in the Azure (which is done in the service start), so you'll not see any services there until you fix this error.<br>
To get rid of this error, go to the IIS folder holding the web application created by WCF Publishing wizard (you can find the path of the location in the completion view in the wizard, for usually something like &quot;C:\inetpub\wwwroot\YourWebAppName&quot;), navigate to the subfolder App_Data/bin and finally replace the assembly Microsoft.ServiceBus.dll in this folder with the latest version of this assembly which can be downloaded from <a href="https://www.nuget.org/packages/WindowsAzure.ServiceBus">https://www.nuget.org/packages/WindowsAzure.ServiceBus</a>.</p>
</li>
<li>
<p>Use VS command prompt with elevated permissions to register the new version of &quot;Microsoft.Servicebus.dll&quot; into GAC:<br>
<code>gacutil -i C:\inetpub\wwwroot\YourWebAppName\App_Data\bin\Microsoft.ServiceBus.dll</code></p>
</li>
<li>
<p>Create new application pool in IIS Management console. You are free to use any allowed name for this app pool. As identity of the new pool use the same account used by BizTalkServerIsolatedHost.</p>
</li>
<li>
<p>Use IIS management console to assign the newly created app pool to your web application previously created by &quot;BizTalk WCF Service Publishing Wizard&quot;.</p>
</li>
<li>
<p>If you don't want to use Windows App Fabric as described in the official documentation to get the web app automatically started, you can simply activate the &quot;Application Initialization&quot; feature in the Windows Server features:<br>
Server Management -&gt; Manage -&gt; Add Roles and Features -&gt; Activate Web Server (IIS) – Web Server – Application Development – Application Initializiation<br>
Afterward add the following <applicationinitialization> element to the web.config file of your WCF/Rest web application.</applicationinitialization></p>
</li>
</ol>
<pre><code>&lt;system.webServer&gt;
     &lt;applicationInitialization doAppInitAfterRestart=&quot;true&quot;&gt;
       &lt;add initializationPage=&quot;/Service1.svc&quot; /&gt;
     &lt;/applicationInitialization&gt;
&lt;/system.webServer&gt;
</code></pre>
<p>You can find <a href="https://weblog.west-wind.com/posts/2013/oct/02/use-iis-application-initialization-for-keeping-aspnet-apps-alive">here</a> more details regarding the settings required to have the web application always running. This is required, since the relay in Azure will exist only if the web app is running.</p>
<ol start="7">
<li>Use IISRESET from elevated command promt to restart the IIS.</li>
</ol>
<p>Having all this done, you should be able to open the your BizTalk Endpoint in the browser (localy, on BizTalk server) without any errors.<br>
If you take a look into Azure Portal (or in Azure Service Bus Explorer), you'll see new WCF Relay item automatically created in your Azure Relay Service or Service Bus Namespace Service.</p>
<p>Now to get the BizTalk WCF or Rest endpoint called from anywhere you can use the Uri of the created Azure relay, something like that:<br>
<a href="https://yourrelay.servicebus.windows.net/YourWebAppName/Service1.svc/YourServiceOperation">https://yourrelay.servicebus.windows.net/YourWebAppName/Service1.svc/YourServiceOperation</a><br>
&quot;YourServiceOperation&quot; needs to be configured in the adapter setting of the BizTalk receive Location assigned to your IIS web application.</p>
<p>You need to put following HTTP Header to your request for authentication purposes:<br>
<code>Authorization: SharedAccessSignature [sasToken]</code><br>
where [sasToken] is to be replaced with a time limited Shared Access Signature token, generated from the Shared Access Policy name and key value for particular resource Uri.<br>
Example:</p>
<pre><code>Authorization: SharedAccessSignature sr=https%3a%2f%2fyourAzureRelay.servicebus.windows.net%2fyourWcfRelay&amp;sig=ZYJkLRqivWHsHxPIUUlUL5LXIEIEFRoEVyDVU%2bxFljs%3d&amp;se=1612453185&amp;skn=yourSasPolicyName
</code></pre>
<p>Here is sample code showing how to generate a Sas Token with expiration time 1 hour:</p>
<pre><code>string CreateSASToken(string resourceUri, string keyName, string keyValue)
{
    TimeSpan sinceEpoch = DateTime.UtcNow - new DateTime(1970, 1, 1);
    var expiry =  Convert.ToString((int)sinceEpoch.TotalSeconds + 3600);

    string stringToSign = HttpUtility.UrlEncode(resourceUri) + &quot;\n&quot; + expiry;
    HMACSHA256 hmac = new HMACSHA256(Encoding.UTF8.GetBytes(keyValue));

    var signature = Convert.ToBase64String(hmac.ComputeHash(Encoding.UTF8.GetBytes(stringToSign)));
    var sasToken = String.Format(CultureInfo.InvariantCulture, &quot;SharedAccessSignature sr={0}&amp;sig={1}&amp;se={2}&amp;skn={3}&quot;,
                HttpUtility.UrlEncode(resourceUri), HttpUtility.UrlEncode(signature), expiry, keyName);
   return sasToken;
}
</code></pre>
<p>where:<br>
<code>resourceUri = &quot;https://yourAzureRelay.servicebus.windows.net/yourWcfRelay&quot;;</code></p>
<p><code>keyName = &quot;your SAS Policy name created for Relay in Azure Portal&quot;</code></p>
<p><code>keyValue = &quot;value of the primary or secondary key for the SAS Policy, which is automaticaly generated in Azure Portal on SAS Token creation&quot;</code></p>
<p>You can use Azure Portal to create Shared Access policy for your Relay or Service Bus Namespace.<br>
Consider that a policy used by the BizTalk Endpoint consumer should be permitted for Sending messages only.</p>
<p>And finally, here is sample code how to call Azure Relay endpoint by using HttpClient:</p>
<pre><code>using(var httpClient = new HttpClient())
{
    var url = string.Format(&quot;{0}&quot;, RelayAddress);
                                         httpClient.DefaultRequestHeaders.TryAddWithoutValidation(&quot;Authorization&quot;,    sasToken);
                        
    httpClient.DefaultRequestHeaders.TryAddWithoutValidation(&quot;Content-Type&quot;,   &quot;application/json&quot;);
   
   var content = new StringContent(&quot;{'Property': 'Value'}&quot;);
   var response = await httpClient.PostAsync(resourceUri, content);
   var responseText = await response.Content.ReadAsStringAsync();

}
</code></pre>
<p>The approach described worked for me fine on both, BizTalk Server 2016 and BizTalk 2020.</p>
<p>Edit:<br>
If a proxy server is required to be configured on your BizTalk server for outgoing HTTP connections, you will determine that the WCF-WebHttp Receive Adapter used in your Receive location generated by WCF Publisher Wizard doesn't provide configuration option for that.<br>
The easiest way to get Proxy Server configured is to insert the following configuration section to end of the web.config file of your IIS web application:</p>
<pre><code>  ...
  &lt;system.net&gt;
    &lt;defaultProxy&gt;
      &lt;proxy proxyaddress=&quot;http://yourProxyServer:port&quot; /&gt;
    &lt;/defaultProxy&gt;
  &lt;/system.net&gt;
&lt;/configuration&gt;
</code></pre>
<p>Consider &quot;proxyaddress&quot; to be written in lowercase. Trying to apply camelcase (&quot;proxyAddress&quot; what I did) will not work here. Instead of getting an error saying &quot;invalid property&quot; or similar, the proxy setting will simply not be applied.</p>
<p>Theoretically, it should be also possible to apply the proxy server on the webHttpRelayBinding configuration element by using proxyAddress attribute like here:</p>
<pre><code>...
&lt;bindings&gt;
      &lt;webHttpRelayBinding&gt;
        &lt;!-- For some reasons, this doesn't work --&gt;
        &lt;binding name=&quot;RelayEndpointConfig&quot; useDefaultWebProxy=&quot;false&quot; proxyAddress=&quot;http://yourProxyServer:port&quot;&gt; 
          &lt;security relayClientAuthenticationType=&quot;RelayAccessToken&quot; mode=&quot;Transport&quot; /&gt;
        &lt;/binding&gt;
      &lt;/webHttpRelayBinding&gt;
    &lt;/bindings&gt;
...
</code></pre>
<p>For some reasons this didn't work for me. The proxy server defined here, was simply ignored. But in contrast to the camelcase behavior mentioned above for &quot;proxyaddress&quot; attribute in &quot;defaultProxy&quot; element, here you'll get an &quot;invalid property&quot; error if you don't use camelcase and write &quot;proxyaddress&quot; instead of &quot;proxyAddress&quot;.</p>
</div>]]></content:encoded></item><item><title><![CDATA[BizTalk Server: how to configure Two-Way certificate authentication in BizTalk MQSC Adapter]]></title><description><![CDATA[Instruction how to configure Two-Way certificate based Authentication for MQSC Adapter in BizTalk Server]]></description><link>https://developers.de/2020/02/28/how-to-configure-two-way-certificate-authentication-in-biztalk-mqsc-adapter/</link><guid isPermaLink="false">5e57e67e1e1e0c06882c39ef</guid><category><![CDATA[BizTalk]]></category><category><![CDATA[MQSC Adapter]]></category><category><![CDATA[tw-way authentication]]></category><category><![CDATA[2-way authentication]]></category><category><![CDATA[two way authentication]]></category><category><![CDATA[certificate]]></category><category><![CDATA[IBM MQ]]></category><dc:creator><![CDATA[Edin Mulic]]></dc:creator><pubDate>Fri, 28 Feb 2020 09:25:10 GMT</pubDate><content:encoded><![CDATA[<div class="kg-card-markdown"><p>To configure 2-way certificate authentication in the MQSC adapter used in BizTalk receive location to retrieve messages from an IBM MQ Queue you’ll need at least 2 certificate sets:</p>
<h1 id="1servercertificatesset">1. Server Certificates set</h1>
<p>The server certificates set will be usually provided by the remote party responsible for the IBM MQ Server. This certificates set consists at least of one Server/Client authentication certificate and possible one or more Root CA certificates (if not included in the Server/Client certificate) used to build valid certification path for the Server/Client certificate.<br>
This certificate set must be installed in two different locations on the BizTalk server to make the BizTalk MQSC Adapter able to use it:</p>
<h2 id="1installationofservercertificatesinibmkeydatabase">1. Installation of Server certificates in IBM Key Database</h2>
<p>a) Use the “IBM Key Management” Tool strmqikm.exe (can be found in the IBM MQ Client installation folder (for usually here C:\Program Files\IBM\WebSphere MQ\bin64) to create a new IBM key database as described <a href="https://www.ibm.com/support/knowledgecenter/SSFKSJ_9.0.0/com.ibm.mq.sec.doc/q012680_.htm">here</a>.</p>
<p>b) Use “Add…” button under “Signer Certificates” in the “IBM Key Management” GUI to add all Server certificates to the IBM key database:<br>
<img src="https://developersde.blob.core.windows.net/usercontent/2020/2/27166_Untitled.png" alt="27166_Untitled"><br>
Please note, here you can use any name when asked to enter certificates label.</p>
<h2 id="2installationofservercertificatesinwindowsusercertificatestore">2. Installation of Server certificates in Windows User Certificate store</h2>
<p>In addition to the installation of the Server certificates in the IBM Key database certificate storage, you’ll need to install the same certificates in the windows User Certificate storage on the BizTalk server. To accomplish this, you’ll need to login to the BizTalk server with the service account used by BizTalk Host Instance the MQSC adapter based Receive Location is assigned to.</p>
<p>a) Login to the BizTalk Server with the credentials of the service account used by BizTalk host instance assigned to the MQSC Adapter based receive location you want to get running.</p>
<p>b) Open User certificates storage from command prompt by using the command certmgr.msc</p>
<p>c) Use the “Import…” option to import all Server certificates. The Server/Client authentication certificate should be imported to the “Personal” storage. All other Root CA certificates are to be imported to the “Trusted Root Certification Authorities” storage:<br>
<img src="https://developersde.blob.core.windows.net/usercontent/2020/2/27166_Untitled1.png" alt="27166_Untitled1"></p>
<h1 id="2clientcertificatesset">2. Client Certificates set</h1>
<p>The Client certificates set will be usually provided by the party responsible for the network/domain where the BizTalk Server is hosted. Similar to the Server certificate set, the Client certificate set also consists at least of one Server/Client authentication certificate and possible one or more Root CA certificates (if not included in the Server/Client certificate) used to build valid certification path for the Server/Client certificate. The subject of this certificate should be FQDN of the BizTalk Server.</p>
<h2 id="1createcertificatesigningrequest">1. Create Certificate Signing Request</h2>
<p>Use the menu option “Create -&gt; New Certificate Request …” in the “IBM Key Management” tool (installed with the IBM MQ Client installation under C:\Program Files\IBM\WebSphere MQ\bin64\strmqikm.exe) on the BizTalk Server to generate Certificate Signing Request (CSR) for the BizTalk Server machine:<br>
<img src="https://developersde.blob.core.windows.net/usercontent/2020/2/27166_Untitled2.png" alt="27166_Untitled2"><br>
In the field “Key Label” you can use any name to describe the certificate. The Certificate Request will appear under this label in the list of certificate requests in the IBM Key Management tool.<br>
I have used “Key Size” 1024 and “Signature algorithm” SHA384WithRSA. Important is to set “Common Name” to FQDN name of the BizTalk Server (if not automatically filled).<br>
You should also fill out further fields like organization, country etc. to make the certificate more transparent later.</p>
<h2 id="2sendcsrfiletosystemadmin">2. Send CSR file to system admin</h2>
<p>Provide the generated CSR file to the system administrator of the BizTalk Server domain to get valid Client certificates set.<br>
Please note, the IBM Key Management tool creates CSR file in *.arm format which is not supported by Windows tools for certificate generation. If your system administrator requires *.der format you can use the function “Extract …” to create CSR export in this format:<br>
<img src="https://developersde.blob.core.windows.net/usercontent/2020/2/27167_Untitled3.png" alt="27167_Untitled3"><br>
For more details regarding how to send third party certificate signing request on windows see the following links:<br>
<a href="https://www.ibm.com/support/pages/request-contains-no-certificate-template-information-when-signing-thirdpartycertificatetool-csr">https://www.ibm.com/support/pages/request-contains-no-certificate-template-information-when-signing-thirdpartycertificatetool-csr </a><br>
<a href="https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/certreq_1">https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/certreq_1</a></p>
<p>The certificate template to be used is by system administrator is  “Computer”, “Client Authentication, Server Authentication”:<br>
<img src="https://developersde.blob.core.windows.net/usercontent/2020/2/27169_Untitled4.png" alt="27169_Untitled4"></p>
<h2 id="3importcertificateretreivedfromsystemadmin">3. Import Certificate retreived from system admin</h2>
<p>Once the system administrator has provided the Client certificate set to you, you’ll need to use the action “Receive …” under “Personal Certificates” in the “IBM Key Management” GUI to import the certificate retrieved from the system administrator:<br>
<img src="https://developersde.blob.core.windows.net/usercontent/2020/2/27169_Untitled5.png" alt="27169_Untitled5"></p>
<h2 id="4importrootcacertificatestooonliftheimportedcertificateisnotvalid">4. Import Root CA certificates too (onl if the imported certificate is not valid)</h2>
<p>If the certificate doesn’t contain all Root CA certificates building the full certification path (you can check this by using “Validate” action under “Personal Certificates”), you’ll need to import CA Root certificates manually by using “Add …” action under “Signer Certificates” in the “IBM Key Management” GUI.<br>
IMPORTANT: The label of the Client Certificate must be built from the fix prefix “ibmwebspheremq” followed by the name of the service account the BizTalk Host Instance is running with in lowercase. I.e. “ibmwebspheremqbtssvcaccount” without quotes, when the name of the account used by BizTalk Host instance is “BtsSvcAccount”.</p>
<h2 id="5providepublicpartofcertificatetotheremoteparty">5. Provide public part of certificate to the remote party</h2>
<p>Finally, extract the public key and provide it to the remote party to make them able to prepare the IBM MQ Server for the communication with the BizTalk server.<br>
For more details how to extract certificate public key see <a href="https://www.ibm.com/support/knowledgecenter/SSFKSJ_9.0.0/com.ibm.mq.sec.doc/q012820_.htm">here</a>.</p>
<h2 id="4configurebiztalkmqscaadapterforreceivelocation">4. Configure BizTalk MQSCA Adapter for Receive Location</h2>
<p>Finally you can configure the BizTalk MQSC Adapter in the Receive Location.<br>
The minimal set of the mandatory settings required for MQSC Adapter configuration even if you don’t want to configure two-way certificate based authentication are:<br>
•	Connection name (IP address or host name of the IBM MQ Server)<br>
•	Port number of the IBM MQ<br>
•	Channel name<br>
•	Name of the Queue Manager<br>
•	Name of the Queue<br>
All those values provided to you by the remote party which is hosting the IBM MQ Server, must be entered in the MQSC Adapter settings view.<br>
In addition to those parameters remote party must provide to you a value for the Adapter setting “SSL Cipher Specification” (i.e. something like ECDHE_RSA_AES_256_CBC_SHA384) which is also to be configured in the BizTalk MQSC adapter settings of the receive location.<br>
The last required setting is “SSL Key Repository Location” which is actually path of the IBM Key database created in the step 1.1.a of this description.<br>
Please note, the name of the IBM Key database file must not contain file extension (i.e. if the Key DB name is C:\ProgramData\IBM\MQ\key.kdb the value to enter in the “SSL Key Repository Location” is “C:\ProgramData\IBM\MQ\key”.</p>
<p>I used BizTalk Server 2013 R2, but the is probably valid for other BizTalk versions too.</p>
<p>Update:<br>
While trying to get the MQSC adapter based Receive Location in the production environment running, we detected some more issues and additional configuration steps were required.</p>
<ol>
<li>On the MQ Server side the admins needed to add following setting:<br>
CHANNELS:<br>
PasswordProtection=OPTIONAL</li>
<li>In the MQSC BizTalk adapter settings we entered the value &quot;mqm&quot; as &quot;User Id&quot;.</li>
<li>On the BizTalk server, in the file mqclient.ini (C:\Program Files (x86)\IBM\WebSphere MQ\mqclient.ini) we added folloowing configuration:<br>
SSL:<br>
OCSPAuthentication=OPTIONAL<br>
OCSPCheckExtensions=NO<br>
CDPCheckExtensions=NO<br>
CHANNELS:<br>
PasswordProtection=OPTIONAL<br>
MQCSP.AuthenticationType=MQCSP_AUTH_NONE</li>
<li>We added following environment variable to the BizTalk machine:<br>
MQCCSID = 1208<br>
Please remark, all those changes were not required in all environments we have.</li>
</ol>
</div>]]></content:encoded></item></channel></rss>