1 Reply Latest reply on May 26, 2006 1:46 PM by Julien Martin

    Question about message handlers and their interaction with a

    Julien Martin Expert

      Hello,

      I have a WS client (i.e. a servlet) and a corresponding message handler. I simply want to retrieve IN the client a variable FROM the handler. Please let me know how to do that.

      Here is a snippet from the handler:

      public boolean handleResponse(MessageContext context) {
       try{
       SOAPMessageContext smc = (SOAPMessageContext) context;
      
       SOAPMessage msg = smc.getMessage();
       Iterator it = msg.getAttachments();
      
       while(it.hasNext()){
       AttachmentPart ap = (AttachmentPart) it.next();
       DataHandler dh = ap.getDataHandler();
      
       smc.setProperty("prop", dh);//HERE IS MY PROPERTY/VARIABLE
       }
       } catch(Exception e){
       e.printStackTrace();
       }
      
       return true;
       }
      


      What I want to achieve specifically is retrieving in my servlet an attachment that is available in my handler.

      Any help immensely welcome.

      Julien.