public void configure() throws Exception {
         
         
        
from("jetty:http://localhost:8080/json?matchOnUriPrefix=true";).process(new
Processor() {
                        
                        @Override
                        public void process(Exchange exchange) throws Exception 
{
                                BeanInvocation beanInvocation = new 
BeanInvocation();
                        
beanInvocation.setMethod(PolicySOAPServices.class.getMethod("findPolicy", 
                        RequestPolicyView.class));
                                RequestPolicyView requestPolicyView = new 
RequestPolicyView();
                                requestPolicyView.setPolicyNo(1079);
                                Object[] args = new Object[] 
{requestPolicyView};
                                beanInvocation.setArgs(args);
                                exchange.getIn().setBody(beanInvocation);
                                
                        }
        
}).to("http://localhost:9060/ws/policyServices/findPolicy?bridgeEndpoint=true";);

 i got the following error :


016-05-16 09:13:19.359 ERROR 19624 --- [qtp302783055-16]
o.a.camel.processor.DefaultErrorHandler  : Failed delivery for (MessageId:
ID-HLLT-PC0A4F7B-50009-1463379165007-0-2 on ExchangeId:
ID-HLLT-PC0A4F7B-50009-1463379165007-0-1). Exhausted after delivery attempt:
1 caught: org.apache.camel.InvalidPayloadException: No body available of
type: java.io.InputStream but has value: BeanInvocation public abstract
com.sapiens.alis.foundation.external.model.entities.dto.policy.ResponsePolicyView
com.sapiens.alis.foundation.soap.interfaces.policy.PolicySOAPServices.findPolicy(com.sapiens.alis.foundation.external.model.entities.dto.policy.RequestPolicyView)
with
[com.sapiens.alis.foundation.external.model.entities.dto.policy.RequestPolicyView@5796fabe]]
of type: org.apache.camel.component.bean.BeanInvocation on:
HttpMessage@0x7927fcde. Caused by: No type converter available to convert
from type: org.apache.camel.component.bean.BeanInvocation to the required
type: java.io.InputStream with value BeanInvocation public abstract
com.sapiens.alis.foundation.external.model.entities.dto.policy.ResponsePolicyView
com.sapiens.alis.foundation.soap.interfaces.policy.PolicySOAPServices.findPolicy(com.sapiens.alis.foundation.external.model.entities.dto.policy.RequestPolicyView)
with
[com.sapiens.alis.foundation.external.model.entities.dto.policy.RequestPolicyView@5796fabe]].
Exchange[ID-HLLT-PC0A4F7B-50009-1463379165007-0-1]. Caused by:
[org.apache.camel.NoTypeConversionAvailableException - No type converter
available to convert from type:
org.apache.camel.component.bean.BeanInvocation to the required type:
java.io.InputStream with value BeanInvocation public abstract
com.sapiens.alis.foundation.external.model.entities.dto.policy.ResponsePolicyView
com.sapiens.alis.foundation.soap.interfaces.policy.PolicySOAPServices.findPolicy(com.sapiens.alis.foundation.external.model.entities.dto.policy.RequestPolicyView)
with
[com.sapiens.alis.foundation.external.model.entities.dto.policy.RequestPolicyView@5796fabe]]]

Message History
---------------------------------------------------------------------------------------------------------------------------------------
RouteId              ProcessorId          Processor                             
                                          
Elapsed (ms)
[route1            ] [route1            ]
[jetty:http://localhost:8080/json?matchOnUriPrefix=true                       
] [       189]
[route1            ] [process1          ] [Processor@0x6f08589b                 
                                        
] [        26]
[route1            ] [to1               ]
[http://localhost:9060/ws/policyServices/findPolicy?bridgeEndpoin] [      
160]

Stacktrace
---------------------------------------------------------------------------------------------------------------------------------------

org.apache.camel.InvalidPayloadException: No body available of type:
java.io.InputStream but has value: BeanInvocation public abstract
com.camel.policy.ResponsePolicyView
com.camel.soap.interfaces.policy.PolicySOAPServices.findPolicy(com.camel.policy.RequestPolicyView)
with [com.camel.policy.RequestPolicyView@5796fabe]] of type:
org.apache.camel.component.bean.BeanInvocation on: HttpMessage@0x7927fcde.
Caused by: No type converter available to convert from type:
org.apache.camel.component.bean.BeanInvocation to the required type:*
java.io.InputStream* with value BeanInvocation public abstract
com.camel.policy.ResponsePolicyView
com.camel.policy.PolicySOAPServices.findPolicy(com.camel.policy.RequestPolicyView)
with [com.camel.policy.RequestPolicyView@5796fabe]].
Exchange[ID-HLLT-PC0A4F7B-50009-1463379165007-0-1]. Caused by:
[org.apache.camel.NoTypeConversionAvailableException - No type converter
available to convert from type:
org.apache.camel.component.bean.BeanInvocation to the required type:
java.io.InputStream with value BeanInvocation public abstract
com.camel.policy.ResponsePolicyView
com.camel.policy.PolicySOAPServices.findPolicy(com.camel.policy.RequestPolicyView)
with [com.camel.policy.RequestPolicyView@5796fabe]]]
        at
org.apache.camel.impl.MessageSupport.getMandatoryBody(MessageSupport.java:107)
~[camel-core-2.17.0.jar:2.17.0]
        at
org.apache.camel.component.http.HttpProducer.createRequestEntity(HttpProducer.java:460)
~[camel-http-2.17.0.jar:2.17.0]
         

why is expected to get java.io.InputStream ?
what i did wrong? 



--
View this message in context: 
http://camel.465427.n5.nabble.com/rest-to-soap-tp5782601.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to