public void onMessage(MessageContext arg0) { SOAPBody body = arg0.getEnvelope().getBody(); OMElement echoStringResponseElem = body.getFirstChildWithName(new QName (applicationNamespaceName,echoStringResponse)); if (echoStringResponseElem==null) { System.out.println("Error: SOAPBody does not have a 'echoStringResponse' child"); return; } OMElement echoStringReturnElem = echoStringResponseElem.getFirstChildWithName(new QName (applicationNamespaceName,EchoStringReturn)); if (echoStringReturnElem==null) { System.out.println("Error: 'echoStringResponse' element does not have a 'EchoStringReturn' child"); return; } String resultStr = echoStringReturnElem.getText(); System.out.println("Callback '" + name + "' got result:" + resultStr); } }
public void toSOAPEnvelope(SOAPEnvelope envelope) { SOAPBody body = envelope.getBody(); //detach if already exist. OMElement elem = body.getFirstChildWithName(new QName(namespaceValue, Sandesha2Constants.WSRM_COMMON.TERMINATE_SEQUENCE)); if (elem!=null) elem.detach(); toOMElement(body); }
public void toSOAPEnvelope(SOAPEnvelope envelope) { SOAPBody body = envelope.getBody(); //detach if already exist. OMElement elem = body.getFirstChildWithName(new QName(namespaceValue, Sandesha2Constants.WSRM_COMMON.CLOSE_SEQUENCE_RESPONSE)); if (elem!=null) elem.detach(); toOMElement(body); }
public void toSOAPEnvelope(SOAPEnvelope envelope) { SOAPBody body = envelope.getBody(); //detach if already exist. OMElement elem = body.getFirstChildWithName(new QName(namespaceValue, Sandesha2Constants.WSRM_COMMON.TERMINATE_SEQUENCE_RESPONSE)); if (elem!=null) elem.detach(); toOMElement(body); }
public void toSOAPEnvelope(SOAPEnvelope envelope) { SOAPBody body = envelope.getBody(); //detach if already exist. OMElement elem = body.getFirstChildWithName(new QName(namespaceValue, Sandesha2Constants.WSRM_COMMON.CLOSE_SEQUENCE)); if (elem!=null) elem.detach(); toOMElement(body); }
public void toSOAPEnvelope(SOAPEnvelope envelope) { SOAPBody body = envelope.getBody(); //detach if already exist. OMElement elem = body.getFirstChildWithName(new QName(Sandesha2Constants.SPEC_2007_02.MC_NS_URI, Sandesha2Constants.WSRM_COMMON.MAKE_CONNECTION)); if (elem!=null) elem.detach(); toOMElement(body); }
public void toSOAPEnvelope(SOAPEnvelope envelope) throws AxisFault { SOAPBody body = envelope.getBody(); //detach if already exist. OMElement elem = body.getFirstChildWithName(new QName(rmNamespaceValue, Sandesha2Constants.WSRM_COMMON.CREATE_SEQUENCE)); if (elem!=null) elem.detach(); toOMElement(body); }
public void toSOAPEnvelope(SOAPEnvelope envelope) throws AxisFault { SOAPBody body = envelope.getBody(); //detach if already exist. OMElement elem = body.getFirstChildWithName(new QName(rmNamespaceValue, Sandesha2Constants.WSRM_COMMON.CREATE_SEQUENCE_RESPONSE)); if (elem!=null) elem.detach(); toOMElement(body); }
public InvocationResponse invoke(MessageContext msgContext) { SOAPBody soapBody = msgContext.getEnvelope().getBody(); // // if the operation was a fault, there will always be // a SOAP 1.2 Fault element in the response body // if ((soapBody.getFirstChildWithName(SoapConstants.FAULT_QNAME) != null)) handleFault(msgContext); else handleResponse(msgContext); return InvocationResponse.CONTINUE; } }
/** * Reads the SOAP body of a message and attempts to retreive the session identifier string * with a namesapce * * @param body Body of the SOAP message * @param ns Namespace * @return a String uniquely identifying a session or null */ private static String getSourceSession(SOAPBody body, OMNamespace ns) { OMElement messageNode = body.getFirstChildWithName(new QName(ns.getNamespaceURI(), FIXConstants.FIX_MESSAGE, ns.getPrefix())); return messageNode.getAttributeValue(new QName(ns.getNamespaceURI(), FIXConstants.FIX_MESSAGE_INCOMING_SESSION, ns.getPrefix())); }
private Metadata handleRequest(MessageContext msgContext) throws AxisFault { Metadata metadata = null; SOAPEnvelope envelope = msgContext.getEnvelope(); SOAPBody body = envelope.getBody(); OMElement aReq = body.getFirstChildWithName(new QName( MexConstants.Spec_2004_09.NS_URI, MexConstants.SPEC.GET_METADATA)); List metadata_request_list; if (aReq != null) { mexNamespaceValue = MexConstants.Spec_2004_09.NS_URI; metadata_request_list = determineMetadataTypes(aReq); } else { throw new MexException("Invalid Metadata request"); } metadata = processRequest(metadata_request_list, msgContext, aReq); return metadata; }
/** * Reads the SOAP body of a message and attempts to retreive the application level * sequence number * * @param body Body of the SOAP message * @param ns Namespace * @return application level sequence number or -1 */ private static int getSequenceNumber(SOAPBody body, OMNamespace ns) { OMElement messageNode = body.getFirstChildWithName(new QName(ns.getNamespaceURI(), FIXConstants.FIX_MESSAGE, ns.getPrefix())); String value = messageNode.getAttributeValue(new QName(ns.getNamespaceURI(), FIXConstants.FIX_MESSAGE_COUNTER, ns.getPrefix())); if (value != null) { return Integer.parseInt(value); } else { return -1; } }
/** * Reads the SOAP body of a message and attempts to retreive the session identifier string * * @param msgCtx Axis2 MessageContext * @return a String uniquely identifying a session or null */ public static String getSourceSession(MessageContext msgCtx) { String srcSession; SOAPBody body = msgCtx.getEnvelope().getBody(); OMNamespace ns = getNamespaceOfFIXPayload(body); if (ns == null) { OMElement messageNode = body.getFirstChildWithName(new QName(FIXConstants.FIX_MESSAGE)); srcSession = messageNode.getAttributeValue(new QName( FIXConstants.FIX_MESSAGE_INCOMING_SESSION)); } else { srcSession = getSourceSession(body, ns); } return srcSession; }
@Override public SOAPEnvelope handle(SOAPEnvelope envelope) throws WsnFault { SOAPEnvelope result = null; SOAPBody body = envelope.getBody(); OMElement getCurrentMessageRequestElement = body .getFirstChildWithName(WsnConstants.GET_CURRENT_QNAME); GetCurrentMessage getCurrentMessage = WsnHelper .getCurrentMessageFromOM(getCurrentMessageRequestElement); QName topicPath = getCurrentMessage.getTopicPath(); NotificationMessage currentMessage = this.manager .getCurrentMessage(topicPath); return result; }
/** * Reads the SOAP body of a message and attempts to retreive the application level * sequence number * * @param msgCtx Axis2 MessageContext * @return application level sequence number or -1 */ public static int getSequenceNumber(MessageContext msgCtx) { int seqNum; SOAPBody body = msgCtx.getEnvelope().getBody(); OMNamespace ns = getNamespaceOfFIXPayload(body); if (ns == null) { OMElement messageNode = body.getFirstChildWithName(new QName(FIXConstants.FIX_MESSAGE)); String value = messageNode.getAttributeValue(new QName(FIXConstants.FIX_MESSAGE_COUNTER)); if (value != null) { seqNum = Integer.parseInt(value); } else { seqNum = -1; } } else { seqNum = getSequenceNumber(body, ns); } return seqNum; }
OMElement messageNode = soapBody.getFirstChildWithName(new QName( FIX_MSG)); Iterator<?> messageElements = (Iterator<?>) messageNode
/** * * @param message * @return */ public static Unsubscribe unsubscribeFromSOAPBody(SOAPBody body) { Unsubscribe unsubscribe = null; OMElement unsubElement = body .getFirstChildWithName(WsnConstants.UNSUBSCRIBE_QNAME); if (unsubElement != null) { unsubscribe = new Unsubscribe(); unsubscribe.setContent(unsubElement.getFirstElement()); } return unsubscribe; }
.getFirstChildWithName(new QName(rmNamespaceValue,Sandesha2Constants.WSRM_COMMON.CREATE_SEQUENCE_RESPONSE)); if (createSeqResponsePart == null) throw new OMException(SandeshaMessageHelper.getMessage(
public SOAPEnvelope handle(SOAPEnvelope envelope) throws WsnFault { SOAPEnvelope reply = null; SOAPBody body = envelope.getBody(); try { // build the subscribe object OMElement subscribeElement = body .getFirstChildWithName(WsnConstants.SUBSCRIBE_QNAME); Subscribe subscribe = WsnHelper.subscribeFromOM(subscribeElement); Subscription subscription = new Subscription(); subscription.setProducerEPR(this.manager.getProducerEPR()); subscription.setConsumerEPR(subscribe.getConsumerEPR()); subscription.setFilter(subscribe.getFilter()); this.manager.addSubscription(subscription); reply = buildSubscriptionReply(subscribe); } catch (Exception e) { reply = buildErrorReply(); } return reply; }
OMElement closeSequenceBody = closeSequnceEnvelope.getBody().getFirstChildWithName( new QName(rmNamespaceValue, Sandesha2Constants.WSRM_COMMON.CLOSE_SEQUENCE));