You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by jgoggins <jo...@hotmail.com> on 2016/02/01 12:27:20 UTC
Re: Shared Camel Context.
Hi Matt,
Still unable to make progress here. I have a simple SOAP 12 endpoint
defined, and this is working if I send a request.
@Endpoint
public class HeartbeatEndpoint {
@Action("http://myevent/Heartbeat")
@ResponsePayload
public HeartbeatResponse Heartbeat(@RequestPayload Heartbeat
arg) {
HeartbeatResponse response = new
HeartbeatResponse();
response.setHeartbeatResult(5);
System.out.println("HEART BEAT");
return response;
}
}
I setup a route earlier
@Component
public class MyRouter extends SpringRouteBuilder {
@Override
public void configure() throws Exception {
from("spring-ws:uri:http://myevent/Heartbeat?endpointMapping=#endpointMapping")
.to("log:output?showAll=true")
.to("direct-vm:processOrder");
}
I tried all different from patterns but get unresolved endpoint exceptions.
When I post a message to the endpoint I use "http://localhost:8080/myevent"
but this is also not working. If I use
from("spring-ws:http://localhost:8080/myevent"), this will start but when I
post a message, it arrives at the endpoint and is not processed by the camel
endpoint.
This is how I setup the route
@Bean
public CamelContext camelContext() throws Exception {
CamelContext camelContext = new
SpringCamelContext(applicationContext);
camelContext.addRoutes(new CTIPsRouter());
return camelContext;
}
--
View this message in context: http://camel.465427.n5.nabble.com/Shared-Camel-Context-tp5777066p5777096.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Shared Camel Context.
Posted by jgoggins <jo...@hotmail.com>.
It seems this was incorrect;
I removed @Endpoint public class HeartbeatEndpoint.
My router is setup as
@Component
public class MyRouter extends SpringRouteBuilder {
@Override
public void configure() throws Exception {
from("spring-ws:rootqname:{http://myevent/Heartbeat}Heartbeat?endpointMapping=#endpointMapping")
.log("************* output from java ***************");
}
Because this is representing a service already defined, it is SOAP12.
I already have the bean configured when the @Endpoint HeartbeatEndpoint was
working
@Bean(name = "soap12")
public SaajSoapMessageFactory soap12MessageFactory() throws
SOAPException {
MessageFactory messageFactory =
MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
SaajSoapMessageFactory factory = new
SaajSoapMessageFactory(messageFactory);
return factory;
}
but the camel route builder does not see it.
Error is SoapMessageDispatcher : Could not handle mustUnderstand
headers:
{http://www.w3.org/2005/08/addressing}Action,{http://www.w3.org/2005/08/addressing}To.
Returning fault
I attempted to use the MessageFactory as
"?endpointMapping=#endpointMapping&messageFactory=#soap12MessageFactory"
but received the error
llegalArgumentException: Could not find a suitable setter for property:
messageFactory as there isn't a setter method
Using here as a reference
http://camel.apache.org/spring-web-services.html
--
View this message in context: http://camel.465427.n5.nabble.com/Shared-Camel-Context-tp5777066p5777156.html
Sent from the Camel - Users mailing list archive at Nabble.com.