2 Replies Latest reply on Apr 15, 2011 6:57 AM by madhucm

    How to receive Error code from SOAPClient

    madhucm

      Hi,

      I am using org.jboss.soa.esb.actions.soap.SOAPClient in my ESB.

      And i am trying to get the HTTP status code or any exception if SOAPClient fails to send request.

      Here , there may be plenty of reasons for unsuccesful delivary ex :--404,500 etc....

      My requirment is to catch any error or exception (can be soap fault exception) or http status code in ESB so that i do some bussiness logic based on Exception .

      I tried to use below code but unable to receive any exception.

       

       

      <action  class="com.xxx.esb.yyy.A228ProducerInquiry.ProducerInquiryTransactionHandler" name="RequestMapper" process="mapRequestPath">

           <property name="OGNLPath" value="AgentValidation.strXMLIN"/>

          </action>

       

          <action class="org.jboss.soa.esb.actions.soap.SOAPClient" name="FasatPost">

           <property name="responseAsOgnlMap" value="true" />

           <property name="wsdl" value="http://example.org?wsdl"/>

           <property name="SOAPAction" value="mySoapAction"/>

            </action>

       

          <action name="response-mapper"

                                                        class="com.foresters.esb.acord.A228ProducerInquiry.MyResponseAction">

                                              </action>

       

      I can see exception in console and SOAP UI but unable to receive in ESB

       

       

       

      Thanks,

      Madhu CM

        • 1. How to receive Error code from SOAPClient
          madhucm

          Any update on this please.

           

          Thanks,

          Madhu CM

          • 2. How to receive Error code from SOAPClient
            madhucm

            Hi,

            I tried myself and got the solution:

             

            its very simple.

            I just included <property name="exceptionMethod" value="exceptionHandler"/> in "request-mapper" action pipeline.

            There i am able to catch exception.

             

              public void exceptionHandler(Message message, Throwable exception)

               {

                

                  System.out.println("!ERROR!");

                  System.out.println(exception.getMessage());

                     

               }

             

             

            Thanks,

            Madhu CM