Package org.apache.axiom.soap

Examples of org.apache.axiom.soap.SOAPHeaderBlock.addChild()


    sequenceHeaderBlock.setMustUnderstand(true);
    identifier.toOMElement(sequenceHeaderBlock, omNamespace);
   
    OMElement messageNoElement = sequenceHeaderBlock.getOMFactory().createOMElement(Sandesha2Constants.WSRM_COMMON.MSG_NUMBER,omNamespace);
    messageNoElement.setText(Long.toString(messageNumber));
    sequenceHeaderBlock.addChild(messageNoElement);
   
    if (lastMessage){   
      OMElement lastMessageElement = sequenceHeaderBlock.getOMFactory().createOMElement(Sandesha2Constants.WSRM_COMMON.LAST_MSG, omNamespace);
      sequenceHeaderBlock.addChild(lastMessageElement);
    }
View Full Code Here


    messageNoElement.setText(Long.toString(messageNumber));
    sequenceHeaderBlock.addChild(messageNoElement);
   
    if (lastMessage){   
      OMElement lastMessageElement = sequenceHeaderBlock.getOMFactory().createOMElement(Sandesha2Constants.WSRM_COMMON.LAST_MSG, omNamespace);
      sequenceHeaderBlock.addChild(lastMessageElement);
    }
  }
}
View Full Code Here

                    // add child elements
                    OMNode omNode = null;
                    for (Iterator iter = omHeaderNode.getChildren(); iter.hasNext();) {
                        omNode = (OMNode) iter.next();
                        hb.addChild(omNode);
                    }

                    OMAttribute omatribute = null;
                    // add attributes
                    for (Iterator iter = omHeaderNode.getAllAttributes(); iter.hasNext();) {
View Full Code Here

                if (i == 31) {
                    OMNamespace omNamespace = OMAbstractFactory.getOMFactory().createOMNamespace(
                            "http://sample.com", "myNs");
                    SOAPHeaderBlock header = OMAbstractFactory.getSOAP12Factory()
                            .createSOAPHeaderBlock("VitalHeader", omNamespace);
                    header.addChild(AXIOMUtil.stringToOM("<foo>This is a sample Header</foo>"));
                    serviceClient.addHeader(header);
                }
               
                // Invoking the serive in the TestCase-28 should fail. So handling it differently..
                if (i == 28) {
View Full Code Here

                        soapHeaderBlock.addAttribute("activityID", (String) synapseContext
                                .getProperty("bam_activity_id"), null);
                    }
                    bampropertyElement.addAttribute("name", propName, null);
                    bampropertyElement.addAttribute("value", propValue, null);
                    soapHeaderBlock.addChild(bampropertyElement);
                } else {
                    // If the BAM header already present
                    //    1. If activity id is not present generate a one and include it to BAM header
                    //    2. Set activity id in synapse context for response path
                    OMElement bamHeader = (OMElement)itr.next();
View Full Code Here

                        soapHeaderBlock.addAttribute("activityID", (String) synapseContext
                                .getProperty("bam_activity_id"), null);
                    }
                    bampropertyElement.addAttribute("name", propName, null);
                    bampropertyElement.addAttribute("value", propValue, null);
                    soapHeaderBlock.addChild(bampropertyElement);
                }
            }

            //set the activityID as a synapse property to access by mediation statistics observer properties
            synapseContext.setProperty("activity_property", propName);
View Full Code Here

                                     new QName(ActivityPublisherConstants.BAM_ACTIVITY_ID_HEADER_NAMESPACE_URI,
                                         "BAMEvent"));
            if (!itr.hasNext()) {
                soapHeaderBlock = soapEnvelope.getHeader().addHeaderBlock("BAMEvent", omNs);
                soapHeaderBlock.addAttribute("activityID", actID, null);
                soapHeaderBlock.addChild(bampropertyElement);
            }
        } // If header is null add BAM headers
        if (soapEnvelope.getHeader() == null) {
            if (soapFactory != null) {
                (soapFactory).createSOAPHeader(soapEnvelope);
View Full Code Here

                (soapFactory).createSOAPHeader(soapEnvelope);
            }
            if (soapEnvelope.getHeader() != null) {
                soapHeaderBlock = soapEnvelope.getHeader().addHeaderBlock("BAMEvent", omNs);
                soapHeaderBlock.addAttribute("activityID", actID, null);
                soapHeaderBlock.addChild(bampropertyElement);
            }
        }
    }
   
    private ConcurrentMap<String, String> processInMessageContext(MessageContext inMsgContext) {
View Full Code Here

                        }
                    } else if (soapHeader.get("value", soapHeader) instanceof XML) {
                        OMNamespace omNamespace = OMAbstractFactory.getOMFactory().createOMNamespace(uri, null);
                        SOAPHeaderBlock headerBlock = OMAbstractFactory.getSOAP12Factory().
                                createSOAPHeaderBlock(localName, omNamespace);
                        headerBlock.addChild(((XML) soapHeader.get("value", soapHeader)).getAxiomFromXML());
                        wsRequest.sender.addHeader(headerBlock);
                    } else {
                        throw new CarbonException("Invalid property found for the soap headers");
                    }
                }
View Full Code Here

        headerBlock.setMustUnderstand(mustUnderstand);
        OMNode child = element.getFirstOMChild();
        while (child != null) {
            // Get the next child before addChild will detach the node from its original place.
            OMNode next = child.getNextOMSibling();
            headerBlock.addChild(child);
            child = next;
        }
    }
   
    /**
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.