private OMElement getHeader(MessageContext context) { SOAPHeader header = context.getEnvelope().getHeader(); OMElement contextHeader = header.getFirstChildWithName(new QName( "http://schemas.airavata.apache.org/workflow-execution-context", "context-header")); return contextHeader; }
private OMElement getHeader(MessageContext context) { SOAPHeader header = context.getEnvelope().getHeader(); OMElement contextHeader = header.getFirstChildWithName(new QName( "http://airavata.apache.org/schemas/wec/2012/05", "context-header")); return contextHeader; } }
private void extractServiceGroupContextId(MessageContext msgContext) throws AxisFault { SOAPHeader soapHeader = msgContext.getEnvelope().getHeader(); if (soapHeader != null) { OMElement serviceGroupId = soapHeader.getFirstChildWithName(SERVICE_GROUP_QNAME); if (serviceGroupId != null) { msgContext.setServiceGroupContextId(serviceGroupId.getText()); } } }
private void extractServiceGroupContextId(MessageContext msgContext) throws AxisFault { SOAPHeader soapHeader = msgContext.getEnvelope().getHeader(); if (soapHeader != null) { OMElement serviceGroupId = soapHeader.getFirstChildWithName(SERVICE_GROUP_QNAME); if (serviceGroupId != null) { msgContext.setServiceGroupContextId(serviceGroupId.getText()); } } }
void loadOutHeader() throws XdsInternalException { if (serviceClient == null) return; OperationContext oc = serviceClient.getLastOperationContext(); if (oc == null) return; HashMap<String, MessageContext> ocs = oc.getMessageContexts(); MessageContext out = ocs.get("Out"); if (out == null) return; outHeader = Util.deep_copy(out.getEnvelope().getHeader()); }
public void removeSessionID(MessageContext syCtx) { removeSessionID(syCtx.getEnvelope().getHeader(), QNAME_SERVICE_GROUP_ID); } }
public SOAPEnvelope toSOAPEnvelope() throws RMMessageBuildingException { SOAPFactory soapFactory = getSoapFactory(); SOAPEnvelope soapEnvelope = soapFactory.getDefaultEnvelope(); if (this.sequenceAcknowledgment != null){ soapEnvelope.getHeader().addChild(this.sequenceAcknowledgment.toSOAPHeaderBlock()); } soapEnvelope.getHeader().addChild(this.sequence.toSOAPHeaderBlock()); return soapEnvelope; }
public ProcessingContext build(SOAPEnvelope elem) { ProcessingContext context = null; SOAPBody soapBody = elem.getBody(); if (soapBody != null) { context = build(soapBody.getFirstElement()); } else { context = build((OMElement) null); } context.setEnvelope(elem); extractInfoFromHeader(context, elem.getHeader()); return context; }
public ProcessingContext build(SOAPEnvelope elem) { ProcessingContext context = null; SOAPBody soapBody = elem.getBody(); if (soapBody != null) { context = build(soapBody.getFirstElement()); } else { context = build((OMElement) null); } context.setEnvelope(elem); extractInfoFromHeader(context, elem.getHeader()); return context; }
/** * Gives the endpoint based on the service group context ID of the request message. * * @param synCtx Request MessageContext, possibly containing a service group context ID. * @return Endpoint associated with the soap session, if current message is a soap session * message and if current message is not the first message of the session. Returns null, * if an Endpoint could not be found for the session. */ public SessionInformation getSession(MessageContext synCtx) { return SALSessions.getInstance().getSession( extractSessionID(synCtx.getEnvelope().getHeader(), QNAME_SERVICE_GROUP_ID)); }
public SOAPEnvelope toSOAPEnvelope() throws RMMessageBuildingException { SOAPFactory soapFactory = getSoapFactory(); SOAPEnvelope soapEnvelope = soapFactory.getDefaultEnvelope(); soapEnvelope.getHeader().addChild(sequenceAcknowledgment.toSOAPHeaderBlock()); return soapEnvelope; }
public SessionInformation getSession(MessageContext synCtx) { return SALSessions.getInstance().getSession( extractSessionID(synCtx.getEnvelope().getHeader(), CSID_QNAME)); }
public void unbind(MessageContext synCtx) { SALSessions.getInstance().removeSession(extractSessionID(synCtx.getEnvelope().getHeader(), QNAME_SERVICE_GROUP_ID)); }
public void updateSession(MessageContext synCtx) { SALSessions.getInstance().updateSession(synCtx, extractSessionID(synCtx.getEnvelope().getHeader(), CSID_QNAME)); }
private void sendSoapException( SOAPEnvelope soapDoc, SOAPFactory factory, HttpResponseBuffer response, OWSException e, ServletRequest request, Version requestVersion ) throws OMException, ServletException { XMLExceptionSerializer serializer = getExceptionSerializer( requestVersion ); sendSOAPException( soapDoc.getHeader(), factory, response, e, serializer, null, null, request.getServerName(), request.getCharacterEncoding() ); }
public void unbind(MessageContext synCtx) { SALSessions.getInstance().removeSession( extractSessionID(synCtx.getEnvelope().getHeader(), CSID_QNAME)); }
private void sendSoapException( SOAPEnvelope soapDoc, SOAPFactory factory, HttpResponseBuffer response, OWSException e, ServletRequest request, SOAPVersion version ) throws OMException, ServletException { XMLExceptionSerializer serializer = getExceptionSerializer( parseVersion( "1.2.0" ) ); sendSOAPException( soapDoc.getHeader(), factory, response, e, serializer, null, null, request.getServerName(), request.getCharacterEncoding() ); }
@Override public Credentials doSOAP( SOAPEnvelope soapDoc, HttpServletRequest req ) throws SecurityException { OMElement requestHeader = soapDoc.getHeader(); SoapHeaderXMLAdapter soapXMLHeader = new SoapHeaderXMLAdapter(); soapXMLHeader.setRootElement( requestHeader ); SoapHeader soapHeader = soapXMLHeader.parseHeader(); LOG.info( soapHeader.getUsername() + " " + soapHeader.getPassword() ); return new Credentials( soapHeader.getUsername(), soapHeader.getPassword() ); }
private void performTestForCloneEnvelope(SOAPFactory soapFactory, SOAPHeaderBlock header, OMElement childNode) { SOAPEnvelope tempEnvelope = soapFactory.getDefaultEnvelope(); //adding a text value header.setText("my custom header"); //adding an attribute header.addAttribute("name", "value", null); tempEnvelope.getHeader().addChild(header); tempEnvelope.getBody().addChild(childNode); SOAPEnvelope clonedEnvelope= MessageHelper.cloneSOAPEnvelope(tempEnvelope); assertEquals(tempEnvelope.toString(),clonedEnvelope.toString()); } }
public void testHeaderRelativeXPath() throws Exception { MessageContext ctx = TestUtils.getTestContext("<test>" + message + "</test>"); OMFactory fac = ctx.getEnvelope().getOMFactory(); OMNamespace ns = fac.createOMNamespace("http://test", "t"); ctx.getEnvelope().getHeader().addHeaderBlock("test", ns).setText(message); ctx.getEnvelope().getHeader().addHeaderBlock("test2", ns); SynapseXPath xpath = new SynapseXPath("$header/t:test"); xpath.addNamespace(ns); assertEquals(message, xpath.stringValueOf(ctx)); xpath = new SynapseXPath("$header/*"); assertEquals(2, xpath.selectNodes(ctx).size()); }