You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "Kessel, Christopher" <ck...@transunion.com> on 2010/05/17 20:15:02 UTC

FastInfoSet configuration client and server?

I'm trying to figure out a few things related to using FastInfoSet:
1) How do I set up our CXF Servlet to use FastInfoSet?
2) How do I set up our SOAP client to use FastInfoSet?
3) Will this work if I also have other SOAP clients that won't be using
FastInfoSet?

In a nutshell, we have server that's exposed to the outside world as
well as used by our internal systems. For example, our batch server will
be calling our main server and could use FastInfoSet since we control
both ends. However, the batch system uses the same interface that's used
by the outside world who probably aren't using FastInfoSet.

Can I use FastInfoSet in this kind of setup? And, if so, can you point
to example configuration/code for server and client? 

For the server, I did find the following page, but I'm not sure where
I'd add the Spring <bean> declaration. Would it a sibling to the
<jaxws:endpoint> declaration that exposes the SOAP endpoint?

https://cwiki.apache.org/confluence/display/CXF20DOC/FeaturesList

Thanks,
Chris

Re: FastInfoSet configuration client and server?

Posted by Daniel Kulp <dk...@apache.org>.
On Monday 17 May 2010 2:15:02 pm Kessel, Christopher wrote:
> I'm trying to figure out a few things related to using FastInfoSet:
> 1) How do I set up our CXF Servlet to use FastInfoSet?
> 2) How do I set up our SOAP client to use FastInfoSet?

In both cases, if you add something like:
<cxf:bus>
      <cxf:features>
       <bean class="org.apache.cxf.feature.FastInfosetFeature"/>
      </cxf:features>
</cxf:endpoint>

then it should enable the FI stuff.     You can also do it more programmatic 
by adding the raw interceptors in the places you want them.   
org.apache.cxf.interceptor.FIStaxInInterceptor
org.apache.cxf.interceptor.FIStaxOutInterceptor


> 3) Will this work if I also have other SOAP clients that won't be using
> FastInfoSet?

By default, yes.    Normally what happens is the first request a client sends 
is not FI, but includes a header saying it would like FI if the server 
supports it.   If the server does, it responds with FI and future requests 
from the client will be in FI.   If not, the client keeps sending normal XML.   
It's kind of a negotiated thing.  

If you want to FORCE the use of FI, you can do:
<bean class="org.apache.cxf.feature.FastInfosetFeature">
    <property  name="force" value="true"/>
</bean>

but I don't normally recommend that.  It's usually better to just allow the 
negotiation to occur.

If this is a java first thing, you can add an annotation like:
@Features(features = "org.apache.cxf.feature.FastInfosetFeature") 
to the interface instead.  Sometimes a little simpler.

Dan


> In a nutshell, we have server that's exposetd to the outside world as
> well as used by our internal systems. For example, our batch server will
> be calling our main server and could use FastInfoSet since we control
> both ends. However, the batch system uses he same interface that's used
> by the outside world who probably aren't using FastInfoSet.
> 
> Can I use FastInfoSet in this kind of setup? And, if so, can you point
> to example configuration/code for server and client?
> 
> For the server, I did find the following page, but I'm not sure where
> I'd add the Spring <bean> declaration. Would it a sibling to the
> <jaxws:endpoint> declaration that exposes the SOAP endpoint?
> 
> https://cwiki.apache.org/confluence/display/CXF20DOC/FeaturesList
> 
> Thanks,
> Chris

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog