I am trying to convert json data into one for our object types required by a
webservice.

I have not started with the json conversion yet, I just wanted the framework
in place and ensure that the provider class gets called. But it isn't, so
the service just has the parameter 'queryNodeData' set to null.

I can't see what I am doing wrong.

service snippet:
    @GET
    @Path("search")
    @ConsumeMime("application/json")
    @ProduceMime("application/json")
    public NodeDataMessage search(@QueryParam("querynodedata") final
NodeData queryNodeData) {
    }

beans.xml snippet:
        <jaxrs:server id="documentServiceRest" address="/rest">
                <jaxrs:serviceBeans>
                        <ref bean="documentServicesFacadeBean" />
                </jaxrs:serviceBeans>
                <jaxrs:providers>
                        <ref bean="nodeDataProviderBean" />
                </jaxrs:providers>
        </jaxrs:server>
        <bean id="nodeDataProviderBean" class="foo.bar.NodeDataProvider" />

provider class:
  package foo.bar
  import ...
  public class NodeDataProvider implements MessageBodyReader<NodeData> {
    public boolean isReadable(Class<?> type, Type genericType, Annotation[]
annotations) {
        return NodeData.class.isAssignableFrom(type);
    }
    public NodeData readFrom(Class<NodeData> arg0, Type arg1, Annotation[]
arg2, MediaType arg3,
            MultivaluedMap<String, String> arg4, InputStream arg5) throws
IOException,
            WebApplicationException {
        return new NodeData();
    }
}

-- 
View this message in context: 
http://www.nabble.com/MessageBodyReader-implementation-problem-tp20581190p20581190.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to