Friday, March 4, 2011

If you have Skype running and you use IIS with ports: 80 and 443 - you may be in trouble

      I've been using Skype for the last year as a primary messaging solution and newer had any problems until a few weeks ego. All of the sudden, my computer start show all kind of network issues where main would be a failure to run any of the web applications on a local IIS 7.0. When I tried to start default web application or any other applications - IIS prodused the following error:

"The process cannot access the file because it is being used by another process."

The System's log error looks like this:

Log Name:      System
Source:        Microsoft-Windows-IIS-W3SVC
Event ID:      1004
The World Wide Web Publishing Service (WWW Service) did not register the URL prefix http://*:80/WebApps for site 1. The site has been disabled. The data field contains the error number.

To find out what is causing the issue, I scanned my network for an applications listening on ports 80 and 443 by executing the following commands :

netstat -aon | find ":80"
netstat -aon | find ":443"

Here is what I got as a result:

TCP                 LISTENING       10024
TCP               LISTENING       10024

When I checked my task manager, I found that this process ID 10024 belongs to Skype.
Having this information, the fixing was a matter of minutes:
  • Within Skype, select Tools from the top menu
  • Select Options
  • Select Advanced from the left sidebar
  • Select Connection from the Advanced sub-menu
  • Uncheck the Use port 80 and 443 as alternatives for incoming connections checkbox
Here is a screen-shot of the Skype with advanced settings menu opened:

Tuesday, December 21, 2010

Subscribing/Pulling stored procedure optimisation. How to resolve a stall problem of the Advent Geneva Workflow Manager.

If you need to implement a custom queue process, one of the simplest solutions would be SQL Server table based solution. Especially, this is beneficial if there is a UI Control panel involved with capabilities to provide a real-time information about queue and dequeue progress.
BizTalk based Advent Geneva WorkFlow Manager (WFM) use a similar approach where the local SQL Server DB preserve information about WFM's activities in the "Activities" table. The only challenge is to prevent subscriber process from pulling the same record more then one time. This is why the "Status" field instoduced:  when subscriber pulls data, the flag(status) must be updated. Flag also must be a one of the conditions for pulling data select statement, so when subscriber pulls, it selects only "Open" records (Status = 'O'). As soon as it red it - status must be flipped to "Processed" (Status='P').
Here is how it would looks in T-SQL:
Declare @ID as int

Set @ID= (Select Top 1 [ID] From [Queue] Where [Status]='O')
Update  [Queue] Set [Status]='P' Where [ID]=@ID

Select * From Queue Where [ID]=@ID

At first, this approach looks solid. However, we have to remember that this queue table would be accessed by many processes simultaneously, so when subscriber try to read and update the same records at the same time - the SQL DB table immediately introduce a table lock. In the case of Advent Geneva WFM, all activities suddenly become frozen and the only quick fix in this situation is to restart subscription process(restart BizTalk host instances).
From my experience, at the time when I was part of New York Life Investments Geneva development team, our infrastructure team were slated  to restart BizTalk host instance 3-5 times per day. They actually had a scripting approach to do it (can you believe it?).
Finally, at some point, I was sick and tired of hearing about Geneva WFM stall problems, so, after spending some time on research, I found the way or resolving this problem.
The fix is really simple and at the same time very elegant. Please see below:
Here is the same statement, but written differently:

[ID] [int] NOT NULL,
[Status] [nchar](1)

UPDATE TOP (1) [Queue]
SET[Queue].[Status] = 'P'
WHERE [Queue].[Status] = 'O'

SELECT * FROM @Updated

As you see from the script, I took advantage from the SQL Server build-in INSERT, UPDATE triggers. So, instead of two separate actions (select first and then update selected) - the updated stored procedure have only one action : "to update  status". To output the result of a select query - I am using "INSERTED" trigger table.
As soon as we deployed modified script - all table locks disappeared and from that day on Geneva WorkFlow Manager was newer frozen, all activities were processed on time.

Tuesday, October 19, 2010

Add LinkedIn icon link in your Outlook 2007 email signature

If you really want to present yourself professionally, the very first step is to have a nice email signature. And you would expect that folks in Microsoft made your life easier with every new release on the Office products, such as MS Outlook 2007. This is true in most cases, but not in the case when you want to have a clickable image in your email signature.

A few days ego I decided to change the appearance on my email signature and add a link to my professional social network profile - LinkedIn - in a form of clickable image.
I was surprised when I realized that it is not really straightforward as it should be. All what Outlook is offering for signature design is an options to add just image or hyperlink with text. I searched Google and found a few posts with solutions - non of which works in my case for some reason, probably due to the fact that I have 64 bit
laptop with Windows 7 on it .

It was bugging me for a couple of days and, finally, yesterday, I was able to resolve this issue and build my ideal email signature:

Here is a detail instruction how to do it.
  1. Open Outlook and create your signature: Tools-Options-Mail format-Signatures-New

  2. Add all information which you have planned for your signature. Please note – If you want to have a clickable email address, you can do it by using "Insert Hyperlink" icon:

  3. Now your signature looks similar to this one:

  4. Before we go to the final steps, we need to get a LinkedIn icon. To get them you have to login to your LinkedIn account-Profile-Change public profile settings-customized buttons.
    Download any icon you like and save it locally, on your PC.
  5. Click "Picture" icon and navigate to the saved .png file which you just downloaded and click OK
  6. Save your signature and close Outlook. Just remember what name you assigned to it – in my case I used "Test"

  7. What we have right now is not what we want because the image is just an image and does not have hyperlink capability. Let's fix it
  8. We have to locate a source-file which Outlook use for this signature. In my case, all of my signature files located in the next folder:
    "C:\Users\AlexStar\AppData\Roaming\Microsoft\Signatures". If you not sure, just search for "Signatures" folder and select the one created for your User account.
  9. As you can see, Outlook created three files and one folder with the name similar to your signature name:

  10. We just need to modify two files: YourSignatureName.htm and YourSignatureName.rtf First let's change .htm file.

  11. Open YourSignatureName.thm file in the text editor (In my case I use Notepad++) . As you can see, Outlook created a lot of comments which you can easily erase

  12. Locate the line with a link to your image. In my case, it was this one:

    <img border=0 width=80 height=15 src="Test_files/image001.gif" v:shapes="_x0000_i1025">

  13. Change it to the following:
    <a href="your linkedin public profile URL"><img border=0 width=80 height=15 src=" Test_files/image001.gif " v:shapes="_x0000_i1025"></a>
  14. Save .htm file
  15. Go back to the "Signatures" folder and double click on your modified .htm file – it should be opened in the default browser
  16. Make sure that your linkedin image hyperlink works. Now copy all the text right from the browser window
  17. Double click on the .rtf file – you should see your signature information opened in the MS Word
  18. Overwrite all information in the .rtf file with the one you copied from the browser
  19. Save .rtf file
  20. Your custom signature is ready.

Thursday, September 6, 2007

How to step into web service in debug mode from the BizTalk

Recently, I was working with BizTalk solution where send port communicate with web service. So, to successfully complete it, I had to debug web service.Here are two methods how to do it:

Method 1)
My web service project is file system based(not IIS based), so if you start debug session, Visual Studio will engage Cassiny server (ASP.NET development server). However, the deployed web service is hosted in the IIS .
Ones I started the project in the debug mode, I copied the URL from the browser (it was http://localhost:60149/.....). Next step is to change SOAP property of my web port to this URL. Ones orchestration activated, it sends a message to the web port, then to the web service and finally hit the break point. The only disadvantage is that you have to change SOAP property in your port.

Method 2)
Open the web project in Visual Studio.
Attach to the process: w3wp.exe (tip: if you do not see this process listed, you have to lunch the working process by executing the web service in the browser first)
Engage your orchestration
Break point got hit

Saturday, July 14, 2007

My experience with BizTalk 2006 Enterprise Service Bus (ESB) Guidance

Marty Wasznicky and Don Smith have released the CTP2 version of the Enterprise Service Bus (ESB) Guidance. You can get it here: This is out of the box message repair and error handling solution prepared by Microsoft’s Patterns & Practices team.
It is happened that my current client is requesting such as functionality, so I downloaded and installed it on my VPC already with an idea to use it as a good start-point.
The installation of ESB is not easy. I chose to install core system with the source files. It is a solution with 23 projects, including BizTalk, C# and C++ project types, so if you got an error “Unable to load project” when you first time try to open your solution – that means that you are missing some of the Visual Studio 2005 components. In my case, I forgot to install C++, so “ESB.JMS.PipelineComponents” refused to load. I installed C++, but it takes 800Mb of my limited VPC's HD space, so I just removed C++ project from my solution instead (it is for MQSerios adapter anyway and I do not plan to use it in the near future). Talking about prerequisites: please read documentation first and try to follow it – you will save a lot of time later on.
Do not forget to change a target SQL Server name for each BizTalk project.Just goto project's Properties-->Deployment-->Server and replace original server name by your local name, or just type“.” Also, do not worry about missing strong key – they are presented and each project has inline notation with relative pass to the .snk file (you still have to unzip whole solution to the “C:/Projects” directory).
Finally, you opened your solution successfully. If you still fail to build then you probably missing some referenced components, so go to “C:\Projects\Microsoft.Practices.ESB\Source\Core\Install\Scripts” directory and prepare “PreProcessingCORE.vbs” for the run. I would recommend to check all paths and replaced “%programfiles%/BizTalk……” with the correct one, becouse if VBS script failes, it does it silently without creating important objects, like web-site or user. Also, I would recommend to enhanced it with comments, like this: Msgbox “User created” … - it was really helpful for me.
Next script to run is CORE_CreateBizTalkApplication.cmd . It failed to deploy solution, but I was able to deploy it manually from the solution level with no problem at all. Last step is to import binding file. Hint: do not forget to change some send ports and receive locations FILE adapter URI path to the correct one, because most of the ports are pointed to the “E” directory and my VPC for example has only one “C” drive. Now you are ready to go, just do not forget to restart a host instance.
Finally, the most interesting part - working scenario test.
My first application to run was “Repair and Resubmit Custom Exception Handler Sample”. The prerequisites does not look to complicated, so after running setup script I was ready to go and test how it works. However, when I tried to submit InfoPath form after repair, I got HTTP error 405 “Method Not allowed”:

That is because your virtual directory does not have execute permissions (by default):

After changing it to “Script and executables” I submitted my InfoPath form again hoping that all my problems are far behind. Not yet J . I got new HTTP error 404 “Not Found”:

Checking permissions of the “HwsMessages” virtual directory did not show any problems. Path was correct and pointed to the right DLL.
I spent some time before I realized what is missing. BizTalk HTTP Adapter is implemented as an ISAPI application. Make sure BtsHttpReceive.dll is an allowed Web Services Extensions in IIS.
To enable, launch IIS Manager and click on the "Web Service Extension" folder located below the "Web sites" folder in the navigation tree. If not found, add an entry by right click on the Web Service Extension folder. Select "Add a new Web service extension...”, give it an identifiable name such as "BizTalk HTTP Adapter" and add the path of BtsHttpReceive.dll (usually found on C:\Program Files\Microsoft BizTalk Server 2006\HTTPReceive\BTSHTTPReceive.dll)

Friday, July 13, 2007

BizTalk 2006 installation guide simplified

If you want to install BizTalk Server 2006 and look into the documentation, it is a lot of reading. I would not say that it is useless(which is defenatly, not and I personally founf this white paper pretty impressive and detailed), but sometimes would be nice just have a short overview of the whole process.
Here are my notes about it in short:
  • Make sure you have Windows 2003 Server with all service packs and updates
  • Install IIS(Installation CD is required)
  • If you plan to use SharePoint services - install WSS 2.0 and extend default web-site (.NET Framework 2.0 must be installed prior to install this feature. This prerequisite is not enforced by BizTalk Server 2006 setup program.)
  • Install MMC 3.0 (download from Microsoft site )
  • Install SQL Server 2005 with next futures selected as Yes:
  • Notification services
  • Reporting services
  • And next futures selected as No:
  • Mobile edition
  • MSDE
  • Start SQL Agent on Startup
  • Install Service Pack 1 for SQL Server 2005
  • Install 2005
  • ---Custom install,
  • Uncheck the SQL Server Express component
  • Add the following "groups" from the administrative tools computer management “users and groups” utility...
  • Administrators
  • BAS Enabled Hosts
  • BizTalk Application Users
  • BizTalk BAS Administrators
  • BizTalk BAS Managers
  • BizTalk BAS Users
  • BizTalk BAS Web Services Group
  • BizTalk Isolated Host Users
  • BizTalk Server Administrators
  • BizTalk Server Operators
  • Debugger Users
  • EDI Subsystem Users
  • SSO Administrators
  • SSO Affiliate Administrators
  • Add the current account (current logged in user account) to each of those groups.
  • Note: the “SQLServer2005NotificationServicesUser$[your machine name here]” account was automatically created when we installed SQL Server and checked the notification services box.
  • Install BizTalk 2006
  • Configuration steps: Open BizTalk configuration wizard
  • Select “Custom” installation and enter the “Server name” and domain user account with run as service permissions (you will save some typing time later). Here are my thoughts about user accounts. Microsoft, in his installation guide - listed 14 different service accounts. I think that this is too much and does not necessary. If you planning to have a several security zones where your processing host and DBs would be behind firewall and your isolated host – outside or your internal domain – then you should considering to create a separate users for each of those hosts. Otherwise, one domain user account is good enough to run all services.
  • At the point of configuring SSO, please remember the location and password for the Master Secret backup. It is really important because if for some reason you change service account “user/password” combination, the BizTalk server will be disabled until you restore master secret. It is recommended to keep it in the safe place on the CD separately from the Server.
  • Do not install next BizTalk futures, which are completely useless:
  • HWS runtime
  • HWS web services