Web Services

In the new WebLogic Server 12c JAVA EE 6 plays an important role so, inevitably, Web Services also have new features and possibilities. Let's look at some of them.

WebLogic Web Services with Java EE 6

As been said before, WebLogic Server 12c fully supports the Java EE 6 specifications, so Web Services are also supporting these since 2009. But of course now, in 12c as well.

For instance, there is enhanced support for EJB 3.1. Support for Web Services in EJB 3.1 is based on the Java API for XML-based Web Services (JAX-WS) 2.1 specification, as well as its predecessor, the Java API for XML-based RPC (JAX-RPC) 1.1. If you want to manipulate the structure of your SOAP message, you can use an API called SAAJ (SOAP with Attachments API for Java). To register your XML, you can use JAXR.

If you want to use some sort of remote protocol which is a bit similar to CORBA or RMI, the JAX-RPC interface is quite useful. Finally, they can be packaged together with an EJB in an EAR file.

WebLogic 12c and Jersey JAX-RS RI Version 1.9

Web Services in 12c now supports Jersey Java API for RESTful Web Services (JAX-RS) according to the JSR-311 specifications. WebLogic won't use shared libraries for this but uses Runtime MBeans for post-deployment manageability. Out of the box, the Jersey bundle is not yet implemented as a shared library in WebLogic, but after building and deploying to WebLogic, it shows up as a shared library; you can see the jersey-bundle#[email protected] library present on the server.

WebLogic 12c and Jersey JAX-RS RI Version 1.9

In the weblogic.xml deployment descriptor, you can see the references for JAX-RS shared-library that will be deployed on the server, which you specified during creating a building.

WebLogic 12c and Jersey JAX-RS RI Version 1.9

RESTful Services with Java (JAX-RS) support is provided through Jersey, which is the reference implementation for JAX-RS. This support was already added in 10.3.4 as part of the JAVA EE 6 specification. REST, other than SOAP, can be consumed by any client, even with Ajax and JavaScript. It is more lightweight because it does not parse XML, and consumes less bandwidth because it doesn't read the header every time.

Support for EclipseLink MOXy (JAXB)

EclipseLink JAXB (MOXy) is now the default JAXB (JSR-222) provider in WebLogic Server 12c. The EclipseLink MOXy component enables you to bind Java classes to XML schemas. For implementing mapping through annotations, MOXy uses JAXB, which also stores the mappings in an XML format. These mappings can be used for handling complex structures of XML code, but you don't have to mirror the XML schema into the JAVA class model anymore. The JAXB data binding process consists of the following tasks:

  • Bind — Binds XML Schema to Java classes, or value classes. Each class provides access to the content via a set of JavaBean-style access methods. Binding is managed by the JAXB schema compiler.
  • Unmarshal — Converts the XML document to Java objects that can be accessed by your Java code. Complex types and attribute declarations are mapped to field properties using class values which uses get and set methods.
  • Marshal — Converts the Java objects back to XML content.

EclipseLink MOXy is one implementation of the standard runtime defined by the JAXB specification. To specify EclipseLink MOXy as your JAXB provider:

  • Add the JAXB APIs and eclipselink.jar on your WebLogic Server's classpath
  • Use a jaxb.properties file (in the same package as your domain classes

However, UDDI v2.0 Registry and UDDIExplorer, as well as WebLogic Web Services 8.1 Application Environment, are removed from WebLogic 12c.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.140.197.136