I'm trying to configure a SearchContextProvider to use FIQL searches in my
CXFRS Restful application in OSGi using blueprint. There is documentation on
how to do this for straight CXF Restul services. For example, one can
register the provider in a <jaxrs:service> and use @Context to inject a
SerchContext., but I'm using <cxf:rsServer>, and a pass-through controller
class:

public class ControllerService {

@GET
@Path("/accounts")
@Produces("application/json")
public String getAccounts(){
 return null;
}

In my blueprint file, i tried this:

<cxf:rsServer id="restServer"
                address="http://${rest.server}:${port}/api";
serviceClass="com.dsi.edispense.cxf.ControllerService"
                loggingFeatureEnabled="true" loggingSizeLimit="200" >
                <cxf:providers>
                        <bean id="searchContextProvider"
class="org.apache.cxf.jaxrs.ext.search.SearchContextProvider"/> 
                </cxf:providers>
        </cxf:rsServer>

<bean id="accountmanager' class=....AccountManager"/>

<camelContext xmlns="http://camel.apache.org/schema/blueprint";>
           <route id="accounts" streamCache="false">
                        <from 
uri="cxfrs:bean:restServer?bindingStyle=SimpleConsumer" />
                        <recipientList>
                                <simple>direct:${header.operationName}</simple>
                        </recipientList>
                </route>

                <route>
                        <from uri="direct:getAccount" />
                        <bean ref="accountmanager" method="getAccounts" />
                </route>

</camelContext>

When I try to inject a ServiceContext into my AccountManager class and use
it, I get a Exception: java.lang.NullPointerException.

Has anyone tried to use FIQL in Camel CXFRS and if so, how can I get it to
work?





--
View this message in context: 
http://camel.465427.n5.nabble.com/How-can-I-configure-and-use-SearchContext-in-CXFRS-tp5737843.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to