public RMApplicationMessage(SOAPEnvelope originalMessage) { super(); this.soapNamesapce = originalMessage.getNamespace().getNamespaceURI(); this.originalMessage = originalMessage; this.isSequenceHeaderAdded = false; }
public OMNamespace getEnvelopeNamespace() { return getSOAPEnvelope().getNamespace(); }
/** * Answer SOAPVersion for specified envelope * @param envelope SOAP Envelope * @return version of SOAP * @throws MexException */ public static int getSOAPVersion(SOAPEnvelope envelope) throws MexException { String namespaceName = envelope.getNamespace().getNamespaceURI(); if (namespaceName.equals(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI)) return MexConstants.SOAPVersion.v1_1; else if (namespaceName.equals(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI)) return MexConstants.SOAPVersion.v1_2; else throw new MexException("Unknown SOAP version"); }
public static int getSOAPVersion(SOAPEnvelope envelope) throws SandeshaException { String namespaceName = envelope.getNamespace().getNamespaceURI(); if (namespaceName.equals(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI)) return Sandesha2Constants.SOAPVersion.v1_1; else if (namespaceName.equals(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI)) return Sandesha2Constants.SOAPVersion.v1_2; else throw new SandeshaException(SandeshaMessageHelper.getMessage( SandeshaMessageKeys.unknownSoapVersion, namespaceName)); }
private SOAPFactory getSOAPFactory(MessageContext msgContext) throws AxisFault { String nsURI = msgContext.getEnvelope().getNamespace().getNamespaceURI(); if (SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(nsURI)) { return OMAbstractFactory.getSOAP12Factory(); } else if (SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(nsURI)) { return OMAbstractFactory.getSOAP11Factory(); } else { throw new AxisFault(Messages.getMessage("invalidSOAPversion")); } } }
public static void validateSOAPVersion(String soapNamespaceURIFromTransport, SOAPEnvelope envelope) { if (soapNamespaceURIFromTransport != null) { OMNamespace envelopeNamespace = envelope.getNamespace(); String namespaceName = envelopeNamespace.getNamespaceURI(); if (!(soapNamespaceURIFromTransport.equals(namespaceName))) { throw new SOAPProcessingException( "Transport level information does not match with SOAP" + " Message namespace URI", envelopeNamespace.getPrefix() + ":" + SOAPConstants.FAULT_CODE_VERSION_MISMATCH); } } }
public SOAPFactory getSOAPFactory(org.apache.axis2.context.MessageContext msgContext) throws AxisFault { String nsURI = msgContext.getEnvelope().getNamespace().getNamespaceURI(); if (SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(nsURI)) { return OMAbstractFactory.getSOAP12Factory(); } else if (SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(nsURI)) { return OMAbstractFactory.getSOAP11Factory(); } else { throw new AxisFault(Messages.getMessage("invalidSOAPversion")); } } }
public SOAPFactory getSOAPFactory(MessageContext msgContext) throws AxisFault { String nsURI = msgContext.getEnvelope().getNamespace().getNamespaceURI(); if (SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(nsURI)) { return OMAbstractFactory.getSOAP12Factory(); } else if (SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(nsURI)) { return OMAbstractFactory.getSOAP11Factory(); } else { throw new AxisFault(Messages.getMessage("invalidSOAPversion")); } }
public SOAPFactory getSOAPFactory(MessageContext msgContext) throws AxisFault { String nsURI = msgContext.getEnvelope().getNamespace().getNamespaceURI(); if (SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(nsURI)) { return OMAbstractFactory.getSOAP12Factory(); } else if (SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(nsURI)) { return OMAbstractFactory.getSOAP11Factory(); } else { throw new AxisFault(Messages.getMessage("invalidSOAPversion")); } }
private SOAPFactory getSOAPFactory(MessageContext msgContext) throws AxisFault { String nsURI = msgContext.getEnvelope().getNamespace().getNamespaceURI(); if (SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(nsURI)) { return OMAbstractFactory.getSOAP12Factory(); } else if (SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(nsURI)) { return OMAbstractFactory.getSOAP11Factory(); } else { throw new AxisFault(Messages.getMessage("invalidSOAPversion")); } } }
public static void validateSOAPVersion(String soapNamespaceURIFromTransport, SOAPEnvelope envelope) { if (soapNamespaceURIFromTransport != null) { OMNamespace envelopeNamespace = envelope.getNamespace(); String namespaceName = envelopeNamespace.getNamespaceURI(); if (!(soapNamespaceURIFromTransport.equals(namespaceName))) { throw new SOAPProcessingException( "Transport level information does not match with SOAP" + " Message namespace URI", envelopeNamespace.getPrefix() + ":" + SOAPConstants.FAULT_CODE_VERSION_MISMATCH); } } }
public SOAPFactory getSOAPFactory(MessageContext msgContext) throws AxisFault { String nsURI = msgContext.getEnvelope().getNamespace().getNamespaceURI(); if (SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(nsURI)) { return OMAbstractFactory.getSOAP12Factory(); } else if (SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(nsURI)) { return OMAbstractFactory.getSOAP11Factory(); } else { throw new AxisFault(Messages.getMessage("invalidSOAPversion")); } }
private SOAPEnvelope createDefaultSOAPEnvelope(MessageContext inMsgCtx) { String soapNamespace = inMsgCtx.getEnvelope().getNamespace() .getNamespaceURI(); SOAPFactory soapFactory = null; if (soapNamespace.equals(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI)) { soapFactory = OMAbstractFactory.getSOAP11Factory(); } else if (soapNamespace .equals(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI)) { soapFactory = OMAbstractFactory.getSOAP12Factory(); } else { log.error("Unknown SOAP Envelope"); } if (soapFactory != null) { return soapFactory.getDefaultEnvelope(); } return null; }
private SOAPEnvelope createDefaultSOAPEnvelope(MessageContext inMsgCtx) { String soapNamespace = inMsgCtx.getEnvelope().getNamespace() .getNamespaceURI(); SOAPFactory soapFactory = null; if (soapNamespace.equals(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI)) { soapFactory = OMAbstractFactory.getSOAP11Factory(); } else if (soapNamespace .equals(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI)) { soapFactory = OMAbstractFactory.getSOAP12Factory(); } else { log.error("Unknown SOAP Envelope"); } if (soapFactory != null) { return soapFactory.getDefaultEnvelope(); } return null; }
private SOAPEnvelope createDefaultSOAPEnvelope(MessageContext inMsgCtx) { String soapNamespace = inMsgCtx.getEnvelope().getNamespace() .getNamespaceURI(); SOAPFactory soapFactory = null; if (soapNamespace.equals(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI)) { soapFactory = OMAbstractFactory.getSOAP11Factory(); } else if (soapNamespace .equals(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI)) { soapFactory = OMAbstractFactory.getSOAP12Factory(); } else { log.error("Unknown SOAP Envelope"); } if (soapFactory != null) { return soapFactory.getDefaultEnvelope(); } return null; }
public boolean isSOAP11() { return envelope.getNamespace().getNamespaceURI().equals( SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI); }
/** * Get the SOAP factory from the SOAP envelope version * * @param envelope * the SOAP envelope * @return the SOAP factory * @throws MessagingException * if it is not possible to determine the SOAP version * */ public static SOAPFactory getSOAPFactory(SOAPEnvelope envelope) throws MessagingException { final String nsURI = envelope.getNamespace().getNamespaceURI(); if (SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(nsURI)) { return OMAbstractFactory.getSOAP12Factory(); } else if (SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(nsURI)) { return OMAbstractFactory.getSOAP11Factory(); } else { throw new MessagingException(Messages.getMessage("invalidSOAPversion")); } }
/** @param soapVersionURIFromTransport */ protected void identifySOAPVersion(String soapVersionURIFromTransport) { SOAPEnvelope soapEnvelope = getSOAPEnvelope(); if (soapEnvelope == null) { throw new SOAPProcessingException("SOAP Message does not contain an Envelope", SOAPConstants.FAULT_CODE_VERSION_MISMATCH); } OMNamespace envelopeNamespace = soapEnvelope.getNamespace(); if (soapVersionURIFromTransport != null) { String namespaceName = envelopeNamespace.getNamespaceURI(); if (!(soapVersionURIFromTransport.equals(namespaceName))) { throw new SOAPProcessingException( "Transport level information does not match with SOAP" + " Message namespace URI", envelopeNamespace.getPrefix() + ":" + SOAPConstants.FAULT_CODE_VERSION_MISMATCH); } } }
public static TerminateSequenceMessage fromSOAPEnvelpe(SOAPEnvelope soapEnvelope) throws RMMessageBuildingException { String soapNamespace = soapEnvelope.getNamespace().getNamespaceURI(); OMElement terminateSequenceElement = soapEnvelope.getBody().getFirstElement(); String rmNamespace = terminateSequenceElement.getNamespace().getNamespaceURI(); TerminateSequenceMessage terminateSequenceMessage = new TerminateSequenceMessage(rmNamespace,soapNamespace); OMElement identifierElement = terminateSequenceElement.getFirstElement(); terminateSequenceMessage.setIdentifier(identifierElement.getText()); // parsing the sequence acknowledgment if exists. Iterator iter = soapEnvelope.getHeader().getChildrenWithLocalName(MercuryConstants.SEQUENCE_ACKNOWLEDGMENT); if (iter.hasNext()) { SOAPHeaderBlock sequenceAcknowledgmentHeaderBlock = (SOAPHeaderBlock) iter.next(); SequenceAcknowledgment sequenceAcknowledgment = SequenceAcknowledgment.fromSOAPHeaderBlock(sequenceAcknowledgmentHeaderBlock); terminateSequenceMessage.setSequenceAcknowledgment(sequenceAcknowledgment); } return terminateSequenceMessage; }
private Axis2Info getAxis2Info(MessageContext messageContext, String acksToAddress, String addressingNamespaceURI) throws AxisFault { Axis2Info axis2Info = new Axis2Info(); axis2Info.setServiceContext(messageContext.getServiceContext()); axis2Info.setOptions(messageContext.getOptions()); axis2Info.setTransportIn(messageContext.getTransportIn()); TransportOutDescription transportOut = ClientUtils.inferOutTransport( messageContext.getConfigurationContext().getAxisConfiguration(), new EndpointReference(acksToAddress), messageContext); axis2Info.setTransportOut(transportOut); axis2Info.setServerSide(messageContext.isServerSide()); axis2Info.setSoapNamespaceURI(messageContext.getEnvelope().getNamespace().getNamespaceURI()); axis2Info.setAddressingNamespaceURI(addressingNamespaceURI); axis2Info.setProperties(messageContext.getProperties()); return axis2Info; }