About Me

My photo
Northglenn, Colorado, United States
I'm primarily a BI Developer on the Microsoft stack. I do sometimes touch upon other Microsoft stacks ( web development, application development, and sql server development).

Monday, November 27, 2006

A useful BizTalk Sql Query

Found this sql statement on another blog that shows you what ports are still referencing a mapping. This is useful if you need to undeploy the maps and you are having trouble finding what port might be still referencing.

select
'RcvPort' PortType,
r.nvcName Port,
item.name MapName,
assem.nvcName Assembly,
nSequence, indoc_docspec_name, outdoc_docspec_name
from bts_receiveport_transform rt
inner join bts_receiveport r
on rt.nReceivePortID = r.nID
inner join bt_mapspec ms
on ms.id = rt.uidTransformGUID
inner join bts_assembly assem
on ms.assemblyid = assem.nID
inner join bts_item item
on ms.itemid = item.id
--order by Port, nSequence

union

select
'SendPort' PortType,
r.nvcName Port,
item.name MapName,
assem.nvcName Assembly,
nSequence, indoc_docspec_name, outdoc_docspec_name
from bts_sendport_transform rt
inner join bts_sendport r
on rt.nSendPortID = r.nID
inner join bt_mapspec ms
on ms.id = rt.uidTransformGUID
inner join bts_assembly assem
on ms.assemblyid = assem.nID
inner join bts_item item
on ms.itemid = item.id

order by PortType, Port, nSequence

Saturday, November 18, 2006

SQL Server Adapters for BizTalk

Ok, so in my recent project I have multiple calls to make to a sql server's database. I ran into a problem calling the same database, but to get around that you simply add a unique ID to the end of the URI. It then would look something like: SQL://localhost/database_name/uniqueID

I got that information from the MSDN website.

Some FYI and Tips:

1) Have SQL Server do most of the work, with stored procedures when it comes to a large amount of updating.
2) Use some kind of status update when grabing data from a table to prevent multiple pickups with BizTalk. Use something like a date field or some type of varchar naming.
3) Use "select top 1" to make the document only have one root element.
4) SQL Adapters are limited to 60 messages a minute, unless you poll while data is found.
5) Try to keep the message size to under 1MB.
6) Save Tran and Rollback Tran will cause an error in the SQL Adapter
7) The generated root element is made in the adapter, not the store procedure.

Some tips on BizTalk 2004 to remember.

So here is a list of things that solved some of my errors that I have been having in developing a
BizTalk 2004 application.

1) I was having some trouble in developing maps for 2 of them. I then decided to use an external XSLT instead. I started getting un inforormative errors like unexpected ":" and missing ";" in the btm mapping on line 8 and 9. These errors of course made no sense, since there were no line 8 or 9. I knew the problem had to be in the XSLT. The probelm ended up being that I had to get rid of the Version = 1.0 attribute and a var declaration that I had in the xml:stylesheet declaration. This is what the line should of been:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:userCSharp="urn:userCSharp"
exclude-result-prefixes="msxsl userCSharp">

<xsl:output method="xml"
omit-xml-declaration="yes" /> <xsl:template match="/">


2) When writing scripts that use that same functions over and over again, then make a external assemblies. I also made the assembly version hard coded, so that when I change the scripts I don't have to worry about resetting the maps.

Saturday, October 28, 2006

Past week...

So, I've been busy on two seperate projects, one with asp.net concurrency and bug fixing; the other with mapping schemas in BizTalk 2004.

The concurrency problem had an interesting solution. We used the timestamp in the database to check for a change before conmitting the updates. My other bugs where as always easy and stupd mistakes.

The biztalk conversion wizard for converting BTS2002 to BTS2004 didn't want to work for me, but it did give me the information that I needed. So I have the old maps and schemas, of course they are not sane mappings. The schemas use lots of attributes and multiple nodes in the destination schemas, which made me convert alot of visual basic into C# inline code, and use xslt in complex mappings.

Thursday, October 05, 2006

BTS 2002 to BTS 2004 Migration: Error about a user('null')

I was having trouble using VS 2003 Migration wizard to authenicate to a remote server. Of course I had to VPN into the domain. The problem I was getting after entering the server and database name, was an error stating that I could not connect because the username was null. The VS was suppose to use my credential for the connection. Solving the problem was done by going to the Control Panel > Stored User Names and Passwords. Add a connection with my username@domain and password. This got me in.

Tuesday, October 03, 2006

Java Question:

Well, I was just browsing the Code Project's website and found this interesting. Given the following Java code:

Posted by: Dominik Reichl

Integer i = 1;
Integer j = 1;
Integer n = 1000;
Integer m = 1000;

boolean b1 = (i == j);
boolean b2 = (n == m);


Now, what are b1 and b2?

Surprisingly b1 is true, b2 is false.

Why?
















Posted by: Dominik Reichl

Ok, so here's the solution why it works this way
First of all, we are using Integer wrapper classes instead of the primitive int type. When compiling, the integral values 1 and 1000 are implicitely converted to Integer objects (called auto-boxing, from int to Integer).

So, we got 4 different Integer instances, right? No!

The Java VM automatically packs "small" primitive values into identical objects (1 is small, 1000 isn't small). You can easily verify this by pasting the code above into a small testing project and fire up the debugger: i and j reference the same object, while n and m reference different objects. The == operator is comparing references, therefore b1 is true (same references) and b2 is false (different references).

Currently "small" means any integer between -128 and 127. But according to Sun this can change to [-32768, +32767] in the future. This packing trick has been introduced to solve performance problems when doing arithmetic with wrapper classes.

Wednesday, September 27, 2006

BizTalk Questions: Migrating BTS 2002 to BTS 2004

Well, I'm starting to read a article on migrating BT2002 to BT2004 and seen these questions and answers.

What is a promoted property?


Property promotion enables you to flag schema nodes at design time for promotion to the MessageBox at run time. In addition to any custom metadata you explicitly define by promoting properties, BizTalk Server 2004 has several pre-existing properties that it tracks by default. These pre-existing properties are not defined by instance schemas.


What is a binding file?


Binding files are shortcuts so that you can bind once using the BizTalk Explorer, export that binding, and then import it when you need to assign the binding subsequent times. For example, if you install and deploy your development environment and save a binding file, when it is time to go into production, you can script the Deployment Wizard and specify the binding file to use to create the bindings for the ports. For messaging migration, the Migration Wizard only generates one binding file for the send or receive locations in a solution.


Can I have multiple schemas with the same root node?


No. The messaging engine relies on the root node to resolve an XML instance to a schema at run time. (This is possible in BizTalk Server 2002.)


Can I add an orchestration within my migration project?


Yes, it is possible, but not recommended because you have to manually create a send/receive port to/from an orchestration, thereby complicating the migration of your messaging solution.


Is it possible to create an orchestration that receives a non-XML message (a binary large object (BLOB) for instance) through a pipeline with a custom disassembler and promote properties in the blob?


You can pass type-less [aka: un-type] messages through orchestrations by declaring them as an XmlDocument. If you want to retrieve their data, you need to pass them to a .NET object as XLANGPart/XLANGMessage and call part.RetrieveAs(typeof(Stream) ); by using part.LoadFrom( myStream ), you can also construct non-XML messages in an orchestration.


How do I create a dynamic send port?


You can create a dynamic send port either using BizTalk Explorer or within an orchestration:

BizTalk Explorer – Create the port using BizTalk Explorer, and then assign values to the transport properties in BizTalk Editor using the global property schema. You can then select the appropriate schema from references. By default, BizTalk Server 2004 references Microsoft.BizTalk GlobalPropertySchema. Values to the transport properties come from your document. You need to promote elements from your schema using the global property schema.

Orchestration – You can create dynamic ports in an orchestration, and, after you deploy it, the port is accessible from BizTalk Explorer. In the orchestration, you need to assign the address (transport) using an Expression shape.


Will the Migration Wizard migrate custom script functoids?


No. Any maps that are migrated that contain custom script functoids need to be opened and functoids re-coded.


Will the Migration Wizard migrate my queue receive functions?


Yes. BizTalk Server supports all types of receive functions including BizTalk message queuing (MSMQ) file receive. BizTalk Server supports the conventional HTTP receive function, but not the HTTP file receive function because it has no meaningful use in the product.


Will the Migration Wizard migrate my pre-processor?


No. You must update your project by manually migrating any components such as pre-processors not migrated by the Migration Wizard.


Will the Migration Wizard migrate my channel routing and filter configurations?


No, with one exception. BizTalk Server 2004 automatically migrates routing and filtering configurations for channels that use dynamic routing or filtering. Custom routing done in a channel requires that you promote the properties and create the filters.


Will the Migration Wizard migrate orchestrations?

No. The Migration Wizard only migrates the following items.
  • BTS 2002 document definitions to BTS 2004 schemas

  • BTS 2002 maps to BTS 2004 maps

  • BTS 2002 receive functions to BTS 2004 receive locations

  • BTS 2002 ports and channels to BTS 2004 ports and pipelines

  • BTS 2002 port groups (distribution lists) to BTS 2004 send port groups


The content in this section is provided by Ben Goeltz, Brandon Gross, and Stephen Roger of Equarius, Inc. For more information about Equarius, Inc., see http://go.microsoft.com/fwlink/?LinkId=26941, published in September 2004.

Monday, September 25, 2006

MS ASP.Net Assessment Question: Comparing DataSet Tables

You are using the DataSet designer to create a DataSet. The DataSet contains two related tables. You create a table named Products. Products contains a VendorID column that is not unique. You also create a table named Vendors. Vendors contains a VendorID column that is the primary key.

You need to create a relationship between the two tables. Every value in the Product table's VendorID column must have a corresponding value in the Vendor table's VendorID column.

What should you do?

A)Drag a Relation object onto the designer. Set the parent table to Products. Set the child table to Vendors. Select VendorID as the column for both tables. Click Both Relation and Foreign Key Constraint.

B)Right-click the VendorID column on the Vendors table. Click Set Primary Key.

C)Drag a Relation object onto the designer. Set the parent table to Vendors. Set the child table to Products. Select VendorID as the column for both tables. Click Foreign Key Constraint Only.

D)Drag a Relation object onto the designer. Set the parent table to Products. Set the child table to Vendors. Select VendorID as the column for both tables. Click Foreign Key Constraint Only.

E)Drag a Relation object onto the designer. Set the parent table to Vendors. Set the child table to Products. Select VendorID as the column for both tables. Click Relation Only.

A) Product shouldn't be the parent table.
B) Won't solve the relationship problem.
C) Best answer, by setting the restraints, this could be used to enforced the relationship rules, so that it enforces rules about how updates and deletes to related tables are propagated.
D) Products shouldn't be the parent table.
E) There is no relation only contraint.

MS ASP.Net Assessment Question: Validate Email Address

You create a Web Form that enables users to confirm their e-mail addresses.

You need to validate that users type e-mail addresses on the Web Form and that the e-mail addresses exist in a database.

What should you do?

A) Configure a RequiredFieldValidator control, a RegularExpressionValidator control, and a CustomValidator control.
B) Configure a RegularExpressionValidator control.
C) Configure a CompareValidator control.
D) Configure a RequiredFieldValidator control and a RegularExpressionValidator control.

A)Best Answer, by having the controls use for checking for populating textboxes and valid email address, then you will have to use the custom validator to check if both textboxes are also similar.
B)Wrong, since the regular expression validator doesn't check unless data has been entered into the textbox.
C)Wrong, only compares two textboxes, won't check if they are correct.
D) Wrong, would check for populate field and correct format for email, but not if two textboxes are similar.

MS ASP.Net Assessment Question: Web and Mobile pages.

You create a Web application. The Web application has 10 pages that only mobile devices access. It also has 25 pages that only standard Web browsers access.

You need to implement the Web application by using the minimum amount of custom code.

What should you do?

A) Create all Web pages from the System.Web.UI.Page base class. Create custom device adapters for ASP.NET server controls.
B) Create all Web pages from the System.Web.UI.MobileControls.MobilePage base class. Add controls from the Mobile namespace.
C) Create all Web pages from the System.Web.UI.Page base class and use a master page.
D) Create a set of pages from the System.Web.UI.Page class. Then create a set of pages from the System.Web.UI.MobileControls.MobilePage base class.

A) To much work, and don't know if it would work.
B) Easiest, would generate HTML if web pages and WML/HTML for mobile devices.
C) Wrong, most mobile devices can not display HTML, only WML.
D) Would work, but it might be take to much work compared to B.