Advertisement
Guest User

Untitled

a guest
Jul 29th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. CamelContext context =new DefaultCamelContext();
  2.  
  3. HttpComponent httpComponent = new HttpComponent();
  4. context.addComponent("http", httpComponent);
  5.  
  6. ProducerTemplate template = context.createProducerTemplate();
  7.  
  8. GetQuote getQuote = new GetQuote();
  9. getQuote.setSymbol("test123");
  10.  
  11. GetQuoteResponse getQuoteResponse = template.requestBody("http://www.webservicex.net/stockquote.asmx",getQuote, GetQuoteResponse.class);
  12.  
  13. System.out.println(getQuoteResponse);
  14.  
  15. Caused by: org.apache.camel.InvalidPayloadException: No body available of type: java.io.InputStream but has value: net.webservicex.GetQuote@10bdf5e5 of type: net.webservicex.GetQuote on: Message[ID-namal-PC-33172-1469806939935-0-1]. Caused by: No type converter available to convert from type: net.webservicex.GetQuote to the required type: java.io.InputStream with value net.webservicex.GetQuote@10bdf5e5. Exchange[ID-namal-PC-33172-1469806939935-0-2]. Caused by: [org.apache.camel.NoTypeConversionAvailableException - No type converter available to convert from type: net.webservicex.GetQuote to the required type: java.io.InputStream with value net.webservicex.GetQuote@10bdf5e5]
  16.  
  17. Caused by: org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type: net.webservicex.GetQuote to the required type: java.io.InputStream with value net.webservicex.GetQuote@10bdf5e5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement