Create SQL Receive Locations Programmatically.

Posted at: 5/25/2007 at 7:52 PM by saravana
One of our recent projects involved creating an orchestration, which was bound to a physical one way receive port polling data from SQL server.  There will be multiple SQL receive locations for the same receive port. The receive locations will have different polling conditions based on the customer. Our requirement was to create one receive location per customer. So, we'll be adding more SQL receive locations as the customer base increases.  For that reason I created this function (part of a bigger client application) which create SQL receive location programmatically, which uses BizTalk Catalogue explorer object (no WMI). Hope this will be helpful to some one, because there is minor things to take care of.
You can download the .CS file from here.
The below figure shows a SQL receive location created with help of the above function.

How To Execute it:

Here is the sample code, which is used to run the function.

string server "SK_WORKSTATION";
string 
database "ORDER_POLLING";
string 
address "SQL://" + server + "/" + database + "/" + Guid.NewGuid().ToString();

CreateAndConfigureSQLReceiveLocation(
  
"Receive.SQL.Autogenerated.SK1"
"Receive.Sch.Orders.Internal.SQL.1Way.AllPollingService.ActivationMessages"
, address
"False"
"Minutes"
"10"
"DocumentRootElement"
"http://www.digitaldeposit.net/samples/SQL/schema"
"exec [GetSQLActivationMessage] @AccountNumber='007'"
"Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;User ID=sa;Initial Catalog=ORDER_POLLING;Data Source=SK_WORKSTATION"
"Data Source=(local);Initial Catalog=BiztalkMgmtDb;Integrated Security=true;Trusted_Connection=True"
);

NOTE: The function assumes you already got a "Receive Port" (which you pass as second argument to the function), but its not hard to create it inside the function.

Nandri!
Saravana

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags: | |  Categories: BizTalk General
Actions: Email this article Email | Kick it! | DZone it! | Save to del.icio.us | Technorati Links
Post Information: Permanent LinkPermalink | CommentsComments(1) | Comments RSS

Comments

Thursday, July 26, 2007 1:21 PM
Incredulus
Hi Saravana kumar,

So for one messaging receive port ( in the biztalk explorer) , can we have multiple locations, as far as I know we can configure the messaging port for one particular database->Table.

As you have said for customer 1 you will have one messaging receive port and a location for that, for customer 2 another messaging receive port and a location for that, and so on an so forth..

or One messaging port and many locations?? Can you please help me to know more..

I have another question, like , If I am receiving different types of incoming messages (*.txt,flat file,EDI,EDIFACT) in a single receive folder,

Do I need to create a schema for each message ,

and how to dynamically segregate the messages and associate it with the schemas for furthur processing.

can it be done in this way , like I inform my trading partner to send a EDI file with the name as EDI.PO.1001, EDIFACT.PO.001 and then in the custom pipeline we can strip off the file name (EDI or EDIFACT) create a folder programmatiacally and place the file in the folder configured .

I hope this makes sense, but it still needs different file folders and ports.

your response will be of very help to me.

Thanks
Dheeraj

Add comment


(Will show your Gravatar icon)  

  Country flag

biuquote
  • Comment
  • Preview
Loading