Geeks With Blogs

News This is the *old* blog. The new one is at blog.sixeyed.com

Elton Stoneman
This is the *old* blog. The new one is at blog.sixeyed.com

I've finally uploaded my ESBSimpleSamples project to CodePlex here: ESB Simple Samples

It's intended as a quick-start for using the ESB Guidance package, and it has a client library for building strongly-typed service request objects. It has two very simple sample services which return the encoded value of a given character, either in ASCII or Unicode. The services are exposed as Web services and IIS-hosted WCF, and there's a WinForms client which lets you call them directly or via ESB.

Prerequisites

To use the samples you'll need the following up and running:

  • Visual Studio 2005
  • BizTalk 2006 R2
  • ESB Guidance package
  • ESB Guidance sample app ("GlobalBank" – this is only used to save me configuring a dynamic send/receive port)
  • UDDI services

Deployment

Nothing helpful in the project I'm afraid. I stripped out all the test and build artifacts before uploading, but you should only need to:

  • Build & deploy the ESBSimpleSamples solution
  • Create the Web services virtual directory in IIS (import settings from ESBSimpleSamples.Services.Web\Config\IISConfig.xml)
  • Add UDDI settings for the Web services (in ESBSimpleSamples.Services.Web\Config\UDDISettings.xml)
  • Create the WCF virtual directory in IIS (import settings from ESBSimpleSamples.Services.WCF\Config\IISConfig.xml)
  • Add UDDI settings for the WCF services (in ESBSimpleSamples.Services.WCF\Config\UDDISettings.xml)

You'll need to change the paths to the SNK file in the BizTalk project, and to the project outputs in the IISConfig files.

Running

Run the WinForms client and you'll get this form:

You can check all is well with your deployment by calling the various services – with InProcess the client app instantiates service objects locally; Web and WCF call the services directly; ESB calls the Web service via ESB and ESB.WCF calls the WCF service via ESB.

Any problems are likely to be config – if the services don't respond it'll be an IIS issue, and if the ESB calls don't respond it'll be UDDI (assuming your ESB Guidance is working for other calls).

Architecture

On the service side, there's not much to it – the ServiceComponents project has the business logic and the Services.Web and Services.WCF projects wrap access to the ServiceComponents. The BizTalk project holds the Request and Response schemas which are the same for the Web and WCF services – BizTalk owns the contracts.

The WinForms client uses generated code for the Web service and WCF calls (using VS 2005 Extensions for WCF). For the ESB call there are simple DTO entities for Request and Response objects, matching the schemas (note these are handwritten rather than use the clunky output from XSD.exe – they'd be codegened from very plain templates in a real project). The ServiceRequest classes wrap usage of ESB, and expose the typed DTOs so the client is abstracted from the message bus:

    ServiceRequests.GetASCIICode esbASCII = new ServiceRequests.GetASCIICode();

esbASCII.Request.Character = "a";

byte[] code = esbASCII.Response.GetASCIICodeResult;

The interesting stuff is all in the ServiceClient project. There's a generated proxy for the ESB.ItineraryServices.Response Web service; the ResolverConnection and ItineraryBuilder classes make life much easier for building itineraries in code. ESBServiceRequest is the base class for clients to build their typed requests – child classes specify the Request and Response types and only need code to prepare the request, specifying the service steps they want:

public class GetASCIICode : ESBServiceRequest<GetASCIICodeRequest, GetASCIICodeResponse>

{

public override ItineraryRequest PrepareRequest()

{

ItineraryBuilder builder = new ItineraryBuilder();

builder.AddRoutingService("ESBSimpleSamples", "GetASCIICode");

builder.AddRequestResponseService();

 

ItineraryRequest request = new ItineraryRequest();

request.Header = builder.GetItinerary();

request.Body = this.GetRequestBody();

 

return request;

}

}

 
In the samples project, UDDI is the chosen resolver so AddRoutingService builds up a UDDI resolver connection for the specified service. When the Response property is accessed, the base class calls for the request to be prepared, sends it to the broker and caches the response.


The ESBSimpleSamples should make the learning curve for ESB Guidance a bit shallower, and the ServiceClient library is one approach you can take for consumers. With this library most of the code is abstracted and the specifics for services can easily be codegened. From a published service, the schema, Request and Response entities, ServiceRequest class, ServiceRequest unit tests and UDDI settings can all be generated. Even if there are no .Net consumers for a service, being able to generate all this and have unit tests verifying the service response should be useful.

Posted on Monday, May 26, 2008 6:55 PM ESB Guidance , BizTalk 2006 R2 , UDDI , CodePlex Project | Back to top


Comments on this post: ESB Simple Samples on CodePlex

# re: ESB Simple Samples on CodePlex
Requesting Gravatar...
This is great. Thanks for sharing. I am in the middle of implementing a ESB solution for an insurance company. I could use your service client library for my consumers of services. You mentioned about codegening the request/response schemas using plain templates. Do you know any good tool,which could be used to do this.

Thanks
Left by Sujesh on May 30, 2008 11:31 AM

# re: ESB Simple Samples on CodePlex
Requesting Gravatar...
Glad you found it useful. I'm working on the codegen side of things and will put up some posts on it soon, hopefully this weekend. I'm planning to add templates to the CodePlex project which use CodeDom so aren't tied to a specific tool - I'll let you know when they're available.
Left by Elton on May 30, 2008 12:17 PM

# re: ESB Simple Samples on CodePlex
Requesting Gravatar...
Have you implemented ESB on a real project?. My concern is the performance. Since all messages goes through the bus,there will be a performance hit. Have you done any load testing on ESB solution? It would good to know your experiences.
Left by Sujesh on Jun 03, 2008 6:03 AM

# re: ESB Simple Samples on CodePlex
Requesting Gravatar...
We're in the prototype stage at the moment, so haven't got to load testing. Using ESB affects performance of course, but we're aiming to introduce no more than 1 second latency for each itinerary step. This should be achievable, but consumer apps need to be aware that each step adds additional latency, as each results in a separate message going to BizTalk.
Left by Elton on Jun 04, 2008 10:51 AM

# re: ESB Simple Samples on CodePlex
Requesting Gravatar...
It's nice to see others building from the limited solutions supplied with the ESB. We developed a simple BTS solution using Exception Management with WCF and Filesystem adapters.

Please share your development environment for leveraging UDDI solutions. We are trying to do all development in Vista and have run into several issues. Thanks Elton!
Left by Douglas on Jun 07, 2008 7:01 PM

# re: ESB Simple Samples on CodePlex
Requesting Gravatar...
Can you please suggest the steps needed to apply UDDI Settings given in step 3 of "Need to do points" i.e.

Add UDDI settings for the Web services (in ESBSimpleSamples.Services.Web\Config\UDDISettings.xml)

I have everything (ESB Guidance ) in place and need to test if all is running well.... but I am not able to perform this step.

Waiting for your response....
Left by Asif Khan on Jun 11, 2008 2:11 PM

# re: ESB Simple Samples on CodePlex
Requesting Gravatar...
Hi Asif, so far I've been adding the UDDI config manually, so using the Web interface of UDDI Services and entering the settings copied from the XML file. There's an article about UDDI Services here: http://www.developer.com/net/net/article.php/3107951 - which walks you through publishing service providers and services.
Left by Elton on Jun 12, 2008 9:46 AM

# re: ESB Simple Samples on CodePlex
Requesting Gravatar...
Douglas, I don't think UDDI Services comes with any flavour of Vista, it's limited to Windows Server 2003 or 2008 (and BizTalk 2006 R3 is likely to have a native regitsry). There are some open source alternatives you could try (like jUDDI - http://ws.apache.org/juddi/), but no .Net ones I've seen.
Left by Elton on Jun 12, 2008 9:50 AM

# re: ESB Simple Samples on CodePlex
Requesting Gravatar...
Douglas, Click on the link "Coordinate" in the UDDI services. There is an option for data import. You can import using the xml file provided by Elton. I had to make a small change to the xml file to make it working.

I had to change en-gb to en-us and also I had to comment <!--<tModelDetail generic="2.0" operator="uddi-dataexport" xmlns="urn:uddi-org:api_v2" />--> in the file.
Left by Sujesh on Jun 13, 2008 5:47 AM

# re: ESB Simple Samples on CodePlex
Requesting Gravatar...
Hello Elthon,

Your simple sample has been very helpful. It's great that someone has taken de liberty to post topics about ESB and narrowed it down.

I have a question though. What do you mean by this sentence:

"From a published service, the schema, Request and Response entities, ServiceRequest class, ServiceRequest unit tests and UDDI settings can all be generated."

How do you generate this? What are the steps to achieve this?

ps keep up the good work. :)
Left by Quoc Nguyen on Oct 28, 2008 9:56 AM

# re: ESB Simple Samples on CodePlex
Requesting Gravatar...
Hi Quoc,

thanks for your comment - glad you're finding this useful. The ESBSimpleSamples has a WinForms project "ServiceClient.Generator" which you point to the .svc or .asmx of your service, and it will generate a schema, request and response DTOs and a typed ServiceRequest class.

That's on CodePlex now so you can use those, although the codegen scripts use the CodeDom and are brittle. I'm in the process of migrating them to T4 scripts, and also adding scripts to generate the UDDI config and unit tests. These aren't finished yet, but when they are I'll add them to CodePlex too.

Elton.
Left by Elton on Oct 31, 2008 9:22 PM

# re: ESB Simple Samples on CodePlex
Requesting Gravatar...
if ESB perfomrance is important, take a look at latest/greatest open source xml lib called vtd-xml

http://vtd-xml.sf.net
Left by Jzhang on Nov 18, 2009 3:38 PM

# re: ESB Simple Samples on CodePlex
Requesting Gravatar...
you may want to look at vtd-xml, the latest and most advanced xml processing api that is a must have for high perfomrance ESB

vtd-xml
Left by anon on Nov 26, 2009 7:44 PM

# re: ESB Simple Samples on CodePlex
Requesting Gravatar...
Having written articles that require this much work, I commend you for your service to the future bloggers. I’m sure they will appreciate it!Keep up the good works.
Left by firewall analysis on Jun 04, 2010 5:42 AM

# re: ESB Simple Samples on CodePlex
Requesting Gravatar...
I am following your blog regularly and got great information.I really like the tips you have given..Thank you so much for sharing this information. I have bookmarked this page for future use.Keep blogging.
Left by Ferienhaus Bibione on Jun 05, 2010 7:07 AM

# re: ESB Simple Samples on CodePlex
Requesting Gravatar...
I have been searching for this type of posts before. Thanks a lot for sharing.
Left by Ferienwohnung caorle on Jun 09, 2010 8:05 AM

# re: ESB Simple Samples on CodePlex
Requesting Gravatar...
What a Great template!!!!!! it its really informative and innovative keep us posted with new updates. its was really valuable. thanks a lot.
Left by Ferienhaus Jesolo on Jun 09, 2010 8:12 AM

# re: ESB Simple Samples on CodePlex
Requesting Gravatar...
Simple, but effective. Thank you for the example. I too find CodePlex very useful.
Left by Dog Allergies on Oct 08, 2010 11:41 PM

# re: ESB Simple Samples on CodePlex
Requesting Gravatar...
hello sir,i am implementing ESB as my final year engineering project,the basic idea is clear but haven't really understood the concept.could you please clear it or give a site which may have samples regarding esb?
Left by vineet varghes on Nov 24, 2010 1:03 PM

# re: ESB Simple Samples on CodePlex
Requesting Gravatar...
I noticed every point of this article. this is too good. thanks for the helpful submission.
Left by saint petersburg hotels on May 05, 2011 3:29 PM

# re: ESB Simple Samples on CodePlex
Requesting Gravatar...
After adding UDDI in my portfolio, I can do my project easier. You have make a clearer generic architecture for every one.
Left by online paralegal degree on May 12, 2011 8:12 AM

# Welcome to onlinejobsbd
Requesting Gravatar...
Really trusted online income site you can visit this
Left by Guaranteed online income on May 17, 2011 8:50 PM

# re: ESB Simple Samples on CodePlex
Requesting Gravatar...
keep it up!! thanks 4 great information.
Left by Team Builder on May 28, 2011 9:34 AM

# re: ESB Simple Samples on CodePlex
Requesting Gravatar...
thanx for the post makes life easier :-) Indian London escorts
Left by London Escorts on Jun 04, 2011 11:52 PM

# re: ESB Simple Samples on CodePlex
Requesting Gravatar...
Im impressed. I dont think Ive met anyone who knows as much about this subject as you do. Youre truly well informed and very intelligent.
Left by photography portfolio on Jun 29, 2011 6:17 AM

# re: ESB Simple Samples on CodePlex
Requesting Gravatar...
One of the more impressive blogs Ive seen. Thanks so much for keeping the internet classy for a change. Youve got style, class, bravado. I mean it. Please keep it up because without the internet is definitely lacking in intelligence.
Left by cabins in Gatlinburg on Jun 30, 2011 4:11 AM

# re: ESB Simple Samples on CodePlex
Requesting Gravatar...
I am having problems in getting some code after using this ESBSimpleSamples, what could be the problem?
buy silver coins
Left by jullie on Sep 17, 2011 7:03 AM

# re: ESB Simple Samples on CodePlex
Requesting Gravatar...
The code is excellent and helpful for me. Keep it up!
Left by managing agents on Nov 14, 2011 11:01 AM

# re: ESB Simple Samples on CodePlex
Requesting Gravatar...
You made it look so simple. Thanks mate.
Left by tampa injury attorney on Nov 18, 2011 5:43 PM

Your comment:
 (will show your gravatar)


Copyright © Elton Stoneman | Powered by: GeeksWithBlogs.net