camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anand_tech <anand29...@gmail.com>
Subject Re: NoTypeConversionAvailableException : When using interface as Apache Camel Proxy
Date Tue, 11 Dec 2012 08:19:14 GMT
Ok i will have a look at your unit tests. For the timing the AppUtil extract
response code is :

public ServiceProviderResponse extractResponse(Exchange exchange){
		ServiceProviderResponse response = new ServiceProviderResponse();
		Message inMessage = exchange.getIn();
		int statusCode = (inMessage.getHeader(Exchange.HTTP_RESPONSE_CODE,
Integer.class));
		response.setStatusCode(statusCode);
		response.setUrl(inMessage.getHeader(Exchange.HTTP_URI, String.class));
		if(statusCode >= Status.BAD_REQUEST.getStatusCode()){
			response.setErrorMessage(inMessage.getBody(String.class));
		}else{
			response.setBody(inMessage.getBody(String.class));
		}
		return response;
	}

The whole working is -  i give a service provider request object in my route
and then extract url, content type , HTTP method etc. from it and then make
a HTTP request to some third party server. After receiving HTTP response
from third party server i convert it into the Service Provider Response
object(as above). 



--
View this message in context: http://camel.465427.n5.nabble.com/NoTypeConversionAvailableException-When-using-interface-as-Apache-Camel-Proxy-tp5723880p5723886.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message