Java – definition of jax-ws and jax-rs [closed]

I read somewhere on the Internet that Jax - WS is a soap implementation and Jax - RS is a rest implementation It's true? Is it jax-ws and jax-rs implementation or specification?

Thank you in advance

Solution

They are the specifications that define the API

>JSR 224: Java API for XML based web services (jax-ws) 2.0 http://jcp.org/en/jsr/detail?id=224 >JSR 311: jax-rs: JavaTM API for restful Web Services http://jcp.org/en/jsr/detail?id=311

The APIs they define (interfaces, classes, and exceptions) need to be implemented

The reference implementation (RI) of Jax - WS is included in Java se Jax-ws RI is a metro project( http://metro.java.net/ )Part of the Metro includes enhancements and features supported by Jax - WS RI In the soap world, the web service stack can support optional functions such as WS security Metro supports those, while Jax - WS RI does not

Since Jax - WS is included in Java se, yes, you can generate Jax - WS (soap) web services without a server This is because Java se contains a very basic HTTP server You use the endpoint class to publish services This is more important for testing than anything else The real reason Jax - WS is included in Java se is to make it easier to become a soap service client To really run jax-ws web services, you need a server, such as GlassFish, JBoss, or Weblogic There are some capabilities to add jax-ws implementations to tomcat, but only a real Java EE application server can contain a complete implementation

The reference implementation (RI) of jax-rs is named Jersey( http://jersey.java.net/ ). Jax - RS is not included in Java se. You must download the implementation Once downloaded, it can be used without a server, but again, it is actually more suitable for use in a server One reason to download Jersey is to let the Jersey client API write the client (this is not part of the current jax-rs specification) Like the jax-ws implementation, you can add Jersey to tomcat, or the complete Java EE application server will include the jax-rs implementation

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>