You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by chaituu <ya...@gmail.com> on 2015/04/10 03:06:17 UTC

how to execute separate route if external webservice sends success response

<jaxws:endpoint id="employeeServicews"
        implementor="#employeeImpl"
        address="/services/employee">
     </jaxws:endpoint>
    
    <jaxws:client id="externalwebserviceEndpoint"
		address="http://xxxx/xx/xx.asmx" 
		serviceClass="com.xx.xxx.xx.xx.xx.xx.xx" >
		</jaxws:client>	
		
		
		
		
	<camelContext xmlns="http://camel.apache.org/schema/spring" trace="false">
  
    <dataFormats>
        <bindy type="Csv" packages="xxx.xx" id="csvReport"/>
    </dataFormats>
  
     
     <route>
     <from uri="seda:generateCSV"/> 
	 <bean ref="generateCSV" method="generateCSV"/>
	 //pass the list of map objects to csv bindy.
 	 <marshal ref="csvReport" />
	 <to uri="file:main/data/?fileName=test.csv"/>
   </route>
   
    
  </camelContext>
  
  
  @Override
	public String  getEmployee(final String employee)
			
			//hitting external web service endpoint
			response = externalwebserviceEndpoint.getEmployee(employee);
			
			//immediately send the response back to the client saying success if
response != null then in the separate thread in asynchronous mode to
generate csv.
			
			if(response != null)
			{
			  //how  to send the response in a separate thread in asynchronous mode.
			  template.asycBody("seda:generateCSV",response);
			  return "success";
			}
			
			}



--
View this message in context: http://camel.465427.n5.nabble.com/how-to-execute-separate-route-if-external-webservice-sends-success-response-tp5765550.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: how to execute separate route if external webservice sends success response

Posted by Reji Mathews <co...@gmail.com>.
Check out camel producer templates.

Cheers
Reji
On 10 Apr 2015 06:38, "chaituu" <ya...@gmail.com> wrote:

> <jaxws:endpoint id="employeeServicews"
>         implementor="#employeeImpl"
>         address="/services/employee">
>      </jaxws:endpoint>
>
>     <jaxws:client id="externalwebserviceEndpoint"
>                 address="http://xxxx/xx/xx.asmx"
>                 serviceClass="com.xx.xxx.xx.xx.xx.xx.xx" >
>                 </jaxws:client>
>
>
>
>
>         <camelContext xmlns="http://camel.apache.org/schema/spring"
> trace="false">
>
>     <dataFormats>
>         <bindy type="Csv" packages="xxx.xx" id="csvReport"/>
>     </dataFormats>
>
>
>      <route>
>      <from uri="seda:generateCSV"/>
>          <bean ref="generateCSV" method="generateCSV"/>
>          //pass the list of map objects to csv bindy.
>          <marshal ref="csvReport" />
>          <to uri="file:main/data/?fileName=test.csv"/>
>    </route>
>
>
>   </camelContext>
>
>
>   @Override
>         public String  getEmployee(final String employee)
>
>                         //hitting external web service endpoint
>                         response =
> externalwebserviceEndpoint.getEmployee(employee);
>
>                         //immediately send the response back to the client
> saying success if
> response != null then in the separate thread in asynchronous mode to
> generate csv.
>
>                         if(response != null)
>                         {
>                           //how  to send the response in a separate thread
> in asynchronous mode.
>                           template.asycBody("seda:generateCSV",response);
>                           return "success";
>                         }
>
>                         }
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/how-to-execute-separate-route-if-external-webservice-sends-success-response-tp5765550.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>