Elton Stoneman

  Home  |   Contact  |   Syndication    |   Login
  120 Posts | 0 Stories | 3598 Comments | 0 Trackbacks

News

Archives

Post Categories

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.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati
posted on Monday, May 26, 2008 6:55 PM

Feedback

# re: ESB Simple Samples on CodePlex 5/30/2008 11:31 AM Sujesh
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

# re: ESB Simple Samples on CodePlex 5/30/2008 12:17 PM Elton
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.

# re: ESB Simple Samples on CodePlex 6/3/2008 6:03 AM Sujesh
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.

# re: ESB Simple Samples on CodePlex 6/4/2008 10:51 AM Elton
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.

# re: ESB Simple Samples on CodePlex 6/7/2008 7:01 PM Douglas
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!

# re: ESB Simple Samples on CodePlex 6/11/2008 2:11 PM Asif Khan
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....

# re: ESB Simple Samples on CodePlex 6/12/2008 9:46 AM Elton
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.

# re: ESB Simple Samples on CodePlex 6/12/2008 9:50 AM Elton
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.

# re: ESB Simple Samples on CodePlex 6/13/2008 5:47 AM Sujesh
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.

# re: ESB Simple Samples on CodePlex 10/28/2008 9:56 AM Quoc Nguyen
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. :)

# re: ESB Simple Samples on CodePlex 10/31/2008 9:22 PM Elton
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.

# re: ESB Simple Samples on CodePlex 11/18/2009 3:38 PM Jzhang
if ESB perfomrance is important, take a look at latest/greatest open source xml lib called vtd-xml

http://vtd-xml.sf.net

# re: ESB Simple Samples on CodePlex 11/26/2009 7:44 PM anon
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

# re: ESB Simple Samples on CodePlex 6/4/2010 5:42 AM firewall analysis
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.

# re: ESB Simple Samples on CodePlex 6/5/2010 7:07 AM Ferienhaus Bibione
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.

# re: ESB Simple Samples on CodePlex 6/9/2010 8:05 AM Ferienwohnung caorle
I have been searching for this type of posts before. Thanks a lot for sharing.

# re: ESB Simple Samples on CodePlex 6/9/2010 8:12 AM Ferienhaus Jesolo
What a Great template!!!!!! it its really informative and innovative keep us posted with new updates. its was really valuable. thanks a lot.


# re: ESB Simple Samples on CodePlex 10/8/2010 11:41 PM Dog Allergies
Simple, but effective. Thank you for the example. I too find CodePlex very useful.

# re: ESB Simple Samples on CodePlex 11/14/2010 5:36 AM software reviews
I’ll definitely popular your site and arrive back once in awhile. Happy blogging. I normally do not write comments on posts, but your post urged me to commend your writings. Thanks for writing this,

# re: ESB Simple Samples on CodePlex 11/24/2010 1:03 PM vineet varghes
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?

# re: ESB Simple Samples on CodePlex 5/5/2011 3:29 PM saint petersburg hotels
I noticed every point of this article. this is too good. thanks for the helpful submission.

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

# Welcome to onlinejobsbd 5/17/2011 8:50 PM Guaranteed online income
Really trusted online income site you can visit this


# re: ESB Simple Samples on CodePlex 5/28/2011 9:34 AM Team Builder
keep it up!! thanks 4 great information.

# re: ESB Simple Samples on CodePlex 6/4/2011 11:52 PM London Escorts
thanx for the post makes life easier :-) Indian London escorts

# re: ESB Simple Samples on CodePlex 6/29/2011 6:17 AM photography portfolio
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.


# re: ESB Simple Samples on CodePlex 6/30/2011 4:11 AM cabins in Gatlinburg
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.


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


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

# re: ESB Simple Samples on CodePlex 11/18/2011 5:43 PM tampa injury attorney
You made it look so simple. Thanks mate.

Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: