Automatic testing of WCF Receive and send ports

28. November 2011

We are using the Powershell BizTalk Adapter when deploying our BizTalk solution.

And since we depend on a lot of external services and expose som WCF-services as well, we might as well do a quick test to see if the respond properly. Even a simple check to see if the URL responds with HTTP 200-OK will catch a lot of configuration and setup related errors.

The following script will iterate through all WCF receive and send port and try a simpe HTTP get. Perfect as the last step of any BizTalk deployment :-)


function GetStatusCodeFromURL
{
    param([string]$serviceName,[string]$url)

    try
    {
        Write-Host "$serviceName => " -NoNewline
       
        $req=[system.Net.HttpWebRequest]::Create($url);
        $res = $req.getresponse();
        $stat = $res.statuscode;
        $res.Close();
               
        if ($stat -eq "OK")
        {
            Write-Host "$stat" -ForegroundColor:Green
        }
        else
        {
            Write-Host "$stat" -ForegroundColor:Red
        }
       
    }
    catch [System.Exception]
    {
        $exceptionMessage = $url + ": " + $_.Exception.Message
        Write-Host $exceptionMessage -ForegroundColor:Red       
    }
   
}

Write-Host "Testing HTTP send- and receiveports" -ForegroundColor:Green

## All receive locations
foreach ($bizApplication in Get-ChildItem "BizTalk:\Applications" | Where-Object {$_.Status -ne "NotApplicable"})
{
    $bizApplicationName = $bizApplication.Name

    foreach ($bizReceiveLocation in Get-ChildItem "BizTalk:\Applications\$bizApplicationName\Receive Locations" | Where-Object {$_.Address.EndsWith(".svc")})
    {
        $desc = $bizApplicationName + ": " + $bizReceiveLocation.Name
        GetStatusCodeFromURL $desc "http://localhost" + $bizReceiveLocation.Address
    }

    foreach ($bizSendPort in Get-ChildItem "BizTalk:\Applications\$bizApplicationName\Send Ports" | Where-Object {$_.IsTwoWay -eq $true})
    {
        $desc = $bizApplicationName + ": " + $bizSendPort.Name
        GetStatusCodeFromURL $desc $bizSendPort.PrimaryTransportAddress
    }
   
}


Christian Staerk  

BizTalk Server, Sharepoint Server

List of BizTalk updates

24. November 2011

Sandro created a nice and neat list of BizTalk updates.

http://sandroaspbiztalkblog.wordpress.com/2011/11/22/biztalk-server-list-of-service-packs-and-cumulative-updates-available/


Thx Sandro ;)


Michael Høtoft  

BizTalk Server

Using powershell to query shared ressources

11. November 2011

While testing settings in a development enviroment, i needed a simple way to reflect and discover shared runtime ressources, with powershell of cause!

[System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.Solutions.BTARN.Shared”)

$runtimeValue = [Microsoft.Solutions.BTARN.Shared.RuntimeGlobal]::DataDbConnectionString

Write-Host $runtimeValue

easy  ;)

 


Michael Høtoft  

Sharepoint Server

Mutiple BizTalk Server databases on the same shared sql instans is not a good idea

9. November 2011

Recently (with more and more development enviroments beeing virtualized) I have experienced a tendency to share the underlying servers on a SQL server cluster. In a shared instans.

This does work in some basic BizTalk scenarios. But I have recenltlyy experienced an issue where the unique name on BAM dts packagesand the underlying deployment could not be shared. Similar to this issue : http://social.msdn.microsoft.com/forums/en-US/biztalkediandas2/thread/0e5b3380-601c-44cb-b599-91b699d557b4. This might only be an issue for EDI solutions, but we expect to see it with the rosettanet adapter too. 

So as a general reminder of development better practice : ISOLATE DEVELOPMENT. Even when the operations guys(or girls) are trying to make there life easier with more shared ressources.


Michael Høtoft  

BizTalk Server

IIS 32 bit mode

9. November 2011

Tyring to install sharepoint services 3.0 for a BizTalk 2009 BAM feature, I ran into an error regarding IIS running in 32 bit emulation mode. To change this use the following command:

CScript "%SystemDrive%\InetPub\AdminScripts\adsutil.vbs" set w3svc/AppPools/Enable32bitAppOnWin64 0

And perform an iisreset.


Michael Høtoft  

BizTalk Server, Sharepoint Server