You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by manish_goyal <ma...@infosys.com> on 2008/11/11 11:42:46 UTC

Unmarshlling SOAP message to JAVA object

Hi,

I have send a JAVA Object to JMS after converting it to the SOAP message.
Using following code:-

MessageFactory mf = MessageFactory.newInstance();
         /*
          *  Create a SOAP message object.*/
         SOAPMessage soapMessage = mf.createMessage();
        
soapMessage.setProperty(javax.xml.soap.SOAPMessage.CHARACTER_SET_ENCODING,
"UTF-8");
         SOAPPart soapPart = soapMessage.getSOAPPart();
         SOAPEnvelope envelope = soapPart.getEnvelope();
        
envelope.setEncodingStyle("http://schemas.xmlsoap.org/soap/encoding/");
         SOAPBody soapBody = (SOAPBody)envelope.getBody();

            JAXBContext jc1 = JAXBContext.newInstance( "com.cvs.eph.test" );
            Marshaller marshaller = jc1.createMarshaller();
            marshaller.setProperty( Marshaller.JAXB_FORMATTED_OUTPUT,
Boolean.TRUE );
            marshaller.marshal( client, System.out );
            marshaller.marshal( client,soapBody);
            soapMessage.saveChanges();

            soapMessage.writeTo(System.out);

            Message m =
MessageTransformer.SOAPMessageIntoJMSMessage(soapMessage, session );

            producer.send(m);


Now in my consumer Java Application which is listening to JMS queue, I need
to convert this SOAP message to JAVA object.

Please give the pointers to convert back to JAVA objcet.

Thanks.

Regards,
Manish
-- 
View this message in context: http://www.nabble.com/Unmarshlling-SOAP-message-to-JAVA-object-tp20437036p20437036.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.