2 Replies Latest reply on Mar 15, 2011 3:43 PM by tjain2011

    my webservice has a return type as a java object..the exchange out is null

    tjain2011

      Hi All

      I have a webservice exposed as a cxfendpoint  and it returns a java object as the return type, the Exchange does not give me the return result from the webservice. Can you tell me how can I get the response from the webservice in my .process().

       

      Thanks

        • 2. Re: my webservice has a return type as a java object..the exchange out is null
          tjain2011

          Thanks for the link. I have tried the same thing but there is no response from the webservice in the exchange...

           

          when i send a request to the route I am not able to see any response from the webservice.

          Is there i am doing something wrong here, is there a different way of doing it.

           

          msgList[1].toString() throws a array index out of bounds excetion.

           

          from("cxf:bean:releasePOEndpoint").handleFault()

          .to("log:incoming?showAll=true")

          .process(new Processor() {

                  public void process(Exchange exchange) throws Exception {

                           logger.info(" cxf:bean:releasePOEndpoint processing exchange in camel");

                           Message in = exchange.getIn();

                          Object[] msgList = exchange.getIn().getBody(Object[].class);

                          ReleasePurchaseOrderRequestType poRequest (ReleasePurchaseOrderRequestType)msgList[0];

                          ReleasePurchaseOrderRequestType poRequest = (ReleasePurchaseOrderRequestType)msgList[0];     

                          logger.info("#####Exchange ouput"+msgList[1].toString());

                   exchange.getOut().setHeader(CxfConstants.OPERATION_NAMESPACE,"http://company.com/pehz/wsdl/purchase_order_service.v1_0");

          exchange.getOut().setHeader(CxfConstants.OPERATION_NAME, "releasePurchaseOrder");

                                                   

                  exchange.getOut().setBody(in.getBody());

          }

          })

          .to("cxf:bean");