Hi there,

I'm using apache-servicemix-4.3.1-fuse-01-09 and I need to consume RESTful 
requests.
Here is the documentation I have used: http://camel.apache.org/cxfrs.html
Here is my configuration file

<beans xmlns="http://www.springframework.org/schema/beans";
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
    xmlns:jaxrs="http://cxf.apache.org/jaxrs";
    xmlns:cxf="http://camel.apache.org/schema/cxf";
    xsi:schemaLocation="
        http://www.springframework.org/schema/beans                 
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
        http://camel.apache.org/schema/spring                       
http://camel.apache.org/schema/spring/camel-spring.xsd
        http://cxf.apache.org/jaxrs                                 
http://cxf.apache.org/schemas/jaxrs.xsd
        http://camel.apache.org/schema/cxf                          
http://camel.apache.org/schema/cxf/camel-cxf.xsd
    ">
    <import resource="classpath:META-INF/cxf/cxf.xml" />
    <import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
    <import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
    <import resource="classpath:META-INF/cxf/osgi/cxf-extension-osgi.xml" />

    <cxf:rsServer id="myServer" address="/" serviceClass="org.test.MyService" />

    <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring";>
        <route>
            <from uri="cxfrs://bean:myServer?exchangePattern=InOut"/>
            <transform>
                <constant>Hello World!!!</constant>
            </transform>
        </route>
    </camelContext>
</beans>

Here is implementation of org.test.MyService

@Path("/service")
@Produces("application/json")
public class MyService {

    @POST
    @Path("/resource")
    public Response add(@QueryParam("res") String res) {
        return Response.ok(new Status("The Resource has been 
processed")).build();
    }

}

I'm wondering why we have to specify the serviceClass attribute and why this 
attribute should point at the real class. I'm asking because the response of 
such a service will always be "Hello World!!!" and implementation of 
MyService.add method does not matter in that case.

Best Regards,
Sergey Zhemzhitsky


_______________________________________________________

The information contained in this message may be privileged and conf idential 
and protected from disclosure. If you are not the original intended recipient, 
you are hereby notified that any review, retransmission, dissemination, or 
other use of, or taking of any action in reliance upon, this information is 
prohibited. If you have received this communication in error, please notify the 
sender immediately by replying to this message and delete it from your 
computer. Thank you for your cooperation. Troika Dialog, Russia. 
If you need assistance please contact our Contact Center  (+7495) 258 0500 or 
go to www.troika.ru/eng/Contacts/system.wbp  

Reply via email to