5 Replies Latest reply on Nov 10, 2011 12:28 PM by mpalvankar

    Camel throwing error on invoking external web service

    mpalvankar

      I have a web service on FUSE, which invokes an external web service (RPC/encoded) through Camel routing.

       

      On invoking the external service, camel encounters and error. I have attached the logs for reference.

       

      Any idea what could be the reason for the error. The request is reaching the external service as I can see the same in the logs.

       

      -


      15:42:11,272 | ERROR | qtp619726-124    | DefaultErrorHandler              | 83 - org.apache.camel.camel-core - 2.8.0.fuse-00-08 | Failed delivery for exchangeId: ID-LTIB775-56116-1320833518424-0-1. Exhausted after delivery attempt: 1 caught: org.apache.camel.component.http.HttpOperationFailedException: HTTP operation failed invoking http://localhost:9090/jasperserver/services/repository with statusCode: 500

       

      org.apache.camel.component.http.HttpOperationFailedException: HTTP operation failed invoking http://localhost:9090/jasperserver/services/repository with statusCode: 500

       

      -


       

      Below is the camel configuration:

       

      1. CXF endpoint for the web serivce on FUSE:

       

       

       

      -


       

      Thanks in advance, this forum is great help. I have been able to start on FUSE very quickly with help of this forum.

        • 1. Re: Camel throwing error on invoking external web service
          ffang

          Hi,

           

          Is your external web service get invoked successfully?

          Could you check the server side log?

           

          I guess the SOAPAction header and soap payload may not what server side expected, thus return 500 status code.

          Could you use a standalone client proxy to make a successful invocation and use some tcpdump tool to dump the onwire message and compare it with the one you used in camel router? This may give you more concrete ideas what's wrong here.

           

          Freeman

          • 2. Re: Camel throwing error on invoking external web service
            mpalvankar

            Thanks Freeman. After setting correct payload for ecternal service, I was able to get response from external service. The external service sends a response with SOAP Attachment.

             

            I have a question here. What dataFormat (PAYLOAD ?) should be mentioned for a response with Attachment.

             

            Any pointers to retrieve an attachment in Processor to which this reposnse is routed.

             

            Thanks again.

            • 3. Re: Camel throwing error on invoking external web service
              mpalvankar

              I have added a Processor to process the response from external service as I need to retrieve the SOAP Attachment.

               

              The Exchange.getIn().getBody is an instance of InputStream -org.apache.camel.converter.stream.CachedOutputStream$WrappedInputStream

               

              Should the data from WrappedInputStream be decoded - before its written to a file.

               

              Is there any other way to retrieve the SOAP Attachment.

              • 4. Re: Camel throwing error on invoking external web service
                njiang

                Hi,

                 

                camel-http component doesn't support the SOAP with Attachment out of box. I'm afraid you need to deal the input stream yourself to extract the attachment.

                 

                Willem

                • 5. Re: Camel throwing error on invoking external web service
                  mpalvankar

                  Thanks for the hint. I was able to retrieve the attachment from the InputStrem.

                   

                  Again thanks a lot for the support and quick responses. It really helps. This forum rocks !!!