axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Hänni" <haenn...@gmail.com>
Subject [AXIS2] JAXB Marshaller
Date Tue, 01 Jul 2008 16:17:33 GMT
Hello

I'm using JAXB in one of my handlers. For marschalling I do:

    public InvocationResponse invoke(MessageContext msgCtx) throws AxisFault
{

        SOAPEnvelope env = msgCtx.getEnvelope();

        try {
            // initialize jaxb context and unmarshaller
            JAXBContext context = JAXBContext.newInstance(JAXB_CONTEXT);
            Unmarshaller unmarshaller = context.createUnmarshaller();
            unmarshaller
                    .setEventHandler(new
javax.xml.bind.helpers.DefaultValidationEventHandler());

            // unmarshal the MessageContext
            Object message = unmarshaller.unmarshal(env.getBody()
                    .getFirstElement().getXMLStreamReader());
  ...

This woks perfect, but how can I marshall the Object "message" back to the
MessageContext, to apply the changes I made?

Thanks,
Michael

Mime
View raw message