ホット・トピック・セミナー「metro」
TRANSCRIPT
Metro
Metro
Sun Microsystems, Inc.
Metro
Metro
Metro
GlassFish
SOAP
JAX-WS RI + WSIT
JAX-WSAPI
WSIT.NET
Metro
XMLMetro GlassFish Web Services Stack
metro.dev.java.netJAXBJAXPSAAJ
WS-RMSOAP
SMTPSpringJSONHTTP. . .. . .
HTTP Security WS-A ReliabilityTXStub
Message
Message
invoke
01010001...
11001010...
return
Invoker Z Y X W TubeHead
Message
Message
invoke
return
Metro
JAX-WS 2.1 API
Metro
WS
WSDL
POJO
JAXB 2.1 API
XMLJava
XML
XML Schema 1.0
: WSIT
End-to-end
(WS-Trust)
EJB/RMIWS
.NET
(MTOM)
SOAP
(FastInfoset)
HTTP, HTTPS
SMTP
TCP/IP
JMS
In-VM
(JSR-109)
Servlet
Spring
Stateful
HTTP
SOAP 1.1/1.2, WSDL 1.1, WS-Addressing, MTOM,
WS-I Basic Profile 1.x, SOAP Attachment Profile
WS-ReliableMessaging, WS-SecureConversation, WS-Trust, WS-Security, WS-Policy, WS-AtomicTransaction,
Microsoft.NET
plugfest
Metro / .NET
ClientEndpoint
ClientEndpointMetro.NET 3.0
GlassFish v2, v3
JBoss WS 2.1.0
BEA WebLogic 10
TmaxSoft JEUS
OK
JavaSE6 light-weight HTTP server
NetBeans
Ant
Maven
Eclipse
Java -> XML -> Java
HTTPS
WSDL
WS-ReliableMessaging
Metro
FastInfoset
Axis2 1.1.130%-100%
http://weblogs.java.net/blog/kohsuke/archive/2007/02/jaxws_ri_21_ben.html
Java.net
, ML,
Hudson
CDDLGPLv2
SCA
SpringJSON
Metro
Sun
BEA WebLogic Server 10
JBoss WS 2.1.0
IBM JDK6
Salesforce.com APEX8.0 toolkit
Stateful web service
JMX
Jersey
Reference
Metro
metro.dev.java.net
https://forums.java.net/jive/forum.jspa?forumID=46
http://feeds.feedburner.com/MetroBlogs
GlassFish (glassfish.java.net)
The Aquarium (blogs.sun.com/theaquarium)
Jersey
Sun Microsystems, Inc.
REST
JavaREST API
API
REST vs. SOAP SOAP
HTTP(SOAP)
XML
XML
REST vs. SOAP: REST
HTTP
HTTP
HTTP URL
http://d.hatena.ne.jp/kkawa/20081012/p2
:
http://www.amazon.com/gp/-/x/15322209_a/:qri/
/music/artists
/music/artists/{id}
/music/recordings
/music/recordings/{id}
/music/artists/{id}/recordings
/music/genre/{id}
/music/format/{id}
XML JSON
REST
REpresentational State Transfer
URI
HTTP
HTML,XML,JSON,
REST
JavaREST API
API
public class Artist extends HttpServlet { public enum SupportedOutputFormat {XML, JSON};
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String accept = request.getHeader("accept").toLowerCase(); String acceptableTypes[] = accept.split(","); SupportedOutputFormat outputType = null; for (String acceptableType: acceptableTypes) { if (acceptableType.contains("*/*") || acceptableType.contains("application/*") || acceptableType.contains("application/xml")) { outputType=SupportedOutputFormat.XML; break; } else if (acceptableType.contains("application/json")) { outputType=SupportedOutputFormat.JSON; break; } } if (outputType==null) response.sendError(415); String path = request.getPathInfo(); String pathSegments[] = path.split("/"); String artist = pathSegments[1]; if (pathSegments.length < 2 && pathSegments.length > 3) response.sendError(404); else if (pathSegments.length == 3 && pathSegments[2].equals("recordings")) { if (outputType == SupportedOutputFormat.XML) writeRecordingsForArtistAsXml(response, artist); else writeRecordingsForArtistAsJson(response, artist); } else { if (outputType == SupportedOutputFormat.XML) writeArtistAsXml(response, artist); else writeArtistAsJson(response, artist); } } private void writeRecordingsForArtistAsXml(HttpServletResponse response, String artist) { ... }
private void writeRecordingsForArtistAsJson(HttpServletResponse response, String artist) { ... }
private void writeArtistAsXml(HttpServletResponse response, String artist) { ... }
private void writeArtistAsJson(HttpServletResponse response, String artist) { ... }}
JSFHTTPREST
21
API
REST
Java5
HTTP
REST
JavaREST API
API
POJO
@UriTemplate("/artists/{id}")public class Artist {
@ProduceMime("application/xml") @HttpMethod InputStream getXml( @UriParam("id") String artist) { ... }
...}
HttpResponse
HTTP
30x201
Representation
(T)HTTP
T
HTTPT
SPI
XMLJSON
@UriParam, @QueryParam, @MatrixParam, @HeaderParam
EntityT
@HttpMethodpublic Recording updateRecording( @UriParam("id") String id, Recording updatedRecording)
REST
JavaREST API
API
JSR-311
https://jsr311.dev.java.net
Jersey
https://jersey.dev.java.net
Blogs
http://blogs.sun.com/sandoz
http://weblogs.java.net/blog/mhadley/
http://blogs.sun.com/japod
BACK UP SLIDES
Nothing to see beyond here
SOAP Message
MessagePacketMessagesHeadersAttachmentSetPayloadAttachmentFactoriesHeaderListHeader
Java Seminar 2008
Page
Page