0 Replies Latest reply on Mar 12, 2011 8:25 PM by tjain2011

    Unable to recieve the response Camel- cxfEndPoint

    tjain2011

      I need to know little but more about directing a camel route from one cxfendpoint to another cxf endpoint with a little processing in between.

      I have all the endpoint and cxf route set up but unable to get the response I am not sure if I am testing it properly.

       

      I have a service which takes an input object with three values and gives me back an output object.

       

      Camel Route:

      from("cxf:bean:releasePOEndpoint")

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

                .to("mock:end");

       

      End point:

       

      list = quote.getReceivedExchanges();

               if(list !=null && !list.isEmpty())

               {

               String body1 = list.get(0).getIn().getBody(String.class);

               System.out.println("######Response: "+body1.toString());

               }

               else{

                    System.out.println("No messages received");

               }

               assertMockEndpointsSatisfied();

       

      So this is what i am doing I think I am not all correct in testing the route. can u tell me how to test the end point and how to use the exchange INOUT if at all i need that. How to get the response from the webservice. Because right now it throws an soap fault exception which is defined in my wsdl.

       

      2011-03-11 15:06:39,107 org.apache.cxf.phase.PhaseInterceptorChain  - Interceptor for ReleasePurchaseOrderPortTypeService#releasePurchaseOrder has thrown exception, unwinding now

      org.apache.cxf.binding.soap.SoapFault: Error writing to XMLStreamWriter.

           at org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor$SoapOutEndingInterceptor.handleMessage(SoapOutInterceptor.java:288)

           at org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor$SoapOutEndingInterceptor.handleMessage(SoapOutInterceptor.java:270)

           at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)

           at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:99)

           at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:315)

           at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:113)

           at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:311)

           at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:280)

           at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:72)

           at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:931)

           at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:868)

           at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)

           at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:185)

           at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:114)

           at org.eclipse.jetty.server.Server.handleAsync(Server.java:397)

           at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:601)

           at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1068)

           at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:805)

           at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:218)

           at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:426)

           at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:508)

           at org.eclipse.jetty.io.nio.SelectChannelEndPoint.access$000(SelectChannelEndPoint.java:34)

           at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:40)

           at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:451)

           at java.lang.Thread.run(Thread.java:680)

      Caused by: javax.xml.stream.XMLStreamException: No open start element, when trying to write end element

           at com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1547)

           at com.ctc.wstx.sw.BaseStreamWriter.reportNwfStructure(BaseStreamWriter.java:1576)

           at com.ctc.wstx.sw.BaseNsStreamWriter.doWriteEndTag(BaseNsStreamWriter.java:644)

           at com.ctc.wstx.sw.BaseNsStreamWriter.writeEndElement(BaseNsStreamWriter.java:276)

           at org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor$SoapOutEndingInterceptor.handleMessage(SoapOutInterceptor.java:279)

           ... 24 more

       

      Thank you very much in advance.

      let me know if you need any other piece of information