| By Stanimir Stanev, Rob Bartlett | Article Rating: |
|
| March 3, 2008 06:00 AM EST | Reads: |
14,220 |
The .NET Client
In the client, we generate web
service proxies exactly the same as if they were HTTP, only we don't
necessarily have the option to hit a url that generates/serves a wsdl,
so we use a file wsdl. We don't have to do anything special with the
proxies. In this example, ShippingService is the service, and
GetDistance() is its only operation. It accepts a GetDistanceRequest
and returns a GetDistanceResponse. Before we call an operation on our
service, we register our protocol to use our ActiveMqWebRequestCreate
for a custom URI prefix. Once this protocol is registered, it's
available from that point forward within the application domain.
// Create a dummy URI
System.Uri urlRequest = new
System.Uri("activeJms://ftp.momentum.com/activeJmsUri/I/do/not/exist.txt");
// Register it
bool isGood = WebRequest.RegisterPrefix("activeJms",
new ActiveMqQueueWebRequest.ActiveMqQueueWebRequestCreate(
"tcp://localhost:61616", "myQueue", "un", "pw"));
We call our services the same way we would if it were HTTP. The only difference is that the URI uses a different prefix.
ShippingService.ShippingService svc = new ShippingService.ShippingService();
svc.Url = "activeJms://localhost:61616";
ShippingService.GetDistanceRequest req = new ShippingService.GetDistanceRequest();
req.startZipCode = "78728"; req.endZipCode = "50158";
ShippingService.GetDistanceResponse resp = svc.GetDistance(req);
In this specific implementation, each prefix has a fixed address and queue. Fancier implementations could support extra information in the URI query string similar to the Tibco one mentioned in the URL-based JMS transport section.
.NET Consumer Summary
The components above can be
created once, and then leveraged for any number of services. Once the
protocol is registered, we don't have to change the way we work with
services, and for all the talk of SOAP, we didn't have to see any!
There's nothing to prevent us from using both the JMS and HTTP web
service implementations in the same application or integration tests.
Conclusion
We made our service consumers talk
directly to the MOM layer. No extra hubs are involved, so the SOAP
requests reach the middleware as quickly as possible. With appropriate
JMS adapters and knowledge, you can easily implement a consumer in
almost any language. Most important, we kept untouched the generated
stubs and proxies at the consumer and reused the service engine on the
server side. So in addition to the highly scalable and reliable, this
approach is also fast and easy to implement.
Published March 3, 2008 Reads 14,220
Copyright © 2008 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Stanimir Stanev
Stanimir Stanev is a senior consultant at MomentumSI's Enterprise Architecture Solutions practice. He has many years of experience focusing on providing enterprise architecture and strategy expertise to companies looking to migrate to or maximize the advantages of SOA principles.
More Stories By Rob Bartlett
Rob Bartlett is a senior consultant at MomentumSI's Software Development Solutions practice. He has over a decade of experience in technical roles, guiding major corporations in the design, implementation, and integration of business solutions.
- Kindle 2 vs Nook
- Confessions of a Ulitzer Addict
- IBM Hardware Chief, Intel VC Exec Arrested in Insider Trading Scam
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- Ulitzer.com Named Exclusive "New Media" Sponsor of Cloud Computing Conference & Expo
- Infrastructure-as-a-Service Will Mature in 2010: Microsoft's David Chou
- Windows 7 – Microsoft’s First Step to the Cloud
- Cloud Expo and the End of Tech Recession
- Jill Tummler Singer, Deputy CIO of CIA, Keynotes at GovIT Expo
- Reality Check at the Cloud Computing Expo
- Visual Studio 2010 Is Cloud Friendly
- Fired SCO CEO Fires Back
- Kindle 2 vs Nook
- The Difference Between Web Hosting and Cloud Computing
- Ajax in RichFaces 3.3, JSF 2 and RichFaces 4
- Confessions of a Ulitzer Addict
- Wave on Ulitzer: Confessions of a Google Wave Fanboy
- IBM Hardware Chief, Intel VC Exec Arrested in Insider Trading Scam
- Cloud Computing Best Practices
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- Ulitzer.com Named Exclusive "New Media" Sponsor of Cloud Computing Conference & Expo
- Infrastructure-as-a-Service Will Mature in 2010: Microsoft's David Chou
- Eval JavaScript in a Global Context
- Windows 7 – Microsoft’s First Step to the Cloud
- Google Maps and ASP.NET
- Crystal Reports XI & How It Has Changed
- Converting VB6 to VB.NET, Part I
- Creating Controls for.NET Compact Framework in Visual Studio 2005
- Where Are RIA Technologies Headed in 2008?
- How to Write High-Performance C# Code
- AJAX World RIA Conference & Expo Kicks Off in New York City
- Implementing Tab Navigation with ASP.NET 2.0
- i-Technology Photo Exclusive: Bill Gates & Steve Jobs In "Nerds"
- .NET Archives: Getting Reacquainted with the Father of C#
- i-Technology Viewpoint: "SOA Sucks"
- Programmatically Posting Data to ASP .NET Web Applications































