protected String getOperationName(MessageContext inMsg) throws AxisFault { AxisOperation op = inMsg.getOperationContext().getAxisOperation(); if (op == null) { throw new AxisFault( "Operation is not located, if this is doclit style the SOAP-ACTION should specified via the SOAP Action to use the RawXMLProvider"); } String operationName = null; if ((op.getName() == null) || ((operationName = JavaUtils.xmlNameToJava(op.getName().getLocalPart())) == null)) { throw new AxisFault("invalid operation found"); } return operationName; }
/** * same as OutInAxisOperationClient */ public MessageContext getMessageContext(String messageLabel) throws AxisFault { return oc.getMessageContext(messageLabel); }
public void registerMessageContext(MessageContext msgContext, OperationContext operationContext) throws AxisFault { msgContext.setAxisOperation(this); operationContext.addMessageContext(msgContext); msgContext.setOperationContext(operationContext); if (operationContext.isComplete()) { operationContext.cleanup(); } }
/** * Remove the indicated message context. * Example Usage: The exchange is aborted and we need to * undo the work and free resources. * @param label * @throws AxisFault */ public void removeMessageContext(String label) throws AxisFault { MessageContext mc = getMessageContext(label); if (mc != null) { messageContexts.remove(label); setComplete(false); touch(); } }
/** * @param context The OperationContext */ public void setOperationContext(OperationContext context) { // allow setting the fields to null // useful when extracting the messge context from the object graph operationContext = context; this.setParent(operationContext); if (operationContext != null) { if (serviceContext == null) { setServiceContext(operationContext.getServiceContext()); } else { if (operationContext.getParent() != serviceContext) { throw new AxisError("ServiceContext in OperationContext does not match !"); } } this.setAxisOperation(operationContext.getAxisOperation()); } }
MessageContext responseMessageContext = msgCtx.getOperationContext().getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE); SOAPEnvelope resenvelope = null; if (responseMessageContext!=null) .getProperty(Constants.Configuration.CHARACTER_SET_ENCODING)); responseMessageContext.setProperty(Constants.Configuration.CONTENT_TYPE, requestMsgOpCtx .getProperty(Constants.Configuration.CONTENT_TYPE)); responseMessageContext.setProperty(HTTPConstants.MTOM_RECEIVED_CONTENT_TYPE, requestMsgOpCtx .getProperty(HTTPConstants.MTOM_RECEIVED_CONTENT_TYPE)); if (requestMsgOpCtx.getAxisOperation().getMessageReceiver() == null) {
/** * Creates a new {@see MessageContext} for the response. * * @param msgContext The current, i.e. in flow, message context * @return The new message context for the outgoing flow * @throws AxisFault When an error occurs during the creation of the response * message context */ protected MessageContext createResponseContext(final MessageContext msgContext) throws AxisFault { final MessageContext outMsgContext = MessageContextBuilder.createOutMessageContext(msgContext); outMsgContext.getOperationContext().addMessageContext(outMsgContext); replicateState(msgContext); return outMsgContext; } }
private boolean isAuthenticated(String remoteIP) { OperationContext opCtx = msgContext.getOperationContext(); ServiceContext serviceCtx = opCtx.getServiceContext(); String opName = opCtx.getAxisOperation().getName().getLocalPart(); String serviceName = serviceCtx.getAxisService().getName(); if ((serviceName.equals(ServerConstants.GLOBAL_ADMIN_SERVICE) || serviceName.equals(ClusteringConstants.NODE_MANAGER_SERVICE)) && (opName.equals("login") || opName.equals("logout"))) { return true; } String loginStatus = (String) serviceCtx.getServiceGroupContext(). getPropertyNonReplicable(ServerConstants.ADMIN_LOGGED_IN); boolean authenticated = "true".equals(loginStatus); if(!authenticated){ SimpleDateFormat date = new SimpleDateFormat("'['yyyy-MM-dd HH:mm:ss,SSSS']'"); log.warn("Illegal access attempt at " + date.format(new Date()) + " from IP address " + remoteIP); } return authenticated; }
/** * Removes the pointers to this <code>OperationContext</code> in the * <code>ConfigurationContext</code>'s OperationContextMap so that this * <code>OperationContext</code> will eventually get garbage collected * along with the <code>MessageContext</code>'s it contains. Note that if * the caller wants to make sure its safe to clean up this OperationContext * he should call isComplete() first. However, in cases like IN_OPTIONAL_OUT * and OUT_OPTIONAL_IN, it is possibe this will get called without the MEP * being complete due to the optional nature of the MEP. */ public void cleanup() { ServiceContext serv = getServiceContext(); if (serv != null) { serv.getConfigurationContext().unregisterOperationContext(key); } }
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); } }
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"); }
@Override public void cleanup(MessageContext msgContext) throws AxisFault { log.trace("cleanup() releasing connection"); OperationContext opContext = msgContext.getOperationContext(); if (opContext != null) { InputStream in = (InputStream)opContext.getProperty(MessageContext.TRANSPORT_IN); if (in != null) { try { in.close(); } catch (IOException ex) { // Ignore } } } // guard against multiple calls msgContext.removeProperty(HTTPConstants.HTTP_METHOD); }
OperationContext context = new OperationContext(operation, pollMessage.getMessageContext().getServiceContext()); context.addMessageContext(returnMessage); returnMessage.setServiceContext(null); returnMessage.setOperationContext(context);
public OperationContext createOperationContext(AxisOperation axisOp) { OperationContext ctx = new OperationContext(axisOp, this); configContext.contextCreated(ctx); return ctx; }
private static void setOutMessageContextToBPELMessageContext( final BPELMessageContext bpelMessageContext) throws AxisFault { MessageContext outMessageContext = MessageContextBuilder .createOutMessageContext(bpelMessageContext.getInMessageContext()); outMessageContext.getOperationContext().addMessageContext(outMessageContext); bpelMessageContext.setOutMessageContext(outMessageContext); }
/** * @param context The OperationContext */ public void setOperationContext(OperationContext context) { // allow setting the fields to null // useful when extracting the messge context from the object graph operationContext = context; this.setParent(operationContext); if (operationContext != null) { if (serviceContext == null) { setServiceContext(operationContext.getServiceContext()); } else { if (operationContext.getParent() != serviceContext) { throw new AxisError("ServiceContext in OperationContext does not match !"); } } this.setAxisOperation(operationContext.getAxisOperation()); } }
/** * Removes the pointers to this <code>OperationContext</code> in the * <code>ConfigurationContext</code>'s OperationContextMap so that this * <code>OperationContext</code> will eventually get garbage collected * along with the <code>MessageContext</code>'s it contains. Note that if * the caller wants to make sure its safe to clean up this OperationContext * he should call isComplete() first. However, in cases like IN_OPTIONAL_OUT * and OUT_OPTIONAL_IN, it is possibe this will get called without the MEP * being complete due to the optional nature of the MEP. */ public void cleanup() { ServiceContext serv = getServiceContext(); if (serv != null) { serv.getConfigurationContext().unregisterOperationContext(key); } }
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"); } }
/** * Remove the indicated message context. * Example Usage: The exchange is aborted and we need to * undo the work and free resources. * @param label * @throws AxisFault */ public void removeMessageContext(String label) throws AxisFault { MessageContext mc = getMessageContext(label); if (mc != null) { messageContexts.remove(label); setComplete(false); touch(); } }
@Override public void cleanup(MessageContext msgContext) throws AxisFault { log.trace("cleanup() releasing connection"); OperationContext opContext = msgContext.getOperationContext(); if (opContext != null) { InputStream in = (InputStream)opContext.getProperty(MessageContext.TRANSPORT_IN); if (in != null) { try { in.close(); } catch (IOException ex) { // Ignore } } } // guard against multiple calls msgContext.removeProperty(HTTPConstants.HTTP_METHOD); }