End-to-end paths for web services - RESTful services
You can use Java™ API for RESTful Web Services (JAX-RS) to develop services that follow Representational State Transfer (REST) principles. RESTful services are based on manipulating resources. Resources can contain static or dynamically updated data. By identifying the resources in your application, you can make the service more useful and easier to develop.
子主题
实现 JAX-RS Web 应用程序
您可以使用 Java™ API for RESTful Web Services (JAX-RS) 来开发遵循具象状态传输 (REST) 原理的服务。通过使用 JAX-RS,可以简化 RESTful 服务的开发。Using XML content in JAX-RS application requests and responses
XML is a common media format that RESTful services consume and produce. To deserialize and serialize XML, you can represent requests and responses by Java Architecture for XML Binding (JAXB) annotated objects.Using JSON content in JAX-RS application requests and responses
JavaScript Object Notation (JSON) is a common media format that RESTful services consume and produce. You can use this lightweight data-interchange format that is based on the object-literal notation of JavaScript to exchange data.Using Atom content in JAX-RS application requests and responses
You can use the Atom Syndication Format (Atom) to format web feeds, which communicate news and updates of episodic information about websites. Using Atom content in JAX-RS applications, you can take advantage of web content syndication that provides the same decentralized, dynamic mechanisms for adding new metadata and content supported by RSS, but does so in a way that helps protect core interoperability between implementations.使用定制实体格式
尽管 Java API for RESTful Web Services (JAX-RS) 运行时环境包括多个用于处理 Java 类型的序列化和反序列化的实体提供程序,但它并不支持所有可能的介质类型。您可以开发定制实体提供程序,以便将 Java 类型与消息体绑定。使用内容协商功能在 JAX-RS 应用程序中处理多种内容类型
RESTful 应用程序的其中一个优点是,能够返回资源的不同表示。借助具象状态传输 (REST),客户机和服务器可以交换同一介质类型的资源,也可以使用不同的介质类型。内容协商使客户机和服务器能够对用来交换数据的内容格式达成一致。Using JAX-RS context objects to obtain more information about requests
Java API for RESTful Web Services (JAX-RS) provides different types of context to resource classes and providers. You can use context objects to access request information such as discovering the HTTP headers that are sent as part of the request. Context objects also provide convenience methods for evaluating a request and building an appropriate response.Implementing RESTful views of EJB applications using JAX-RS
If you have enterprise JavaBeans (EJB) applications, you can expose a RESTful interface to the enterprise bean using Java API for RESTful Web Services (JAX-RS). By implementing JAX-RS annotated enterprise beans, you keep the EJB functionality including transaction support, injection of Java EE components and resources, and other EJB session bean capabilities.Using Java contexts and dependency injection with JAX-RS
Java API for RESTful Web Services (JAX-RS) root resources and providers can be used in a Java Contexts and Dependency Injection (JCDI) enabled web archive (WAR). Simply add a valid WEB-INF/beans.xml file to your WAR file and any JAX-RS root resources and providers that are valid JCDI beans can use JCDI functionality.Using handlers to enhance request and response processing
You can implement handlers on the server-side of a Java API for RESTful Web Services (JAX-RS) application to enhance request and response processing.Using multipart content in JAX-RS application requests and responses
Using multipart messages, servers and clients can transmit multiple messages using a single message. Multipart messages are useful when both the client and server need to send multiple requests but want to save the cost of sending and receiving entire HTTP request and responses for each part.Using multipart/form-data content in JAX-RS application requests and responses
A frequently used content type for submitting files through an HTML form is multipart/form-data. The IBM® implementation of Java API for RESTful Web Services (JAX-RS) greatly simplifies the processing of such data by automatically splitting the parts and automatically decoding them. If such automatic processing is not desired, the resource may instead receive the parts in an object so processing of the parts is under the complete control of the resource method.实现安全 JAX-RS 应用程序
Java API for RESTful Web Services (JAX-RS) 的 IBM 运行时环境是由从 Apache Wink 项目派生的 servlet 驱动。在 WebSphere® Application Server 环境内,管理 Web 容器中 servlet 的生命周期。因此,Web 容器所提供的安全服务适用于 WebSphere Application Server 中部署的 REST 资源。Using WADL to generate service documentation
Web Application Description Language (WADL) is a description language for HTTP-based applications. It is currently a World Wide Web Consortium (W3C) Member Submission. WADL can be used by programs to give information about the service in a machine-processable method. For instance, you can use an Extensible Stylesheet Transformation (XSLT) document to transform the WADL documentation by using a custom XSLT and a XSLT processor.在服务器应用程序内使用 Apache Wink REST 客户机以发出请求
可以将 Apache Wink REST 客户机用作可运行以将请求发送到 JAX-RS 应用程序的客户机。将 Apache Wink REST 客户机用作独立瘦客户机
您可以使用 WebSphere Application Server 作为单独瘦客户机提供的 Thin Client for JAX-RS 向 RESTful 服务发送请求,而不必使用服务器应用程序内的 Apache Wink REST 客户机。Thin Client for JAX-RS 是独立 Java SE 6 客户机环境,它在非 WebSphere 环境中运行未受管的 JAX-RS RESTful web Service 客户机应用程序来调用由应用程序服务器托管的 JAX-RS RESTful Web Service。Using JAX-RS 2.0 client as a stand-alone thin client
Instead of using the CXF REST client inside a server application, you can use the Thin Client for JAX-RS that is provided with WebSphere® Application Server as a stand-alone thin client to send requests to your RESTful service. The Thin Client for JAX-RS is a stand-alone Java SE 8 client environment that enables running unmanaged JAX-RS RESTful web services client applications in a non-WebSphere environment to call JAX-RS RESTful web services that are hosted by the application server.
Related information:


http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=welc6tech_wbs_rest_thr
文件名:welc6tech_wbs_rest_thr.html