java - How do i use multiple CXF endpoints to call a webservice in Camel? -
i have 2 endpoints:
cxf_first_endpoint="cxf:bean:cxfendpoint?{address=first_address}&serviceclass=com.service.class.first" cxf_second_endpoint="cxf:bean:cxfendpoint?{address=second_address}&serviceclass=com.service.class.second"
how implement 2 separate web service call after defining endpoints. if use both, , consume endpoints using routes, 1 of endpoints override other , able use one. if comment other endpoint, running successfully. need use both. using messagecontentlist both web service response:
messagecontentslist result = (messagecontentslist) exchange.getin().getbody();
thanks, please let me know if need more information
here route-definition:
from("direct:paymentinfo").routeid("paymentinfo") .bean(billingserviceprocessor, "processbillingpaymentrequest") .to(cxf_billingservice_endpoint) .bean(billingserviceprocessor, "processbillingpaymentresponse") .end(); from("direct:holidays").routeid("holidayretrieval") .bean(entityprocessor, "processholidaysrequest") .to(cxf_entityservice_endpoint) .bean(entityprocessor, "processholidaysresponse") .end();
i solved problem. found out both endpoints using same beanid (cxfendpoint) defined in camel-config.xml.
i defined id cxfendpoint1 in camel-config.xml , used endpoint , solved problem. both web-service calls working fine without hassles.
<bean id="cxfendpoint" class="org.apache.camel.component.cxf.cxfendpoint" /> <bean id="cxfendpoint1" class="org.apache.camel.component.cxf.cxfendpoint"/>
and here respective endpoints:
cxf_first_endpoint="cxf:bean:cxfendpoint?{address=first_address}&serviceclass=com.service.class.first" cxf_second_endpoint="cxf:bean:cxfendpoint1?{address=second_address}&serviceclass=com.service.class.second"
thanks,
Comments
Post a Comment