0 Replies Latest reply on May 27, 2006 12:24 AM by Julien Martin

    Design question about message handlers

    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 WS 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.