public void awaitResponse() throws InterruptedException, AxisFault { if (log.isDebugEnabled()) { log.debug("Returning thread but keeping socket open -- awaiting response"); } status = RequestResponseTransportStatus.WAITING; msgContext.getOperationContext().setProperty(Constants.RESPONSE_WRITTEN, "SKIP"); }
public void connect(MessageContext messageContext) { // Set the force login String strValue = (String) ConnectorUtils.lookupTemplateParamater(messageContext, SalesforceUtil.SALESFORCE_LOGIN_FORCE); if (strValue != null || "true".equals(strValue)) { // Setting Transport Headers Axis2MessageContext axis2smc = (Axis2MessageContext) messageContext; axis2smc.getAxis2MessageContext().getOperationContext() .setProperty(SalesforceUtil.SALESFORCE_LOGIN_DONE, "false"); } }
public void setProperty(String key, Object value) { if (value == null) { return; } properties.put(key, value); // do not commit response by default in the server process if (SynapseConstants.RESPONSE.equals(key) && getAxis2MessageContext().getOperationContext() != null) { getAxis2MessageContext().getOperationContext().setProperty( org.apache.axis2.Constants.RESPONSE_WRITTEN, "SKIP"); } }
public boolean processOutMessage(RMMsgContext rmMsgCtx, Transaction transaction) { if (log.isDebugEnabled()) log.debug("Enter: CreateSeqMsgProcessor::processOutMessage"); MessageContext msgCtx = rmMsgCtx.getMessageContext(); // adding the SANDESHA_LISTENER SandeshaListener faultCallback = (SandeshaListener) msgCtx.getOptions().getProperty( SandeshaClientConstants.SANDESHA_LISTENER); if (faultCallback != null) { OperationContext operationContext = msgCtx.getOperationContext(); if (operationContext != null) { operationContext.setProperty(SandeshaClientConstants.SANDESHA_LISTENER, faultCallback); } } if (log.isDebugEnabled()) log.debug("Exit: CreateSeqMsgProcessor::processOutMessage " + Boolean.FALSE); return false; }
protected void processResponse(HttpResponse response, MessageContext msgContext) throws IOException { obtainHTTPHeaderInformation(response, msgContext); HttpEntity httpEntity = response.getEntity(); InputStream in = httpEntity.getContent(); if (in == null) { throw new AxisFault(Messages.getMessage("canNotBeNull", "InputStream")); } Header contentEncoding = httpEntity.getContentEncoding(); if (contentEncoding != null) { if (contentEncoding.getValue().equalsIgnoreCase(HTTPConstants.COMPRESSION_GZIP)) { in = new GZIPInputStream(in); // If the content-encoding is identity we can basically ignore // it. } else if (!"identity".equalsIgnoreCase(contentEncoding.getValue())) { throw new AxisFault("HTTP :" + "unsupported content-encoding of '" + contentEncoding.getValue() + "' found"); } } OperationContext opContext = msgContext.getOperationContext(); if (opContext != null) { opContext.setProperty(MessageContext.TRANSPORT_IN, in); } }
public void setProperty(String key, Object value) { if (value == null) { return; } properties.put(key, value); // do not commit response by default in the server process if (SynapseConstants.RESPONSE.equals(key) && getAxis2MessageContext().getOperationContext() != null) { getAxis2MessageContext().getOperationContext().setProperty( org.apache.axis2.Constants.RESPONSE_WRITTEN, "SKIP"); } }
protected void processResponse(HttpMethodBase httpMethod, MessageContext msgContext) throws IOException { obtainHTTPHeaderInformation(httpMethod, msgContext); InputStream in = httpMethod.getResponseBodyAsStream(); if (in == null) { throw new AxisFault(Messages.getMessage("canNotBeNull", "InputStream")); } Header contentEncoding = httpMethod .getResponseHeader(HTTPConstants.HEADER_CONTENT_ENCODING); if (contentEncoding != null) { if (contentEncoding.getValue().equalsIgnoreCase(HTTPConstants.COMPRESSION_GZIP)) { in = new GZIPInputStream(in); // If the content-encoding is identity we can basically ignore // it. } else if (!"identity".equalsIgnoreCase(contentEncoding.getValue())) { throw new AxisFault("HTTP :" + "unsupported content-encoding of '" + contentEncoding.getValue() + "' found"); } } OperationContext opContext = msgContext.getOperationContext(); if (opContext != null) { opContext.setProperty(MessageContext.TRANSPORT_IN, in); } }
/** * Sets the property value in appropriate message context * * @param scope which property needs to set * @param messageContext messageContext used in the mediation * @param documentElement target element which needs to set as property */ public void setProperty(String scope, MessageContext messageContext, Object documentElement) { if (XMLConfigConstants.SCOPE_DEFAULT.equals(scope)) { messageContext.setProperty(property, documentElement); } else if (XMLConfigConstants.SCOPE_AXIS2.equals(scope)) { ((Axis2MessageContext) messageContext).getAxis2MessageContext().setProperty(property, documentElement); } else if (XMLConfigConstants.SCOPE_OPERATION.equals(scope)) { ((Axis2MessageContext) messageContext).getAxis2MessageContext().getOperationContext().setProperty(property, documentElement); } }
public static void triggerAxisFault(MessageContext msgCtx, String faultInfoKey, String faultInfoValue, QName faultCode, QName faultSubcode, String faultReason) throws AxisFault { if (faultInfoKey != null) { Map faultInfoForHeaders = (Map) msgCtx .getProperty(Constants.FAULT_INFORMATION_FOR_HEADERS); if (faultInfoForHeaders == null) { faultInfoForHeaders = new HashMap(); msgCtx.setProperty(Constants.FAULT_INFORMATION_FOR_HEADERS, faultInfoForHeaders); } faultInfoForHeaders.put(faultInfoKey, faultInfoValue); } /* * */ if (!msgCtx.isSOAP11()) { setFaultCodeForSOAP12(msgCtx, faultCode, faultSubcode); } OperationContext opCtx = msgCtx.getOperationContext(); opCtx.setProperty( Constants.Configuration.SEND_STACKTRACE_DETAILS_WITH_FAULTS, Boolean.FALSE); throw new AxisFault(faultReason, faultSubcode); }
private static void triggerAddressingFault(MessageContext messageContext, String faultInformationKey, Object faultInformationValue, String faultcode, String faultSubcode, String faultReason) throws AxisFault { Map<String, Object> faultInformation = (Map<String, Object>)messageContext.getLocalProperty(Constants.FAULT_INFORMATION_FOR_HEADERS); if (faultInformation == null) { faultInformation = new HashMap<String, Object>(); messageContext.setProperty(Constants.FAULT_INFORMATION_FOR_HEADERS, faultInformation); } faultInformation.put(faultInformationKey, faultInformationValue); if (messageContext.isSOAP11()) { faultcode = (faultSubcode != null) ? faultSubcode : faultcode; } else { setFaultCode(messageContext, faultcode, faultSubcode); } OperationContext oc = messageContext.getOperationContext(); if (oc != null) { oc.setProperty(Constants.Configuration.SEND_STACKTRACE_DETAILS_WITH_FAULTS, "false"); } messageContext.setProperty(AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES, Boolean.FALSE); String namespace = (String)messageContext.getProperty(AddressingConstants.WS_ADDRESSING_VERSION); throw new AxisFault(faultReason, new QName(namespace, faultcode, AddressingConstants.WSA_DEFAULT_PREFIX)); }
private static void triggerAddressingFault(MessageContext messageContext, String faultInformationKey, Object faultInformationValue, String faultcode, String faultSubcode, String faultReason) throws AxisFault { Map<String, Object> faultInformation = (Map<String, Object>)messageContext.getLocalProperty(Constants.FAULT_INFORMATION_FOR_HEADERS); if (faultInformation == null) { faultInformation = new HashMap<String, Object>(); messageContext.setProperty(Constants.FAULT_INFORMATION_FOR_HEADERS, faultInformation); } faultInformation.put(faultInformationKey, faultInformationValue); if (messageContext.isSOAP11()) { faultcode = (faultSubcode != null) ? faultSubcode : faultcode; } else { setFaultCode(messageContext, faultcode, faultSubcode); } OperationContext oc = messageContext.getOperationContext(); if (oc != null) { oc.setProperty(Constants.Configuration.SEND_STACKTRACE_DETAILS_WITH_FAULTS, "false"); } messageContext.setProperty(AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES, Boolean.FALSE); String namespace = (String)messageContext.getProperty(AddressingConstants.WS_ADDRESSING_VERSION); throw new AxisFault(faultReason, new QName(namespace, faultcode, AddressingConstants.WSA_DEFAULT_PREFIX)); }
public void acknowledgeMessage(MessageContext msgContext) throws AxisFault { if (log.isDebugEnabled()) { log.debug("Acking one-way request"); } // need to skip the ACK till we get the ACK from the actual service for the out-only MEP if ((AddressingHelper.isReplyRedirected(msgContext) && !msgContext.getReplyTo().hasNoneAddress()) || (msgContext.getOperationContext() != null && WSDL2Constants.MEP_URI_IN_ONLY.equals(msgContext.getOperationContext() .getAxisOperation().getMessageExchangePattern()))) { status = RequestResponseTransportStatus.ACKED; msgContext.getOperationContext().setProperty( Constants.RESPONSE_WRITTEN, Constants.VALUE_FALSE); } }
= ((Axis2MessageContext) synCtx).getAxis2MessageContext().getOperationContext(); if (!continueParent && opCtx != null) { opCtx.setProperty(Constants.RESPONSE_WRITTEN, "SKIP");
context.getOperationContext().setProperty( Constants.DIFFERENT_EPR, Constants.VALUE_TRUE);
context.getOperationContext().setProperty( Constants.DIFFERENT_EPR, Constants.VALUE_TRUE);
((Axis2MessageContext) synCtx).getAxis2MessageContext().getOperationContext().setProperty( org.apache.axis2.Constants.RESPONSE_WRITTEN, "SKIP");
((Axis2MessageContext) synCtx).getAxis2MessageContext().getOperationContext().setProperty( org.apache.axis2.Constants.RESPONSE_WRITTEN, "SKIP");
public boolean mediate(MessageContext messageContext) { SynapseLog synLog = getLog(messageContext); synLog.traceOrDebug("Start : Sampler mediator"); if (synLog.isTraceTraceEnabled()) { synLog.traceTrace("Message : " + messageContext.getEnvelope()); } if (!messageContext.isResponse()) { if (synLog.isTraceOrDebugEnabled()) { synLog.traceOrDebug("Adding the message with message id : " + messageContext.getMessageID() + " into the message queue for sampling"); } messageQueue.add(messageContext); } else { synLog.auditWarn("Encountered a response message which will not be sampled"); } OperationContext opCtx = ((Axis2MessageContext) messageContext).getAxis2MessageContext().getOperationContext(); if (opCtx != null) { opCtx.setProperty(Constants.RESPONSE_WRITTEN, "SKIP"); } synLog.traceOrDebug("End : Sampler mediator"); return false; }
public boolean mediate(MessageContext synCtx) { if (synCtx.getEnvironment().isDebuggerEnabled()) { if (super.divertMediationRoute(synCtx)) { return true; } } SynapseLog synLog = getLog(synCtx); if (synLog.isTraceOrDebugEnabled()) { synLog.traceOrDebug("Start : Respond Mediator"); if (synLog.isTraceTraceEnabled()) { synLog.traceTrace("Message : " + synCtx.getEnvelope()); } } synCtx.setTo(null); synCtx.setResponse(true); Axis2MessageContext axis2smc = (Axis2MessageContext) synCtx; org.apache.axis2.context.MessageContext axis2MessageCtx = axis2smc.getAxis2MessageContext(); axis2MessageCtx.getOperationContext() .setProperty(org.apache.axis2.Constants.RESPONSE_WRITTEN, "SKIP"); Axis2Sender.sendBack(synCtx); if (synLog.isTraceOrDebugEnabled()) { synLog.traceOrDebug("End : Respond Mediator"); } return false; }
public boolean mediate(MessageContext messageContext) { if (messageContext.getEnvironment().isDebuggerEnabled()) { if (super.divertMediationRoute(messageContext)) { return true; } } SynapseLog synLog = getLog(messageContext); synLog.traceOrDebug("Start : Sampler mediator"); if (synLog.isTraceTraceEnabled()) { synLog.traceTrace("Message : " + messageContext.getEnvelope()); } if (!messageContext.isResponse()) { if (synLog.isTraceOrDebugEnabled()) { synLog.traceOrDebug("Adding the message with message id : " + messageContext.getMessageID() + " into the message queue for sampling"); } messageQueue.add(messageContext); } else { synLog.auditWarn("Encountered a response message which will not be sampled"); } OperationContext opCtx = ((Axis2MessageContext) messageContext).getAxis2MessageContext().getOperationContext(); if (opCtx != null) { opCtx.setProperty(Constants.RESPONSE_WRITTEN, "SKIP"); } synLog.traceOrDebug("End : Sampler mediator"); return false; }