Geeks With Blogs
Bill Osuch - Random geek notes

(This is a reference for a lunch & learn I'm giving at my company)

This demo will create a BizTalk process that monitors a directory for an XML file, loads it into an orchestration, and drops it into a different directory. There’s no real processing going on (other than moving the file from one location to another), but this will introduce you to Messages, Orchestrations and Ports.

To begin, create a new BizTalk Project names OrchestrationPortDemo:

When the solution has been created, right-click the OrchestrationPortDemo solution name and select Add -> New Item. Add a BizTalk Orchestration named DemoOrchestration:

Click Add and the orchestration will be created and displayed in the BizTalk Orchestration Designer. The designer allows you to visually create your business processes:

Next, you will add a message (the basic unit of communication) to the orchestration. In the Orchestration View, right-click Messages and select New Message. In the message properties window, enter DemoMessage as the Identifier (the name), and select .NET Classes -> System.Xml.XmlDocument for Message Type. This indicates that we’ll be passing a standard Xml document in and out of the orchestration.

Next, you will add Send and Receive shapes to the orchestration. From the toolbox, drag a Receive shape onto the orchestration (where it says “Drop a shape from the toolbox here”). Next, drag a Send shape directly below the Receive shape.

For the properties of both shapes, select DemoMessage for Message – this indicates we’ll be passing around the message we created earlier.

The Operation box will have a red exclamation mark next to it because no port has been specified. We will do this in a minute.

On the Receive shape properties, you must be sure to select True for Activate. This indicates that the orchestration will be started upon receipt of a message, rather than being called by another orchestration. If you leave it set to false, when you try to build the application you’ll receive the error “You must specify at least one already-initialized correlation set for a non-activation receive that is on a non self-correlating port.”

Now you’ll add ports to the orchestration. Ports specify how your orchestration will send and receive messages. Drag a port from the toolbox to the left-hand Port Surface, and the Port Configuration Wizard launches. For the first port (the receive port), enter the following information:

Name: ReceivePort
Select the port type to be used for this port: Create a new Port Type
Port Type Name: ReceivePortType
Port direction of communication: I’ll always be receiving <…>
Port binding: Specify later

By choosing “Specify later” you are choosing to bind the port (choose where and how it will send or receive its messages) at deployment time via the BizTalk Server Administration console. This allows you to change locations later without building and re-deploying the application.

Next, drag a port to the right-hand Port Surface; this will be your send port. Configure it as follows:

Name: SendPort
Select the port type to be used for this port: Create a new Port Type
Port Type Name: SendPortType
Port direction of communication: I’ll always be sending <…>
Port binding: Specify later

Finally, drag the green arrow on the ReceivePort to the Receive_1 shape, and the green arrow on the SendPort to the Send_1 shape. Your orchestration should look like this:

Now you have a couple final steps before building and deploying the application. In the Solution Explorer, right-click on OrchestrationPortDemo and select Properties. On the Signing tab, click “Sign the assembly”, and choose <New…> from the drop-down. Enter DemoKey as the Key file name, and deselect “Protect my key file with a password”. This will create the file DemoKey.snk in your solution.

Signing the assembly gives it a strong name so that it can be deployed into the global assembly cache (GAC).

Next, click the Deployment tab, and enter OrchestrationPortDemo as the Application Name. Save your solution.

Click “Build OrchestrationPortDemo”. Your solution should (hopefully!) build with no errors.

Click “Deploy OrchestrationPortDemo”. (Note – If you’re running Server 2008, Vista or Win7, you may get an error message. If so, close Visual Studio and run it as an administrator)

That’s it! Your application is ready to be configured and fired up in the BizTalk Server Administration console, so stay tuned!

Technorati Tags:

Posted on Friday, March 19, 2010 12:26 PM BizTalk | Back to top


Comments on this post: Simple BizTalk Orchestration & Port Tutorial

# re: Simple BizTalk Orchestration & Port Tutorial
Requesting Gravatar...
@Bill:

Thanks for the tutorial!

Thought you might like to know that your "Contact" link is throwing a 404 error.

http://geekswithblogs.net/SystemMessages/FileNotFound.aspx?aspxerrorpath=/bosuch/contact.aspx

Cheers,
Left by Wakazula on Jul 19, 2010 7:35 AM

# re: Simple BizTalk Orchestration & Port Tutorial
Requesting Gravatar...
thanks for the tutorial , i learnt a lot from it
Left by sushil sahu on Jul 25, 2011 12:25 AM

# re: Simple BizTalk Orchestration & Port Tutorial
Requesting Gravatar...
Awesome tutorial, best one I've come across with good explanations that are not overwhelming to grasp. Keep up the good work.
Left by kay k on May 24, 2012 8:49 AM

# re: Simple BizTalk Orchestration & Port Tutorial
Requesting Gravatar...
Hi
You did not define where we define a receive and send port.If you do not define this then It will show error messge.
Thanks
Sunil Kumar Verma

Left by Sunil on Oct 17, 2012 10:31 PM

# re: Simple BizTalk Orchestration & Port Tutorial
Requesting Gravatar...
Click the link at the top of the page to go to part 2 of this article and you'll see how to configure the send and receive ports in the admin console.
Left by Bill on Oct 18, 2012 5:34 AM

# re: Simple BizTalk Orchestration & Port Tutorial
Requesting Gravatar...
Very useful for beginers. Many Thanks.
Left by vimal on Feb 07, 2014 2:07 AM

# re: Simple BizTalk Orchestration & Port Tutorial
Requesting Gravatar...
Great tutorial. Simple yet to-the-point.
Left by Alex on Feb 19, 2014 1:26 PM

Your comment:
 (will show your gravatar)


Copyright © Bill Osuch | Powered by: GeeksWithBlogs.net