Wednesday, May 14, 2008

Distinguished fields of type xs:dateTime not Working on Orchestrations

Writing a spyke for a simple program, I came out with this odd behavior when I try to compile my BizTalk project.

image

I have created a simple schema, and in one of the fields I have field of type xs:dateTime. Well, when I have tried to use this field on an expression shape, I get this build compiler error:

'System.Xml.XmlDocument' does not contain a definition for 'XXXX'

where XXXX is the field name of the element that I have declared as a xs:dateTime type. I then went and set it up as a distinguished field. Here is a sample generated xml from my test schema:

  1. <ns0:Customer xmlns:ns0="http://DistingProperty.Test.Customer.v1">
    <FName>FName_0</FName>
    <DOB_datetime>1999-05-31T13:20:00.000-05:00</DOB_datetime>
    <DOB_date>1999-05-31</DOB_date>
    </ns0:Customer>

and this is the schema that I have used


image

When I am trying to use the distinguished field inside an expression shape, noticed that I get the Visual Studio IntelliSense:

image

When you try to read this value, it will always complain about the XmlDocument not being able to find the definition for the field that is defined as DateTime.

To get around this, you should use the System.Convert.ToString() instead of the .ToString() function;


1 Trace.WriteLine(" bad:[" + msgIN.DOB_datetime.ToString() + "]");

2 Trace.WriteLine("good:[" + System.Convert.ToString(msgIN.DOB_datetime) + "]");



Another lengthy way to get around this issue is to assign the distinguish field to an xmlNode and then use the xml Namespace Manager to get to the node value instead.

The code on my expression shape looks like this:


1 System.Diagnostics.Trace.WriteLine("bts- In here");

2

3 //assign values to person

4 xDoc = msgIN;

5

6 xmlnsMgr = new System.Xml.XmlNamespaceManager(xDoc.NameTable);

7 xmlnsMgr.AddNamespace("ns0", "http://DistingProperty.Test.Customer.v1");

8

9 xNode = xDoc.SelectSingleNode("/ns0:Customer/DOB_datetime", xmlnsMgr);

10 System.Diagnostics.Trace.WriteLine("bts-[" + xNode.OuterXml + "]");

11

12 xNode = xDoc.SelectSingleNode("/ns0:Customer/DOB_date", xmlnsMgr);

13 System.Diagnostics.Trace.WriteLine("bts-[" + xNode.OuterXml + "]");

14

15 //this works as expected

16 System.Diagnostics.Trace.WriteLine("bts- " + msgIN.FName);

17


Which ever way you choose, this looks like a limitation on the way the XLANG/s in the Expression shape interprets the command code.

Monday, May 12, 2008

How to Setup Windows SharePoint Services 3.0 with BizTalk 2006 R2

Today I have found this error AGAIN.! [old post]

Setup is unable to proceed due to the following error(s):
This product requires ASP.NET v2.0 to be set to 'Allow' in the list of Internet Information Services (IIS) Web Server Extensions. If it is not available in the list, re-install ASP.NET v2.0.
Correct the issue(s) listed above and re-run setup.

This time I am installing WSS 3.0 with SP1 on a Windows 2003 - SP2 machine.  This is a greenfield installation of BizTalk 2006-R2.

Noticed that on my IIS Manager, there is no ASP.NET 2.0 service extensions

image

I ran the standard command that *everyone* should have memorized by now... ;)

c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -iru -enable

Now, when I open my IIS Manager I see the ASP.NET v2 service extension enabled

image

Running the setup.exe for WSS works fine now. 

Hint:  Don't forget to select Advanced settings and then select  the Web Client configuration.  This is a necessary step, if you want to specify the name of the database where the WSS configuration will exist.

Thursday, May 08, 2008

Error trying to re-install SQL Server 2005 on a Failover Cluster environment

I had to un-install the SQL instance that I have on my virtual cluster.  The reason?  I could not get the Service Pack 2 to be recognized by my BizTalk configuration.  Apparently, the SP2 that I had installed was the 9.00.3027.0 and not the 9.00.3042.1  Monish pointed that out that I might have an older version of the Service Pack [he is the only person I know that reads those EULA information...]

 9.0.3027.0  - 12/1/2006 11:17am 9.0.3042.1  - 9/5/2007 12:09am

I am trying to start from scratch the installation of SQL 2005, and when I run the setup I get this message:

image

TITLE: Microsoft SQL Server 2005 Setup
There was an unexpected failure during the setup wizard. You may review the setup logs and/or click the help button for more information.

For help, click: http://go.microsoft.com/fwlink?LinkID=20476&ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.06&EvtSrc=setup.rll&EvtID=50000&EvtType=datastore%5cmachineconfigscopeproperties.cpp%40InvokeSqlSetupDllAction%40SqlInstallConfigScope.InstanceName%400x2

Well, clicking on that link, does not provided any more help. Click on the help and I get this other screen:

image

the last line tells me about the event type that has failed:

datastore\machineconfigscopeproperties.cpp@InvokeSqlSetupDllAction@SqlInstallConfigScope.InstanceName@0x2

Now, I have the code that causes the installation to fail. What's next?  ;)

Then I found this other technical article on the MSDN 925976, this suggested cleaning up the registry. I went and clear all of the registry entries from my SQLNode1 and I still get the same error.  I then follow the same instructions on my SQLNode2.  This still did not allowed me to run the setup.  So I went one step deeper and instead of removing just the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.X\ registry key like they suggested, I removed all hives starting from HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server.

Success..! now I am able to run the setup on my primary node, and I *WILL* install the correct Service Pack this time.. ;)