Hi, I have some problem while converting BytesMessage to SOAPMessage. I am using SAAJ api available in weblogic i.e. webservices.jar. Initially I am converting SOAPMessage with attachments to BytesMessage and sending that to a JMS queue. After this one message driven bean is getting invoked. The MDB has to get this message and send out the message to web services again. To do this it has to convert the BytesMessage received back to SoapMessage with whatever attachments comes along. But i am unable to convert the BytesMessage to SOAPMessage with attachments. Message Driven Bean ------------------------------------------------------------- public void onMessage(Message msg) { BytesMessage byteMsg = (BytesMessage) msg; SoapTest soapTest=null; ByteArrayInputStream soapInputStream=null; int ln=0; int length=0; byte[] data=null; try { length = byteMsg.readInt(); data = new byte[length]; ln=byteMsg.readBytes(data); soapInputStream = new ByteArrayInputStream(data); soapTest = new SoapTest(); try { soapTest.createSM(soapInputStream); soapTest.createSMessage(); soapInputStream.close(); } catch (Exception e) { System.out.println("e--->" + e); } } catch (JMSException ex) { ex.printStackTrace(); } } soapTest.java ------------------------------------------------------------------ public void createSM(ByteArrayInputStream bais) throws Exception{ MessageFactory factory = MessageFactory.newInstance(); MimeHeaders headers = new MimeHeaders(); headers.addHeader("Content-Id", "update_address"); headers.addHeader("Content-Type", "application/soap+xml"); SOAPMessage message = factory.createMessage(headers,bais); java.util.Iterator iterator = message.getAttachments(); while (iterator.hasNext()) { AttachmentPart attachment = (AttachmentPart)iterator.next(); String id = attachment.getContentId(); String type = attachment.getContentType(); System.out.print("Attachment " + id + " has content type " + type); if (type == "text/plain") { Object content = attachment.getContent(); System.out.println("Attachment " + "contains:\n" + content); } } }