Monday February 27, 2006
Java SE 6: Mustang and WS-TMI
Filed under:
javase6
Did you know that Java SE 6,
Mustang, features
a subset of the Java EE Web Services stack ?
I've been tinkering with it, check it: Its
JAX-WS (
JSR 224) with a helping
of
JAXB (
JSR 222) for its data
binding, a good dollop of
WS
Metadata Annotations (
JSR
181), with a sprinkling of a few of its own. Of course you've
already teased a coulis of
XML strained
with
WSDL in a
JAX-RPC boullion
with sun-dried
MTOM/
XOP and hand-crushed
swaRef...
Yawn, W H A T E V E R . Too much information. Way.
Let's try it this way around....you have a neat little program, see ?
It does something cute like adding a couple of numbers, which is
self-evidently your market-dominating online
service in thin disguise:
public class NumberAdderUpperer {
public int addNumbers(int number1, int number2) {
return number1 + number2;
}
}
And naturally, you know you want to tell all your friends to use it, so in
Mustang, they made it so you can do this:
import
javax.jws.WebService;
@WebService
public class NumberAdderUpperer {
public int addEmUp(int
number1, int number2) {
return number1 + number2;
}
}
OK, so now you'd hit deploy in your IDE of course and stick it on the
corporate app server, tell the world, and be done. But for the slightly
more cautious amongst you, let's you and I do it with nothing more than
the Mustang SDK, which has its own mini-Http server just for things
like this:-
import
javax.xml.ws.Endpoint;
...
Endpoint.publish("http://localhost:8080/ws-tmi/adderupperer", new NumberAdderUpperer ());
Oops ! And now your new number adding service is published at:
"http://<hostname>:8080/ws-tmi/adderupperer".
Could it
BE any easier ? (actually, maybe you think it could - let me
know....)
And I did mention that adding numbers is an incognito book ordering or drug prescription authorisation
service, and your
soi-disant friends unmasked: they're your customers or patients, right ?
Ya, two imports and an annotation: that's the kind of simplicity I can go for.
Posted by dannycoward
( Feb 27 2006, 04:56:44 PM PST )
Permalink
Posted by Neal Sanche on February 28, 2006 at 10:15 AM PST #
Posted by Neal Sanche on February 28, 2006 at 02:52 PM PST #
Posted by Mats Henricson on March 29, 2006 at 01:32 PM PST #
Posted by Simon Brocklehurst on April 05, 2006 at 08:08 AM PDT #
Posted by Curt Cox on June 16, 2006 at 10:02 AM PDT #
Posted by Navin on June 20, 2006 at 07:21 AM PDT #
Posted by Danny Coward on June 21, 2006 at 02:42 PM PDT #
Posted by Sathish on June 27, 2006 at 12:16 AM PDT #
Posted by John Catherino on June 29, 2006 at 10:28 AM PDT #
Posted by Ethan Giordano on July 17, 2006 at 07:07 AM PDT #