Interesting tech stuff I come across day-to-day. Mainly around Biztalk and .NET 3.0

Ah!! Control flow didn't get into my exception handler block inside the orchestration (or) how can I handle the exception when the send port raises the error with suspended (resumable) status.

Thursday, April 26, 2007

Conditions:

1. Above orchestration is constructed with just default settings.

2. Logical port Port_2 is configured to use a Send Port with FILE adapter pointing to an unknown URI (purposely, to generate error) and RetryCount = 0

3. Logical port Port_5 is configured to use a Send Port with FILE adapter (normal valid setting).

Will the control flow get into exception handler?

In the above scenario the orchestration will complete successfully without throwing any exception even though the message is not transmitted successfully to the target recipient. The main reason for that is because the orchestration engine successfully persisted the message and state into the MessageBox database. So, from Orchestration perspective the transaction was successful.  But, when the send port picked up the message, it couldn't transmit the message successfully due to the KNOWN URI configured in the FILE adapter, so it raised an exception and suspends the referenced message with Suspended (resumable) status. Later an adminstrator can correct the configuration in the send port with correct URI and resume the message from admin console, which then will transmit successfully.

The end result is the control flow didn't get into the exception block, even though logically there is an exception in the transmission.

So, how can I make the control flow to get into my exception block:

I made few changes to the Orchestration:

1. I set the "Delivery Transmitted" property to "Transmitted" for Port_2

2. Changed the exception handlers, "Exception Object Type" to "Microsoft.XLANGs.BaseTypes.DeliveryFailureException"

3. Created a new message using Orchestration View called EXC_MESSAGE (just System.String type), and modified the exception handler block as shown in the following figure, added a construct shape with follwing statements inside MessageAssignment

soapExc = (System.Web.Services.Protocols.SoapException)delFailException.InnerException;
EXC_MESSAGE = soapExc.Detail.InnerXml;

where, delFailedException is the name of the catch exception block,  soapExc is a local variable of type SoapException.

Now,  the message flow will get into the exception handler block and following ERROR message will be transmitted via the Send shape (eventually to the configured physical send port) configured in the exception handler.

<?xml version="1.0" ?><string><ns0:NACK Type="NACK" xmlns:ns0="http://schema.microsoft.com/BizTalk/2003/NACKMessage.xsd"><NAckID>{8F3626A6-E110-49AF-802A-8E85BD5016C6}</NAckID><ErrorCode>0xc0c01c10</ErrorCode><ErrorCategory>0</ErrorCategory><ErrorDescription>The FILE send adapter cannot open file C:\BTSSamples\Listen Timeout Exception\File Drop3\02. OUT RES\{66A1BABF-5509-42CE-82F8-0E100852C526}.xml for writing. Details: The system cannot find the path specified. </ErrorDescription></ns0:NACK></string>

You can do lot of things with this error message now, like for example: you can email it to the adminstrator.

Summary:

So, there is nothing new here "Delivery Notificaition" and "NACK" messages are been there for a very long time. The reason for this post is a result of 2 questions raised in the newsgroup

1. My Control flow is not passing to the exception handler, and

2. How to handle Suspended (resumable) exceptions within orchestration.

Nandri!

Saravana

Labels:




BizTalk - Strange Exception Messages and Corresponding Fixes.

During our BizTalk development we come across some really strange error message, which normally doesn't reflect the real cause. I always wanted to consolidate everything in one place. After seeing couple of errors that's being raised in the news groups, I thought this is the right time to materialise it. If you have come across any strange errors and willing to share please let me know via my contact page.

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

Exception: 'System.Xml.XmlDocument' does not contain a definition for 'Status'

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

Cause:

System.Diagnostics.Debug.WriteLine(PO_SOURCE.Status.ToString());

Resolution:

status = PO_SOURCE.Status;
System.Diagnostics.Debug.WriteLine(status.ToString());

where "status" is a variable of type System.String.

Credit: Tim

Remark: When you try to do the conversion directly on the context property, the above exception is raised. You can easily fix it by first assigning the context property to a local variable and then doing the conversion.

DateLogged: 17th May 2007 (BizTalk 2006)

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

ERROR: The BAM deployment failed.
A connection cannot be made. Ensure that the server is running.
No connection could be made because the target machine actively refused it

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

Credit: Saravana Kumar

Remark:

If you receive the following error when you try to deploy BAM activities using bm.exe tool

The error information doesn't reflect on the actual cause. Make sure, "SQL Server Analysis Services" is started.

DateLogged: 26th April 2007 (BizTalk 2006)

Nandri!

Saravana

Labels:




More on Internet Service Bus (BizTalk Services)

There are more confusion around people regarding BizTalk Services (Identity, Connectivity, ServiceBus, and Workflow). Why do we need all this additional service? Is there any business value? Will it make any difference to my client. etc etc

Of course it will, remember the services are just in CTP, the more it get matures companies will come up with more ideas. Clemen Vasters from connected system division got an excellent post about "BizTalk Services" and the practical requirement for such services.

Extract from his post:

"If you are an ISV catering shrink-wrapped business solutions to SMEs whose network infrastructure may be as simple as a DSL line (with dynamic IP) that goes into a (wireless) hub and is as locked down as it possibly can be by the local networking company that services them, we can do as much as we want as an industry in trying to make inter-company B2B work and expand it to SMEs; your customers just aren't playing in that game if they can't get over these basic connectivity hurdles."

Related Links from this blog:
BizTalk Services. How does Identity Service and Connectivity service fit together.
BizTalk in the direction of SaaS (Software as a Service)


Nandri!
Saravana

Labels:




BizTalk Services. How does Identity Service and Connectivity service fit together.

Wednesday, April 25, 2007

From my understanding of BizTalk Services (Identity, Connectivity, ServiceBus, and Workflow) so far, the word BizTalk doesn't really mean much(at least at the moment, with currently live Identity and Connectivity (aka Relay) services). May be it will make sense once  ServiceBus is live. There is nothing offensive here.It makes sense more on Windows Communication Foundation (WCF) front rather than BizTalk.

What is Identity Service?

Identity service is a way of authenticating end users and connected systems. Much similar (but not the same) to Microsoft's effort of introducing Microsoft Passport few years back,  as one stop shop for your authentication needs.  Identity services (previously called Secure Token Services - STS) uses Windows Cardspace technology to authenticate clients (both users and connected systems) using claims based access control. To use any other services like Connectivity, the authentication needs to be performed via Identity Service. So, it's mandatory to create an Identity Service account (Create New Account). On client side IE 7.0  is required.

What is Connectivity Service?

Connectivity Service is also called as Relay Service, which provides two main functionality:

1. Ability to create a listening endpoint (WCF endpoint) at the relay service, and

2. Ability to Send and Receive messages to and from that endpoint.

Listening endpoint is created by, configuring an application to listen on a public address (ex: net.relay://connect.biztalk.net/services/SARAVANA_W2003/HelloWorld/). If that address is available and the user is authorized, the relay service will start listening on that address on behalf of the application. The following config code snippet shows, how you'll create a listening endpoint on a relay service from your WCF service application.

<service name="Saravana.DigitalDeposit.HelloWorld">
<endpoint name="RelayEndpoint"
contract="Saravana.DigitalDeposit.HelloWorldContract"
binding="relayBinding"
bindingConfiguration="default"
address="net.relay://connect.biztalk.net/services/SARAVANA_W2003/HelloWorld/" />
</service>

Microsoft has build some specific WCF bindings called Relay Bindings, to make integration seamless with Relay Service.

How Identity Service and Connectivity service fit together:

The following figure shows the high level overview of how both the services (Identity and Connectivity) work together.

Server Authentication and establishing a Listening endpoint:
Step #1: An application behind a firewall (Example: HelloWorld Service) requests a security token for the Relay Service from the Identity Service.

Step #2: Identity Service responds with the appropriate token (assuming that "HelloWorld Service" could successfully authenticate to the service).

Step #3: "HelloWorld Service" initiates a connection to the Relay Service and asks to listen on a particular address (Ex: net.relay://connect.biztalk.net/services/SARAVANA_W2003/HelloWorld/). If the address is available and "HelloWorld Service" is authorized, a listening endpoint is created.

Client Authentication:
Step #4: The Client application requests a security token for the Relay Service from the Identity Service.

Step #5: Identity Service responds with the appropriate token (assuming the Client could successfully authenticate).

Sending and Receiving Messages:
Step #6: The Client formulates the application message and sends it to "HelloWorld Service" address on the Relay Service (Ex: net.relay://connect.biztalk.net/services/SARAVANA_W2003/HelloWorld/). The Client includes the security token it received in Step #5.

Step #7: The Relay Service forwards the application message down the open TCP connection to "HelloWorld Service".

Step #8: "HelloWorld Service" creates an application response and sends it back to the Relay Service.

Step #9: The Relay Service completes the outstanding HTTP request with an HTTP response containing the application response message.

Hope this gives a basic understanding of Identity and Connectivity services.  The documentation at the moment is very thin, I'll recommend downloading the SDK, which got some good sample to start with.

Nandri!

Saravana

Labels:




BizTalk Server 2006 R2 Support Forum, How to get hold of WCF LOB Adapter SDK.

Tuesday, April 24, 2007

I haven't seen people highlighting about the BizTalk Server 2006 R2 forum in the blogs. If in case you haven't come across, there is a separate forum to post questions related to BizTalk Server 2006 R2.  The forum is categorized into following sections:

 

In one of the forum post Sonu Arrora (Program manager, WCF LOB Adapter SDK) explained how you can get hold of the WCF LOB Adapter SDK, which doesn't come as part of default install.

  1. Visit the following link and login using your .NET passport account https://connect.microsoft.com/Downloads/Downloads.aspx?SiteID=65
  2. Select the package named "BizTalk Adapter Pack and WCF LOB Adapter SDK";

IMPORTANT: Adapter SDK Beta 2 is not a public beta yet.  You need to contact btsr2tap@microsoft.com to get access to the Adapter SDK Beta 2 bits.   They can grant your passport account access, under some beta software evaluation license agreement.

UPDATE: Unfortunately WCF LOB Adapter SDK is not for everyone until Q3, I received the following email from MS

Saravana,

The ASDK is currently only available to TAP customers. The ASDK will be publically available in Q3.

Thanks.
James Snow
TAP Program Manager

Nandri!

Saravana

Labels:




BizTalk in the direction of SaaS (Software as a Service)

I heard the announcement of "BizTalk Internet Services" from Connected Systems Division in Microsoft through BizTalk server team blog.

What is SaaS?
Software as a service (Saas) is an application delivery model where vendors develop applications and hosts and operates the application for use by its customers over the internet. SaaS vendors typically utilize a "multi-tenant architecture", meaning that multiple customers are running the same software, but with a virtually separate data. SaaS was originally considered a potential security and operational risk. Many businesses wish to keep their information technology operations under internal control. However, there is a counter-argument that the professionals operating SaaS applications may have much better security and redundancy tools available to them, and therefore the level of service may be superior in many cases.

Example: Google Apps, a classic example, where they made their gmail services as a hosted service for companies to utilize, without the burden of setting up their own environment.

There is clear hint from BizTalk Server Team message, the service won't be free:

"Also, given the early stage, these services are available for free which may change down the road".

Initial release of BizTalk Internet Services include (as of 24th April 2007):

  • Message routing - firewall friendly B2B messaging (Available now)
  • Simple publish/subscribe event brokering - Pub/Sub at Internet scale (Coming soon)
  • Simple federated identity and access control (Available now)
  • Workflow processes - Simple templates for cross-organization integration and the orchestration of business processes interacting with multiple services (Coming soon)


When I tried to access http://labs.biztalk.net/, it asked for User Name and Password. As of now I don't know how you can participate in the program, even though the message from BizTalk Server team clearly states

"We are inviting developers from all over the world to use the services and provide feedback. Our vision for services, much like our vision for software, is to radically improve the productivity of developers as they build next generation applications."

I'll update this post, once I get the answer.

UPDATE #1 (23rd Arpil 2007):

1. There is an article in eWeek (April 23, 2007) explaining more about this.

2. Developers who want to get hold of this service now, there is an excellent post by Dennis, explaining step by step, procedure you can follow to kick start.

3. You can download the SDK for Relay and Identity service.

Thanks Bernabe for pointing the link.

UPDATE #2 (25th April 2007):

1. More about BizTalk Services in eWeek (not the same article mentioned earlier)

2. Good write up by Steven Martin in this post

Thanks Richard for pointing the links.

Update #3 (27th April 2007):

Steve Forte explain how BizTalk services will help his company Corzen outsource its spidering needs

http://www.stephenforte.net/owdasblog/PermaLink.aspx?guid=a8de9324-c373-4cab-8e10-4e23251a3fb4
Nandri!
Saravana

Labels:




Configure your BizTalk applications to run under seperate Host with Click of a button?

Thursday, April 19, 2007

UPDATE: Full source code of this project is now available at CodePlex. Project URL http://www.codeplex.com/BizTalkAppHostConfig

Companies use BizTalk Server in a variety of configurations. Let's see this scenario:

Scenario: Company-X is a medium sized company they got variety of small BizTalk applications like "Order Processing", "Payroll Processing", "Payment Processing" etc. But they only have one BizTalk infrastructure (they got replica setting for testing and production) with 2 BizTalk application servers (BizTalk group) connected to 2 SQL servers clustered. All their BizTalk applications are deployed in this BizTalk group. All the applications are configured to run within the default In-Process and Isolated host and one instance per host is created on both the application servers.

The main issues with the above scenario are:

  • Every time a new application is deployed or existing application is upgraded the host instances needs to be restarted (to refresh cached components). Stopping or restarting the host instance is going to affect each and every deployed application. At the minimum none of the applications are going to process any messages during the upgrade process.
  • Security can be compromised, because there is no security boundary between applications.
  • If one application causes problem to the host instance it's going to affect the overall system.

The solution to the above mentioned problems is to create separate logical hosts for each application and then creating corresponding host instances. Logical hosts can be created for BizTalk application using variety of tools that comes out of the box like BizTalk administration console, WMI, etc, but we'll face the following issues

  1. A thorough understanding of the host and host instances concept is required for the person who is performing the task.
  2. Creating logical host and configuring the BizTalk artifacts manually (handlers, receive locations, send ports and orchestrations) are error prone.
  3. Managing multiple logical hosts and their corresponding configuration will become more difficult over time.

ApplicationHostCreator is designed to create and manage logical hosts for BizTalk applications seamlessly to support situations as described in the above scenario.

Read more about how to use the tool and download version 1.0 of the tool at http://www.biztalk247.com

LINK: http://www.biztalk247.com/v1/articles/appHostCreator.aspx

Nandri!

Saravana

Labels:




Can you use Dynamic Send Port without Orchestration? Yes you can.

Dynamic send ports are used in situations, where you don't know in advance the type of transport adapter to use to send messages to your trading partner. May be based on certain content in your message you need to make that decision at runtime to pick up the transport adapter. The below figure shows the configuration for a Dynamic One-Way Send port, you can see you only specify the Name and Pipeline details (you can specify some of the other properties like maps, filters, etc).

Example Scenario: Say you are receiving an order message as shown below, which contains the "From" and "To" information in the header.
<Order>
<Header>
<From>me</From>
<To>Contoso</To>
</Header>

<Body>.........</Body>
</Order>

Based on the "To" (trading partner name) you need to pick up the appropriate transport (ex: Contoso = FTP, Northwind=HTTP).

Dynamic Send port works very well with Orchestration, all you need to do is specify the following line inside your expression shape

Port_1(Microsoft.XLANGs.BaseTypes.Address) = "http://www.tradingpartner.com/receive.ashx"

That's all it requires to route the message to dynamic send port. BizTalk resolves the correct transport address from the URI you specified.

(I put the following screen shot, so you know what I'm talking about) 

Behind the Scene:

When you create a Dynamic Send Port from BizTalk management console and start it, in the background BizTalk creates subscriptions for all the adapters installed in your server. A query for subscription shows the following result.

If you look at the expression used inside the subscription you'll see it's looking for 3 properties "OutboundTransportType" (HTTP,FILE,FTP etc), "SPID" (Send Port Id) and existence of "OutboundTransportLocation". The below figure shows the expression used for SendPort4: HTTP

When the orchestration submits the message to the MessageBox it promotes these three properties in the message context, which then gets picked up by the corresponding Dynamic Send Port.

How to use Dynamic Send Port without Orchestration?

If you want to use Dynamic Send Port in a  content based routing scenario (aka Messaging-Only scenario) one option is to promote the 3 properties

  • OutboundTransportType
  • SPID
  • OutboundTransportLocation

somewhere in your receive pipeline using custom pipeline component and submit it to the message box, which will then be picked up by the corresponding Dynamic Send Port. The only problem with this approach is SPID (Send Port id) is a system generated value and it might differ from environment to environment.

So, what's the best solution?

All you need to do is define a new FILTER in your Dynamic send port, example BTS.ReceivePortName == <<your receive port name>>. That's all it requires. Now if you look at the expression for SendPort4: HTTP you can see it accepts 2 different conditions one with SPID OR the other other one with ReceivePortName. So, all you need to do now is promote the following properties somewhere in your receive pipeline and submit the message to the MessageBox.

  • ReceivePortName
  • OutboundTransportType
  • OutboundTransportLocation

Instead of ReceivePortName you can use whatever promoted property you have in your system. Now, you know for sure those values are not going to change like SPID.

Nandri!

Saravana

Labels:




BizTalk HotRod Magazine.

Tuesday, April 17, 2007

This morning I came across this interesting magazine via Richard Seroter. I quickly glimpsed through the magazine at work and was very impressed by the contents straight away.

 This is the first magazine I've seen dedicated to BizTalk resources. The first issue contains 8 good articles written by people from Microsoft and its partners.

After seeing the content of the magazine I couldn't resist to wait till the weekend to update  BizTalk247. So, I added a new section to BizTalk247 called MAGAZINE which previews the content of BizTalk HotRod.

I encourage all BizTalk developers to go through the articles in the magazine they are well written based on real time customer situations.

As a feature article, there is an article from Stephen Kaufman which highlights the features of BizTalk 2006 R2.

Nandri!

Saravana

Labels: