Wednesday, November 30, 2011

Custom Orchestration not showing in the Esb Itinerary Property Window

Ever tried to use a custom 'Orchestration' in your Itinerary for processing your business funtionality only to find out that 'Itinerary Designer' is not showing it in the 'Itinerary Service' properties??


Well, there are couple of things you need to do, before you get to that point!!!


First of all, You need to create a new entry for your 'Orchestration' in the ESB.Config file located at 'C:\Program Files\Microsoft BizTalk ESB Toolkit 2.0\Esb.config'. Open up the configuration file, look for 'itineraryServices' node. Inside this, you've got to add a new entry for an 'ItineraryService' of type Orchestration.


Here are the list of attributes for the ItineraryService node :
id : It has be a new GUID. Generate a new GUID and assign it.
name : Any name that you want to assign to your Orchestration Service. This is the same name that would be used by the 'Receive Shape' in your Orchestration to subscribe to the messages comming for the Itinerary Service.
type : This is the combination of Orchestration Name and Assembly Name. This information can be found by right clicking on the Orchestration in the BizTalk Admin Console, and click on Properties. It will show a list of properties. Under 'General' tab, you could find the Name and Assembly information. Just copy those two values seperated by a comma.
scope : Since this is an Orchestration service, it's scope should be 'Orchestration'.
state = "None".
A typical entry in the ESB.Config file will look like this :


"itineraryService id="5" name="TwoWayTransformation" type="ESB.MultipleWebServices.Orchestrations.TwoWayRouting, XactConnectArtifacts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f922625124e336c0" scope="Orchestration" stage="None"/"


Once you have this information in the ESB.Config File, it should show up in the Itinerary Service Property Window for the ServiceName property. If it doesn't show, close the Visual Studio and open it up again... It should be able to show up now...


If it still doesn't, like it did for me, then the problem lies else where...


When you configure SSO using EsbConfigurationTool.exe, are you storing it in a datastore or a file???Change it to look it up from a file.... It will show up!!!! If you have configured it to look in a datastore then any changes made to the configuration file will obviously not show up...


So, Open up the ESBConfigurationTool.exe, click on Configuration node and see what is checked over there.... File Source or SSO Configuration Source???If it is SSO Configuration Source, then click on the UnConfigure Source button in the menu, Select File Source and then click Apply Configuration....


From now on, any changes made to the Configuration File will show up!!!!

Thursday, February 24, 2011

DB2 Adapter Send port Configuration:

Step1 : Create two way send port with DB2 adapter
Step2: Configure the
1. Connection String :
User ID=ediuser;Password=***************;Initial Catalog=BCDB2T;Network Transport Library=TCP;Host CCSID=37;PC Code Page=1252;Network Address=host. sic.com;Network Port=4050;Package Collection=MOLE;Default Schema=MOLE;Process Binary as Character=False;Units of Work=RUW;DBMS Platform=DB2/MVS;Defer Prepare=False;Rowset Cache Size=0;Authentication=Server;Persist Security Info=True;Connection Pooling=False;Derive Parameters=False;

2. Document Target namespace (input schema) - http://Debatching.Db2Schema.
3. Response Root Element Name : Response root(Tp_Response)
4. URI : DB2://host.lahsic.com:4050/BCDB2T/MOLE(configure Connection string automatically created this string)
Connection String configuration:
Click on Connection string button -> select new connection string radio button
Next-> set Data source flat form (DB2/MVS,DB2/AS400…)
Next->set Net work Type (TCP/IP)
Next ->Address of alias (DB2 server address eg host. sic.com)
Next -> Set Port
Next-> set the Initial catlog, Package Collection, Default schema and Database name (Database name and Initial catalog both are same)
Next ->Set Host CCID and PC Code page (default ones)
Next ->set the Security method (default –sign on), user name, password, confirm password and Authentication method (default server).
Next -> Select Connection pool, Defer prepare, derive prepare
Next -> test Connect button and packages and finish…

No template information found. See the application log in Event Viewer for more details

I am facing the following issue in my Visual Studio 2008. When I try to Create new website or new project it shows following error message.
“No template information found. See the application log in Event Viewer for more details.
To open Event Viewer, click Start, Click Control Panel, double-click Administrative Tools, and then double-click Event Viewer.”

Event log display following warning:
The global template information is out of date. Regenerate the templates by running 'devenv.exe /installvstemplates' or reinstalling the application. Note: corrective action requires Administrator privileges.

Solutions:
1. Run devenv /installvstemplates as suggested in Event Viewer.
Then Run devenv /resetsettings.
2 . If this do not help then try to run Visual Studio Repair using program & features (Install/Unstall).

To repair Visual Studio on Windows XP or earlier
1. In Control Panel, on the Add or Remove Programs page, select the product edition you want to repair and then click Change/Remove.
2. In the Setup wizard, click Next.
3. Click Repair or Reinstall.

4. Temporary fix:

FROM
\Common7\IDE\ItemTemplates”
TO
“My Documents\Visual Studio 2005\Templates\ItemTemplates”.

Monday, February 7, 2011

Wednesday, February 2, 2011

BizTalk Pipeline Component problem – Component ‘…’ could not be initialized. Pipeline component ‘…’ could not be resolved (is an assembly reference mi

SOLUTION
• Rebuild pipeline component in Visual Studio
• Shutdown Visual Studio
• Deploy the component (copy to “C:\Program Files\Microsoft BizTalk Server …\Pipeline Components”)
• Restart BizTalk Host Instances
These steps solved my problem
Other possible solutions
Solution 1
• Some external assemblies are missing
• Copy the missing assemblies in the Pipeline components folder or in GAC
Solution 2
• Restart the system

Tuesday, January 25, 2011

Configuration in BizTalk Map

Steps:
1. Open "BTSNTSvc.exe.config" file from "drive:\Program Files\Microsoft BizTalk Server 2009 ".
2. Add configuration setting there such as -
//appsettings
add value="Data Source=.;Initial Catalog=yourDB;Integrated Security=SSPI" key="STR"
appsettings//
3. In map file, drag and drop script functoid and write following inline c# script.
public string GetConnectionString()
{
string connString=System.Configuration.ConfigurationSettings.AppSettings.Get("STR").ToString();
return connString;
}
4. While using any database related functoid, drag output of script functoid as input in database functoid. And do not forget to put it in correct parameter sequence.
Note: One more last thing, you cannot test config value in map at design time because configuration values are read BTS host at runtime.

Configuration in BizTalk Map

Steps:
1. Open "BTSNTSvc.exe.config" file from "drive:\Program Files\Microsoft BizTalk Server 2009 ".
2. Add configuration setting there such as -



3. In map file, drag and drop script functoid and write following inline c# script.
public string GetConnectionString()
{
string connString=System.Configuration.ConfigurationSettings.AppSettings.Get("STR").ToString();
return connString;
}
4. While using any database related functoid, drag output of script functoid as input in database functoid. And do not forget to put it in correct parameter sequence.
Note: One more last thing, you cannot test config value in map at design time because configuration values are read BTS host at runtime.

Monday, January 24, 2011

Excel custom pipeline

http://blogs.msdn.com/b/gzunino/archive/2004/08/02/206377.aspx

Debatching with xlinq in Receive Pipeline

sample Xml:


<_x0032_100>
name
providerid
loc

<_x0032_200>

2010
66
dec
a
100


2010
76
Dec
item
100


2011
2011
Dec
ab
100


2011
2011
Sep
ab
100


2011
2011
Dec
ab
100


2011
2011
Dec
ab
100


<_x0032_300>
sc
dcdc

<_x0032_400>
lc
25



use the following.

1.Create a disassembler pipeline component.
2.Use the following code in the disassemble stage

public void Disassemble(IPipelineContext pc, IBaseMessage inmsg)
{
try
{
// Clone the message context so we can associate it with the new message later
originalMsgContext = PipelineUtil.CloneMessageContext(inmsg.Context);
// create the xml doc
incomingXML.Load(inmsg.BodyPart.GetOriginalDataStream());

splittedNode = incomingXML.SelectSingleNode(strxpath);


}
catch (Exception ex)
{

throw (ex);
}
}

/// Input message
Then in the GetNext use something like this....


public IBaseMessage GetNext(IPipelineContext context)
{
XmlDocument currentMessage = new XmlDocument();
IBaseMessage newMsg = null;
List strdocs = new List();
StringReader strreadRead = new StringReader(splittedNode.OuterXml);


//XLINQ query with year,renderingid and month
var grouped = from c in System.Xml.Linq.XElement.Load(strreadRead).Elements("serviceline") group c by new { year = c.Element("year").Value, renderingid = c.Element("renderingid").Value, month = c.Element("month").Value } into c select c;

foreach (var serviceline in grouped)
{
string strgroup = "<_x0032_200>";
foreach (var temps in serviceline)
{
strgroup += temps.ToString();
strgroup += "\n";
}
strgroup = strgroup + "";

strdocs.Add(strgroup);
strgroup = string.Empty;

}

if ((strdocs.Count > 0) && (splitCounter < editnode =" incomingXML.SelectSingleNode(strxpath);" fragment =" incomingXML.CreateDocumentFragment();" innerxml =" strdocs[splitCounter];" splitcounter =" splitCounter" memstream =" new" newmsg =" context.GetMessageFactory().CreateMessage();" newmsgpart =" context.GetMessageFactory().CreateMessagePart();" data =" memStream;" iprop =" 0;" val =" originalMsgContext.ReadAt(iProp,">

Friday, January 21, 2011

Consuming Web Services without web references in BizTalk

1.Generating the proxy class from wsdl.exe. You can generate the proxy class from the Visual Studio command prompt, and giving the proper switches will create the proxy class.

wsdl /out:[dir]proxy.cs http://localhost/[webservice URI].asmx?wsdl

2 .After generating the proxy class, you can add the proxy class to a .NET Library project, give it a strong name key file, build the project. (Don’t forget to GAC the generated assembly before deploying the BizTalk project).

3.After it is GAC’d, we can configure the send port of the orchestration and supply the AssemblyName and MethodName properties for the message context. After the BizTalk Project is deployed, we can configure the send port calling the Web Service. In the Web Service tab, select the assembly which was created before by building the .NET library project containing the proxy class. Select the type name and method name, and in the General tab, specify the Web Service URI.

In this way, you can have more control over the proxy and handle its versioning, and a little change in the Web Service won't make you build deploy the project again.


Suppress Element if Attribute is not required(map)

Here is the solution:

Custom Pipeline

There are multiple categories of pipeline components. These categories are –

Pipeline Components Stages :

General Component:
(Decode, Encode, Pre-assemble, Resolve Party or Validate )Take one message process message and produce zero or one message

Disassemble Component:
Split message, promote custom properties

Assemble Component:
Used to wrap message with head or trailer or both

Probe Component:
(This is not an independent component. Any pipeline component can implement the IProbeMessage interface if it must support message probing functionality.)
Enables the component to check the beginning part of the message.


Developing General Pipeline Component

General pipeline component implements following interfaces –

a. IBaseComponent Interface
b. IComponentUI Interface
c. IComponent Interface
d. IPersistPropertyBag (Optional. Required when pipeline design time properties are to be defined)

IBaseComponent Interface:

All pipelines implement this interface. Interface provides members which can be implemented to provide information about pipeline.

IBaseComponent Interface Properties:

Description Property.
Used to specify small description about pipeline component.
Description is visible on pipeline properties page at design time.


Name Property
used to specify name of pipeline component. Name is visible on pipeline properties page at design time.

Version Property
used to specify version (example 1.0.0.0) of pipeline component. Visible on pipeline properties page at design time.

IComponentUI Interface:
All pipeline components must implement this interface. Members of this interface provide design time support.

IComponentUI Interface Properties:
Icon Property:
used to provide icon associated with pipeline component.

Validate Method:
This is called by pipeline designer before pipeline compilation to
verify that all configuration properties are correctly set.


IComponent Interface
This is core interface. Member of this interface is implemented for specific message processing/massaging.
IComponent Interface Properties:

Execute Method:
Does specific processing/massaging in inbound message and produces output message to be forwarded to next stages of pipeline or message box.

IPersistPropertyBag

Interface provides members which can be used to save and load pipeline design time properties with property bag. This interface is implemented only when pipeline’s design time properties are to be defined.
IpersistPropertyBag Properties:

GetClassID Method:
Retrieves the component's globally unique identifying value.
InitNew Method:
Initializes any objects needed by the component to use the persisted properties.
Load Method:
Used to load property from property bag.
Save Method:
Used to save property to property bag.

Tuesday, October 26, 2010

BizTalk Adapter Pack 2.0 Migration Wizard – SAP IDOCs

http://kentweare.blogspot.com/2009/12/biztalk-adapter-pack-20-migration.html

Sunday, October 17, 2010

Zombie

• What is a zombie?
A zombie message is a message that was routed to a running orchestration from the messagebox and was "in flight" when the orchestration ended. An "in flight" message is a message that has been routed to a service instance and so is in a messagebox queue destined for the service instance. Since the message can no longer be consumed by the subscribing orchestration instance, the message is suspended and marked with a ServiceInstance/State value of "Suspended (Non-resumable)".
A zombie service instance is an instance of an orchestration which has completed while a message that was routed to the orchestration instance from the messagebox was still "in flight". Since the orchestration instance has ended, it cannot consume the "in flight" messages and so is suspended and marked with a ServiceInstance/State value of "Suspended (Non-resumable)".
The occurrence of zombies typically falls into one of the following categories:
1. Terminate control messages – The orchestration engine allows the use of control messages to cancel all currently running work in a specific orchestration instance. Since the control message immediately halts the running orchestration, zombie instances are not unexpected. A number of Human Workflow related designs tend to use this mechanism as well as some other designs.
2. Parallel listen receives – In this scenario the service instance waits for 1 of n messages and when it receives certain messages it does some work and terminates. If messages are received on a parallel branch just as the service instance is terminating, zombies are created.
3. Sequential convoys with non-deterministic endpoints – In this scenario, a master orchestration schedule is designed to handle all messages of a certain type in order to meet some type of system design requirement. These design requirements may include ordered delivery, resource dispenser, and batching. For this scenario, the tendency is to define a while loop surrounding a listen with one branch having a receive and the other having a delay shape followed by some construct which sets some variable to indicate that the while loop should stop. This is non-deterministic since the delay could be triggered, but a message could still be delivered. Non-deterministic endpoints like this are prone to generating zombies.
When a zombie service instance is suspended in Microsoft BizTalk Server 2006 the following error message is generated:
Copy
0xC0C01B4C The instance completed without consuming all of its messages. The instance and its

Tuesday, October 12, 2010

Test the biztalk application with same folder

A really simple tip that is great to use when building demos and proof of concepts using the file adapter.

1. Create one folder (docs) and place all your test files there.

2. Configure the receive location to use the docs folder and “Copy*.xml” as the filter (for Server 2008, Vista and 7 use “*Copy*.xml”

3. Configure all your send ports to send to the docs folder with filenames like “Order_%MessageID%.xml”.

When you test, select the file and use CTRL+C, CTRL+V to create a copy.

You can then test your application from one folder.

Unit Testing In Biztalk 2009

Deployment property page of a BizTalk project. The following screenshot shows this project setting accessed from Project Designer when we right-click a project and click the Properties.




Screenshot of the Deployment tab in Project Designer exposing the Enable Unit Testing project property.


This feature allows us to create unit tests for schemas, maps, and pipelines.

When this feature is enabled and the project rebuilt, the artifact classes will be derived from the following base classes to support unit testing.

Artifact type
Base class
Schema
Microsoft.BizTalk.TestTools.Schema.TestableSchemaBase
Map
Microsoft.BizTalk.TestTools.Mapper.TestableMapBase
Pipeline
Microsoft.BizTalk.TestTools.Pipeline.TestablePipelineBase




Using the Unit Testing Feature with Schemas

This topic demonstrates how to use the unit testing feature to add a unit test for the schemas.

Testing Schemas
Schemas can be unit tested by using them to validate instance messages. To create Unit Test, we need to select Test->New Test from the Visual Studio Menu. This will bring up a dialog box where we will select Unit Test Wizard.


We have to enter a project name for the unit testing project when we are prompted for it.


After the Create button is pressed, we can see “Create Unit Tests” dialog box. We have to choose the Filter drop down list and select “Display Base Types”. Then we need to expand the Schemas Project, Schemas.SimpleRequest, Bases & Interfaces and select “Microsoft.BizTalk.TestTools.Schemas.TestableSchemaBase”.


Pressing OK button will create unit tests for each selected schema in the schemas in the project. It will also set all the necessary project references. We can validate XML as well as flat files.



The following code will be generated for the Test Method. We will need to set references to an input instance filename to validate the test instance.

[TestMethod()]
public void ValidateInstanceTestWithValidMessage()
{
TestableSchemaBase target = new SimpleRequest();
string inputInstanceFilename = @" ValidSimpleRequest.xml";
OutputInstanceType inputType = new OutputInstanceType();
inputType = OutputInstanceType.XML;
bool expected = true;
bool actual;
actual = target.ValidateInstance(inputInstanceFilename, inputType);
Assert.AreEqual(expected, actual);
}


The Solution Items file LocalTestRun.testrunconfig is to be opened. We need to select the Deployment screen and add the directory that contains all the test data and schemas that will be used during unit testing. This will allow us to use relative paths in our unit tests.









Using the Unit Testing Feature with Maps

Maps can be tested by passing a test input instance to the map and validating that output message has been correctly transformed. We have to follow the exact same steps to generate a Unit Test for Map as it is for creating Unit Test for a Schema. In this case we have to select the class “Microsoft.BizTalk.TestTools.Mapper.TestableMapBase”.
But Multi-Input maps cannot be unit tested in this version of BizTalk.
The generated Unit Test will have a method where we just need to update information about the input and output message instances.

[TestMethod()]
public void TestMapAddTest()
{
TestableMapBase target = new SimpleRequest_To_SimpleResponse();
string inputInstanceFilename = @" AddSimpleRequest.xml";
InputInstanceType inputType = new InputInstanceType();
inputType = InputInstanceType.Xml;
string outputInstanceFilename = @"AddSimpleResponse.xml";
OutputInstanceType outputType = new OutputInstanceType();
outputType = OutputInstanceType.XML;
target.TestMap(inputInstanceFilename,
inputType, outputInstanceFilename, outputType);
XmlDocument output = new XmlDocument();
output.Load(outputInstanceFilename);
Assert.AreEqual("20", output.SelectSingleNode("/*[local-name()='SimpleResponse' and namespace-uri()='http://Schemas.SimpleResponse']/*[local-name()='Result' and namespace-uri()='http://Schemas.SimpleResponse']").InnerText);
}

Using the Unit Testing Feature with Pipelines

Both send and receive pipelines can be unit tested. Pipelines can be tested by passing a test input instance and schema to the pipeline. We have to follow the exact same steps to generate a Unit Test for Pipeline as it is done for creating Unit Test for a Schema. In this case we have to select “Microsoft.BizTalk.TestTools.Mapper.TestableReceivePipeline” for unit testing a receive pipeline and “Microsoft.BizTalk.TestTools.Mapper.TestableSendPipeline” for unit testing a send pipeline.

We have to customize the generated unit testing code with additional details about test instance messages and schemas.
Unit Test code to test receive and send pipeline is shown below.

[TestMethod()]
public void TestReceivePipelineTest()
{
TestableReceivePipeline target = new FFRcvSampleFile();
StringCollection documents = new StringCollection();
documents.Add(@"Sampe ASCII.txt");
StringCollection parts = new StringCollection();
Dictionary schemas = new Dictionary();
schemas.Add("Schemas.SampleSchema", @"SampleSchema.xsd");
target.TestPipeline(documents, parts, schemas);
}


[TestMethod()]
public void TestSendPipelineTest()
{
TestableSendPipeline target = new FFSendSampleFile();
StringCollection documents = new StringCollection();
documents.Add(@"SampleSchema.xml");
StringCollection parts = new StringCollection();
Dictionary schemas = new Dictionary();
schemas.Add("Schemas.SampleSchema", @"SampleSchema.xsd");
target.TestPipeline(documents, parts, schemas);
}


Known Issues

· The Unit testing feature for maps currently does not support multiple map inputs.
· When we are testing maps, output Instance file name cannot be null or empty.
· BizTalk SDK needs to be deployed to the machine running the pipeline unit tests.


Conclusion

Unit testing is a best practice when it comes to application development.
Until the release of BizTalk 2009 we had to rely on unit testing frameworks like BizUnit and Pipeline Testing Library to test BizTalk components. Having native support for testing Schemas, Maps and Pipelines makes unit testing easier.
By driving development with automated tests any developer can write reliable, bug-free code no matter what its level of complexity.





References
http://www.msdn.com

Wednesday, October 6, 2010

BizTalk WCF Web Service Over SSL

1 . Expose a BizTalk WCF Web Service using BizTalk WCF Service Publishing
Wizard tool.
It creates one WCF web service in IIS and another one is Receive Location in BizTalk.
2 . Changes required in Web.Config of WCF Web Service.
Go to the web.config file by navigating from WCF Web Service in IIS.
a . Configure BizTalk Receive Location

receiveLocationName="WcfService_BizTalkAccountDataWcfService/AcountDataService"
publicBaseAddress=https://<>:9090/ />

b . HttpsGetEnable should be true

c . Enable HttpsMexendpoint
binding="mexHttpsBinding" bindingConfiguration=""
contract="IMetadataExchange" />
3 . Changes required in BizTalk ReceiveLocation configuration.
Go to the Biztalk ReceiveLocation that will be created by Wizard in first step.
Click on the configuration button (here transport type may be WCF-BasicHttp or
WCF- WSHttp).Next Click on Security tab of Transport Property, then change the below
configuration.
Security Mode: Transport
Transport clint credential type : None
4. Changes required in IIS
a . Set the Application Pool for the WCF Web Service.
Select your WCF Web Service from IIS and click on Advanced Settings from
Action pane. Create a new application pool and select here, otherwise you can give
BAMAppPool temporarly.
ApplicationPool – BAMAppPool (example)
b . Create a Self signed Certificate
i. Go to IIS and click on the Top node then Click on the Server Certificates from
central panel.
ii. Click on the Create a Self Signed Certificate from Action panel.
iii. Enter the name and click ok.
c . Add https with port and certificate.
i. Select Default Web Sites in IIS then click on bindings option from Actions panel
(it will be right panel of the IIS).
ii. Click on the Add button on Site Bindings pop up.
iii. Select following setting on Add site bindings.
Type: Https
Port: 9090 (Use the same port what you used in web.config – look at the2.a
section above)
SSL Certificate: Select a certificate you created in 4.a section above.
d . Enable SSL for you WCF web Service.
i. Click on your WCF Web Service inside IIS.
ii. Then Click on SSL Settings from central panel. Next Check the SSL
Required checkbox and Select the Accept radio button for Clint Certificates.
5. Restart the IIS using IISReset command and enable the BizTalk ReceiveLocation then try
to browse the URL. It will show the WSDL file without error.
Reference URL - http://rocksolidknowledge.com/Screencasts.mvc/Watch?video=WCFSSL.wmv

Orchestration Debug with System.Diagnostics.Debug and Parallel shapes in orchestration

Orchestration Debug with System.Diagnostics.Debug and Parallel shapes in orchestration

In this post I want to show alternate method for Debug and demonstrate how Parallel shape
works in orchestration.

1. Create new orchestration
2. Create first receive port
3. Insert Parallel Actions shape
4. Add to shape 2 branches
5. Add 8 Expressions

So your orchestration should look like
6. edit each expression shape
Expression_1 :
System.Diagnostics.Debug.WriteLine("Exp1");

Expression_2 :
System.Diagnostics.Debug.WriteLine("Exp2");

Expression_3 :
System.Diagnostics.Debug.WriteLine("Exp3");

Expression_4 :
System.Diagnostics.Debug.WriteLine("Exp4");

================

Expression_8 :
System.Diagnostics.Debug.WriteLine("Exp8");


Download DebugView Utility from
great tool by Mark Russinovich

Create a simple xml which will start orchestration


Start debug view
Enable Capture Global Win32, Enable Verbose Kernel Output
Start orchestration
and check for output !


Same trick you can use in your Window applications, Windows services and WPF applications.

BizTalk Orchestration debug

BizTalk Orchestration debug

You can debug your orchestration using Visual Studio by attaching it to BTSNTSvc.exe processes. The orchestration will be debugged without break point if it has Exception,
in this case you will not need to setup a break point, like any desktop application which you run in debug mode.
The engine will generate C# file for you were you can details of the exception.

In this post I want to show how to debug an orchestration setting a break point

I will create an orchestration which will throw an exception when dividing by 0 (Zero)

Create a simple schema where you will pass 2 numbers
and another schema with 1 parameter which will hold division result.

All element should be decimal and distinguished

1. Create Receive port in orchestration
2. Create Scope
3. Add Construct message to Scope
4. Add Message assignment to constructor
5. Create Send port

Edit expression for assignment:

Variable_1.LoadXml(@"14.4 ");
MessageOut = Variable_1;
MessageOut.Result = (MessageIn.x / MessageIn.y);

where Variable_1 is System.Xml.XmlDocument variable in the Scope
Change namespace and parameters if needed.

At the end your orchestration should look like
Now create two file adapters to receive parameters and send the result
Deploy BizTalk project and bind orchestration ports

For the first time input simple right numbers for x and y
Check the output that result is OK.

then insert 0(Zero) for y which will produce Exception in orchestration
In Event Viewer you will have the exception description

xlang/s engine event log entry: Uncaught exception (see the 'inner exception' below) has suspended an instance of service 'OrchDebug.Division(6ec96fde-7908-1b3e-f21d-244ab1fe40fa)'.
The service instance will remain suspended until administratively resumed or terminated.

Open Group Hub in BizTalk Management Console

check for suspended messages you will see there new Resumable message

open that message in list and right click on it

Start debugger

in this case you can see the shapes and setup a break point.

Then just attach your visual studio debugger to BTSNTScv.exe
and debug it like a windows server or Web application

after attaching to debugger put new file in receive directory and check your visual studio, it will debug your orchestration.

biztalk server 2009 and wcf sql adapter

http://geekswithblogs.net/martinabbott/archive/2009/06/03/biztalk-server-2009-and-wcf-sql-adapter.aspx