Thursday, March 19, 2009

What is the difference between BizTalk Oracle Adapters?

I know even you must have wondered for couple of years by now... what's the heck with these Oracle Adapters and what's the difference between them. Do they need ODP.NET or just plain .NET... What... what.. what....?
so here is the table I found on this site, pretty comprehensive... very useful

BizTalk: Feature comparison of BizTalk Oracle Adapters

Feature

Microsoft BizTalk Oracle Adapter

Microsoft BizTalk WCF Adapter

TopXml Adapter for Databases

BizTalk Server support version

BizTalk Server 2006

BizTalk Server 2006 R2

BizTalk Server 2004/2006

Access

ODBC driver to connect to DB

Oracle Adapter for .NET (ODP.NET)

Oracle Adapter for .NET (ODP.NET)

Processing

Supports “PollingQuery” and “TableChangedEvent”

Single Polling mechanism that provides the following features:

·        Generate strongly typed schema based on a SELECT statement

·        Specify Post-Poll statements to be executed after a polling event

·        Poll and Post-Poll statements executed in a Transaction context

·        Specify Transaction Isolation level

·        Poll, Post-Poll and transaction levels can be specified with binding properties

·       Generation of BizTalk schemas based on SQL statements, Stored Procedures (in, out, return parameters), multiple tables

·        Periodic polling of data source

·        Oracle alerts (send and receive) can send asynchronous notifications based on some events. Uses DBMS_ALERTS oracle package.

·        Oracle Receiver can be configured to receive alerts and Oracle Sender can send alerts to data source.

·        Oracle Pipes allow inter-process communications with Oracle sessions

 

IDE Integration

Standard integration

Enhanced integration at design time between BizTalk and Visual Studio that provide the following features:

·        Standardized GUI for browsing, searching and retrieving LOB artificats

·        Design-time enhancements for browsing stored procedures, functions and packages (categorized and hierarchical manner)

 

·        Redesigned and developed in C#.NET that provides tight integration with BizTalk Adapter framework

·        Generate schemas based on stored procedures and also Select, Insert, Update, Delete and InsertUpdate statements on tables and views

Programming Interface

·        Standard XML schema messages

·        Metadata is retrieved as XML messages

·        Exposes WCF Programming interfaces that provide WCF channel, WCF service model and web service model

·        Exposes programming interfaces for retrieving metadata including search and browse capabilities

 

·        Schema generation capabilities that allow importing database schema from the underlying data provides into the orchestrations.

·        Uses Enterprise Instrumentation framework for tracing and logging

·        Send Adapters are equipped with Exception handlers that allows you to specify Send Adapter behavior when a particular exception is raised

Transactions

·        Not Supported

·        Supports WCF mode Transactions for Outbound and Inbound

·        Supports Transactions and Transaction Isolation levels

Additional Features

·        Not Supported

·        Supports IN, OUT, INOUT REFCURSORS with strongly typed and weakly typed variants

·        Supports BLOB, CLOB, BFILE types in tables and stored procedures with streaming capabilities

·        Enhancing on top of ODP.NET, the WCF-based Oracle DB adapter supports RECORD type parameters in stored procedures/functions even though these types are not natively supported by ODP.NET (version 10.2.0.20)http://blogs.msdn.com/aggbug.aspx?PostID=5755446

·        Supports various Data sources such as IBM DB2, SyBase, MySQL etc

·        Extendable Data Providers

Support and Licensing

·        Depends on licensing agreement with Microsoft

·        No additional pricing for the adapters

·        Depends on licensing agreement with Microsoft

·        No additional pricing for the adapters

·        Additional pricing and licensing model

·        Online Support


Thursday, March 12, 2009

How to change the installation directory in Biztalk


Problem:- Whenever I install (not deploy) BizTalk application it creates its own directory on the server similar to what I have on my BizTalk computer.

Solutution is simple... :)
Let me help you,
When we install the BizTalk application [when we double click on .msi] that time it asks you the file location where you should install BizTalk Application and even if you specify some other location few files will be created at the location similar to your Application on local Biztalk box.

Avoid this by changing the destination location to %BTAD_InstallDir%\Something.dll

I hope this tip is useful to someone sometime... feel free to leave comment.

Happy BizTalking... ;)

How to write file using file adapter if other process is polling at the location.


Scenario / Problem:- You need to write a file at a location where someone's process [BizTalk or some other process] is waiting for specific file to appear there.

Answer is very simple, [Some non-technical people I know were reluctant to understand this]

So I thought I will post it here and BizTalkers can understand how simple and logical it is to manage it this way.

This is File Adapter's Property.
Goto Advance of the File Adapter 
and Click Use Temporary file while writing. [SomethingPicks.Out.BTS-WIP] and then once BizTalk is done with writing this file, it renames to whatever is the desired extension is... in this case file name will be [SomethingPicks.Out]

This will probably will look like What's so great about this? but trust me... it is very important feature what BizTalk provides.

About Allow Cache on write works great for files upto 1 MB. For bigger files I will suggest to do use-temp file method.

Happy BizTalking.... :)

Wednesday, March 11, 2009

Warning:- The master secret has not been backed up !

The master secret has not been backed up. If you lose the master secret all the information stored in the SSO system will be lost permanently and your systems may fail to work correctly. Please use the SSO admin tools to back up your master secret.

Scary, I'll agree.  Simple fix, however.  This step is part of BizTalk installation on this blog (not published yet; write me for an advance copy), but I've broken it out here:

  • On the Start menu, click Run.
  • In the Run dialog box, type “cmd”, and then click OK.
  • At the command line, go to the Enterprise Single Sign-On installation directory.
  • The default installation directory is :\Program Files\Common Files\Enterprise Single Sign-On.
  • Type “ssoconfig -backupsecret ”, where is the path and name of the file where the master secret will be backed up. For example, “A:\ssobackup.bak” to back up to a floppy disk, or “C:\mastersecret_servername.bak” to be moved to VSS or some other secure repository.
  • Provide a password to protect this file. You will be prompted to confirm the password and to provide a password hint to help you remember this password.
  • Store the backup file in a secure location.

The backup file can be used to restore a Master Secret Server or promote a group member to master secret server, as Follows.

If your MSS should fail, here are the steps to promote a member server to the MSS:

  • Change the master secret server name from the original to the new using ssomanage: “ssomanage -updatedb”.
  • Stop the ENTSSO service on the new master secret server.
  • Start the ENTSSO service on the new master secret server. It will recognize that it is the master secret server and that it has no secrets.
  • On the new master secret server, restore the backed up master secret file using ssoconfig: “ssoconfig -restoresecret BackupFile” 

The new server is now the master of the group. 

Tuesday, March 10, 2009

Biztalk Send Port File Name Macros

Biztalk Send Port File Name Macros

If you ever wanted to know how to use any other file name macros other than %MessageID% here they are:

%datetime%
Coordinated Universal Time (UTC) date time in the format YYYY-MM-DDThhmmss (for example, 1997-07-12T103508).

%datetime_bts2000%
UTC date time in the format YYYYMMDDhhmmsss, where sss means seconds and milliseconds (for example, 199707121035234 means 1997/07/12, 10:35:23 and 400 milliseconds).

%datetime.tz%
Local date time plus time zone from GMT in the format YYYY-MM-DDThhmmssTZD, (for example, 1997-07-12T103508+800).

%DestinationParty%
Name of the destination party. The value comes from message the context property BTS.DestinationParty.

%DestinationPartyID%
Identifier of the destination party (GUID). The value comes from the message context property BTS.DestinationPartyID.

%DestinationPartyQualifier%
Qualifier of the destination party. The value comes from the message context property BTS.DestinationPartyQualifier.

%MessageID%
Globally unique identifier (GUID) of the message in BizTalk Server. The value comes directly from the message context property BTS.MessageID.

%SourceFileName%
Name of the file from where the File adapter read the message. The file name includes extension and excludes the file path, for example, foo.xml. When substituting this property, the File adapter extracts the file name from the absolute file path stored in the FILE.ReceivedFileName context property. If the context property does not have a value, for example, if message was received on an adapter other than File adapter, then the macro will not be substituted and will remain in the file name as is (for example, C:\Drop\%SourceFileName%).

%SourceParty%
Name of the source party from which the File adapter received the message.

%SourcePartyID%
Identifier of the source party (GUID). The value comes from the message context property BTS.SourcePartyID.

%SourcePartyQualifier%
Qualifier of the source party from which the File adapter received the message.

%time%
UTC time in the format hhmmss.

%time.tz%
Local time plus time zone from GMT in the format hhmmssTZD (for example, 124525+530).

Source:
http://www.codeproject.com/useritems/SendHandlerMacro.asp  

Friday, March 6, 2009

Custom Pipeline Component Cann't be added Toolbox

annot add (custom) pipeline component to the toolbox (You have selected an invalid pipeline component assembly. Please check security settings for the assembly if you are loading it from an UNC path)

Thanks to ... Patrick Wellink


If you created a pipeline component with the Pipeline componet wizard it will probably run just fine.

But then comes that moment in time that yoy want to create a new pipeline component that looks just like an already created pipeline, so you decide to copy the code and change some things.
Then you compile the component and you try to add it to the Vizual studio toolbox. And then you get the following message :

You have selected an invalid pipeline component assembly. Please check security settings for the assembly if you are loading it from an UNC path.

Well, you can check whatever you want but it probably won't help.

Possible causes are :

1. Your Pipeline uses some DLL that's not in the GAC or pipeline components folder.

2. There is something wrong with the namespaces..... That's what I am going to cover now.

A pipeline component has the following piece of code...

 private System.Resources.ResourceManager resourceManager = new System.Resources.ResourceManager("BizTalk.BestPractice.PipelineComponents.AuditingComponent"Assembly.GetExecutingAssembly());

For descriptions and stuff, the pipeline uses a resource file. The piece of code above tells the pipeline component where the resource file is located. 
If the namespace and component name are not exactly the same as the namespace and component name mentioned in the piece of code above you will get that message.

I saw several questions about this in google but none had this solution, so I figured this blog entry would maybe come in handy for someone with the same problem.

Thursday, March 5, 2009

Encrypting Connection Strings in Web.config

Encrypting Connection Strings in Web.config

Thanks to Wei-Meng Lee

One of the best practices in ASP.NET is to save your database connection strings in the Web.config file instead of hard-coding it in your code. This allows you to change database servers easily, without needing to modify your code. As an additional protection, it is always better to use integrated Windows security to access your database, rather than using SQL Server authentication, and thus including your SQL server credentials in the connection string. Either way, it's not such a good idea to save your connection strings as plain text in Web.config -- you should ideally encrypt the connection strings so that it leaves no chance for a potential hacker to easily get more information about your database server.

In ASP.NET 2.0, Microsoft has taken this further by allowing you to encrypt the connection strings in Web.config, all without much plumbing on your part.

Using the DataProtectionConfigurationProvider and RSAProtectedConfigurationProvider for Encryption

To see how you can encrypt the connection strings stored in the Web.config file, you will configure a GridView control to bind to an SqlDataSource control. The connection string used by the SqlDataSource control is saved in the Web.config file. You then encrypt the connection strings, using the two Protection Configuration Providers available in .NET 2.0.

1. Launch Visual Studio 2005 and create a new Website project. Name the project as C:\EncryptConfig.

2. Populate the default form with a GridView control and configure it to use an SqlDataSource control. Configure the SqlDataSource control using the Choose Data Source drop-down list in the GridView Tasks menu (see Figure 1) to connect to the Authors table in the pubs database in SQL Server 2000. In particular, ensure that the connection string to the database is stored in Web.config.

Figure 1
Figure 1: Configuring the GridView control.

The Source View of the GridView and SqlDataSource controls look like this:

GridView ID="GridView1" runat="server" DataKeyNames="au_id"      DataSourceID="SqlDataSource1" AutoGenerateColumns="False">                                                                                 GridView>  SqlDataSource ID="SqlDataSource1" runat="server"       SelectCommand="SELECT * FROM [authors]"      ConnectionString=""> SqlDataSource>     

3. The default form should now look very much like Figure 2.

Figure 2
Figure 2: The GridView and SqlDataSource control.

4. The Web.config file will now contain the connection string:

                             ...  

5. Switch to the code-behind of the default form and add in the EncryptConnStr() method. The EncryptConnStr() method first retrieves the Web.config file and then applies encryption to the specified section (, in this case) of the file using the Protection Configuration Provider indicated (passed in via the protectionProvider parameter).

Imports System.Configuration Imports System.Web.Security      Public Sub EncryptConnStr(ByVal protectionProvider As String)         '---open the web.config file         Dim config As Configuration = _            ConfigurationManager.OpenWebConfiguration( _            Request.ApplicationPath)         '---indicate the section to protect         Dim section As ConfigurationSection = _            config.Sections("connectionStrings")         '---specify the protection provider         section.SectionInformation.ProtectSection(protectionProvider)         '---Apple the protection and update         config.Save()     End Sub 

6. Also, add in the DecryptConnStr() method. The DecryptConnStr() method will decrypt the encrypted connection strings in web.config:

    Public Sub DecryptConnStr()         Dim config As Configuration = _            ConfigurationManager.OpenWebConfiguration( _            Request.ApplicationPath)         Dim section As ConfigurationSection = _            config.Sections("connectionStrings")         section.SectionInformation.UnProtectSection()         config.Save()     End Sub 

7. Note that the UnProtectSection() method, unlike ProtectSection(), does not require a provider name. When a section is encrypted, information regarding the provider that performed the encryption is stored in the Web.config file. UnProtectSection will use that information to determine which provider to use to decrypt the data.

8. There are two protection configuration providers available for your use -- DataProtectionConfigurationProvider and RSAProtectedConfigurationProvider. The DataProtectionConfigurationProvider uses the Windows DPAPI to perform encryption. The RSAProtectedConfigurationProvider uses the public-key algorithm available in the .NET Framework's RSACryptoServiceProvider class to perform encryption.

9. To test the EncryptConnStr() method, call it in the Form_Load event (you should only call the Encypt() method once) with the indicated Protection Configuration Provider:

    Protected Sub Page_Load(ByVal sender As Object, _                             ByVal e As System.EventArgs) _                             Handles Me.Load         Encrypt("DataProtectionConfigurationProvider")         '--or--         ' Encrypt("RSAProtectedConfigurationProvider")     End Sub 

10. If you use the DataProtectionConfigurationProvider provider, your connection string will now look like this:

                                                                                  AQAAANCMnd8.............p4nZCszebgXs=                                       ... 

11. If you use the RSAProtectedConfigurationProvider provider, your connection string will now look like this:

                                                                                                                                                           RSA Key                                                            J7HkJ/9i...c2usLA=                                                                             k6w9KUZ...5p2AP5gQ==                                      ... 

12. Notice that the section added to Web.config contains information needed to decrypt the connection strings. More importantly, doesn't contain the decryption key. For example, if you use the Windows DataProtectionConfigurationProvider, the decryption key is auto-generated and saved in the Windows Local Security Authority (LSA).

13. The really cool thing about encrypting the Web.config file is that the process of decrypting the required connection string is totally transparent to the developer. Controls and code that need to access the connection string will automatically know how to encrypt the encrypted information. However, if you want to decrypt the Web.config file so that you can make modifications to it, simply call the DecryptConnStr() method.

You can check if a section is protected by using the IsProtected property, like this:

If Not section.SectionInformation.IsProtected Then    section.SectionInformation.ProtectSection(protectionProvider)    config.Save() End If 

You can encrypt almost all the sections in Web.config, with the exceptions of some sections such as and . This is because these sections are accessed by parts of the unmanaged code in ASP.NET.

Programmatically Add a New Connection String

You can programmatically add a new connection string to the Web.config file, even though it is encrypted. The following AddConnString() method adds a new connection string named NorthWindConnectionString to an encrypted Web.config:

   Public Sub AddConnString()         '---add a connection string to Web.config         Dim config As Configuration = _                ConfigurationManager.OpenWebConfiguration( _                Request.ApplicationPath)         config.ConnectionStrings.ConnectionStrings.Add _            (New ConnectionStringSettings("NorthwindConnectionString", _            "server=localhost;database=northwind;integrated security=true"))         config.Save()     End Sub 

If you were to decrypt the Web.config file, you will find the newly added connection string:

           

Summary

In this article, I have discussed how easy it is to encrypt connection strings in the Web.config file using the two Protection Configuration Providers -- DataProtectionConfigurationProvider and RSAProtectedConfigurationProvider -- for encryption. Since it is now so easy to perform encryption in Web.config, there is really no reason for not doing so. 

FEEDJIT Live Traffic Map