Blogging BizTalk

Lets Discuss BizTalk

Publishing Schemas As A Webservice With Exception Handling


Where you need to publish an schema or orchestration as service:
Scenario where the communication has to happen in real time for example someone wants to call an orchestration from an UI or wants to post a request to BizTalk.

How do you Do That:

Develop a schema project as usual. If required you can pick an orchestration as the subscriber or leave it. Since you are publishing the Schema it will be loosely coupled and you can have multiple subscribers to the same message type.

Once done please go ahead and deploy the schema/solution.(In the case of orchestration you will like to have your activate receive  shape directly bound to msgbox) Also please consider having a fault port in your orchestration. That way you will be able to return a custom exception in case of any issues from BizTalk.

Some Unique Errors You May Encounter are:
The Messaging Engine failed to register the adapter for “WCF-BasicHttp” for the receive location : Solution your app pool id has to be part of BizTalk Admin group.
must receive before sending a message whose message type corresponds to a request response operation on an implemented port.You need to move your second send shapes under a condition branch as shown in the picture.

Demo:
This scenario we are going to design a synchronous BizTalk service which will return a response for each request.
1> Define your request response contracts.For this example I am going to create an orchestration which will consume the request and create a response. Make sure the activate receive shape is directly bound to msgbox.
This is how your solution is going to look like.
Orchestration

2>Once done please go ahead and deploy it.Start the orchestration.

3>Go to BizTalk WCF publishing wizard and follow the following steps( BizTalk WCF publishing Wizard can be found in Visual studio for 2009 or in the Start>>program >> Microsoft BizTalk server >>). I am going to design a HTTP based 2 way communication here. Please follow the following steps as showed in the screenshot below.

note:We can also publish an orchestration as a web service but using schema gives you loosely coupled architecture. In the case of schema you can define multiple subscribers at your convenience.

WCFPublish

Once you are done with the Wizard it is going to create one receive port and location + one IIS application.

The app pool for the BizTalk application in IIS has to be a part of Admin group and you will also need to enable directory browsing.

BTIISApplication

WCFWiz_RcvPort

WCFWiz_RcvPort2

4>Once done this is going to create a two way receive location and port. Please go ahead and start that. The solution is ready to be tested.

How To Test:
1>Go to your IIS and take the WCF endpoint. You can use this endpoint in SOAP UI/Stylus.. to post a request and get the response.

2>Using A Windows Client:

WCFClientBasic

Once the project is created right click on references and pick add service reference

WCFClient2

This step will create a service reference for you. Now open the program.cs and make necessary changed to it.

WCFClient4

Run it and you will see the BizTalk process invoked.

InvokedBTAdminConsole

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

D Goins Insperience

Technological outformation for this day and age

[INACTIVE BLOG] Connected Thoughts - Thiago Almeida

Connected systems and the occasional picture

Uri Katsir's Blog

BizTalk , BizTalk RFID and .NET

prashantbiztalkblogs

My BizTalk Experiences

BizTalk Server Tutorial

BizTalk Server Concepts and Common Errors

Extremely Talented Monkeys

A Technical Blog by Ed Jones: Azure, .NET, BizTalk, WCF, and SQL Server

On All Things Web

Discussing web development without limits

Vikas Bhardwaj's Blog

Articles about BizTalk Server and .NET C#

Cloud develop

a blog about (cloud) development... because I'm a nerd

Hooking Stuffs Together

My learning logs from day to day work experience about Integration platform using Microsoft technologies.

Connected Pawns

Mainly BizTalk & Little Chess

jhelatissimo

a blogger in the process.

MS Innovations Blog

Tips, Tricks, and Workarounds for BizTalk and other Microsoft technologies

srirambiztalks

Katradhu Kaialavu,Kalladhadhu Ulagalavu!

Vijay Microsoft Technical

BizTalk, WCF, ESB ToolKit, Windows Azure

Mind Over Messaging

Musings on BizTalk, Azure, WCF, and Enterprise Integration

%d bloggers like this: