Mytec
Fast Infoset: JAX-RPC API to JAX-WS API migration.
If you migrate a Web service client, written on top of the JAX-RPC API, to the newer JAX-WS API and need to keep it communicate using Fast Infoset – you need to follow easy migration procedure.
Very likely old code enables Fast Infoset using one of the following JAX-RPC API specific methods:
- Setting the System property
java -Dcom.sun.xml.rpc.client.ContentNegotiation=pessimistic ... - Setting Content Negotiation on a Stub
stub = ...; // Obtain reference to stub
stub._setProperty(com.sun.xml.rpc.client.StubPropertyConstants.CONTENT_NEGOTIATION_PROPERTY, "pessimistic"); - Setting Content Negotiation on an instance of Call
call = ...; // Obtain reference to call call.setProperty(com.sun.xml.rpc.client.dii.CallPropertyConstants.CONTENT_NEGOTIATION_PROPERTY, "pessimistic");
For JAX-WS API based Web services, Fast Infoset could be enabled very similar way to JAX-RPC cases (2) and (3), described above. JAX-WS API uses different property name, though supported property values are same: “none”, “optimistic”, “pessimistic”.
After migration to a JAX-WS API, a Web service client will be represented either by Stub or Dispatcher object. However the Fast Infoset enabling procedure is the same for both representations. It's required to set Content Negotiation property on a Web service Stub or Dispatch.
So JAX-WS API specific way to enable Fast Infoset is following:
- Setting Content Negotiation on a Stub or Dispatch
stubOrDispatch = ...; // Obtain reference to Stub or Dispatch ((BindingProvider) stubOrDispatch).getRequestContext().put("com.sun.xml.ws.client.ContentNegotiation", "pessimistic");
Additional links:
[1] How to enable Fast Infoset
[2] Fast Infoset in Java Web Services Developer Pack, Version 1.6
Posted at 01:41PM Mar 26, 2008 by oleksiys in Web Services | Comments[1]
Hi Oleksiys. Could you provide some information on how FastInfoset is available in the Metro and GlassFish AppServer releases?
Also, readers may need to be reminded that JWSDP 1.6 is no longer 'supported', that they need to get FI through Metro and GlassFish.
- eduard/o
Posted by Eduardo Pelegri-Llopart on March 26, 2008 at 07:22 PM CET #