当前位置: 首页>>代码示例>>Java>>正文


Java MessageContext.getAxisOperation方法代码示例

本文整理汇总了Java中org.apache.axis2.context.MessageContext.getAxisOperation方法的典型用法代码示例。如果您正苦于以下问题:Java MessageContext.getAxisOperation方法的具体用法?Java MessageContext.getAxisOperation怎么用?Java MessageContext.getAxisOperation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.axis2.context.MessageContext的用法示例。


在下文中一共展示了MessageContext.getAxisOperation方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: dispatchAndVerify

import org.apache.axis2.context.MessageContext; //导入方法依赖的package包/类
/**
 * Finds axis Service and the Operation for DSS requests
 *
 * @param msgContext request message context
 * @throws AxisFault if any exception occurs while finding axis service or operation
 */
private static void dispatchAndVerify(MessageContext msgContext) throws AxisFault {
    requestDispatcher.invoke(msgContext);
    AxisService axisService = msgContext.getAxisService();
    if (axisService != null) {
        httpLocationBasedDispatcher.invoke(msgContext);
        if (msgContext.getAxisOperation() == null) {
            requestURIOperationDispatcher.invoke(msgContext);
        }

        AxisOperation axisOperation;
        if ((axisOperation = msgContext.getAxisOperation()) != null) {
            AxisEndpoint axisEndpoint =
                    (AxisEndpoint) msgContext.getProperty(WSDL2Constants.ENDPOINT_LOCAL_NAME);
            if (axisEndpoint != null) {
                AxisBindingOperation axisBindingOperation = (AxisBindingOperation) axisEndpoint
                        .getBinding().getChild(axisOperation.getName());
                msgContext.setProperty(Constants.AXIS_BINDING_OPERATION, axisBindingOperation);
            }
            msgContext.setAxisOperation(axisOperation);
        }
    }
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:29,代码来源:IntegratorStatefulHandler.java

示例2: waitForReply

import org.apache.axis2.context.MessageContext; //导入方法依赖的package包/类
private void waitForReply(MessageContext messageContext, DatagramSocket datagramSocket,
                          String contentType) throws IOException {

    // piggy back message constant is used to pass a piggy back
    // message context in asnych model
    if (!(messageContext.getAxisOperation() instanceof OutInAxisOperation) &&
            messageContext.getProperty(org.apache.axis2.Constants.PIGGYBACK_MESSAGE) == null) {
        return;
    }

    byte[] inputBuffer = new byte[4096]; //TODO set the maximum size parameter
    DatagramPacket packet = new DatagramPacket(inputBuffer, inputBuffer.length);
    datagramSocket.receive(packet);

    // create the soap envelope
    try {
        MessageContext respMessageContext = messageContext.getOperationContext().
                getMessageContext(WSDL2Constants.MESSAGE_LABEL_IN);
        InputStream inputStream = new ByteArrayInputStream(inputBuffer, 0, packet.getLength());
        SOAPEnvelope envelope = TransportUtils.createSOAPMessage(respMessageContext,
                inputStream, contentType);
        respMessageContext.setEnvelope(envelope);
    } catch (XMLStreamException e) {
        throw new AxisFault("Can not build the soap message ", e);
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2-transports,代码行数:27,代码来源:UDPSender.java

示例3: waitForReply

import org.apache.axis2.context.MessageContext; //导入方法依赖的package包/类
private void waitForReply(MessageContext msgContext, Socket socket,
                          String contentType) throws AxisFault {

    if (!(msgContext.getAxisOperation() instanceof OutInAxisOperation) &&
            msgContext.getProperty(org.apache.axis2.Constants.PIGGYBACK_MESSAGE) == null) {
        return;
    }

    if (contentType == null) {
        contentType = TCPConstants.TCP_DEFAULT_CONTENT_TYPE;
    }

    try {
        MessageContext responseMsgCtx = createResponseMessageContext(msgContext);
        SOAPEnvelope envelope = TransportUtils.createSOAPMessage(msgContext,
                    socket.getInputStream(), contentType);
        responseMsgCtx.setEnvelope(envelope);
        AxisEngine.receive(responseMsgCtx);
    } catch (Exception e) {
        handleException("Error while processing response", e);
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2-transports,代码行数:23,代码来源:TCPTransportSender.java

示例4: checkMessageIDHeader

import org.apache.axis2.context.MessageContext; //导入方法依赖的package包/类
/**
 * Validate that a message id is present when required. The check applied here only applies to
 * WS-Addressing headers that comply with the 2005/08 (final) spec.
 *
 * @param msgContext
 * @throws AxisFault
 * @see AddressingInHandler#checkForMandatoryHeaders
 */
private void checkMessageIDHeader(MessageContext msgContext) throws AxisFault {
    String namespace = (String)msgContext.getLocalProperty(WS_ADDRESSING_VERSION);
    if (!Final.WSA_NAMESPACE.equals(namespace)) {
        return;
    }

    AxisOperation axisOperation = msgContext.getAxisOperation();
    
    if (axisOperation != null) {
        String mep = axisOperation.getMessageExchangePattern();
        int mepConstant = Utils.getAxisSpecifMEPConstant(mep);
        
        if (mepConstant == WSDLConstants.MEP_CONSTANT_IN_OUT ||
                mepConstant == WSDLConstants.MEP_CONSTANT_IN_OPTIONAL_OUT ||
                mepConstant == WSDLConstants.MEP_CONSTANT_ROBUST_IN_ONLY) {
            String messageId = msgContext.getOptions().getMessageId();
            if (messageId == null || "".equals(messageId)) {
                AddressingFaultsHelper
                .triggerMessageAddressingRequiredFault(msgContext, WSA_MESSAGE_ID);
            }
        }
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:32,代码来源:AddressingValidationHandler.java

示例5: updateCurrentInvocationStatistic

import org.apache.axis2.context.MessageContext; //导入方法依赖的package包/类
private static void updateCurrentInvocationStatistic(MessageContext messageContext,
                                                     long responseTime) throws AxisFault {
    messageContext.setProperty(StatisticsConstants.GLOBAL_CURRENT_INVOCATION_RESPONSE_TIME,responseTime);

    if (messageContext.getAxisOperation() != null) {
        Parameter operationResponseTimeParam = new Parameter();
        operationResponseTimeParam.setName(StatisticsConstants.OPERATION_RESPONSE_TIME);
        operationResponseTimeParam.setValue(responseTime);
        messageContext.getAxisOperation().addParameter(operationResponseTimeParam);
    }

    if (messageContext.getAxisService() != null) {
        Parameter serviceResponseTimeParam = new Parameter();
        serviceResponseTimeParam.setName(StatisticsConstants.SERVICE_RESPONSE_TIME);
        serviceResponseTimeParam.setValue(responseTime);
        messageContext.getAxisService().addParameter(serviceResponseTimeParam);
    }
}
 
开发者ID:wso2,项目名称:carbon-commons,代码行数:19,代码来源:ResponseTimeCalculator.java

示例6: invokeBusinessLogic

import org.apache.axis2.context.MessageContext; //导入方法依赖的package包/类
/**
 * Invokes the business logic invocation on the service implementation class
 *
 * @param msgContext the incoming message context
 * @throws AxisFault on invalid method (wrong signature)
 */
public void invokeBusinessLogic(MessageContext msgContext) throws AxisFault {
    try {
        // get the implementation class for the Web Service
        Object obj = getTheImplementationObject(msgContext);

        // find the WebService method
        Class implClass = obj.getClass();

        AxisOperation op = msgContext.getAxisOperation();
        Method method = findOperation(op, implClass);

        if (method == null) {
            throw new AxisFault(Messages.getMessage("methodDoesNotExistInOnly"));
        }

        method.invoke(obj,
                      new Object [] { msgContext.getEnvelope().getBody().getFirstElement() });

    } catch (Exception e) {
        throw AxisFault.makeFault(e);
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:29,代码来源:RawXMLINOnlyMessageReceiver.java

示例7: waitForReply

import org.apache.axis2.context.MessageContext; //导入方法依赖的package包/类
private void waitForReply(MessageContext msgContext, String mailMessageID) throws AxisFault {
    // piggy back message constant is used to pass a piggy back
    // message context in asnych model
    if (!(msgContext.getAxisOperation() instanceof OutInAxisOperation) &&
            (msgContext.getProperty(org.apache.axis2.Constants.PIGGYBACK_MESSAGE) == null)) {
        return;
    }
    
    ConfigurationContext configContext = msgContext.getConfigurationContext();
    // if the mail message listner has not started we need to start it
    if (!configContext.getListenerManager().isListenerRunning(MailConstants.TRANSPORT_NAME)) {
        TransportInDescription mailTo =
                configContext.getAxisConfiguration().getTransportIn(MailConstants.TRANSPORT_NAME);
        if (mailTo == null) {
            handleException("Could not find the transport receiver for " +
                MailConstants.TRANSPORT_NAME);
        }
        configContext.getListenerManager().addListener(mailTo, false);
    }

    SynchronousCallback synchronousCallback = new SynchronousCallback(msgContext);
    Map callBackMap = (Map) msgContext.getConfigurationContext().
        getProperty(BaseConstants.CALLBACK_TABLE);
    callBackMap.put(mailMessageID, synchronousCallback);
    synchronized (synchronousCallback) {
        try {
            synchronousCallback.wait(msgContext.getOptions().getTimeOutInMilliSeconds());
        } catch (InterruptedException e) {
            handleException("Error occured while waiting ..", e);
        }
    }

    if (!synchronousCallback.isComplete()){
        // when timeout occurs remove this entry.
        callBackMap.remove(mailMessageID);
        handleException("Timeout while waiting for a response");
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2-transports,代码行数:39,代码来源:MailTransportSender.java

示例8: createDataServiceRequest

import org.apache.axis2.context.MessageContext; //导入方法依赖的package包/类
public static DataServiceRequest createDataServiceRequest(
		MessageContext msgContext) throws DataServiceFault {
	AxisService axisService = msgContext.getAxisService();
	AxisOperation axisOp = msgContext.getAxisOperation();
	OMElement inputMessage = msgContext.getEnvelope().getBody().getFirstElement();
	/* get operation/request name */
	String requestName = axisOp.getName().getLocalPart();
	if (inputMessage != null && !requestName.equals(inputMessage.getLocalName())) {
		throw new DataServiceFault("Input Message and " + requestName + " Axis Operation didn't match.");
	}
	/* retrieve the DataService object representing the current data service */
	DataService dataService = (DataService) axisService.getParameter(
			DBConstants.DATA_SERVICE_OBJECT).getValue();
	
	DataServiceRequest dsRequest;
       /* Check whether the request is collection of requests (request box), if so create RequestBoxRequest */
       if (isRequestBoxRequest(requestName)) {
           dsRequest = createRequestBoxRequest(dataService, requestName, inputMessage);
           return dsRequest;
       }
	/* check if batch or single request */
	if (isBatchRequest(inputMessage)) {
		dsRequest = new BatchDataServiceRequest(
				dataService, requestName, getBatchInputValuesFromOM(inputMessage));
	} else {
		dsRequest = new SingleDataServiceRequest(
				dataService, requestName, getSingleInputValuesFromOM(inputMessage)); 
	}
	
	/* set user information */
	populateUserInfo(dataService, dsRequest, msgContext);
	
	/* checks if this is a boxcarring session */
	if (isBoxcarringRequest(requestName)) {
		/* wrap the current request in a boxcarring request */
		dsRequest = new BoxcarringDataServiceRequest(dsRequest);
	}

	return dsRequest;
}
 
开发者ID:wso2,项目名称:carbon-data,代码行数:41,代码来源:DataServiceRequest.java

示例9: checkUsingAddressing

import org.apache.axis2.context.MessageContext; //导入方法依赖的package包/类
/**
 * Check that if the wsaddressing="required" attribute exists on the service definition
 * (or AddressingFeature on the client) or <wsaw:UsingAddressing wsdl:required="true" />
 * was found in the WSDL (provider side only) that WS-Addressing headers were found on
 * the inbound message.
 */
private void checkUsingAddressing(MessageContext msgContext)
        throws AxisFault {
    String addressingFlag;
    if (!msgContext.isServerSide()) {
        // On client side, get required value from the request message context
        // (set by AddressingConfigurator).
        // We do not use the UsingAddressing required attribute on the
        // client side since it is not generated/processed by java tooling.
        addressingFlag = AddressingHelper.getRequestAddressingRequirementParameterValue(msgContext);
        if (log.isTraceEnabled()) {
            log.trace("checkUsingAddressing: WSAddressingFlag from MessageContext=" + addressingFlag);
        }
    } else {
        // On provider side, get required value from AxisOperation
        // (set by AddressingConfigurator and UsingAddressing WSDL processing).
        AxisDescription ad = msgContext.getAxisService();
        if(msgContext.getAxisOperation()!=null){
    	   ad = msgContext.getAxisOperation();
        }
        addressingFlag =
            AddressingHelper.getAddressingRequirementParemeterValue(ad);
        if (log.isTraceEnabled()) {
            log.trace("checkUsingAddressing: WSAddressingFlag from AxisOperation=" + addressingFlag);
        }
    }
    if (AddressingConstants.ADDRESSING_REQUIRED.equals(addressingFlag)) {
        AddressingFaultsHelper.triggerMessageAddressingRequiredFault(msgContext,
                                                                     AddressingConstants.WSA_ACTION);
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:37,代码来源:AddressingValidationHandler.java

示例10: invoke

import org.apache.axis2.context.MessageContext; //导入方法依赖的package包/类
public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {
    AxisService axisService = msgContext.getAxisService();

    if (axisService == null || axisService.isClientSide()) {
        return InvocationResponse.CONTINUE;
    }

    // Do not trace messages from admin services
    if (axisService.getParent() != null) {
        if (SystemFilter.isFilteredOutService(axisService.getAxisServiceGroup())) {
            return InvocationResponse.CONTINUE;
        }
    }

    ConfigurationContext configCtx = msgContext.getConfigurationContext();
    TraceFilter traceFilter =
        (TraceFilter) configCtx.getAxisConfiguration().
            getParameter(TracerConstants.TRACE_FILTER_IMPL).getValue();
    if (traceFilter.isFilteredOut(msgContext)) {
        return InvocationResponse.CONTINUE;
    }

    if ((msgContext.getAxisOperation() != null) &&
        (msgContext.getAxisOperation().getName() != null)) {
        String operationName =
            msgContext.getAxisOperation().getName().getLocalPart();
        String serviceName = axisService.getName();

        // Add the message id to the CircularBuffer.
        // We need to track only the IN_FLOW msg, since with that sequence number,
        // we can retrieve all other related messages from the persister.
        appendMessage(msgContext.getConfigurationContext(),
                      serviceName, operationName,
                      storeMessage(serviceName, operationName, msgContext));
    }
    return InvocationResponse.CONTINUE;
}
 
开发者ID:wso2,项目名称:carbon-commons,代码行数:38,代码来源:TracingInPostDispatchHandler.java

示例11: cleanupThread

import org.apache.axis2.context.MessageContext; //导入方法依赖的package包/类
public void cleanupThread(MessageContext messageContext) {
    //Only clean up if we are inbound to the server.
    AxisOperation axisOperation = messageContext.getAxisOperation();
    String mep = axisOperation.getMessageExchangePattern();
    int mepConstant = Utils.getAxisSpecifMEPConstant(mep);
    
    if (mepConstant == WSDLConstants.MEP_CONSTANT_IN_ONLY ||
        mepConstant == WSDLConstants.MEP_CONSTANT_IN_OUT ||
        mepConstant == WSDLConstants.MEP_CONSTANT_IN_OPTIONAL_OUT ||
        mepConstant == WSDLConstants.MEP_CONSTANT_ROBUST_IN_ONLY)
    {
        EndpointContextMapManager.setEndpointContextMap(null);
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:15,代码来源:EndpointContextMapMigrator.java

示例12: invoke

import org.apache.axis2.context.MessageContext; //导入方法依赖的package包/类
public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {
    AxisOperation op = msgContext.getAxisOperation();       
    if (!msgContext.isServerSide() && op != null && isAnonymousOperation(op)) {
        op = findRealOperationAction(msgContext);         
        if (op != null) {
            msgContext.setAxisOperation(op);
            if (LOG.isDebugEnabled()) {
                LOG.debug("Anonymous operation detected. Replaced with real operation: " + op);
            }
        }
    }                
    return InvocationResponse.CONTINUE;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:14,代码来源:DispatchOperationHandler.java

示例13: dispatchAndVerify

import org.apache.axis2.context.MessageContext; //导入方法依赖的package包/类
private static void dispatchAndVerify(MessageContext msgContext) throws AxisFault {
    RequestURIBasedDispatcher requestDispatcher = new RequestURIBasedDispatcher();
    requestDispatcher.invoke(msgContext);
    AxisService axisService = msgContext.getAxisService();
    if (axisService != null) {
        HTTPLocationBasedDispatcher httpLocationBasedDispatcher =
                new HTTPLocationBasedDispatcher();
        httpLocationBasedDispatcher.invoke(msgContext);
        if (msgContext.getAxisOperation() == null) {
            RequestURIOperationDispatcher requestURIOperationDispatcher =
                    new RequestURIOperationDispatcher();
            requestURIOperationDispatcher.invoke(msgContext);
        }

        AxisOperation axisOperation;
        if ((axisOperation = msgContext.getAxisOperation()) != null) {
            AxisEndpoint axisEndpoint =
                    (AxisEndpoint) msgContext.getProperty(WSDL2Constants.ENDPOINT_LOCAL_NAME);
            if (axisEndpoint != null) {
                AxisBindingOperation axisBindingOperation = (AxisBindingOperation) axisEndpoint
                        .getBinding().getChild(axisOperation.getName());
                msgContext.setProperty(Constants.AXIS_BINDING_OPERATION, axisBindingOperation);
            }
            msgContext.setAxisOperation(axisOperation);
        }
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:28,代码来源:RESTUtil.java

示例14: checkAction

import org.apache.axis2.context.MessageContext; //导入方法依赖的package包/类
/**
 * If addressing was found and the dispatch failed we SHOULD (and hence will) return a
 * WS-Addressing ActionNotSupported fault. This will make more sense once the
 * AddressingBasedDsipatcher is moved into the addressing module
 */
private void checkAction(MessageContext msgContext) throws AxisFault {
    if ((msgContext.getAxisService() == null) || (msgContext.getAxisOperation() == null)) {
        AddressingFaultsHelper
                .triggerActionNotSupportedFault(msgContext, msgContext.getWSAAction());
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:12,代码来源:AddressingBasedDispatcher.java

示例15: invokeBusinessLogic

import org.apache.axis2.context.MessageContext; //导入方法依赖的package包/类
/**
 * Invokes the bussiness logic invocation on the service implementation class
 *
 * @param msgContext    the incoming message context
 * @param newmsgContext the response message context
 * @throws AxisFault on invalid method (wrong signature) or behaviour (return null)
 */
public void invokeBusinessLogic(MessageContext msgContext, MessageContext newmsgContext)
        throws AxisFault {
    try {

        // get the implementation class for the Web Service
        Object obj = getTheImplementationObject(msgContext);

        // find the WebService method
        Class implClass = obj.getClass();

        AxisOperation opDesc = msgContext.getAxisOperation();
        Method method = findOperation(opDesc, implClass);

        if (method == null) {
            throw new AxisFault(Messages.getMessage("methodDoesNotExistInOut",
                                                    opDesc.getName().toString()));
        }

        OMElement result = (OMElement) method.invoke(
                obj, new Object[]{msgContext.getEnvelope().getBody().getFirstElement()});
        SOAPFactory fac = getSOAPFactory(msgContext);
        SOAPEnvelope envelope = fac.getDefaultEnvelope();

        if (result != null) {
            envelope.getBody().addChild(result);
        }

        newmsgContext.setEnvelope(envelope);
    } catch (Exception e) {
        throw AxisFault.makeFault(e);
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:40,代码来源:RawXMLINOutMessageReceiver.java


注:本文中的org.apache.axis2.context.MessageContext.getAxisOperation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。