Package org.objectweb.celtix.bus.ws.rm

Examples of org.objectweb.celtix.bus.ws.rm.RMPropertiesImpl


     *
     * @param message the SOAP message
     * @return the RM properties
     */
    public RMProperties unmarshalRMProperties(SOAPMessage message) {
        RMProperties rmps = new RMPropertiesImpl();
       
        try {
            Collection<SequenceAcknowledgement> acks = new ArrayList<SequenceAcknowledgement>();
            Collection<AckRequestedType> requested = new ArrayList<AckRequestedType>();          
           
            SOAPEnvelope env = message.getSOAPPart().getEnvelope();
            SOAPHeader header = env.getHeader();
           
            if (header != null) {
                Unmarshaller unmarshaller =
                    getJAXBContext().createUnmarshaller();
                Iterator headerElements = header.examineAllHeaderElements();
                while (headerElements.hasNext()) {
                    SOAPHeaderElement headerElement =
                        (SOAPHeaderElement)headerElements.next();
                    Name headerName = headerElement.getElementName();
                    String localName = headerName.getLocalName();
                    if (Names.WSRM_NAMESPACE_NAME.equals(headerName.getURI())) {
                        LOG.log(Level.INFO, "decoding RM header {0}", localName);
                        if (Names.WSRM_SEQUENCE_NAME.equals(localName)) {
                            SequenceType s = decodeProperty(SequenceType.class,
                                                            headerElement,
                                                            unmarshaller);
                           
                            rmps.setSequence(s);
                        } else if (Names.WSRM_SEQUENCE_ACK_NAME.equals(localName)) {
                            SequenceAcknowledgement ack = decodeProperty(SequenceAcknowledgement.class,
                                                            headerElement,
                                                            unmarshaller);
                            acks.add(ack);                           
                        } else if (Names.WSRM_ACK_REQUESTED_NAME.equals(localName)) {
                            AckRequestedType ar = decodeProperty(AckRequestedType.class,
                                                            headerElement,
                                                            unmarshaller);
                            requested.add(ar);
                        }
                    }
                }
                if (acks.size() > 0) {
                    rmps.setAcks(acks);
                }
                if (requested.size() > 0) {
                    rmps.setAcksRequested(requested);
                }
            }
        } catch (SOAPException se) {
            LOG.log(Level.WARNING, "SOAP_HEADER_DECODE_FAILURE_MSG", se);
        } catch (JAXBException je) {
View Full Code Here


                                                                W3CConstants.NU_SCHEMA_XSD);
        msg.getSOAPPart().getEnvelope().addNamespaceDeclaration(W3CConstants.NP_SCHEMA_XSI,
                                                                W3CConstants.NU_SCHEMA_XSI);
        context.setMessage(msg);
       
        RMPropertiesImpl rmps = new RMPropertiesImpl();
        RMContextUtils.storeRMProperties(context, rmps, true);
        return context;
    }
View Full Code Here

TOP

Related Classes of org.objectweb.celtix.bus.ws.rm.RMPropertiesImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.