/** * Return the fault messages only if it's not an in-only operation. * For WSDL11 generation, the fault messages must be not present in the operation, * as mentioned in <link>http://www.w3.org/TR/wsdl#_one-way</link>. */ private ArrayList<AxisMessage> extractWSDL11FaultMessages(AxisOperation axisOperation) { String mepURI = axisOperation.getMessageExchangePattern(); if (this.isWSDL11FaultyMessagesValidForMEP(mepURI)) { return axisOperation.getFaultMessages(); } else { return new ArrayList<AxisMessage>(); } }
/** * Return the fault messages only if it's not an in-only operation. * For WSDL11 generation, the fault messages must be not present in the operation, * as mentioned in <link>http://www.w3.org/TR/wsdl#_one-way</link>. */ private ArrayList<AxisMessage> extractWSDL11FaultMessages(AxisOperation axisOperation) { String mepURI = axisOperation.getMessageExchangePattern(); if (this.isWSDL11FaultyMessagesValidForMEP(mepURI)) { return axisOperation.getFaultMessages(); } else { return new ArrayList<AxisMessage>(); } }
/** * @see AxisService2WSDL11#extractWSDL11FaultMessages(AxisOperation) */ private ArrayList<AxisBindingMessage> extractWSDL11FaultMessages( AxisBindingOperation axisBindingOperation) { String mepURI = axisBindingOperation.getAxisOperation().getMessageExchangePattern(); if (this.isWSDL11FaultyMessagesValidForMEP(mepURI)) { return axisBindingOperation.getFaults(); } else { return new ArrayList<AxisBindingMessage>(); } }
/** * Should the transport sender wait for a synchronous response to be received? * @param msgCtx the outgoing message context * @return true if a sync response is expected */ protected boolean waitForSynchronousResponse(MessageContext msgCtx) { return msgCtx.getOperationContext() != null && WSDL2Constants.MEP_URI_OUT_IN.equals( msgCtx.getOperationContext().getAxisOperation().getMessageExchangePattern()); }
private void setDefaultMessageReceivers() { Iterator operations = service.getPublishedOperations().iterator(); while (operations.hasNext()) { AxisOperation operation = (AxisOperation) operations.next(); if (operation.getMessageReceiver() == null) { MessageReceiver messageReceiver = loadDefaultMessageReceiver( operation.getMessageExchangePattern(), service); if (messageReceiver == null && // we assume that if the MEP is ROBUST_IN_ONLY then the in-out // MR can handle that WSDL2Constants.MEP_URI_ROBUST_IN_ONLY.equals(operation .getMessageExchangePattern())) { messageReceiver = loadDefaultMessageReceiver( WSDL2Constants.MEP_URI_IN_OUT, service); } operation.setMessageReceiver(messageReceiver); } } }
/** * Should the transport sender wait for a synchronous response to be received? * @param msgCtx the outgoing message context * @return true if a sync response is expected */ protected boolean waitForSynchronousResponse(MessageContext msgCtx) { return msgCtx.getOperationContext() != null && WSDL2Constants.MEP_URI_OUT_IN.equals( msgCtx.getOperationContext().getAxisOperation().getMessageExchangePattern()); }
private boolean isOutOnly(MessageContext messageIn, org.apache.axis2.context.MessageContext axis2Ctx) { return "true".equals(messageIn.getProperty(SynapseConstants.OUT_ONLY)) || axis2Ctx.getOperationContext() != null && WSDL2Constants.MEP_URI_IN_ONLY.equals( axis2Ctx.getOperationContext().getAxisOperation().getMessageExchangePattern()); }
/** * @see AxisService2WSDL11#extractWSDL11FaultMessages(AxisOperation) */ private ArrayList<AxisBindingMessage> extractWSDL11FaultMessages( AxisBindingOperation axisBindingOperation) { String mepURI = axisBindingOperation.getAxisOperation().getMessageExchangePattern(); if (this.isWSDL11FaultyMessagesValidForMEP(mepURI)) { return axisBindingOperation.getFaults(); } else { return new ArrayList<AxisBindingMessage>(); } }
private void setDefaultMessageReceivers() { Iterator operations = service.getPublishedOperations().iterator(); while (operations.hasNext()) { AxisOperation operation = (AxisOperation) operations.next(); if (operation.getMessageReceiver() == null) { MessageReceiver messageReceiver = loadDefaultMessageReceiver( operation.getMessageExchangePattern(), service); if (messageReceiver == null && // we assume that if the MEP is ROBUST_IN_ONLY then the in-out // MR can handle that WSDL2Constants.MEP_URI_ROBUST_IN_ONLY.equals(operation .getMessageExchangePattern())) { messageReceiver = loadDefaultMessageReceiver( WSDL2Constants.MEP_URI_IN_OUT, service); } operation.setMessageReceiver(messageReceiver); } } }
private boolean isOutOnly(MessageContext messageIn, org.apache.axis2.context.MessageContext axis2Ctx) { return "true".equals(messageIn.getProperty(SynapseConstants.OUT_ONLY)) || axis2Ctx.getOperationContext() != null && WSDL2Constants.MEP_URI_IN_ONLY.equals(axis2Ctx.getOperationContext(). getAxisOperation().getMessageExchangePattern()); }
public void setMessageReceivers(AxisService service) { Iterator<AxisOperation> iterator = service.getOperations(); while (iterator.hasNext()) { AxisOperation operation = iterator.next(); String MEP = operation.getMessageExchangePattern(); if (MEP != null) { try { if (WSDL2Constants.MEP_URI_IN_ONLY.equals(MEP)) { Class<?> inOnlyMessageReceiver = Loader.loadClass( "org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"); MessageReceiver messageReceiver = (MessageReceiver) inOnlyMessageReceiver.newInstance(); operation.setMessageReceiver(messageReceiver); } else { Class<?> inoutMessageReceiver = Loader.loadClass( "org.apache.axis2.rpc.receivers.RPCMessageReceiver"); MessageReceiver inOutmessageReceiver = (MessageReceiver) inoutMessageReceiver.newInstance(); operation.setMessageReceiver(inOutmessageReceiver); } } catch (ClassNotFoundException e) { log.error(e.getMessage(), e); } catch (InstantiationException e) { log.error(e.getMessage(), e); } catch (IllegalAccessException e) { log.error(e.getMessage(), e); } } } }
public void setMessageReceivers(AxisService service) { Iterator<AxisOperation> iterator = service.getOperations(); while (iterator.hasNext()) { AxisOperation operation = iterator.next(); String MEP = operation.getMessageExchangePattern(); if (MEP != null) { try { if (WSDL2Constants.MEP_URI_IN_ONLY.equals(MEP)) { Class<?> inOnlyMessageReceiver = Loader.loadClass( "org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"); MessageReceiver messageReceiver = (MessageReceiver) inOnlyMessageReceiver.newInstance(); operation.setMessageReceiver(messageReceiver); } else { Class<?> inoutMessageReceiver = Loader.loadClass( "org.apache.axis2.rpc.receivers.RPCMessageReceiver"); MessageReceiver inOutmessageReceiver = (MessageReceiver) inoutMessageReceiver.newInstance(); operation.setMessageReceiver(inOutmessageReceiver); } } catch (ClassNotFoundException e) { log.error(e.getMessage(), e); } catch (InstantiationException e) { log.error(e.getMessage(), e); } catch (IllegalAccessException e) { log.error(e.getMessage(), e); } } } }
private void terminateRMSSequence() throws AxisFault { // set the state as terminated this.state = STATE_TERMINATE; // notify all the waiting threads MercuryMessageContext mercuryMessageContext = null; MessageContext messageContext = null; for (Iterator iter = this.messageBuffer.values().iterator(); iter.hasNext();){ mercuryMessageContext = (MercuryMessageContext) iter.next(); messageContext = mercuryMessageContext.getMessageContext(); if (messageContext.getAxisOperation().getMessageExchangePattern().equals( WSDL2Constants.MEP_URI_OUT_IN)){ MessageContext inMessageContext = messageContext.getOperationContext().getMessageContext( WSDLConstants.MESSAGE_LABEL_IN_VALUE); synchronized(inMessageContext){ inMessageContext.notify(); } } } // terminate offeredRMD sequence if it is there if (this.offeredRMDSequence != null){ this.offeredRMDSequence.terminate(); } }
private void setMessageReceivers(Wire wire, AxisService axisService) throws Exception { Map<String, InvocationChain> interceptors = new HashMap<String, InvocationChain>(); for (InvocationChain chain : wire.getInvocationChains()) { interceptors.put(chain.getPhysicalOperation().getName(), chain); } Utils.fillAxisService(axisService, configurationContext.getAxisConfiguration(), null, null); for (Iterator<?> i = axisService.getOperations(); i.hasNext();) { AxisOperation axisOp = (AxisOperation) i.next(); InvocationChain invocationChain = interceptors.get(axisOp.getName().getLocalPart()); MessageReceiver messageReceiver = null; if (WSDL2Constants.MEP_URI_IN_ONLY.equals(axisOp.getMessageExchangePattern()) || WSDL2Constants.MEP_URI_ROBUST_IN_ONLY.equals(axisOp.getMessageExchangePattern())) { messageReceiver = new InOnlyServiceProxyHandler(invocationChain); } else {//Default MEP is IN-OUT for backward compatibility messageReceiver = new InOutServiceProxyHandler(invocationChain); } axisOp.setMessageReceiver(messageReceiver); } }
public boolean mediate(MessageContext synCtx) { if (synCtx instanceof Axis2MessageContext) { Axis2MessageContext axis2smc = (Axis2MessageContext) synCtx; org.apache.axis2.context.MessageContext axis2MessageCtx = axis2smc.getAxis2MessageContext(); if (axis2MessageCtx != null) { String mep = axis2MessageCtx.getOperationContext().getAxisOperation(). getMessageExchangePattern(); if (WSDL2Constants.MEP_URI_IN_ONLY.equals(mep)) { synCtx.setProperty(SynapseConstants.OUT_ONLY, "true"); } // do nothing if two way } } return true; } }
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); } }
boolean wrappable = true; if (WSDLUtil.isInputPresentForMEP(op.getMessageExchangePattern())) { if (WSDLUtil.isOutputPresentForMEP(op.getMessageExchangePattern()) && wrappable) { walkSchema(op.getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE), WSDLConstants.OUTPUT_PART_QNAME_SUFFIX);
String mep = axisOperation.getMessageExchangePattern(); int mepConstant = Utils.getAxisSpecifMEPConstant(mep);
/** * Checks if the MEP of the JBI message exchange and the Axis Operation are * the same. * * @param exchange * the exchange * @param axisService * the Axis service * @return true if the MEP are identical, false otherwise */ protected boolean checkMEP(Exchange exchange, AxisService axisService) { AxisOperation operation = axisService.getOperation(exchange.getOperation()); Logger logger = getLogger(); if (logger.isLoggable(Level.FINE)) { logger.fine(this.logHint + ": MEP for Axis Operation is " + operation.getMessageExchangePattern() + "."); logger.fine(this.logHint + ": MEP for JBI message is " + exchange.getPattern() + "."); } int mepConstant = operation.getAxisSpecificMEPConstant(); return (exchange.isInOnlyPattern() && mepConstant == WSDLConstants.MEP_CONSTANT_IN_ONLY) || (exchange.isInOptionalOutPattern() && mepConstant == WSDLConstants.MEP_CONSTANT_IN_OPTIONAL_OUT) || (exchange.isInOutPattern() && mepConstant == WSDLConstants.MEP_CONSTANT_IN_OUT) || (exchange.isRobustInOnlyPattern() && mepConstant == WSDLConstants.MEP_CONSTANT_ROBUST_IN_ONLY); }
String mep = operation.getMessageExchangePattern();