Tips and tricks

BizTalk Orchestrations XPath: Survival Guide

by Ali Raza Zaidi on April 20, 2012

Following are good links Xpath in BizTalk , Original Article is here

{ Comments on this entry are closed }

Esb Itinerary beginner Samples

by Ali Raza Zaidi on April 18, 2012

 

Following links are best starting point for ESB Toolkit.

http://abhijitmahato.wordpress.com/2010/09/10/biztalk-esb-toolkit-2-0-samples-content-based-routing/

http://blogs.technet.com/b/meamcs/archive/2011/11/17/biztalk-esb-step-by-step-walkthrough-creating-a-custom-orchestration-service.aspx

 

http://www.codeproject.com/Articles/293385/Dynamic-message-processing-and-routing-in-Itinerar

 

http://www.codeproject.com/Articles/288285/Hello-World-in-BizTalk-ESB-Itinerary-using-a-Purch

 

{ Comments on this entry are closed }

I found this error, when I just complete the installation of ESB toolkit on my machine. I found that I missed the following Filters on “All.Exceptions” send port

ErrorReport.FailureCode – Exists
Microsoft.Practices.ESB.ExceptionHandling.Schemas.Property.FaultCode – Exists

When I set the these filters on send port. All exception port successfully enlisted and start

{ Comments on this entry are closed }

 

While installing ESB portal on 64 bit machine I found following errors

 

File Management_Install.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see “get-help about_signing” for more details. At line:1 char:2

The reason for this error is the security setting on your pc that does not allow you to execute a script.  This is the so-called Execution Policy. By default, the Execution Policy is set to Restricted. This setting means that you may not run any PS1 script at all.

An overview of the policy levels: Set-ExecutionPolicy Unrestricted

But result is same, then its comes in my mind that machine is  64 bit.

I create a new file with cmd as follow and run it with administers.

%SystemRoot%syswow64WindowsPowerShellv1.0powershell.exe Set-ExecutionPolicy Unrestricted

 

For 32 bit machine at cmd write powershell and enter then just unrestricted policy level  

Set-ExecutionPolicy Unrestricted

for 64 bit machine  use following string at cmd open with administrator rights.

 

%SystemRoot%syswow64WindowsPowerShellv1.0powershell.exe Set-ExecutionPolicy Unrestricted

 

This will solve my problem.

{ Comments on this entry are closed }

set-executionpolicy unrestricted access denied

by Ali Raza Zaidi on April 12, 2012

 

open cmd with accessories with run as administer option.

When command prompot open. Write powershell. And press enter.

Powershell is opened. Now write set-executionpolicy unrestricted. It will run successfully.

{ Comments on this entry are closed }

After hundreds of time failure on BizTalk configuration failed at configuring SSOS with error

Failed to connect to the SQL database SSODB on SQL Server

The best solution I found was to re-register the ssosql.dll on the following manner:

1. start the visual studio command prompt
2. go to the ssosql.dll C:Program FilesCommon FilesEnterprise Single Sign-On
3. regasm ssosql.dll

and probably you are finished.

On 64 bit machine somehow or other regasm did not gac the ssosql.dll, when checked I assembly folder it contains old dll, so on 64 machine you have to regac ssosql.dll manually.

{ Comments on this entry are closed }

Insert with WCF-SQL-Adapter BizTalk 2010

by Ali Raza Zaidi on March 25, 2012

 

I decided to write a simple kick start tutorial for WCF-SQL Adapter for beginners.

In this tutorial where I just perform single operation insert. A simple BizTalk solution which read a value from file location and insert this value into table.

First of all I create a very simple category table. Which hold two fields. As

 

USE [Experiments]

GO

 

/****** Object:  Table [dbo].[CategoryWar]    Script Date: 03/25/2012 22:12:13 ******/

SET ANSI_NULLS ON

GO

 

SET QUOTED_IDENTIFIER ON

GO

 

CREATE TABLE [dbo].[CategoryWar](

[ID] [int] IDENTITY(1,1) NOT NULL,

[CategoryName] [nvarchar](255) NOT NULL,

CONSTRAINT [PK_CategoryWar] PRIMARY KEY CLUSTERED

(

[ID] ASC

)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]

) ON [PRIMARY]

 

GO

 

 

Now I create a new solution with Name WCF_SQLAdapter. You can use as you like.

 

On solution explore, I right click  on add and then  select generate items.

 

Then select consumerAdapterServices  as follow.

 

 

 

 

Select SQLBinding from Consume Adapter Services Wizard. Like  as

 

Then click on Configure Button new popup windows  like that

 

 

Inter the Sql server Name. And Database Name in Initial Catalog. And press save button. Now URI look like as

 

Click on test button to verify the connection established. If connection is successful. Then Category section will below the connected button will populate as select from table all possible option appears at right side as follow.

 

 

Some Schemas and bind files generated as follow. Open schema name with

TableOperation.dbo.CategoryWar.xsd

 

 

Now we create one more schema, which will used as input to BizTalk solution. Like as

 

 

Now I create a map for send value from input schema to Request input message.

 

I used source input schema. And output schema I used to  insert schema from TableOperation.dbo.CategoryWar.xsd. Map will be like

 

After that I create new Orchestration with name InputProcessOrchestation.odx.

I create three message with One for input message, and two with Insert Request Method and one for Insert response.  Orchestation will be look like as

 

 

 

It is very simple orchestration, which reading input from file location transform it into request message. And request response call to WCF-SQL adapter and received message drop in other location.

For wcf-sql call I created send request port with specify later option. Remember the name of operation will be the same which will describe in binding. You can later change it. When I deploy the solution I found three ports on BizTalk console. I created two file ports one for receiving input and second for droping output. I import the binding which is created at the time of consuming the SQL Adpater. It will as


Generate instance form input schema and modify it and drop. This solution is works fine for me.  You can download solution from here.

 

 

 

 

 

{ Comments on this entry are closed }

describe table tsql

by Ali Raza Zaidi on March 13, 2012

Currently I was searching describe  like function, which used in Oracle PLSQL to get the detail of table.  I found equvilent function in TSQL “sp_help”.

you can used it as

sp_help <table_name>

 

i.e

sp_help studentdet

{ Comments on this entry are closed }

The command I forget, so i log it here

 

Using the command line

  1. Open Command Prompt.
  2. Type:

    mstsc /console.

  3. Remote Desktop Connection will start. Type the computer name or IP address of the computer you want to connect to in the Computer box.
  4. Configure any other desired options, and then click Connect.

{ Comments on this entry are closed }

For update part of ETL Process I have to write another Common table expression to get  all records where are changed at source to run update query on destination table

 

My update part of basic ETL using TSQL as

 

with ChangedRows as

(

 

SELECT     sourceEmp.empid, sourceEmp.lastname, sourceEmp.firstname, sourceEmp.title, sourceEmp.titleofcourtesy, sourceEmp.birthdate, sourceEmp.hiredate, sourceEmp.address, sourceEmp.city, sourceEmp.region, sourceEmp.postalcode, sourceEmp.country, sourceEmp.phone, sourceEmp.mgrid,DestEmployee.SourceEmpId

FROM         TSQLFundamentals2008.HR.Employees sourceEmp inner join

TSQLFundamentals2008DW.HR.DimEmployees DestEmployee

on

sourceEmp.empid = DestEmployee.SourceEmpId

where

 

sourceEmp.lastname <> DestEmployee.lastname

or sourceEmp.firstname <> DestEmployee.firstname

or sourceEmp.title <> DestEmployee.title

or sourceEmp.titleofcourtesy <>DestEmployee.titleofcourtesy

or sourceEmp.birthdate<>DestEmployee.birthdate

or sourceEmp.hiredate <> DestEmployee.hiredate

or sourceEmp.address <> DestEmployee.address

or sourceEmp.city <> DestEmployee.city

or sourceEmp.region <> DestEmployee.region

or sourceEmp.postalcode<>DestEmployee.postalcode

or sourceEmp.country <>DestEmployee.country

or sourceEmp.phone<>DestEmployee.phone

or sourceEmp.mgrid <> DestEmployee.mgrid

 

)

update  TSQLFundamentals2008DW.HR.DimEmployees

set    lastname = ChangedRows.lastname

,  firstname = ChangedRows.firstname

,  title = ChangedRows.title

,  titleofcourtesy =ChangedRows.titleofcourtesy

,  birthdate=ChangedRows.birthdate

,  hiredate = ChangedRows.hiredate

,  address = ChangedRows.address

,  city = ChangedRows.city

,  region = ChangedRows.region

,  postalcode=ChangedRows.postalcode

,  country =ChangedRows.country

,  phone=ChangedRows.phone

,  mgrid = ChangedRows.mgrid

from ChangedRows

where TSQLFundamentals2008DW.HR.DimEmployees.SourceEmpId=ChangedRows.empid

{ Comments on this entry are closed }