How do you use FastInfoset with JAXWS?

一世执手 提交于 2019-12-03 16:32:09

The answer is that the info I had on how to enable it was out of date. The following works on the client end (and presumably server end, but there I've got a Spring configuration enabled that handles it).

           JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
           // This enables FastInfoset as the communication protocol
           factory.getInInterceptors().add( new FIStaxInInterceptor() );
           factory.getOutInterceptors().add( new FIStaxOutInterceptor() );
           ... other code to set username, location, etc. goes here.
           client = (C360Server) factory.create();
jkat
//Enabling FastInfoset by configuring proxy 
// Enabling FI in pessimistic mode
Map<String, Object> ctxt = ((BindingProvider)proxy).getRequestContext();
ctxt.put(JAXWSProperties.CONTENT_NEGOTIATION_PROPERTY, "pessimistic");

OR

Enabling FastInfoset using system property

-Dcom.sun.xml.ws.client.ContentNegotiation=pessimistic
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!