| By Stanimir Stanev, Rob Bartlett | Article Rating: |
|
| March 3, 2008 06:00 AM EST | Reads: |
14,236 |
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,236
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
- Why IBM’s Server Chief Got Busted
- Is Cloud Computing Like Teenage Sex?
- Industry Experts Discuss the State of Cloud Computing
- Performance Tuning Essentials for Java
- Confessions of a Ulitzer Addict
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- It's the Java vs. C++ Shootout Revisited!
- Cloud Computing Can Revitalize Your Career as Software Developer
- IBM Could "Reinvent" Java: Mills
- Oracle & Cloud Computing: Exclusive Q&A with SVP Richard Sarwal
- A Brief History of Cloud Computing
- Kindle 2 vs Nook
- Cloud CEOs, CTOs & SVPs to Speak at 4th International Cloud Computing Expo
- Why IBM’s Server Chief Got Busted
- Is Cloud Computing Like Teenage Sex?
- Industry Experts Discuss the State of Cloud Computing
- Performance Tuning Essentials for Java
- The Difference Between Web Hosting and Cloud Computing
- Cloud Computing Expo: Exclusive Q&A with Yahoo! SVP Cloud Computing
- Ajax in RichFaces 3.3, JSF 2 and RichFaces 4
- Confessions of a Ulitzer Addict
- My Thoughts on Ulitzer
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- A Cup of AJAX? Nay, Just Regular Java Please
- Java Developer's Journal Exclusive: 2006 "JDJ Editors' Choice" Awards
- The i-Technology Right Stuff
- JavaServer Faces (JSF) vs Struts
- Rich Internet Applications with Adobe Flex 2 and Java
- Java vs C++ "Shootout" Revisited
- Bean-Managed Persistence Using a Proxy List
- Reporting Made Easy with JasperReports and Hibernate
- Creating a Pet Store Application with JavaServer Faces, Spring, and Hibernate
- What's New in Eclipse?
- Why Do 'Cool Kids' Choose Ruby or PHP to Build Websites Instead of Java?
- i-Technology Predictions for 2007: Where's It All Headed?




































