2 Replies Latest reply on Jun 1, 2012 12:12 AM by kvarun_bans

    How to read SOAP attachment from action class in JBOSS ESB

    kvarun_bans

      Hi , I'm new to JBoss ESB product. I hope someone here can help me answer this question.

       

      I have developed one ESB project and have exposed it as web service. I am calling this ESB service using SOAP/http from client. Client sends a SOAP message which contains attachment too.

       

       

      When I am invoking my web service using Client, I am unable to fetch the attachments in action class.

       

       

      Attached SOAPTip.java is a client class where I am preparing the SOAP request and calling ESB service.

      MYAction is action class of ESB module. MyAction is the only action in my ESB Project.

       

       

      Coide fragment of JBOSS-esb.xml

       

       

       

       

      <services>

        <service category="FirstESBSample" description="A template for Chapter8"

         name="FirstESBService">

         <!-- <security moduleName="JBossWS" rolesAllowed="friend"/> -->

         <listeners>

          <jms-listener busidref="FirstESBChannel" name="FirstESBListener" />

          <jms-listener busidref="FirstJMSChannel" is-gateway="true"

           name="FirstJMSListener" />

         </listeners>

         <actions inXsd="BookServiceRequest.xsd" mep="RequestResponse" outXsd="BookServiceResponse.xsd">

          <action class="com.ing.act.MyAction" name="esbaction"/>

         </actions>

        </service>

      </services>

       

       

       

      Any feedback will be highly appreciated.

       

      Thanks,

      Varun

       

       

       

       

       

        • 1. Re: How to read SOAP attachment from action class in JBOSS ESB
          tcunning

          What are you seeing in the Attachments?

          • 2. Re: How to read SOAP attachment from action class in JBOSS ESB
            kvarun_bans

            Hi Tom,

             

            Thanks for your response.

             

            I am attaching a text in the attachment SOAP request. But when calling attachment methods on ESB message in action class, getting following output.

             

            Attachment attachment = message.getAttachment();

             

             

            System.out.println("SOAP Attachment::: "+attachment.getNames().length);

            System.out.println("SOAP Attachment::: "+attachment.getNames());

            System.out.println("SOAP Attachment::: "+attachment.toString());

             

             

             

            +++++++++++++++++Output++++++++++++++++

            09:34:10,022 INFO [STDOUT] SOAP Attachment::: 0

            09:34:10,022 INFO [STDOUT] SOAP Attachment::: [Ljava.lang.String;@13ce24c

            09:34:10,022 INFO [STDOUT] SOAP Attachment::: attachments: [ Named:{}, Unnamed:[] ]

             

             

            Unable to retrieve the attachment. Please suggest.

             

             

            ~Varun