I have a simple example from my own code here:
Endpoint interface:
---
package com.mycompany.monitoring
@Path("/")
public interface IsAliveServiceEndpoint {
@GET
@Path("isAlive")
@Produces("text/json")
Response isAlive();
}
---
A routebuilder:
---
public class IsAliveServiceRouteBuilder extends RouteBuilder {
@Override
public void configure() throws Exception {
from("cxfrs:bean:isAliveService?bindingStyle=SimpleConsumer")
.to(...do stuff...);
}
}
---
Spring XML:
---
<cxf:rsServer id="isAliveService"
address="http://0.0.0.0:80/status"
serviceClass="com.mycompany.monitoring.IsAliveServiceEndpoint">
</cxf:rsServer>
<bean id="isAliveRouteBuilder"
class="com.mycompany.monitoring.IsAliveServiceRouteBuilder"/>
<camel:camelContext id="myContext">
<camel:routeBuilder ref="isAliveRouteBuilder"/>
</camel:camelContext>
---
Then my service is available on http://localhost/status/isAlive
--
View this message in context:
http://camel.465427.n5.nabble.com/How-to-create-a-camel-spring-webservice-tp5777688p5777766.html
Sent from the Camel - Users mailing list archive at Nabble.com.