Sunday, April 29, 2007

Repair.aspx can't get to the message

In the current project I am working on, there is a need to move some InfoPath forms from one Sharepoint library to another while preserving the information contained in them. The one caveat to this, is that one of the requirement is that we need to modify a couple of fields inside the infopath forms.

In summary these are the tasks that I need to accomplish:
  • Modify the PI (Processing Instructions) for each form in Sharepoint so that they point to the correct template library.
  • Modify some of the data inside of the Infopath forms (since the data is contained inside the Infopath). This includes updating and adding a couple of nodes.
These fields are then used by Biztalk when routing the document to another Sharepoint library. I have tried several approaches.

A. Repair.aspx. This form is found inside the FORMS folder on your Sharepoint library. It does fix the hardcoding href command found on the PI (Processing Instruction) for the InfoPath forms. It will accomplish one of my goals, however the user interface is not the most friendly. For instance, one of the source library location, have over 1500 forms. If you decide to use the Repair.aspx, that's a lot of clicking you got to do..!!

B. Microsoft repair download tool for infopath 2007. This tool can be download here. This is pretty much the EXE version of the repair.aspx. It is called: IPWssUpg.exe. It goes s and change the hard coded values of the InfoPath forms to the current location. This is mainly used when you are moving to a new server, or copying forms to a new library, etc. This tool can accomplish Task 1, but it wont be able to modify the actual content which is what I am after in Task2.

C. Write a .NET component to parse the Sharepoint lists and then load the whole Infopath as an XML file and apply regular expressions to accomplish Task 1 and 2. Lazy.

D. Use Biztalk to do it. Since we already have Biztalk 2006 deployed on the environment, it can be put to good use. ;)

E. Powershell?. maybe, but I don't have the time to learn it right now.

Enter Biztalk 2006. In just 7 lines of code I can accomplish both Task 1 and Task 2. By using the Windows Sharepoint Service Adapter (WSS).

First, setup a basic orchestration:

then on the Message Constructor, add the following lines:

Add Updated PI

1 //Messages are immutable.

2 outMsg = inMsg;


4 //populate the new infopath PI

5 sInfopathPI = @"< ?mso-infoPathSolution PIVersion='' href='some_XSN_Path'? > ....";


7 //issue the command

8 outMsg(XMLNORM.ProcessingInstructionOption) = 1;

9 outMsg(XMLNORM.ProcessingInstruction) = sInfopathPI;

WSS Instructions

1 //set the filename for target location

2 outMsg(WSS.Filename) = strFilename + ".xml";

BTS Instructions

1 //if a form document is found on the library, overwrite it.

2 outMsg(WSS.ConfigOverwrite) = "yes";

3 outMsg(WSS.ConfigOfficeIntegration) = "no";

Make sure that both the receiving and sending logical ports are setup to Specify Bindings Later.
Then using the Biztalk Administrator console, configure a Receive Location and a Send Port to use the WSS adapter, put the values for the Sharepoint Library (both source and target locations)

Bind the physical ports to the logical ports, and the ODX will pick the forms from the source library and move them to the target location.

7 lines of code!!! Can't get any lazier than that.. ;)

Friday, April 27, 2007

Biztalk Services

Internet Service Bus? yikes, I am still waiting at the bus stop for the ESB one so that I can do a transfer. :(

Brian wrote a very informative post on the internet service bus concept. Check it out here.

The demo they have at the biztalk labs is ok. I was able to create a personal identity card in less than 5 minutes. Useless, but fun. Then I try to use the Relay Service, and it tells me that I need a Managed Card. WTF? Once again, I think the technology is in its infancy right now, so I am not risking anything by waiting for a few more months for it to mature.

Also the recommended OS to do any development with it is windows 2003. Oh com'on, I am in cloud nine running Vista 64bits, I am not going back...;)

I guess that there are always those VPC's to take you back to nostalgia lane.

Friday, April 20, 2007

Changing PI on an Infopath Form using repair.aspx

So there is this utility inside Sharepoint 2003. If you ever copy your forms from one library location to another library location, they will copy, but the PI (Processing Instructions) inside the Infopath forms will still be pointing to the original location where the template.xsn was located.

So all of your newly copy Infopath forms when opened they will go to the original location for the template. For instance if your original location is:

and you copy this to a new location, say:

the Infopath forms in the 2006 library will contain the PI
   15 <?mso-infoPathSolution  PIVersion='' href='http://yourSTS_site/Books_2005/Forms/template.xsn'?>
   16 <?mso-application  progid='InfoPath.Document'?>
   17 <?mso-infoPath-file-attachment-present?>

and what you really want is the PI to say something like this:

   15 <?mso-infoPathSolution  PIVersion='' href='http://yourSTS_site/Books_2006/Forms/template.xsn'?>
   16 <?mso-application  progid='InfoPath.Document'?>
   17 <?mso-infoPath-file-attachment-present?>

Enter the repair.aspx utility.! If you type the following:

then you will get a page that will display all of your forms that have the wrong PI embedded into them and then you can select which ones to update.

Click on the Relink Forms command and they will be automatically updated to use the current form library template.


Wednesday, April 18, 2007

Biztalk Web Service Publishing Wizard not found...!

I have run into this situation a couple of times. It is one of those RTFM, I am blogging it here so that it gets indexed and someone will find it useful.

On a windows server 2003 with multiple server installation. There are times that the Web Service Publishing Wizard option is not available on the Biztalk group.

This is because somewhere along the installation instructions, someone skip the step that instruct you to install Visual Studio 2005. Perhaps this is a mis-conception, that you dont need Visual Studio if you are setting up a QA environment, or even a production environment. This might be true, but if you need to use the Web Service Publishing Wizard, you will need to install the Visual Studio runtime and the SDK for .NET 2.0

Run the Visual Studio Setup. Select custom, then select C# and select the SDK option.

After this is installed you will need to re-run the installation setup for Biztalk. Select Modify and then select the Developers Tools and SDK checkbox. Click OK to continue.

now if you pay attention to the status screen, you will see this message being display

after the installation is done, open the program selection and you will see that now we have the Biztalk Web Services Publishing Wizard available to choose.

Monday, April 16, 2007

Biztalk Only eMagazine

Cool initiative. Todd VanNurden and Sal Cincotta are getting back to the basics and created a magazine dedicated to Biztalk. From his initial email:

"...The goal of BizTalk Hotrod is to provide information beyond what you'd normally find on Microsoft sites and its written by people with the real experience..."

This is going to be awesome!. Go and download the first copy at

Wednesday, April 11, 2007

Microsoft free developer e-training

Found this link to Dave Bost blog. He has instructions and the voucher number to use in order to access the free e-Learning courses from Microsoft Training. The courses available seems to cover a wide range: Data and XML, Web, .NET 2.0, Windows, ASP.NET, etc.

Check it out here.

Friday, April 06, 2007

Biztalk 2006 Installation on Multiple Servers

So this is the 3rd time I have encountered this error, so I am blogging about it... Hoping, that by blogging it, it will re-inforce this in my brain and next time I encounter this error, it wont take me that long to figure it out.

Installing Biztalk 2006 on an environment that was previously setup by an IT department with a zealous security guy making the decisions on naming conventions and user accounts is a NIGHTMARE. You can have firewall, ports, security policies, insufficient rights to SQL Server, application pools not setup correctly, etc...

This one environment I have had to work with was just like my IM name ;). Anyways, after about an hour or so trying to find out why the configuration of Biztalk 2006 will just suddenly die after creating 3 databases. I keep getting this one error:

BizTalk Server cannot access SQL server. This could be due to one of the following reasons:

  1. Access permissions have been denied to the current user. Either log on as a user that has been granted permissions to SQL and try again, or grant the current user permission to access SQL Server.
  2. The SQL Server does not exist or an invalid database name has been specified. Check the name entered for the SQL Server and database to make sure they are correct as provided during SQL Server installation.
  3. The SQL Server exists, but is not currently running. Use the Windows Service Control Manager or SQL Enterprise Manager to start SQL Server, and try again.
  4. A SQL database file with the same name as the specified database already exists in the Microsoft SQL Server data folder.

Internal error from OLEDB provider: "Cannot open database "BizTalkRuleEngineDb" requested by the login. The login failed."

And btw, I only had access to 2 domain accounts, instead of the 10+ accounts recommended to run Biztalk with. So finally my friend Monish mentioned about installing the SQL client connectivity tools on the Application server where Biztalk was being installed. duh. Just another case of RTFM. Here is the Biztalk Installation Guide. Cleaned up the old DB's and re-started the configuration, and this time it created all databases.

Makes me wonder, why is the configuration tool of Biztalk running and creating half way installation scripts, but yet it can't finish creating the rest of the databases. I guess I need to dig more information into this.

Thursday, April 05, 2007

Search Macros vs Swickis

There is are so many customized search engines out there. We had the original Swickis, and now the Window Live team has come out with the Search Macros.

My only gripe about these macros is that it is very hard to discover what other search macros are available.

I have found this one that was created by the SQL Server 2005 BOL (Books Online Library) team.

One click and you get access to the latest version of the books online. Versus:
  1. downloading a 130+ MB msi file
  2. installing it
  3. opening CHM file to get to search prompt
If you are at a client site and need to research some sql info on the fly. I believe the Search Macros would be the winner.

Tuesday, April 03, 2007

Biztalk Server 2006 R2 - Beta2 available

Biztalk 2006 R2 was supposed to be out yesterday. However, the official site

did not have a link to it. I have found the R2 at this other url:,

you will find the url for the R2 on the right hand side. Click on it and that will take you to the connect home page. You will need to log in with your Microsoft Passport to be able to see your connections.

If you have not applied for the R2 program, scroll to the bottom and apply. After you apply you will be able to see the download screen (see below).

Will post more after I *play* with it… ;)

Monday, April 02, 2007

Welcome, Frazzled Dad...!

Yeah, it is official. Jim Holmes will be joining Quick Solutions.!!! It is exciting to be able to say that we work with 2 of the most influential people in the .NET community in Ohio.

Brian and Jim will take the Solutions Team to a level never before seen...!!!

Welcome to the team, Jim.